0,1选怪
{ 选怪条件
- 只选择列表框中的怪物_____
- 当选中的对象死亡时,选择下1个怪物
- 选择距离自己最近的那个怪
- 只在半径____范围内选怪
- BOSS不选
}
![](https://images.cnblogs.com/cnblogs_com/xe2011/201205/201205301056401261.png)
![](https://images.cnblogs.com/cnblogs_com/xe2011/201205/201205301056401228.png)
(*修正
1 选列表框中的怪物
2 选最近的怪物*)
{此段代码需要hook的支持}
/// <summary>
/// 选怪
/// </summary>
/// <param name="ID1">目标的ID号,所有可以选中的对象/param>
procedure SelMonster(ID1:DWORD);
begin
ASM
MOV EAX,[$924E0C]
PUSH ID1 //目标ID号
MOV ECX,[EAX+$20]
ADD ECX,$0EC
MOV EBX,$005830D0
CALL EBX
END;
end;
{此段代码需要hook的支持}
/// <summary>
/// {人物是在游戏当中还是小退}
/// </summary>
function InGame():Boolean;
var gameretn:DWORD;
begin
asm
mov eax,[$00924D48]
mov gameretn,eax
end;
if gameretn=0 then Result:=true{在游戏当中}
else if gameretn>=1 then Result:=False; {人物在角色选择界面}
end;
procedure TForm1.Button1Click(Sender: TObject);
{选怪}
var
I :Integer;
L :Integer;
_idtm :DWORD;
pMonster : PDWORD;
Mon_id : PDWORD;
Mon_kind : PDWORD;
Monbase : DWORD;
SelObjId : DWORD;
Mon_amount : PDWORD;
Mon_hpMin : PDWORD;
Mon_hpMax : PDWORD;
Mon_level : PDWORD;
Mon_distance: PSingle;
Mon_name : PDWORD;
Mon_name1 : PWideChar;
Mon_name2 : string;
begin
if InGame=False then Exit;
asm //prc monster
mov eax,[$924E0C]
mov eax,[eax+$1c]
mov eax,[eax+$8]
mov eax,[eax+$24]
mov ecx,[eax+$18]
mov Monbase,ecx
end;
_idtm:=0;
for I := 0 to 768 do
begin
pMonster := pointer(Monbase + I*4);
if pMonster^ > 0 then //当对象数组列表不为0的时候才添加
begin
pMonster :=Pointer(pMonster^ + $4); // 怪物对象指针=[怪物列表基址]+04
Mon_kind :=Pointer(pMonster^+$0B4);
Mon_id :=Pointer(pMonster^+$11c);
Mon_distance :=Pointer(pMonster^+$254); //距离
Mon_name :=Pointer(pMonster^ + $230); //名称
Mon_name1 :=Pointer(Mon_name^ + $0);
for L:= 0 to listbox1.Count-1 do
begin
if (Mon_name1<>listbox1.items[L]) then Continue;
if (Mon_distance^<=50)then _idtm:= Mon_id^;
{这里需要排序 每次选最近的那个 这样效率高可以和别人抢怪}
end;
end;
end;
SelMonster(_idtm);
end;
/// <summary>
/// 选怪
/// </summary>
/// <param name="ID1">目标的ID号,所有可以选中的对象/param>
procedure SelMonster(ID1:DWORD);
begin
ASM
MOV EAX,[$924E0C]
PUSH ID1 //目标ID号
MOV ECX,[EAX+$20]
ADD ECX,$0EC
MOV EBX,$005830D0
CALL EBX
END;
end;
{此段代码需要hook的支持}
/// <summary>
/// {人物是在游戏当中还是小退}
/// </summary>
function InGame():Boolean;
var gameretn:DWORD;
begin
asm
mov eax,[$00924D48]
mov gameretn,eax
end;
if gameretn=0 then Result:=true{在游戏当中}
else if gameretn>=1 then Result:=False; {人物在角色选择界面}
end;
procedure TForm1.Button1Click(Sender: TObject);
{选怪}
var
I :Integer;
L :Integer;
_idtm :DWORD;
pMonster : PDWORD;
Mon_id : PDWORD;
Mon_kind : PDWORD;
Monbase : DWORD;
SelObjId : DWORD;
Mon_amount : PDWORD;
Mon_hpMin : PDWORD;
Mon_hpMax : PDWORD;
Mon_level : PDWORD;
Mon_distance: PSingle;
Mon_name : PDWORD;
Mon_name1 : PWideChar;
Mon_name2 : string;
begin
if InGame=False then Exit;
asm //prc monster
mov eax,[$924E0C]
mov eax,[eax+$1c]
mov eax,[eax+$8]
mov eax,[eax+$24]
mov ecx,[eax+$18]
mov Monbase,ecx
end;
_idtm:=0;
for I := 0 to 768 do
begin
pMonster := pointer(Monbase + I*4);
if pMonster^ > 0 then //当对象数组列表不为0的时候才添加
begin
pMonster :=Pointer(pMonster^ + $4); // 怪物对象指针=[怪物列表基址]+04
Mon_kind :=Pointer(pMonster^+$0B4);
Mon_id :=Pointer(pMonster^+$11c);
Mon_distance :=Pointer(pMonster^+$254); //距离
Mon_name :=Pointer(pMonster^ + $230); //名称
Mon_name1 :=Pointer(Mon_name^ + $0);
for L:= 0 to listbox1.Count-1 do
begin
if (Mon_name1<>listbox1.items[L]) then Continue;
if (Mon_distance^<=50)then _idtm:= Mon_id^;
{这里需要排序 每次选最近的那个 这样效率高可以和别人抢怪}
end;
end;
end;
SelMonster(_idtm);
end;
附件列表