Advertisement
conhuevos

Untitled

May 15th, 2012
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.77 KB | None | 0 0
  1. ----------------------------
  2. ----Super Castlevania IV----
  3. ----------------------------
  4.  
  5. ---------------
  6. ----TOGGLES----
  7. ---------------
  8.  
  9. --Box type toggles
  10. local candle = true
  11. local enemy = true
  12. local player = true
  13.  
  14.  
  15. --Center axis toggles
  16. local player_axis = false
  17. local whip_axis = false
  18. local projectile_axis = true
  19. local enemy_axis = true
  20. local candle_axis = false
  21.  
  22. --Hitpoint display
  23. local playerhp = true
  24. local enemyhp = true
  25.  
  26. --Cheats
  27. local cheats = false
  28.  
  29. ------------------
  30. ---END TOGGLES----
  31. ------------------
  32.  
  33.  
  34. ---------------
  35. ----GLOBALS----
  36. ---------------
  37.  
  38. local pbase = 0x540
  39. local ebase = 0x580
  40. local wbase = 0x200
  41. local pjbase = 0x440
  42.  
  43. local ux = 0xA
  44. local uy = 0xE
  45.  
  46. local uxrad = 0x28
  47. local uyrad = 0x2A
  48.  
  49. local eactive = 0x10
  50.  
  51. local camx = 0x1280
  52. local camy = 0x1298
  53.  
  54. local elife = 0x06
  55.  
  56. local plife = 0x13F4
  57. local hearts = 0x13F2
  58. local facing = 0x0578
  59. local timer = 0x13F0
  60.  
  61. -------------------
  62. ----END GLOBALS----
  63. -------------------
  64.  
  65. local function centeraxis(x,y)
  66.     gui.line(x,y+2,x,y-2,"#FFFFFFFF")
  67.     gui.line(x+2,y,x-2,y,"#FFFFFFFF")
  68. end
  69.  
  70. local function player_hitbox()
  71.     local x = memory.readword(pbase+ux) - memory.readword(camx)
  72.     local y = memory.readword(pbase+uy) - memory.readword(camy)
  73.     local cr = memory.readbyte(0x576)
  74.  
  75.     if cr ~= 0x0F then
  76.         gui.box(x+7,y+27,x-7,y-19,"#0000FF40","#0000FFFF")
  77.         if playerhp == true then
  78.             gui.text(x-10,y-26,"HP:" .. memory.readbyte(plife))
  79.         end
  80.     else
  81.         gui.box(x+7,y+cr,x-7,y-cr,"#0000FF40","#0000FFFF")
  82.             if playerhp == true then
  83.                 gui.text(x-10,y-cr-7,"HP:" .. memory.readbyte(plife))
  84.             end
  85.     end
  86.    
  87.  
  88.    
  89.     if player_axis == true then
  90.         centeraxis(x,y)
  91.     end
  92.    
  93. end
  94.  
  95. local function player_projectiles()
  96.     local base = 0
  97.     local x
  98.     local y
  99.     local xrad
  100.     local yrad
  101.     local oend = 3
  102.    
  103.     for i = 0,oend,1 do
  104.    
  105.         base = pjbase + (i * 0x40)
  106.        
  107.         if i == 0 then
  108.             base = pjbase
  109.         end
  110.        
  111.         if memory.readword(base) ~= 0 then
  112.             x = memory.readword(base+ux) - memory.readword(camx)
  113.             y = memory.readword(base+uy) - memory.readword(camy)
  114.             xrad = memory.readword(base+uxrad)
  115.             yrad = memory.readword(base+uyrad)
  116.             gui.box(x-xrad,y-yrad,x+xrad,y+yrad,"#FFFFFF40","#FFFFFFFF")
  117.            
  118.             if projectile_axis == true then
  119.                 centeraxis(x,y)
  120.             end
  121.            
  122.         end
  123.        
  124.     end
  125. end
  126.  
  127. local function player_whip()
  128.  
  129.     local base = 0
  130.     local x
  131.     local y
  132.     local xrad
  133.     local yrad
  134.     local oend = 8
  135.    
  136.     for i = 0,oend,1 do
  137.    
  138.         base = wbase + (i * 0x40)
  139.        
  140.         if i == 0 then
  141.             base = wbase
  142.         end
  143.        
  144.         if memory.readword(base) ~= 0 then
  145.             x = memory.readword(base+ux) - memory.readword(camx)
  146.             y = memory.readword(base+uy) - memory.readword(camy)
  147.             xrad = memory.readword(base+uxrad)
  148.             yrad = memory.readword(base+uyrad)
  149.            
  150.             if xrad == 0 and yrad == 0 then
  151.                 if base == 0x0400 then
  152.                     gui.box(x-0x10,y-0x04,x+0x10,y+0x04,"#FFFFFF40","#FFFFFFFF")
  153.                 else
  154.                     gui.box(x-0x04,y-0x04,x+0x04,y+0x04,"#FFFFFF40","#FFFFFFFF")
  155.                 end
  156.             else
  157.                 gui.box(x-xrad,y-yrad,x+xrad,y+yrad,"#FFFFFF40","#FFFFFFFF")
  158.             end
  159.            
  160.             if whip_axis == true then
  161.                 centeraxis(x,y)
  162.             end
  163.         end
  164.        
  165.     end
  166. end
  167.  
  168. local function object_hitbox()
  169.     local base = 0
  170.     local x
  171.     local y
  172.     local xrad
  173.     local yrad
  174.     local oend = 36
  175.     local drawn
  176.     local life
  177.     for i = 0,oend,1 do
  178.    
  179.         base = ebase + (i * 0x40)
  180.         drawn = false
  181.        
  182.         if i == 0 then
  183.             base = ebase
  184.         elseif
  185.             base == 0x540 then
  186.             drawn = true
  187.         end
  188.        
  189.         if memory.readword(base+0x10) == 0x0E then
  190.             if candle == true then
  191.                 x = memory.readword(base+ux) - memory.readword(camx)
  192.                 y = memory.readword(base+uy) - memory.readword(camy)
  193.                 xrad = memory.readword(base+uxrad)
  194.                 yrad = memory.readword(base+uyrad)
  195.                 gui.box(x-xrad,y-yrad,x+xrad,y+yrad,"#FFD00040","#FFD000FF")
  196.                 drawn = true
  197.                
  198.                 if candle_axis == true then
  199.                     centeraxis(x,y)
  200.                 end
  201.             end
  202.            
  203.         end
  204.        
  205.         if memory.readword(base+0x10) ~= 0 and drawn == false then
  206.        
  207.             x = memory.readword(base+ux) - memory.readword(camx)
  208.             y = memory.readword(base+uy) - memory.readword(camy)
  209.             xrad = memory.readword(base+uxrad)
  210.             yrad = memory.readword(base+uyrad)
  211.             life = memory.readword(base+elife)
  212.            
  213.             gui.box(x-xrad,y-yrad,x+xrad,y+yrad,"#FF000040","#FF0000FF")
  214.             drawn = true
  215.            
  216.             if enemyhp == true then
  217.                 if life > 0 and life ~= 255 then
  218.                     gui.text(x-10,y-yrad-7,"HP:" .. life)
  219.                 end
  220.             end
  221.             if enemy_axis == true then
  222.                 centeraxis(x,y)
  223.             end
  224.         end
  225.        
  226.        
  227.     end
  228. end
  229.  
  230. local function cheat()
  231.     memory.writebyte(plife,16)
  232.     memory.writeword(timer,1024)
  233.     memory.writebyte(hearts,32)
  234. end
  235.  
  236. gui.register(function()
  237.     if player == true then
  238.         player_hitbox()
  239.         player_whip()
  240.         player_projectiles()
  241.     end
  242.    
  243.     if enemy == true then
  244.         object_hitbox()
  245.     end
  246.     if cheats == true then
  247.         cheat()
  248.     end
  249. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement