Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- get the base address
- local baseAddress = getAddress("client_dx.exe")
- -- light intensity = 0xFF
- -- light color = 0xD7
- local lightValue = { 0xFF, 0xD7 }
- -- address to creature pointer
- local creaturePtrAddress = baseAddress + 0x161B20BC
- -- offset to light address
- local lightOffset = 0xA4
- -- address to patch when we turn torch on or
- -- cast something that changes current light
- local torchAddress = baseAddress + 0xFA387
- -- address to patch when we change our character
- -- z position (e.g.: get into a cave) and we get a light change
- local floorChangeAddress = baseAddress + 0x1019C1
- -- cheat code: mov ax, D7FF
- local opcode = { 0x66, 0xB8, 0xFF, 0xD7 }
- -- patch with our cheat code
- writeBytes(torchAddress, opcode)
- writeBytes(floorChangeAddress, opcode)
- -- at end, we write our desired light to the light address
- -- to force the client display our new light:
- -- first, read pointer
- -- later, write light value to light offset
- local creaturePtr = readInteger(creaturePtrAddress)
- if (creaturePtr and creaturePtr ~= 0) then
- local lightAddress = creaturePtr + lightOffset
- writeBytes(lightAddress, lightValue)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement