Advertisement
HR_Shaft

You've Got Balls! Oddball Melee scripts and Maps

Mar 30th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.40 KB | None | 0 0
  1. --[[ ###     You've Got Balls!       ###]]--
  2. --[[ ###   Oddball Melee & Mods v1   ###]]--
  3. --[[ ###  by H® Shaft for Phasor v2  ###]]--
  4.  
  5. ------ NOT COMPATIBLE WITH ODDBALL GAMETYPE WITH THE "SKULL/ODDBALL" (Juggernaut and IT ok) ------
  6.  
  7. -------------- Should be used with MODIFIED small maps, -------------
  8. -------------- Download Zip file with all small maps: ---------------
  9. -- http://www.mediafire.com/download/3231glqvi6qbppb/Halo-PC-Ball-Maps.zip
  10.  
  11. -- gametype MUST have weapons set to "generic"
  12.  
  13. team_play = false
  14. weapons = {}
  15.  
  16. function GetRequiredVersion()
  17.     return 200
  18. end
  19.  
  20. function OnScriptLoad(process, game, persistent)
  21.     if game == true or game == "PC" then
  22.         GAME = "PC"
  23.         gametype_base = 0x671340
  24.         map_name = readstring(0x698F21)
  25.     else
  26.         GAME = "CE"
  27.         gametype_base = 0x5F5498
  28.         map_name = readstring(0x61D151)
  29.     end
  30.     for i=0,15 do
  31.         if getplayer(i) then
  32.             weapons[i] = {}
  33.         end
  34.     end    
  35.     gametype = readbyte(gametype_base + 0x30)
  36.     if getteamplay() == true then team_play = true else team_play = false end  
  37. end
  38.  
  39. function OnNewGame(map)
  40.     if GAME == "PC" then
  41.         gametype_base = 0x671340
  42.         map_name = readstring(0x698F21)
  43.     elseif GAME == "CE" then
  44.         gametype_base = 0x5F5498
  45.         map_name = readstring(0x61D151)
  46.     end
  47.     for i=0,15 do
  48.         if getplayer(i) then
  49.             weapons[i] = {}
  50.         end
  51.     end
  52.     gametype = readbyte(gametype_base + 0x30)
  53.     if getteamplay() == true then team_play = true else team_play = false end      
  54. end    
  55.    
  56. function getteamplay()
  57.     if readbyte(gametype_base + 0x34) == 1 then
  58.         return true
  59.     else
  60.         return false
  61.     end
  62. end
  63.  
  64. function OnPlayerJoin(player)
  65.     if getplayer(player) then
  66.         weapons[player] = nil
  67.         sendconsoletext(player, "You've got Balls!")
  68.     end
  69. end
  70.  
  71. function OnPlayerKill(killer, victim, mode)
  72.     if getplayer(victim) then
  73.         weapons[victim] = nil
  74.     end
  75. end
  76.  
  77. function OnPlayerLeave(player)
  78.     if getplayer(player) then
  79.         weapons[player] = nil
  80.     end
  81. end
  82.  
  83. function OnPlayerSpawn(player, m_objectId)
  84.     if getplayer(player) then
  85.         weapons[player] = nil
  86.         local m_objectId = getplayerobjectid(player)   
  87.         if m_objectId then
  88.             gameweap = registertimer(0, "AssignGameWeapons", player)   
  89.         end    
  90.     end
  91. end
  92.    
  93. function AssignGameWeapons(id, count, player)
  94.     if getplayer(player) then
  95.         local m_objectId = getplayerobjectid(player)
  96.         local m_object = getobject(m_objectId)     
  97.         if m_objectId then
  98.             for i = 0,3 do
  99.                 local weapID = readdword(getobject(m_objectId), 0x2F8 + i*4)
  100.                 if weapID ~= 0xFFFFFFFF then
  101.                     destroyobject(weapID)
  102.                 end
  103.             end
  104.             if m_object then
  105.                 writebyte(m_object + 0x31E, 1)
  106.                 writebyte(m_object + 0x31F, 1) 
  107.             end    
  108.             local m_weaponId = createobject(gettagid("weap", "weapons\\ball\\ball"), 0, 2, false, 0, 0, 0)
  109.             weapons[player] = "weapons\\ball\\ball"
  110.             assignweapon(player, m_weaponId)
  111.         end
  112.     end
  113.     return false
  114. end
  115.  
  116. function OnObjectInteraction(player, objId, mapId)
  117.     local Pass = nil
  118.     local name, type = gettaginfo(mapId)
  119.     if type == "weap" then
  120.         if gametype == 3 then
  121.             if name == "weapons\\ball\\ball" then
  122.                 Pass = false
  123.             elseif weapons[player] ~= nil then
  124.                 if name ~= weapons[player] then
  125.                     Pass = false
  126.                 end
  127.             end
  128.         else
  129.             if weapons[player] ~= nil then
  130.                 if name ~= weapons[player] then
  131.                     Pass = false
  132.                 end
  133.             end
  134.         end
  135.     end
  136.     return Pass
  137. end
  138.  
  139. function OnObjectCreationAttempt(mapId, parentId, player)
  140.     if mapId == gettagid("weap", "weapons\\assault rifle\\assault rifle") or
  141.         mapId == gettagid("weap", "weapons\\flamethrower\\flamethrower") or
  142.         mapId == gettagid("weap", "weapons\\pistol\\pistol") or
  143.         mapId == gettagid("weap", "weapons\\plasma pistol\\plasma pistol") or
  144.         mapId == gettagid("weap", "weapons\\plasma rifle\\plasma rifle") or
  145.         mapId == gettagid("weap", "weapons\\plasma_cannon\\plasma_cannon") or
  146.         mapId == gettagid("weap", "weapons\\rocket launcher\\rocket launcher") or
  147.         mapId == gettagid("weap", "weapons\\needler\\mp_needler") or
  148.         mapId == gettagid("weap", "weapons\\shotgun\\shotgun") or
  149.         mapId == gettagid("weap", "weapons\\sniper rifle\\sniper rifle") then
  150.         return false
  151.     end
  152. end
  153.  
  154. function OnGameEnd(stage)
  155.     if stage == 1 then
  156.         if gameweap then
  157.             removetimer(gameweap)
  158.             gameweap = nil
  159.         end    
  160.     end    
  161. end
  162.  
  163. -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
  164. -- Visit http://halorace.org/forum/index.php?topic=514.0 or
  165. -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement