我这里也给一些原本HGE没有的怪物DB,但是官服拥有的怪物,并且近几年其他引擎都实现了新DB,如果法海有时间的话,可以稍微参考下,直接说明书里的自定义怪实在是太拉胯了。。。。
怨恶
怪物文件:Mon40,编号3872开始
{ 怨恶 }
constructor TRedCaveMonster8.Create;//004AA4B4
begin
inherited;
m_dwSearchTime:=Random(1500) + 1500;
BoRecallComplete := FALSE;
m_boBossMonster := True;
end;
destructor TRedCaveMonster8.Destroy;
begin
inherited;
end;
procedure TRedCaveMonster8.Attack (TargeTBaseObject: TBaseObject; nDir: Integer);
var
magpwr:Integer;
WAbil:pTAbility;
begin
if m_TargetCret = nil then exit;
nDir:= GetNextDirection (m_nCurrX, m_nCurrY, m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
m_btDirection:=nDir;
SendRefMsg(RM_HIT,m_btDirection,m_nCurrX,m_nCurrY,Integer(m_TargetCret),'');
if IsProperTarget (m_TargetCret) then begin
WAbil:=@m_WAbil;
magpwr:=(Random(SmallInt(HiWord(WAbil.DC) - LoWord(WAbil.DC)) + 1) + LoWord(WAbil.DC));
m_TargetCret.SendDelayMsg (self, RM_MAGSTRUCK, 0, magpwr, 0, 1, '', 800);
end;
end;
procedure TRedCaveMonster8.RangeAttack (TargeTBaseObject: TBaseObject); //반드시 (必须)target <> nil
var
i, k, mx, my, dam, armor: integer;
BaseObjectList :TList;
BaseObject: TBaseObject;
pwr: integer;
WAbil:pTAbility;
nDir: integer;
begin
if TargeTBaseObject = nil then exit;
nDir:= GetNextDirection (m_nCurrX, m_nCurrY, TargeTBaseObject.m_nCurrX, TargeTBaseObject.m_nCurrY);
m_btDirection:=nDir;
SendRefMsg(RM_LIGHTING,m_btDirection,m_nCurrX,m_nCurrY,Integer(TargeTBaseObject),'');
WAbil:=@m_WAbil;
pwr:=GetAttackPower(LoWord(WAbil.DC),SmallInt(HiWord(WAbil.DC) - LoWord(WAbil.DC)));
if pwr <= 0 then exit;
BaseObjectList := TList.Create;
GetMapBaseObjects(m_PEnvir,m_nCurrX,m_nCurrY,1,BaseObjectList);
for I := 0 to BaseObjectList.Count - 1 do begin
BaseObject:=TBaseObject(BaseObjectList.Items[i]);
if IsProperTarget(BaseObject) then begin
SetTargetCreat(BaseObject);
BaseObject.SendDelayMsg(self,RM_MAGSTRUCK,0,pwr,0,0,'',900);
end;
end;
BaseObjectList.Free;
end;
procedure TRedCaveMonster8.RangeAttack2 (TargeTBaseObject: TBaseObject); //반드시 (必须) target <> nil
var
magpwr:Integer;
WAbil:pTAbility;
levelgap:integer;
push:integer;
nDir:integer;
begin
if m_TargetCret = nil then exit;
nDir:= GetNextDirection (m_nCurrX, m_nCurrY, m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
m_btDirection:=nDir;
SendRefMsg(RM_LIGHTING2,m_btDirection,m_nCurrX,m_nCurrY,Integer(m_TargetCret),'');
if IsProperTarget (m_TargetCret) then begin
WAbil:=@m_WAbil;
magpwr:=(Random(SmallInt(HiWord(WAbil.DC) - LoWord(WAbil.DC)) + 1) + LoWord(WAbil.DC));
m_TargetCret.SendDelayMsg (self, RM_MAGSTRUCK, 0, magpwr, 0, 1, '', 800);
levelgap := m_Abil.Level - m_TargetCret.m_Abil.Level;
if (Random(20) < levelgap) then begin
push := 2 + Random(3);
m_TargetCret.CharPushed (nDir, push);
end;
nDir:= GetNextDirection (m_nCurrX, m_nCurrY, m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
if Random(6) = 0 then begin
m_TargetCret.MakePosion(POISON_STONE,3,1);
m_TargetCret.SendMsg (m_TargetCret,RM_MAGICTYPE, 0, 0, 0, 3, '173');
end;
end;
end;
procedure TRedCaveMonster8.RangeAttack3 (TargeTBaseObject: TBaseObject); //반드시 (必须)target <> nil
var
i, k, mx, my, dam, armor: integer;
BaseObjectList :TList;
BaseObject: TBaseObject;
pwr: integer;
WAbil:pTAbility;
nDir: integer;
begin
if TargeTBaseObject = nil then exit;
nDir:= GetNextDirection (m_nCurrX, m_nCurrY, TargeTBaseObject.m_nCurrX, TargeTBaseObject.m_nCurrY);
m_btDirection:=nDir;
SendRefMsg(RM_LIGHTING3,m_btDirection,m_nCurrX,m_nCurrY,Integer(TargeTBaseObject),'');
WAbil:=@m_WAbil;
pwr:=GetAttackPower(LoWord(WAbil.DC),SmallInt(HiWord(WAbil.DC) - LoWord(WAbil.DC)));
if pwr <= 0 then exit;
BaseObjectList := TList.Create;
GetMapBaseObjects(m_PEnvir,m_nCurrX,m_nCurrY,3,BaseObjectList);
for I := 0 to BaseObjectList.Count - 1 do begin
BaseObject:=TBaseObject(BaseObjectList.Items[i]);
if IsProperTarget(BaseObject) then begin
SetTargetCreat(BaseObject);
BaseObject.SendDelayMsg(self,RM_MAGSTRUCK,0,pwr,0,0,'',800);
if Random(6) = 0 then begin
BaseObject.MakePosion(POISON_STONE,5,1);
BaseObject.SendMsg (BaseObject,RM_MAGICTYPE, 0, 0, 0, 5, '173');
end;
end;
end;
BaseObjectList.Free;
end;
procedure TRedCaveMonster8.RangeAttack4 (TargeTBaseObject: TBaseObject); //반드시 (必须)target <> nil
var
I:Integer;
magpwr:Integer;
WAbil:pTAbility;
BaseObject:TBaseObject;
Target:TBaseObject;
nDir:integer;
begin
Target := m_TargetCret;
nDir:= GetNextDirection (m_nCurrX, m_nCurrY, m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
m_btDirection:=nDir;
SendRefMsg(RM_LIGHTING4,1,m_nCurrX,m_nCurrY,Integer(Target),'');
for i:=0 to Target.m_VisibleActors.Count-1 do begin
BaseObject:= TBaseObject (pTVisibleBaseObject(Target.m_VisibleActors[i]).BaseObject);
if (abs(m_nCurrX - BaseObject.m_nCurrX) <= 7) and (abs(m_nCurrY - BaseObject.m_nCurrY) <= 7) then begin
if BaseObject <> nil then begin
if IsProperTarget (BaseObject) then begin
WAbil:=@m_WAbil;
magpwr:=(Random(SmallInt(HiWord(WAbil.MC) - LoWord(WAbil.MC)) + 1) + LoWord(WAbil.MC));
BaseObject.SendDelayMsg (self, RM_MAGSTRUCK, 0, magpwr, 0, 0, '', 1500);
SendDelayRefMsg(RM_10205,0,BaseObject.m_nCurrX,BaseObject.m_nCurrY,100{type},'',1500);
SendDelayRefMsg(RM_10205,0,BaseObject.m_nCurrX,BaseObject.m_nCurrY,101{type},'',1500);
if Random(6) = 0 then begin
BaseObject.MakePosion(POISON_STONE,5,1);
BaseObject.SendMsg (BaseObject,RM_MAGICTYPE, 0, 0, 0, 5, '173');
end;
end;
end;
end;
end;
end;
procedure TRedCaveMonster8.CallDragon; //인면수소환(召唤小怪,盛大没有)
var
nX,nY:Integer;
MonObj:TBaseObject;
n8,nC,n10,n14:Integer;
n08,n0C:Integer;
BaseObject:TBaseObject;
nDir:integer;
PlayObject: TPlayObject;
Target:TBaseObject;
begin
Target := m_TargetCret;
nDir:= GetNextDirection (m_nCurrX, m_nCurrY, m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
m_btDirection:=nDir;
m_dwHitTick:=GetCurrentTime;
BaseObject:=UserEngine.RegenMonsterByName(m_sMapName,m_nCurrX-3,m_nCurrY+3,'인면수');
BaseObject.SendRefMsg(RM_10205,0,m_nCurrX-3,m_nCurrY+3,102,'');
BaseObject:=UserEngine.RegenMonsterByName(m_sMapName,m_nCurrX+3,m_nCurrY-3,'인면수');
BaseObject.SendRefMsg(RM_10205,0,m_nCurrX+3,m_nCurrY-3,102,'');
BaseObject:=UserEngine.RegenMonsterByName(m_sMapName,m_nCurrX+3,m_nCurrY+3,'인면수');
BaseObject.SendRefMsg(RM_10205,0,m_nCurrX+3,m_nCurrY+3,102,'');
BaseObject:=UserEngine.RegenMonsterByName(m_sMapName,m_nCurrX-3,m_nCurrY-3,'인면수');
BaseObject.SendRefMsg(RM_10205,0,m_nCurrX-3,m_nCurrY-3,102,'');
if BaseObject <> nil then begin
BaseObject.SetTargetCreat(m_TargetCret);
end;
end;
function TRedCaveMonster8.AttackTarget: Boolean;
var
targdir: byte;
n8,nC,n10:Integer;
begin
Result := FALSE;
// 근접해 일을때에는 근접 힘 공격을(靠近时的近战攻击)
// 원거리 일때는 원거리 마법공격을 한다.(一定范围之外会使用远程魔法攻击)
if m_TargetCret <> nil then begin
if GetCurrentTime - m_dwHitTick > GetHitSpeed then begin
m_dwHitTick:=GetCurrentTime;
if (abs(m_nCurrX-m_TargetCret.m_nCurrX) <= m_nViewRange ) and (abs(m_nCurrY-m_TargetCret.m_nCurrY) <= m_nViewRange ) then begin
if GetAttackDir(m_TargetCret,targdir) then begin
m_dwTargetFocusTick := GetTickCount;
if Random(10) = 0 then begin
if not BoRecallComplete then begin
if m_WAbil.HP < m_WAbil.MaxHP div 2 then begin
if m_TargetCret.m_sMapName = self.m_sMapName then begin
if (Integer(GetTickCount - m_dwSpellTick) > 2200) then begin
m_dwSpellTick:=GetTickCount();
CallDragon();
BoRecallComplete := TRUE;
end;
end;
end;
end;
end else if Random(10) = 0 then begin
m_TargetCret.GetBackPosition(n8,nC);
if m_PEnvir.CanWalk(n8,nC,False) then begin
SpaceMove(m_PEnvir.sMapName,n8,nC,0);
SendRefMsg(RM_SPACEMOVE_FIRE,0,0,0,0,'');
Result := TRUE;
exit;
end;
end else if Random(8) = 0 then begin
RangeAttack4(m_TargetCret);
end else if Random(5) = 0 then begin
RangeAttack3(m_TargetCret);
end else if Random(3) = 0 then begin
RangeAttack2(m_TargetCret);
end else if Random(3) = 0 then begin
RangeAttack(m_TargetCret);
end else begin
Attack (m_TargetCret, targdir);
end;
end else begin
if Random(10) = 0 then begin
if not BoRecallComplete then begin
if m_WAbil.HP < m_WAbil.MaxHP div 2 then begin
if m_TargetCret.m_sMapName = self.m_sMapName then begin
if (Integer(GetTickCount - m_dwSpellTick) > 2200) then begin
m_dwSpellTick:=GetTickCount();
CallDragon();
BoRecallComplete := TRUE;
Result := TRUE;
end;
end;
end;
end;
end else if Random(10) = 0 then begin
m_TargetCret.GetBackPosition(n8,nC);
if m_PEnvir.CanWalk(n8,nC,False) then begin
SpaceMove(m_PEnvir.sMapName,n8,nC,0);
SendRefMsg(RM_SPACEMOVE_FIRE,0,0,0,0,'');
Result := TRUE;
exit;
end;
end else if Random(5) = 0 then begin
RangeAttack4(m_TargetCret);
Result := TRUE;
end else begin
result := Inherited AttackTarget;
end;
end;
end else begin
if m_TargetCret.m_sMapName = self.m_sMapName then begin
if (abs(m_nCurrX-m_TargetCret.m_nCurrX) <= 11) and (abs(m_nCurrY-m_TargetCret.m_nCurrY) <= 11) then begin
SetTargetXY (m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY)
end;
end else begin
DelTargetCreat; //<!!주의(注意)> TargetCret := nil로 바뀜(变为)
end;
end;
end;
end;
end;
|