Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. -- get the base address
  2. local baseAddress = getAddress("client_dx.exe")
  3.  
  4. -- light intensity = 0xFF
  5. -- light color = 0xD7
  6. local lightValue = { 0xFF, 0xD7 }
  7.  
  8. -- address to creature pointer
  9. local creaturePtrAddress = baseAddress + 0x161B20BC
  10.  
  11. -- offset to light address
  12. local lightOffset = 0xA4
  13.  
  14. -- address to patch when we turn torch on or
  15. -- cast something that changes current light
  16. local torchAddress = baseAddress + 0xFA387
  17.  
  18. -- address to patch when we change our character
  19. -- z position (e.g.: get into a cave) and we get a light change
  20. local floorChangeAddress = baseAddress + 0x1019C1
  21.  
  22. -- cheat code: mov ax, D7FF
  23. local opcode = { 0x66, 0xB8, 0xFF, 0xD7 }
  24.  
  25. -- patch with our cheat code
  26. writeBytes(torchAddress, opcode)
  27. writeBytes(floorChangeAddress, opcode)
  28.  
  29. -- at end, we write our desired light to the light address
  30. -- to force the client display our new light:
  31. -- first, read pointer
  32. -- later, write light value to light offset
  33. local creaturePtr = readInteger(creaturePtrAddress)
  34.  
  35. if (creaturePtr and creaturePtr ~= 0) then
  36. local lightAddress = creaturePtr + lightOffset
  37. writeBytes(lightAddress, lightValue)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement