TwMS v1.45_ICS_牆值左右走
//TwMS v145_ICS_牆值左右走
//原創改寫:Onion
//原創改寫:Onion
//更新:Ken
[Enable]
Alloc(AutoLRICS,512)
Alloc(MyLR,4)
Label(AutoLR)
Label(GetWall)
Label(GetChrX)
Label(GoRight)
Label(GoLeft)
MyLR:
DD 1 //開啟後向右走
00d2a118:
DD AutoLRICS
AutoLRICS:
Cmp [Esp],008EC54F
Jne GetFocus
Mov [Esp],AutoLR
Jmp GetFocus
AutoLR:
Call GetWall
Mov [ebp-04],Eax
Xor Ecx,Ecx
Xor Eax,Eax
Cmp [ebp-04],Eax
Jmp 008EC820
GetWall:
Call GetChrX
Mov Ecx,[00d215c0]
Sub Eax,[Ecx+1c] //角色X值 - 左牆X值
Cmp Eax,04
Jle GoRight
Call GetChrX
Mov Ecx,[Ecx+24]
sub Ecx,Eax //右牆X值 - 角色X值
cmp Ecx,04
Jle GoLeft
Mov Eax,[MyLR]
Ret
GetChrX:
Mov Eax,[00d24e48]
Mov Eax,[Eax+B0C]
Ret
GoRight:
Mov [MyLR],1
Mov Eax,1
Ret
GoLeft:
Mov [MyLR],FFFFFFFF
Mov Eax,FFFFFFFF
Ret
[Disable]
00d2a118:
DD GetFocus
DeAlloc(MyLR)
DeAlloc(AutoLRICS)
[Enable]
Alloc(AutoLRICS,512)
Alloc(MyLR,4)
Label(AutoLR)
Label(GetWall)
Label(GetChrX)
Label(GoRight)
Label(GoLeft)
MyLR:
DD 1 //開啟後向右走
00d2a118:
DD AutoLRICS
AutoLRICS:
Cmp [Esp],008EC54F
Jne GetFocus
Mov [Esp],AutoLR
Jmp GetFocus
AutoLR:
Call GetWall
Mov [ebp-04],Eax
Xor Ecx,Ecx
Xor Eax,Eax
Cmp [ebp-04],Eax
Jmp 008EC820
GetWall:
Call GetChrX
Mov Ecx,[00d215c0]
Sub Eax,[Ecx+1c] //角色X值 - 左牆X值
Cmp Eax,04
Jle GoRight
Call GetChrX
Mov Ecx,[Ecx+24]
sub Ecx,Eax //右牆X值 - 角色X值
cmp Ecx,04
Jle GoLeft
Mov Eax,[MyLR]
Ret
GetChrX:
Mov Eax,[00d24e48]
Mov Eax,[Eax+B0C]
Ret
GoRight:
Mov [MyLR],1
Mov Eax,1
Ret
GoLeft:
Mov [MyLR],FFFFFFFF
Mov Eax,FFFFFFFF
Ret
[Disable]
00d2a118:
DD GetFocus
DeAlloc(MyLR)
DeAlloc(AutoLRICS)
留言
張貼留言