(详细+说明+源码)热血传奇中周围有怪时如何使寻路终止?(目前需要鼠标点击一下))

mfm11111 2010-11-06 02:06:43
//以上代码实现了:有怪时打怪,但非得手动让游戏人物停(例如:鼠标点一下,此时游戏中人物会自动清除周围怪后寻路),无怪时可以寻路了
//疑问:当有怪时,人物不会自动停下来打怪,而需要在游戏中手动用鼠标单击一下才会停
// 此处如何才能让人物停下来呢?
procedure TForm1.Auto_PlayMonTimer(Sender: TObject);
var
i,monNum:integer;
curType:PByte;
temp,temp2,temMonObj:dword;
playBase,pt,curRole,pmonNum,curRoleX,curRoleY,curRoleLD,temp1:PDWORD;//^integer ^Dword;
ws:pchar;
s,tempStr,tempTypeStr,tempStr1:string;
begin
self.Memo2.Clear;
playBase:=Pointer($63E7C4);
playBase:=Pointer(playbase^+$5FB5C);
pmonNum:=Pointer(playbase^+$8);//周围怪物数量
playBase:=Pointer(playbase^+$4);
for i:=0 to pmonNum^-1 do
begin
try
curRole:=Pointer(playBase^+i*4);//对象基址
temMonObj:=curRole^;
curType:=Pointer(curRole^+$e); //表示怪物类型
if (curType^= 0) then continue;//如果是0,表示不是怪物
if (curRole=nil) then continue;
if (curRole^=0) then continue;
pt:=Pointer(curRole^+$24); //表示名称指针
curRoleLD:=Pointer(curRole^+$16); //最后一位为1生0死表示怪物生死
curRoleX:=Pointer(curRole^+$E0); //表示怪物X坐标
curRoleY:=Pointer(curRole^+$E4); //表示怪物Y坐标
temp:=curRoleLD^;
tempStr:=copy(IntToHex(temp,8),8,8);

begin
if (tempStr='0') then //如果怪物是活的并且周围有怪时,则
begin
//当有怪时,人物不会自动停下来,而需要在游戏中手动用鼠标单击一下才会停
//此处如何才能让人物停下来呢,
ws:=Pointer(pt^);//表示名称
s:=strpas(ws);
self.Memo2.Lines.Add('怪物对象基址:'+IntToHex(curRole^,8)+'怪物名称:'+S+'怪物类型:'+IntToHex(curType^,8));
f1_f12(3,curRole^); //传入参数,3表示技能数组下标,curRole^表示怪物对象,调用技能打怪CALL
end
end;
except
continue;
end;
end;
//此处判断周围是否无怪,无怪就寻路
tempStr1:=self.Memo2.Text;
if tempStr1='' then
begin
flag:=true;
goRoadMir($000000df,$00000165); //寻路函数
end;

end;

请路过的兄弟姐妹帮帮忙看一下,提点思路即可,先谢谢了!!!!!!!!!!!!!!
...全文
896 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lhs203203 2010-11-15
  • 打赏
  • 举报
回复
对传奇研究这么透彻干啥?
ychsquid 2010-11-09
  • 打赏
  • 举报
回复
服务端肯定有一种数据发送给客户端让人物停止移动的吧?
比如:服务端检测到某位置无法通行就发送一个数据告诉客户端停止移动,否则就给出下一个坐标
找一下这个在客户端的call
gyk120 2010-11-08
  • 打赏
  • 举报
回复
汗,为了这个问题专门玩了下传奇……
你的人物永远是处在最中心的,那你可以用鼠标模拟点击屏幕正中心的坐标
mfm11111 2010-11-06
  • 打赏
  • 举报
回复
f1_f12(3,curRole^); //传入参数,3表示技能数组下标,curRole^表示怪物对象,调用技能打怪CALL,这个就是使用雷电术的技能CALL调用啊。但它不会自动停下来啊。各位兄弟还有没其它的方法呢?急,提点思路即可
gyk120 2010-11-06
  • 打赏
  • 举报
回复
可否直接使用某技能的call,使用技能后人物会自动停下来

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧