Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------
- ----Super Castlevania IV----
- ----------------------------
- ---------------
- ----TOGGLES----
- ---------------
- --Box type toggles
- local candle = true
- local enemy = true
- local player = true
- --Center axis toggles
- local player_axis = false
- local whip_axis = false
- local projectile_axis = true
- local enemy_axis = true
- local candle_axis = false
- --Hitpoint display
- local playerhp = true
- local enemyhp = true
- --Cheats
- local cheats = false
- ------------------
- ---END TOGGLES----
- ------------------
- ---------------
- ----GLOBALS----
- ---------------
- local pbase = 0x540
- local ebase = 0x580
- local wbase = 0x200
- local pjbase = 0x440
- local ux = 0xA
- local uy = 0xE
- local uxrad = 0x28
- local uyrad = 0x2A
- local eactive = 0x10
- local camx = 0x1280
- local camy = 0x1298
- local elife = 0x06
- local plife = 0x13F4
- local hearts = 0x13F2
- local facing = 0x0578
- local timer = 0x13F0
- -------------------
- ----END GLOBALS----
- -------------------
- local function centeraxis(x,y)
- gui.line(x,y+2,x,y-2,"#FFFFFFFF")
- gui.line(x+2,y,x-2,y,"#FFFFFFFF")
- end
- local function player_hitbox()
- local x = memory.readword(pbase+ux) - memory.readword(camx)
- local y = memory.readword(pbase+uy) - memory.readword(camy)
- local cr = memory.readbyte(0x576)
- if cr ~= 0x0F then
- gui.box(x+7,y+27,x-7,y-19,"#0000FF40","#0000FFFF")
- if playerhp == true then
- gui.text(x-10,y-26,"HP:" .. memory.readbyte(plife))
- end
- else
- gui.box(x+7,y+cr,x-7,y-cr,"#0000FF40","#0000FFFF")
- if playerhp == true then
- gui.text(x-10,y-cr-7,"HP:" .. memory.readbyte(plife))
- end
- end
- if player_axis == true then
- centeraxis(x,y)
- end
- end
- local function player_projectiles()
- local base = 0
- local x
- local y
- local xrad
- local yrad
- local oend = 3
- for i = 0,oend,1 do
- base = pjbase + (i * 0x40)
- if i == 0 then
- base = pjbase
- end
- if memory.readword(base) ~= 0 then
- x = memory.readword(base+ux) - memory.readword(camx)
- y = memory.readword(base+uy) - memory.readword(camy)
- xrad = memory.readword(base+uxrad)
- yrad = memory.readword(base+uyrad)
- gui.box(x-xrad,y-yrad,x+xrad,y+yrad,"#FFFFFF40","#FFFFFFFF")
- if projectile_axis == true then
- centeraxis(x,y)
- end
- end
- end
- end
- local function player_whip()
- local base = 0
- local x
- local y
- local xrad
- local yrad
- local oend = 8
- for i = 0,oend,1 do
- base = wbase + (i * 0x40)
- if i == 0 then
- base = wbase
- end
- if memory.readword(base) ~= 0 then
- x = memory.readword(base+ux) - memory.readword(camx)
- y = memory.readword(base+uy) - memory.readword(camy)
- xrad = memory.readword(base+uxrad)
- yrad = memory.readword(base+uyrad)
- if xrad == 0 and yrad == 0 then
- if base == 0x0400 then
- gui.box(x-0x10,y-0x04,x+0x10,y+0x04,"#FFFFFF40","#FFFFFFFF")
- else
- gui.box(x-0x04,y-0x04,x+0x04,y+0x04,"#FFFFFF40","#FFFFFFFF")
- end
- else
- gui.box(x-xrad,y-yrad,x+xrad,y+yrad,"#FFFFFF40","#FFFFFFFF")
- end
- if whip_axis == true then
- centeraxis(x,y)
- end
- end
- end
- end
- local function object_hitbox()
- local base = 0
- local x
- local y
- local xrad
- local yrad
- local oend = 36
- local drawn
- local life
- for i = 0,oend,1 do
- base = ebase + (i * 0x40)
- drawn = false
- if i == 0 then
- base = ebase
- elseif
- base == 0x540 then
- drawn = true
- end
- if memory.readword(base+0x10) == 0x0E then
- if candle == true then
- x = memory.readword(base+ux) - memory.readword(camx)
- y = memory.readword(base+uy) - memory.readword(camy)
- xrad = memory.readword(base+uxrad)
- yrad = memory.readword(base+uyrad)
- gui.box(x-xrad,y-yrad,x+xrad,y+yrad,"#FFD00040","#FFD000FF")
- drawn = true
- if candle_axis == true then
- centeraxis(x,y)
- end
- end
- end
- if memory.readword(base+0x10) ~= 0 and drawn == false then
- x = memory.readword(base+ux) - memory.readword(camx)
- y = memory.readword(base+uy) - memory.readword(camy)
- xrad = memory.readword(base+uxrad)
- yrad = memory.readword(base+uyrad)
- life = memory.readword(base+elife)
- gui.box(x-xrad,y-yrad,x+xrad,y+yrad,"#FF000040","#FF0000FF")
- drawn = true
- if enemyhp == true then
- if life > 0 and life ~= 255 then
- gui.text(x-10,y-yrad-7,"HP:" .. life)
- end
- end
- if enemy_axis == true then
- centeraxis(x,y)
- end
- end
- end
- end
- local function cheat()
- memory.writebyte(plife,16)
- memory.writeword(timer,1024)
- memory.writebyte(hearts,32)
- end
- gui.register(function()
- if player == true then
- player_hitbox()
- player_whip()
- player_projectiles()
- end
- if enemy == true then
- object_hitbox()
- end
- if cheats == true then
- cheat()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement