Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Enable]
- Alloc(PortalTeleport, 512)
- Label(GP_Ending)
- Label(GP_Loop)
- Label(GP_GoodPortal)
- Label(GP_ExitLoop)
- Label(GP_Reset)
- Alloc(CurrentPortalID, 4)
- Alloc(KeyHook, 256)
- Label(Return)
- Label(KeyCheck)
- Label(KC_Ending)
- Label(KeyHack)
- Label(KH_Ending)
- CurrentPortalID:
- dd 0
- PortalTeleport:
- pushad
- mov edx,[01CD0918]
- test edx,edx
- je GP_Ending
- mov edx,[edx+165C]//MapID
- test edx,edx
- je GP_Ending
- xor ebx,ebx
- xor eax,eax
- mov ecx,[01CD87B8]
- test ecx,ecx
- je GP_Ending
- mov ecx,[ecx+4]
- test ecx,ecx
- je GP_Ending
- GP_Loop:
- mov esi,[ecx+eax*8+04]
- cmp [ecx-4],eax
- jbe GP_Reset
- inc eax
- cmp [esi+1C],#0
- je GP_Loop
- cmp [esi+1C],edx//InMap
- je GP_Loop
- cmp [esi+1C],#999999999
- jne GP_GoodPortal
- cmp [esi+8],7//portal type
- jne GP_Loop
- GP_GoodPortal:
- cmp [esi+8],3//auto portal?
- je GP_Loop
- cmp [CurrentPortalID],ebx
- je GP_ExitLoop
- inc ebx
- cmp [ecx-4],eax
- ja GP_Loop
- GP_Reset:
- mov [CurrentPortalID],0
- xor eax,eax
- xor ebx,ebx
- jmp GP_Ending
- GP_ExitLoop:
- push ecx
- push eax
- mov ecx,[01CCBC74]
- mov eax,[esi+C]//X
- mov [ecx+AABC],eax
- mov eax,[esi+10]//Y
- sub eax,1E
- mov [ecx+AAB0],eax
- mov [ecx+AA98],1
- pop eax
- pop ecx
- inc [CurrentPortalID]
- GP_Ending:
- popad
- xor eax,eax
- ret
- KeyHook:
- push [esp+8]
- call KeyCheck
- cmp eax,07
- je KeyHack
- push -01
- push 018554C2
- jmp Return
- KeyCheck:
- push ecx
- xor eax,eax
- movzx ecx,byte ptr [esp+B]
- cmp ecx,80//key up event
- jne KC_Ending
- movzx eax,byte ptr [esp+A]
- KC_Ending:
- pop ecx
- ret 0004
- KeyHack:
- call PortalTeleport
- KH_Ending:
- xor eax,eax
- ret 0008
- 01412D40:
- jmp KeyHook
- db 90 90
- Return:
- [Disable]
- 01412D40:
- push -01
- push 018554C2
- DeAlloc(PortalTeleport)
- DeAlloc(KeyHook)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement