搜索
查看: 3460|回复: 39

[沟通中] 部分BOSS的DB修正(附带原始代码)

[复制链接]
发表于 2021-3-30 01:48:28 | 显示全部楼层 |阅读模式
BUG反馈
引擎版本号: 0319
登陆器版本号: 0319
BUG描述: 最近在做版本的时候,发现部分原始BOSS虽然包含携带技能的DB代码,但是基本上要么是有BUG,要么就是错误,还有就是根本没有代码,我检查了其他引擎,如GEE,BLUE,LEG,他们的怪物代码都是正确的,唯独HGE出现问题,希望能够修正
BUG重现方式: 此贴包含黄泉教主,牛魔王,魔龙教主,狐月天珠等的原始韩服代码以及可参考的APPR编号,HGE引擎本身拥有BUG,可以在HGE里进行测试研究这个BUG的出现问题
修复后应达到的效果: 这些BOSS怪物跟其他引擎或者韩服以及盛大白金外传区拥有AI以及技能的BOSS怪物达到一致
联系QQ: 隐藏内容
虽然有自定义怪物功能,但是局限性很大,比如无法实现例如黄泉教主的技能召唤小怪效果,以及同时拥有近战和远程技能的怪对于近战和远程配合使用的问题,原本这些都是无所谓的,但是既然其他引擎全部都是正常无错,唯独HGE的要么有问题,要么没appr代码,要么有BUG,我建议还是修复下,直接提供原始的代码,就不需要研究如果去实现和修复BUG了。后面几楼会详细介绍这些怪的问题以及可以参考的代码,所有怪物都是运用盛大原文件的素材,都是自01年开始到现在盛大就已经存在的全部怪物素材



补充内容 (2021-3-30 03:30):
目前希望增加的怪物:黄泉教主的远程攻击AI和召唤怪物AI,牛魔王的远程攻击AI,魔龙教主的远程攻击和攻击效果AI,虹魔教主的狂暴改攻击动作

补充内容 (2021-3-30 03:30):
还有HGE本身没有的怨恶的AI和魔龙阴石阳石的AI

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| 发表于 2021-3-30 01:58:37 | 显示全部楼层
黄泉教主
原版攻击:1.近战攻击,2.玩家跑开后使用小火球攻击,3.使用技能召唤小怪,类似祖玛教主
参考appr:134
HGE是否存在改代码:存在
是否实现:否,134代码下的黄泉教主会使用原版召唤小怪的那个动作来进行距离4的固定远程攻击,并附带冰冻效果,不会召唤小怪,跟原本的不符
自定义怪是否实现:否,自定义怪下的黄泉教主,掉半血后才能召唤指定的小怪,并且有数量限制,原版以及其他引擎都是使用技能,跟祖玛教主一样无限召唤

怪物文件:Mon20
2技能引用编号:2630开始,攻击特效编号3220开始
3技能引用编号:2710开始,小火球编号3300开始


参考代码(韩语已经翻译成中文在后面):
{ 黄泉教主 }

constructor TBoneKingMonster.Create;
begin
  inherited;
  m_nDangerLevel:=5;
  m_SlaveObjectList:=TList.Create;   
  m_boBossMonster:=True;
end;

destructor TBoneKingMonster.Destroy;
begin
  m_SlaveObjectList.Free;
  inherited;
end;

procedure TBoneKingMonster.MagicAttack(nDir:Integer);
var
Target:TBaseObject;
magpwr:Integer;
WAbil:pTAbility;
begin
  if m_TargetCret =  nil then exit;
  Target:=m_TargetCret;
   SendRefMsg(RM_FLYAXE,nDir,m_nCurrx,m_nCurry,Integer(Target),'');
  {hit first target}
  if IsProperTarget(Target) then begin
      WAbil:=@m_WAbil;
      magpwr:=_MAX( 0, LoWord(WAbil.DC) + Random(SmallInt(HiWord(WAbil.DC)-LoWord(WAbil.DC)) + 1) );
      Target.SendDelayMsg(self, RM_MAGSTRUCK, 0, magpwr, 0, 0, '', 600);
      end;
end;

procedure TBoneKingMonster.CallSlave;
const
  sMonName:array[0..2] of String = ('해골무장', '해골궁수', '해골병졸');(骷髅刀斧手,骷髅弓箭手,骷髅锤兵)
var
  I: Integer;
  nC:Integer;
  n10,n14:Integer;
  BaseObject:TBaseObject;
begin
  nC:=Random(4) + 4;
  GetFrontPosition(n10,n14);

  if m_SlaveObjectList.Count < 20 then //gotta make sure he has room for extra slaves before he raises his staff lol
    sendrefmsg(RM_LIGHTING,1,m_nCurrx,m_nCurry,integer(self),''); //make him raise his staff

  for I := 1 to nC do begin
    if m_SlaveObjectList.Count > 20 then break;
    BaseObject:=UserEngine.RegenMonsterByName(m_sMapName,n10,n14,sMonName[Random(3)]);
    if BaseObject <> nil then begin
      m_SlaveObjectList.Add(BaseObject);
    end;
  end;    // for
end;

procedure TBoneKingMonster.Attack(TargeTBaseObject: TBaseObject;nDir: Integer);
var
  WAbil:pTAbility;
  nPower:Integer;
begin
  WAbil:=@m_WAbil;
  nPower:=GetAttackPower (LoWord(WAbil.DC), SmallInt(HiWord(WAbil.DC)-LoWord(WAbil.DC)));
  HitMagAttackTarget(TargeTBaseObject,0,nPower,True);
end;


procedure TBoneKingMonster.Run;
var
  I: Integer;
  BaseObject:TBaseObject;
  nAttackDir:Integer;
begin
  if CanMove and (GetCurrentTime - m_dwWalkTick > GetWalkSpeed) then begin

    if (m_TargetCret <> nil) and
        (abs(m_nCurrX - m_TargetCret.m_nCurrx) >= 2) and (abs(m_nCurry - m_TargetCret.m_nCurry) >= 2) and
        (Integer(GetTickCount - m_dwHitTick) > 2200) then begin
      if MagCanHitTarget(m_nCurrX,m_nCurrY,m_targetCret) then begin //make sure the 'line' in wich magic will go isnt blocked
        m_dwHitTick:=GetCurrentTime;
        nAttackDir:=GetNextDirection(m_nCurrx,m_nCurry,m_TargetCret.m_nCurrx,m_TargetCret.m_nCurry);
        MagicAttack(nAttackDir);
      end;
    end;


    if ((GetTickCount - m_dwSearchEnemyTick) > 8000) or
       (((GetTickCount - m_dwSearchEnemyTick) > 1000) and (m_TargetCret = nil)) then begin
      m_dwSearchEnemyTick:=GetTickCount();
      SearchTarget();

      if (m_nDangerLevel > m_WAbil.HP / m_WAbil.MaxHP * 5) and (m_nDangerLevel > 0) then begin
        Dec(m_nDangerLevel);
        CallSlave();
      end;
      if m_WAbil.HP = m_WAbil.MaxHP then
        m_nDangerLevel:=5;
    end;

    for I := m_SlaveObjectList.Count - 1 downto 0 do begin
      BaseObject:=TBaseObject(m_SlaveObjectList.Items[I]);
      if BaseObject.m_boDeath or BaseObject.m_boGhost then
        m_SlaveObjectList.Delete(I);
    end;    // for
  end;
  inherited;
end;


constructor TPercentMonster.Create;
begin
  inherited;
  m_boDupMode:=False;
  bo554:=False;
  m_dwThinkTick:=GetTickCount();
  m_nViewRange:=5;
  m_nRunTime:=250;
  m_dwSearchTime:=3000 + Random(2000);
  m_dwSearchTick:=GetTickCount();
  m_btRaceServer:=80;
end;

destructor TPercentMonster.Destroy;
begin
  inherited;
end;

function TPercentMonster.Operate(ProcessMsg: pTProcessMessage):Boolean;
begin
  Result:=inherited Operate(ProcessMsg);

end;
function TPercentMonster.Think():Boolean; //004A8E54
var
  nOldX,nOldY:integer;
begin
  Result:=False;
  if (GetTickCount - m_dwThinkTick) > 3 * 1000 then begin
    m_dwThinkTick:=GetTickCount();
    if m_PEnvir.GetXYObjCount(m_nCurrX,m_nCurrY) >= 2 then m_boDupMode:=True;
    if not IsProperTarget{FFFF4}(m_TargetCret) then m_TargetCret:=nil;
  end; //004A8ED2
  if m_boDupMode then begin
    nOldX:=m_nCurrX;
    nOldY:=m_nCurrY;
    WalkTo(Random(8),False);
    if (nOldX <> m_nCurrX) or (nOldY <> m_nCurrY) then begin
      m_boDupMode:=False;
      Result:=True;
    end;
  end;
end;

function TPercentMonster.AttackTarget():Boolean; //004A8F34
var
  btDir:Byte;
begin
  Result:=False;
  if m_TargetCret <> nil then begin
    if GetAttackDir(m_TargetCret,btDir) then begin
      if GetCurrentTime - m_dwHitTick > GetHitSpeed then begin
        m_dwHitTick:=GetCurrentTime;
        m_dwTargetFocusTick:=GetTickCount();
        Attack(m_TargetCret,btDir);  //FFED
        BreakHolySeizeMode();
      end;
      Result:=True;
    end else begin
    if m_TargetCret.m_sMapName = self.m_sMapName then begin
        SetTargetXY(m_TargetCret.m_nCurrX,m_TargetCret.m_nCurrY); {0FFF0h}
        //004A8FE3
      end else begin
        DelTargetCreat();{0FFF1h}
        //004A9009
      end;
    end;
  end;
end;

procedure TPercentMonster.Run; //004A9020
var
  nX,nY:Integer;
begin
  if not m_boFixedHideMode and
     not m_boStoneMode and
     CanMove then begin
    if Think then begin
      inherited;
      exit;
    end;
    if m_boWalkWaitLocked then begin
      if (GetTickCount - m_dwWalkWaitTick) > m_dwWalkWait then begin
        m_boWalkWaitLocked:=False;
      end;
    end;
    if not m_boWalkWaitLocked and (GetCurrentTime - m_dwWalkTick > GetWalkSpeed) then begin
      m_dwWalkTick:=GetCurrentTime;
      Inc(m_nWalkCount);
      if m_nWalkCount > m_nWalkStep then begin
        m_nWalkCount:=0;
        m_boWalkWaitLocked:=True;
        m_dwWalkWaitTick:=GetTickCount();
      end; //004A9151
      if not m_boRunAwayMode then begin
        if not m_boNoAttackMode then begin
          if m_TargetCret <> nil then begin
            if AttackTarget{FFEB} then begin
              inherited;
              exit;
            end;
          end else begin
            m_nTargetX:=-1;
            if m_boMission then begin
              m_nTargetX:=m_nMissionX;
              m_nTargetY:=m_nMissionY;
            end; //004A91D3
          end;
        end; //004A91D3  if not bo2C0 then begin
        if m_Master <> nil then begin
          if m_TargetCret = nil then begin
            m_Master.GetBackPosition(nX,nY);
            if (abs(m_nTargetX - nX) > 1) or (abs(m_nTargetY - nY{nX}) > 1) then begin //004A922D
              m_nTargetX:=nX;
              m_nTargetY:=nY;
              if (abs(m_nCurrX - nX) <= 2) and (abs(m_nCurrY - nY) <= 2) then begin
                if m_PEnvir.GetMovingObject(nX,nY,True) <> nil then begin
                  m_nTargetX:=m_nCurrX;
                  m_nTargetY:=m_nCurrY;
                end //004A92A5
              end;
            end; //004A92A5
          end; //004A92A5 if m_TargetCret = nil then begin
          if (not m_Master.m_boSlaveRelax) and
             ((m_PEnvir <> m_Master.m_PEnvir) or
             (abs(m_nCurrX-m_Master.m_nCurrX) > 20) or
             (abs(m_nCurrY-m_Master.m_nCurrY) > 20)) then begin
           //  sysmsg('recalling to my master',c_red,t_hint);
          SpaceMove(m_Master.m_PEnvir.sMapName, m_nTargetX, m_nTargetY, 1);
          end; // 004A937E
        end;// 004A937E if m_Master <> nil then begin
      end else begin //004A9344
        if (m_dwRunAwayTime > 0) and ((GetTickCount - m_dwRunAwayStart) > m_dwRunAwayTime) then begin
          m_boRunAwayMode:=False;
          m_dwRunAwayTime:=0;
        end;
      end; //004A937E
      if (m_Master <> nil) and m_Master.m_boSlaveRelax then begin
        inherited ;
        exit;
      end;  //004A93A6
      if m_nTargetX <> -1 then begin
         GotoTargetXY(); //004A93B5 0FFEF
      end else begin
        if m_TargetCret = nil then Wondering();// FFEE   //Jacky
      end; //004A93D8
    end;
  end; //004A93D8

  inherited;
end;




constructor TMagicMonster.Create; //004A8B74
begin
  inherited;
  m_boDupMode:=False;
  bo554:=False;
  m_dwThinkTick:=GetTickCount();
  m_nViewRange:=8;
  m_nRunTime:=250;
  m_dwSearchTime:=3000 + Random(2000);
  m_dwSearchTick:=GetTickCount();
  m_btRaceServer:=215;
end;

destructor TMagicMonster.Destroy; //004A8C24
begin
  inherited;
end;
{
function TMagicMonster.MakeClone(sMonName: String;OldMon:TBaseObject): TBaseObject; //004A8C58
var
  ElfMon:TBaseObject;
begin
  Result:=nil;
  ElfMon:=UserEngine.RegenMonsterByName(m_PEnvir.sMapName,m_nCurrX,m_nCurrY,sMonName);
  if ElfMon <> nil then begin
    ElfMon.m_Master:=OldMon.m_Master;
    ElfMon.m_dwMasterRoyaltyTick:=OldMon.m_dwMasterRoyaltyTick;
    ElfMon.m_btSlaveMakeLevel:=OldMon.m_btSlaveMakeLevel;
    ElfMon.m_btSlaveExpLevel:=OldMon.m_btSlaveExpLevel;
    ElfMon.RecalcAbilitys;
    ElfMon.RefNameColor;
    if OldMon.m_Master <> nil then
      OldMon.m_Master.m_SlaveList.Add(ElfMon);
    ElfMon.m_WAbil:=OldMon.m_WAbil;
    ElfMon.m_wStatusTimeArr:=OldMon.m_wStatusTimeArr;
    ElfMon.m_TargetCret:=OldMon.m_TargetCret;
    ElfMon.m_dwTargetFocusTick:=OldMon.m_dwTargetFocusTick;
    ElfMon.m_LastHiter:=OldMon.m_LastHiter;
    ElfMon.m_LastHiterTick:=OldMon.m_LastHiterTick;
    ElfMon.m_btDirection:=OldMon.m_btDirection;
    Result:=ElfMon;
  end;
end;
}
function TMagicMonster.Operate(ProcessMsg: pTProcessMessage):Boolean;
begin
  Result:=inherited Operate(ProcessMsg);

end;
function TMagicMonster.Think():Boolean; //004A8E54
var
  nOldX,nOldY:integer;
begin
  Result:=False;
  if (GetTickCount - m_dwThinkTick) > 3 * 1000 then begin
    m_dwThinkTick:=GetTickCount();
    if m_PEnvir.GetXYObjCount(m_nCurrX,m_nCurrY) >= 2 then m_boDupMode:=True;
    if not IsProperTarget{FFFF4}(m_TargetCret) then m_TargetCret:=nil;
  end; //004A8ED2
  if m_boDupMode then begin
    nOldX:=m_nCurrX;
    nOldY:=m_nCurrY;
    WalkTo(Random(8),False);
    if (nOldX <> m_nCurrX) or (nOldY <> m_nCurrY) then begin
      m_boDupMode:=False;
      Result:=True;
    end;
  end;
end;

function TMagicMonster.AttackTarget():Boolean; //004A8F34
var
  bt06:Byte;
begin
  Result:=False;
  if m_TargetCret <> nil then begin
if m_TargetCret = m_Master then begin //nicky
    m_TargetCret := nil;
end else begin
    if GetAttackDir(m_TargetCret,bt06) then begin
      if GetCurrentTime - m_dwHitTick > GetHitSpeed then begin
        m_dwHitTick:=GetCurrentTime;
        m_dwTargetFocusTick:=GetTickCount();
  // Attack(m_TargetCret,bt06);  //FFED
      end;
      Result:=True;
    end else begin
    if m_TargetCret.m_sMapName = self.m_sMapName then begin
        SetTargetXY(m_TargetCret.m_nCurrX,m_TargetCret.m_nCurrY); {0FFF0h}
        //004A8FE3
      end else begin
        DelTargetCreat();{0FFF1h}
        //004A9009
      end;
    end;
  end;
  end;
end;
procedure TMagicMonster.Run; //004A9020
var
  nX,nY:Integer;
begin
  if not m_boFixedHideMode and
     not m_boStoneMode and
     CanMove then begin
    if Think then begin
      inherited;
      exit;
    end;
    if m_boWalkWaitLocked then begin
      if (GetTickCount - m_dwWalkWaitTick) > m_dwWalkWait then begin
        m_boWalkWaitLocked:=False;
      end;
    end;
    if not m_boWalkWaitLocked and (GetCurrentTime - m_dwWalkTick > GetWalkSpeed) then begin
      m_dwWalkTick:=GetCurrentTime;
      Inc(m_nWalkCount);
      if m_nWalkCount > m_nWalkStep then begin
        m_nWalkCount:=0;
        m_boWalkWaitLocked:=True;
        m_dwWalkWaitTick:=GetTickCount();
      end; //004A9151
      if not m_boRunAwayMode then begin
        if not m_boNoAttackMode then begin
          if m_TargetCret <> nil then begin
            if AttackTarget{FFEB} then begin
              inherited;
              exit;
            end;
          end else begin
            m_nTargetX:=-1;
            if m_boMission then begin
              m_nTargetX:=m_nMissionX;
              m_nTargetY:=m_nMissionY;
            end; //004A91D3
          end;
        end; //004A91D3  if not bo2C0 then begin
        if m_Master <> nil then begin
          if m_TargetCret = nil then begin
            m_Master.GetBackPosition(nX,nY);
            if (abs(m_nTargetX - nX) > 1) or (abs(m_nTargetY - nY{nX}) > 1) then begin //004A922D
              m_nTargetX:=nX;
              m_nTargetY:=nY;
              if (abs(m_nCurrX - nX) <= 2) and (abs(m_nCurrY - nY) <= 2) then begin
                if m_PEnvir.GetMovingObject(nX,nY,True) <> nil then begin
                  m_nTargetX:=m_nCurrX;
                  m_nTargetY:=m_nCurrY;
                end //004A92A5
              end;
            end; //004A92A5
          end; //004A92A5 if m_TargetCret = nil then begin
          if (not m_Master.m_boSlaveRelax) and
             ((m_PEnvir <> m_Master.m_PEnvir) or
             (abs(m_nCurrX-m_Master.m_nCurrX) > 20) or
             (abs(m_nCurrY-m_Master.m_nCurrY) > 20)) then begin
           //  sysmsg('recalling to my master',c_red,t_hint);
          SpaceMove(m_Master.m_PEnvir.sMapName, m_nTargetX, m_nTargetY, 1);
          end; // 004A937E
        end;// 004A937E if m_Master <> nil then begin
      end else begin //004A9344
        if (m_dwRunAwayTime > 0) and ((GetTickCount - m_dwRunAwayStart) > m_dwRunAwayTime) then begin
          m_boRunAwayMode:=False;
          m_dwRunAwayTime:=0;
        end;
      end; //004A937E
      if (m_Master <> nil) and m_Master.m_boSlaveRelax then begin
        inherited ;
        exit;
      end;  //004A93A6
      if m_nTargetX <> -1 then begin
         GotoTargetXY(); //004A93B5 0FFEF
      end else begin
        if m_TargetCret = nil then Wondering();// FFEE   //Jacky
      end; //004A93D8
    end;
  end; //004A93D8
  inherited;
end;


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| 发表于 2021-3-30 02:04:55 | 显示全部楼层
牛魔王
原版攻击:1.近战攻击,2.远程3x3范围攻击
参考appr:71
HGE是否存在该代码:存在HGE是否拥有其他类似代码:存在
是否实现:否,71编号的牛魔王会释放类似狂热火蜥蜴的范围火墙,跟原版出现错误,其他类似代码虽然正确的使用的远程攻击,但是仅仅只使用了远程攻击,又把近战攻击取消了,原版是玩家跑开就走位远程,玩家过来就近战攻击
自定义怪物是否能使用:可以实现同时拥有近战攻击和远程攻击,但是不够智能,并且技能因为去黑边效果而变成半透明,而非正常的不透明无黑边效果


怪物文件:Mon21
2技能引用编号:3400开始,攻击特效编号3580开始


参考代码(韩语已经翻译成中文在后面):

{ 牛魔王 }

constructor TMinotaurKing.Create;//004AA4B4
begin
  inherited;
  nextx:=0;
  nexty:=0;
  boMoving:=FALSE;
  MassAttackMode:=FALSE;
  MassAttackCount:=0;
  NextTarget:=nil;
  m_boApproach:=FALSE;//stops mtk from going towards players
  m_dwSearchTime:=Random(1500) + 1500;
  m_boBossMonster:=True;
end;

destructor TMinotaurKing.Destroy;
begin
  inherited;
end;

function TMinotaurKing.Operate(ProcessMsg:pTProcessMessage):boolean;
begin
  if (ProcessMsg.wIdent = RM_MAGSTRUCK) and (not MassAttackMode) then begin
    //they used magic now pwn them with redcircle!!!!!!
    MassAttackMode:=True;
    MassAttackCount:=0;
  end;
  Result := inherited Operate(ProcessMsg);
end;

procedure TMinotaurKing.RedCircle(nDir:Integer);
var
  I:Integer;
  magpwr:Integer;
  WAbil:pTAbility;
  BaseObject:TBaseObject;
  Target:TBaseObject;
begin
//target selected
  if Target =  nil then exit;
m_btDirection:=nDir;
{ get first target }
if NextTarget <> nil then begin
  Target:=NextTarget;
  NextTarget:=nil;
end else begin
  Target := m_TargetCret;
end;
{do spell effect}
SendRefMsg(RM_LIGHTING,1,m_nCurrX,m_nCurrY,Integer(Target),'');

{do hit radius around target}
  for i:=0 to Target.m_VisibleActors.Count-1 do begin
    BaseObject:= TBaseObject (pTVisibleBaseObject(Target.m_VisibleActors).BaseObject);
    if (abs(Target.m_nCurrX-BaseObject.m_nCurrX) <= 1) and (abs(Target.m_nCurrY-BaseObject.m_nCurrY) <= 1) then begin
     //if in 3 radious range get hit
      if BaseObject <> nil then begin
        if IsProperTarget (BaseObject) then begin
         if Random(BaseObject.m_nAntiMagic) = 0 then begin
          if random(3) = 0 then NextTarget:=BaseObject;
            WAbil:=@m_WAbil;
            magpwr:=_MAX( 0, LoWord(WAbil.DC) + Random(SmallInt(HiWord(WAbil.DC)-LoWord(WAbil.DC)) + 1) );
            BaseObject.SendDelayMsg (self, RM_MAGSTRUCK, 0, magpwr, 0, 0, '', 600);
          end;
        end;
      end;
    end;
  end;
end;


procedure TMinotaurKing.Run;//004AA604
var
  nAttackDir:Integer;
  distx,disty,distx2,disty2:Integer;
begin

  if (not bo554) and CanMove then begin

    if ((GetTickCount - m_dwSearchEnemyTick) > 1000) and (m_TargetCret = nil) then begin
      m_dwSearchEnemyTick:=GetTickCount();
      SearchTarget();
    end;

    //walk code (only make him to towards a target if it's just at the edge of our view range
    if (m_TargetCret <> nil) then begin
      distx := abs(m_nCurrX - m_TargetCret.m_nCurrX);
      disty := abs(m_nCurrY - m_TargetCret.m_nCurrY);
      if (nextx = 0) and (nexty = 0) then begin
        nextx:=m_TargetCret.m_nCurrX ;
        nexty:=m_TargetCret.m_nCurrY;
      end;
    end;
    if boMoving then begin //if moving is true check if we havent reached our destination
      if ((m_nCurrx = nextx) and (m_nCurry = nexty)) then begin
        boMoving:=False;
        nextx:=0;
        nexty:=0;
      end;
      distx2 := abs(m_nCurrX - nextx);
      disty2 := abs(m_nCurrY - nexty);
      if (distx2 < 2) and (disty2 < 2) and (m_PEnvir.MoveToMovingObject(m_nCurrX,m_nCurrY,Self,nextx,nexty,FALSE) <= 0) then begin //if we reached our destination, should add a code to check if there's nobody else there later
        boMoving:=False;
        nextx:=0;
        nexty:=0;
      end;
    end;
    if ((m_TargetCret = nil) or ((distx > 7) or (disty > 7))) and (nextx <> 0) and (nexty <> 0) then
      boMoving:=True;

    if boMoving then begin
      if (GetCurrentTime - m_dwWalkTick > GetWalkSpeed) then begin //check if we should walk closer or not and do it :p
        m_dwWalkTick:=GetCurrentTime;
        m_nTargetX:=nextx;
        m_nTargetY:=nexty;
        GotoTargetXY();
      end;
    end;

    {attack them at distance}
    if (m_TargetCret <> nil) and
        (_max(distx,disty) > 1) and
        (Integer(GetTickCount - m_dwHitTick) > 1200) and
        (not MassAttackMode) then begin
      nAttackDir:=GetNextDirection(m_nCurrX,m_nCurrY,m_TargetCret.m_nCurrX,m_TargetCret.m_nCurrY);
      m_dwHitTick:=GetCurrentTime;
      RedCircle(nAttackDir);
    end;

    {Actual magic attack if hes hit by magic}
    if (Integer(GetTickCount - m_dwHitTick) > 1200) and (m_TargetCret <> nil) then begin
      if (MassAttackMode) then begin
        if (MassAttackCount <= 5) then begin
          m_dwHitTick:=GetCurrentTime;
          inc(MassAttackCount);
          nAttackDir:=GetNextDirection(m_nCurrX,m_nCurrY,m_TargetCret.m_nCurrX,m_TargetCret.m_nCurrY);
          RedCircle(nAttackDir);
        end else begin
          MassAttackCount := 0;
          MassAttackMode := False;
        end;
      end;
    end;
  end;
  inherited;
end;

{LEFT & RIGHT GUARDS}

constructor TMinoGuard.Create; //004A9690
begin
  inherited;
  m_dwSearchTime:=Random(1500) + 1500;
  m_dwHitTick:=GetCurrentTime;
end;

destructor TMinoGuard.Destroy;
begin
  inherited;
end;

procedure TMinoGuard.MagicAttack(nDir:Integer);
var
Target:TBaseObject;
magpwr:Integer;
WAbil:pTAbility;
begin
if m_TargetCret <> nil then Target:=m_TargetCret;

SendRefMsg(RM_LIGHTING,1,m_nCurrX,m_nCurrY,Integer(Target),'');

{Hit first Target}
if IsProperTarget (Target) then begin
       WAbil:=@m_WAbil;
       magpwr:=_MAX( 0, LoWord(WAbil.DC) + Random(SmallInt(HiWord(WAbil.DC)-LoWord(WAbil.DC)) + 1) );
       Target.SendDelayMsg (self, RM_MAGSTRUCK, 0, magpwr, 0, 0, '', 600);
    end;
end;

procedure TMinoGuard.Run;//004A9720
var
nAttackDir:integer;
begin
  if not bo554 and CanMove then begin

     if (m_TargetCret <> nil) and
       ((abs(m_nCurrX - m_TargetCret.m_nCurrX) >= 2) or
       (abs(m_nCurrY - m_TargetCret.m_nCurrY) >= 2)) and
       (Integer(GetTickCount - m_dwHitTick) > 2200) then begin
      if (MagCanHitTarget(m_nCurrX,m_nCurrY,m_targetCret)) or (m_btRaceImg <> 70) then begin //make sure the 'line' in wich magic will go isnt blocked
        m_dwHitTick:=GetCurrentTime;
        nAttackDir:=GetNextDirection(m_nCurrX,m_nCurrY,m_TargetCret.m_nCurrX,m_TargetCret.m_nCurrY);
        MagicAttack(nAttackDir);
      end;
     end;

    if ((GetTickCount - m_dwSearchEnemyTick) > 8000) or
       (((GetTickCount - m_dwSearchEnemyTick) > 1000) and (m_TargetCret = nil)) then begin
      m_dwSearchEnemyTick:=GetTickCount();
      SearchTarget();
    end;
  end;
  inherited;
end;

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| 发表于 2021-3-30 02:10:46 | 显示全部楼层
魔龙教主
原版攻击:1.近战攻击,携带推人和麻痹2.远程5x5范围攻击,携带推人和麻痹
参考appr:137
HGE是否存在该代码:存在是否实现:否,137编号的魔龙教主会使用远程攻击来替代近战,并且不停的走位,但是整体的攻击动作和施法动作会发生严重性的延迟,玩家跑开甚至杀死魔龙教主后,魔龙教主依然会在原地释放之前的动作,延迟效果非常严重,哪怕降低了攻速也没用
自定义怪物是否能使用:可以实现同时拥有近战攻击和远程攻击,但是不够智能,魔龙教主近身有时候不会使用近战,而变成远程,而玩家跑开又会因为远程攻击的几率问题而对魔龙教主进行放风筝
其他引擎是否能实现EG,GEE,BLUE,传奇外传均可实现原版的魔龙教主效果


怪物文件:Mon22
2技能引用编号:3280开始,攻击特效编号3520开始


参考代码(韩语已经翻译成中文在后面):

{ 魔龙教主 }

constructor TOmaKing.Create;
begin
  ldistx:=0;
  ldisty:=0;
  m_dwSpellTick:=GetTickCount();
  m_boAnimal:=False;
  m_nViewRange := 12;  
  m_boBossMonster:=True;
  inherited;
end;

destructor TOmaKing.Destroy;
begin
  inherited;
end;

procedure TOmaKing.Run;//004AA604
var
  distx,disty:integer;
  nDir:integer;
begin
  if not m_boFixedHideMode and
     not m_boStoneMode and
     CanMove then begin
//walk codes next (since ok doesnt go near players like other mobs do this is hopefully a correct code)
  if (m_TargetCret <> nil) then begin
    if (GetCurrentTime - m_dwWalkTick > GetWalkSpeed) then begin //check if we should walk closer or not and do it :p
      m_dwWalkTick:=GetCurrentTime;
      distx:=abs(m_nCurrX - m_TargetCret.m_nCurrX);
      disty := abs(m_nCurrY - m_TargetCret.m_nCurrY);
      nDir:=GetNextDirection(m_nCurrX,m_nCurrY,m_TargetCret.m_nCurrX,m_TargetCret.m_nCurrY);
      if (distx > ldistx) or (disty > ldisty) or (distx > 5) or (disty > 5) then begin //if the last distance from us is further then the current (aka if they running)
        if ((distx > 2) or (disty > 2)) and ((distx < 12) and (disty < 12)) then begin //restrict the maximum pursuit distance to 12 coords away
          //WalkTo(nDir,False);
          m_nTargetX := m_TargetCret.m_nCurrX;
          m_nTargetY := m_TargetCret.m_nCurrY;
          GotoTargetXY;
          ldistx:=abs(m_nCurrX - m_TargetCret.m_nCurrX);
          ldisty := abs(m_nCurrY - m_TargetCret.m_nCurrY);
          exit;
        end;
      end;

      ldistx :=distx;
      ldisty :=disty;
    end;
  end;
//regular attack code
  if (m_TargetCret <> nil) and (GetCurrentTime - m_dwHitTick > GetHitSpeed) and
   (Integer(GetTickCount - m_dwSpellTick) > m_nNextHitTime) and
   (abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 2) and (abs(m_nCurrY - m_TargetCret.m_nCurrY) <= 2)
     and ((abs(m_nCurrY - m_TargetCret.m_nCurrY) + abs(m_nCurrX - m_TargetCret.m_nCurrX)) <= 3) then begin
    m_dwHitTick:=GetCurrentTime;
    if( Random(8) = 0) and (abs(m_nCurrX - m_TargetCret.m_nCurrX) <= 1)and (abs(m_nCurrY - m_TargetCret.m_nCurrY) <= 1) then begin //10% chance he just attacks)
      attacktarget(); //no point trying to hit something that isnt close enough :p
    end else //does repulse
      RepulseCircle();
  end;

//magic attack code
  if (m_TargetCret <> nil) and
       (Integer(GetTickCount - m_dwSpellTick) > m_nNextHitTime * 4) then begin
        m_dwSpellTick:=GetTickCount();
        BlueCircle();
     end;

//search for targets nearbye
  if ((GetTickCount - m_dwSearchEnemyTick) > 8000) or
       (((GetTickCount - m_dwSearchEnemyTick) > 1000) and (m_TargetCret = nil)) then begin
      m_dwSearchEnemyTick:=GetTickCount();
      SearchTarget();
  end;
  end;
  inherited;
end;

procedure TOmaKing.BlueCircle();
var
  I:Integer;
  magpwr:Integer;
  WAbil:pTAbility;
  BaseObject:TBaseObject;
  Target:TBaseObject;
  nDir:integer;
begin
   if m_TargetCret =  nil then exit;
Target := m_TargetCret;
nDir:= GetNextDirection (m_nCurrX, m_nCurrY, m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
m_btDirection:=nDir;
SendRefMsg(RM_LIGHTING,nDir,m_nCurrX,m_nCurrY,Integer(self),'');

    for i := 0 to m_VisibleActors.Count-1 do begin
      BaseObject := TBaseObject (pTVisibleBaseObject(m_VisibleActors).BaseObject);

      if IsProperTarget (BaseObject) then begin
      if (BaseObject.m_btRaceServer = RC_PLAYOBJECT) or (BaseObject.m_Master <> nil) then begin
          WAbil:=@m_WAbil;
          magpwr := (BaseObject.m_WAbil.HP div 4);
          BaseObject.DamageHealth(magpwr); //보호의반지적용 2004-01-17
          BaseObject.SendDelayMsg (self, RM_MAGSTRUCK, 0, magpwr, 0, 0, '', 600);
         end;
      end;
   end;
end;


procedure TOmaKing.RepulseCircle();
var
  I:Integer;
  BaseObject:TBaseObject;
  nDir:Byte;
  push, levelgap:integer;
  pwr: integer;
  WAbil:pTAbility;
begin
{do spell effect}
    if m_TargetCret =  nil then exit;

nDir:= GetNextDirection (m_nCurrX, m_nCurrY, m_TargetCret.m_nCurrX, m_TargetCret.m_nCurrY);
m_btDirection:=nDir;
SendAttackMsg(RM_HIT,nDir,m_nCurrX,m_nCurrY);
{do repule radius around 'ourself'}
for i:=0 to m_VisibleActors.Count-1 do begin
  BaseObject:= TBaseObject (pTVisibleBaseObject(m_VisibleActors).BaseObject);
   if (abs(m_nCurrX-BaseObject.m_nCurrX) <= 2) and (abs(m_nCurrY-BaseObject.m_nCurrY) <= 2)
    and ((abs(m_nCurrY - m_TargetCret.m_nCurrY) + abs(m_nCurrX - m_TargetCret.m_nCurrX)) <= 3) then begin

    if BaseObject <> nil then begin
      if IsProperTarget (BaseObject) then begin
         WAbil:=@m_WAbil;
         pwr:=(Random(SmallInt(HiWord(WAbil.DC) - LoWord(WAbil.DC)) + 1) + LoWord(WAbil.DC));
         push := 2 + Random(3);
         nDir:= GetNextDirection (m_nCurrX, m_nCurrY, BaseObject.m_nCurrX, BaseObject.m_nCurrY);
         levelgap := m_Abil.Level - BaseObject.m_Abil.Level;
        if (Random(20) < levelgap) then begin
         push := 2 + Random(3);
         BaseObject.CharPushed (nDir, push);
         end;
         BaseObject.SendDelayMsg (self, RM_MAGSTRUCK, 0, pwr, 0, 1, '', 600);
      if Random(6) = 0 then begin
         BaseObject.MakePosion(POISON_STONE,3,0);
         BaseObject.SendMsg (BaseObject,RM_MAGICTYPE, 0, 0, 0, 3, '173');
         end;
        end;
      end;
    end;
  end;
end;

function TOmaKing.AttackTarget():Boolean; //004A8F34
var
  btDir:Byte;
begin
  Result:=False;
  if m_TargetCret <> nil then begin
    if GetAttackDir(m_TargetCret,btDir) then begin
      if GetCurrentTime - m_dwHitTick > GetHitSpeed then begin
        m_dwHitTick:=GetCurrentTime;
        m_dwTargetFocusTick:=GetTickCount();
        Attack(m_TargetCret,btDir);  //FFED
      end;
      Result:=True;
    end;
  end;
end;

{ TStoneMonster }

constructor TStoneMonster.Create;
begin
  inherited;
  m_nViewRange   := 6;
  m_boStickMode  := True;
end;

destructor TStoneMonster.Destroy;
begin

  inherited;
end;

procedure TStoneMonster.Run;
var
  i, x, y:     integer;
  nStartX, nStartY, nEndX, nEndY: integer;
  boRecalc:Boolean;
  BaseObject: TBaseObject;
  xList:TList;
begin
  if (not m_boGhost) and (not m_boDeath) then begin
    if GetCurrentTime - m_dwWalkTick > 5000 then begin
      m_dwWalkTick := GetCurrentTime;

      nStartX := _MAX(0, m_nCurrX-3);
      nEndX := _MIN(m_PEnvir.Header.wWidth, m_nCurrX+3);
      nStartY := _MAX(0, m_nCurrY-3);
      nEndY := _MIN(m_PEnvir.Header.wHeight, m_nCurrY+3);

      xList:=TList.Create;
      for x := nStartX to nEndX do begin
        for y := nStartY to nEndY do begin

          m_PEnvir.GetBaseObjects(x, y, True, xList);
          for i := 0 to xList.Count - 1 do begin
            BaseObject := TBaseObject(xList.Items);
            boRecalc := False;
            if BaseObject<>nil then begin
              if (BaseObject.m_btRaceServer <> RC_PLAYOBJECT) and
                (BaseObject.m_Master = nil) and
                (not BaseObject.m_boGhost) and
                (not BaseObject.m_boDeath) then begin

                if BaseObject.m_btRaceServer = 138{OmaThing } then begin
                  if BaseObject.m_wStatusArrValue[0] = 0 then begin
                    boRecalc := True;
                    BaseObject.m_wStatusArrValue[0] := 15;
                    BaseObject.m_dwStatusArrTimeOutTick[0] := GetTickCount + 15100;
                  end;
                end else begin
                  if BaseObject.m_wStatusTimeArr[STATE_DEFENCEUP] = 0 then begin
                    boRecalc := True;
                    BaseObject.m_wStatusTimeArr[STATE_DEFENCEUP] := 8;
                    BaseObject.m_dwStatusArrTick[STATE_DEFENCEUP] := GetTickCount;
                  end;
                  if BaseObject.m_wStatusTimeArr[STATE_MAGDEFENCEUP] = 0 then begin
                    boRecalc := True;
                    BaseObject.m_wStatusTimeArr[STATE_MAGDEFENCEUP] := 8;
                    BaseObject.m_dwStatusArrTick[STATE_MAGDEFENCEUP] := GetTickCount;
                  end;
                end;

                if boRecalc then BaseObject.RecalcAbilitys();
              end;
            end;

            if (Random(6) = 0) and boRecalc then begin
              SendRefMsg(RM_HIT, 0, m_nCurrX, m_nCurrY, 0, '');
            end;
          end;
        end;
      end;
      xList.Free;

      if Random(2) = 0 then begin
        SendRefMsg(RM_TURN, 0, m_nCurrX, m_nCurrY, 0, '');
      end;
    end;
  end;
  inherited;
end;

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| 发表于 2021-3-30 02:19:46 | 显示全部楼层
狐月天珠
原版攻击:1.冰冻攻击,2.全屏雪花攻击3.召唤魂石
参考appr:153
HGE是否存在该代码:存在是否实现:否,HGE的狐月天珠几乎独立于其他引擎,其他引擎都永远冰冻特效攻击和全屏雪花攻击,只有HGE的狐月天珠,不会使用素材文件里自己的攻击,而是用素狐的攻击。。。这个一定要修复
其他引擎是否能实现LEG,GEE,BLUE,官服所有传奇均可实现原版的狐月天珠效果

怪物文件:Mon33
2技能引用编号:攻击特效3350开始


参考代码(韩语已经翻译成中文在后面):
因为狐月天珠的代码超过1500字,所以放在一楼的压缩文件里

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x

点评

楼主能不能发下狐月天珠客户端的AxeMon.pas的渲染代码和 actor.pas文件里面的怪物站、攻击、死亡等动作定义代码看下  发表于 2021-3-30 22:52
 楼主| 发表于 2021-3-30 02:23:11 | 显示全部楼层
虹魔教主原版会狂暴,并且攻击动作和攻击特效会改变,HGE的appr编号改成92后,没测试出可以狂暴的效果,如果没有的话,也希望法海能够加一下


 楼主| 发表于 2021-3-30 02:32:06 | 显示全部楼层
我这里也给一些原本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;

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
发表于 2021-3-30 02:42:18 | 显示全部楼层
大佬很流弊!~~~支持
 楼主| 发表于 2021-3-30 02:43:57 | 显示全部楼层
其他的还在整理

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
发表于 2021-3-30 02:51:29 | 显示全部楼层
自定义怪物动作播放图片最多只支持30张,要是能支持50张就好了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|HGEM2论坛

GMT+8, 2024-11-21 21:30 , Processed in 0.668099 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表