{
1 技能冷却时间
2 配合listbox循环使用技能
}
/// <summary>
/// 使用技能
/// </summary>
/// <param name="ID">技能ID号/param>
procedure skill(ID:DWORD);
begin
ASM
MOV ECX,[$924E0C]
MOV ECX,[ECX+$1C]
MOV ECX,[ECX+$20]
PUSH -1
PUSH 0
PUSH 0
PUSH ID //技能ID
MOV EBX,$00455860
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;
Skills : PDWORD;
skillTmp : DWORD;
Skill_Amount: DWORD;
Skill_delay : DWORD;
Skill_id : PDWORD;
Skill_name : PDWORD;
Skill_name1 : PChar;
skill_tmpId : DWORD;
begin
if InGame=False then Exit;
asm
mov eax,[$924E0C]
mov eax,[eax+$1c]
mov eax,[eax+$20]
mov ecx,[eax+$BE0]
mov Skill_Amount,ecx
mov ecx,[eax+$BDC]
mov skillTmp,ecx
end;
for I := 0 to Skill_Amount - 1 do //技能格子数=5*8=40个
begin
Skills :=pointer(skillTmp + I*4);
Skill_id :=Pointer(Skills^ + $8); //id
Skill_name :=Pointer(Skills^ + $4);
Skill_name :=Pointer(Skill_name^ + $4);
Skill_name :=Pointer(Skill_name^ + $10);
Skill_name1 :=Pointer(Skill_name^ + $0);
if Skills^ > 0 then //当对象数组列表不为0的时候才 ...
begin
ComboBox1.Items.Add(Skill_name1);
if Skill_name1 <> '魔衅' then Continue;
skill_tmpId:=Skill_id^;{直接用id会报错,用了中间变量}
end;
end;
{使用技能}
skill(skill_tmpId);
end;
/// 使用技能
/// </summary>
/// <param name="ID">技能ID号/param>
procedure skill(ID:DWORD);
begin
ASM
MOV ECX,[$924E0C]
MOV ECX,[ECX+$1C]
MOV ECX,[ECX+$20]
PUSH -1
PUSH 0
PUSH 0
PUSH ID //技能ID
MOV EBX,$00455860
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;
Skills : PDWORD;
skillTmp : DWORD;
Skill_Amount: DWORD;
Skill_delay : DWORD;
Skill_id : PDWORD;
Skill_name : PDWORD;
Skill_name1 : PChar;
skill_tmpId : DWORD;
begin
if InGame=False then Exit;
asm
mov eax,[$924E0C]
mov eax,[eax+$1c]
mov eax,[eax+$20]
mov ecx,[eax+$BE0]
mov Skill_Amount,ecx
mov ecx,[eax+$BDC]
mov skillTmp,ecx
end;
for I := 0 to Skill_Amount - 1 do //技能格子数=5*8=40个
begin
Skills :=pointer(skillTmp + I*4);
Skill_id :=Pointer(Skills^ + $8); //id
Skill_name :=Pointer(Skills^ + $4);
Skill_name :=Pointer(Skill_name^ + $4);
Skill_name :=Pointer(Skill_name^ + $10);
Skill_name1 :=Pointer(Skill_name^ + $0);
if Skills^ > 0 then //当对象数组列表不为0的时候才 ...
begin
ComboBox1.Items.Add(Skill_name1);
if Skill_name1 <> '魔衅' then Continue;
skill_tmpId:=Skill_id^;{直接用id会报错,用了中间变量}
end;
end;
{使用技能}
skill(skill_tmpId);
end;