Carrotlord

<BUY Command

Oct 2nd, 2012
169
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. offset 424EAF
  2.  
  3. ; * Usage: <BUYXXXX:YYYY
  4. ; * XXXX = Amount of money required for purchase.
  5. ; * YYYY = Event to jump to if player does not have enough money.
  6.  
  7. MOV EAX, DWORD PTR DS:[4A5AD8]
  8. ADD EAX, DWORD PTR DS:[4A5AE0]
  9. CMP DWORD PTR DS:[EAX], 5955423C    ; Compare *(EAX) with the text string "<BUY".
  10. JNE 424F33                          ; Failed to match.
  11. MOV ECX, DWORD PTR DS:[4A5AE0]
  12. ADD ECX, 4
  13. PUSH ECX
  14. CALL 421900                         ; Get argument 0 (purchase price).
  15. ADD ESP, 4
  16. CMP EAX, DWORD PTR DS:[49E181]
  17. JLE 424EFC                          ; We have enough money.
  18. MOV EDX, DWORD PTR DS:[4A5AE0]      ; Not enough money.
  19. ADD EDX, 9
  20. PUSH EDX
  21. CALL 421900                         ; Get argument 1 (event to jump to).
  22. ADD ESP, 4
  23. PUSH EAX
  24. CALL 421AF0                         ; Go to event.
  25. ADD ESP, 4
  26. JMP 4252A7
  27. SUB DWORD PTR DS:[49E181], EAX      ; Take money.
  28. ADD DWORD PTR DS:[4A5AE0], D        ; Continue script.
  29. JMP 4252A7
RAW Paste Data