HR_Shaft

Game Defaults Setup v1 for Phasor v2

Apr 1st, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.04 KB | None | 0 0
  1. --[[ ###    Game Defaults Setup v1   ###]]--
  2. --[[ ###  by H® Shaft for Phasor v2  ###]]--
  3.  
  4.  
  5. -- don't edit --
  6. team_play = false
  7. falldamage = {}
  8. allowgrenades = {}
  9. default_frags = {}
  10. default_plasma = {}
  11. allowcamo = {}
  12. allowovershield = {}
  13.  
  14. --  Edit the following table boolean values to your preferences --
  15.  
  16. -- note: when fall damage is off/false, it can result in players being trapped
  17. -- also, when players fall thru the map, they can get trapped in falling forever
  18.  
  19. -- fall damage on = true, off = false           Boolean:        -- trap areas:
  20. falldamage.         beavercreek         =       false          
  21. falldamage.         bloodgulch          =       false              
  22. falldamage.         boardingaction      =       true            -- between and beneath ships   
  23. falldamage.         carousel            =       false          
  24. falldamage.         chillout            =       true            -- foggy pit area  
  25. falldamage.         damnation           =       true            -- waterfall area  
  26. falldamage.         dangercanyon        =       true               
  27. falldamage.         deathisland         =       true           
  28. falldamage.         gephyrophobia       =       true            -- beneath bridges and upper platforms     
  29. falldamage.         hangemhigh          =       false              
  30. falldamage.         icefields           =       false              
  31. falldamage.         infinity            =       true               
  32. falldamage.         longest             =       false              
  33. falldamage.         prisoner            =       true               
  34. falldamage.         putput              =       true           
  35. falldamage.         ratrace             =       false              
  36. falldamage.         sidewinder          =       false              
  37. falldamage.         timberland          =       false              
  38. falldamage.         wizard              =       true
  39.  
  40. -- Allow Active-Camo? If set to true, Active-Camo is allowed, if false it won't spawn
  41. --                  Map:                        Boolean:
  42. allowcamo.          beavercreek         =       true -- battle creek
  43. allowcamo.          bloodgulch          =       true               
  44. allowcamo.          boardingaction      =       true               
  45. allowcamo.          carousel            =       true -- derelict
  46. allowcamo.          chillout            =       true               
  47. allowcamo.          damnation           =       true               
  48. allowcamo.          dangercanyon        =       true               
  49. allowcamo.          deathisland         =       true           
  50. allowcamo.          gephyrophobia       =       true               
  51. allowcamo.          hangemhigh          =       true               
  52. allowcamo.          icefields           =       true               
  53. allowcamo.          infinity            =       true               
  54. allowcamo.          longest             =       true               
  55. allowcamo.          prisoner            =       true               
  56. allowcamo.          putput              =       true -- chiron tl34
  57. allowcamo.          ratrace             =       true               
  58. allowcamo.          sidewinder          =       true               
  59. allowcamo.          timberland          =       true               
  60. allowcamo.          wizard              =       true
  61.  
  62. -- Allow Overshield? If set to true, Overshield is allowed, if false it won't spawn
  63. --                  Map:                        Boolean:
  64. allowovershield.    beavercreek         =       true -- battle creek
  65. allowovershield.    bloodgulch          =       true               
  66. allowovershield.    boardingaction      =       true               
  67. allowovershield.    carousel            =       true -- derelict
  68. allowovershield.    chillout            =       true               
  69. allowovershield.    damnation           =       true               
  70. allowovershield.    dangercanyon        =       true               
  71. allowovershield.    deathisland         =       true           
  72. allowovershield.    gephyrophobia       =       true               
  73. allowovershield.    hangemhigh          =       true               
  74. allowovershield.    icefields           =       true               
  75. allowovershield.    infinity            =       true               
  76. allowovershield.    longest             =       true               
  77. allowovershield.    prisoner            =       true               
  78. allowovershield.    putput              =       true -- chiron tl34
  79. allowovershield.    ratrace             =       true               
  80. allowovershield.    sidewinder          =       true               
  81. allowovershield.    timberland          =       true               
  82. allowovershield.    wizard              =       true
  83.  
  84. -- Allow grenades? If set to true, grenades are allowed
  85. --                  Map:                        Boolean:
  86. allowgrenades.      beavercreek         =       true -- battle creek
  87. allowgrenades.      bloodgulch          =       true               
  88. allowgrenades.      boardingaction      =       true               
  89. allowgrenades.      carousel            =       true -- derelict
  90. allowgrenades.      chillout            =       true               
  91. allowgrenades.      damnation           =       true               
  92. allowgrenades.      dangercanyon        =       true               
  93. allowgrenades.      deathisland         =       true           
  94. allowgrenades.      gephyrophobia       =       true               
  95. allowgrenades.      hangemhigh          =       true               
  96. allowgrenades.      icefields           =       true               
  97. allowgrenades.      infinity            =       true               
  98. allowgrenades.      longest             =       true               
  99. allowgrenades.      prisoner            =       true               
  100. allowgrenades.      putput              =       true -- chiron tl34
  101. allowgrenades.      ratrace             =       true               
  102. allowgrenades.      sidewinder          =       true               
  103. allowgrenades.      timberland          =       true               
  104. allowgrenades.      wizard              =       true
  105.  
  106. -- Default frag grenades count = Number of frags player will spawn with
  107. --                  Map:                        # Frags:
  108. default_frags.      beavercreek         =       1 -- battle creek
  109. default_frags.      bloodgulch          =       2              
  110. default_frags.      boardingaction      =       1              
  111. default_frags.      carousel            =       1 -- derelict
  112. default_frags.      chillout            =       1              
  113. default_frags.      damnation           =       1              
  114. default_frags.      dangercanyon        =       2              
  115. default_frags.      deathisland         =       2          
  116. default_frags.      gephyrophobia       =       2              
  117. default_frags.      hangemhigh          =       1              
  118. default_frags.      icefields           =       2              
  119. default_frags.      infinity            =       2              
  120. default_frags.      longest             =       1              
  121. default_frags.      prisoner            =       1              
  122. default_frags.      putput              =       1 -- chiron tl34
  123. default_frags.      ratrace             =       1              
  124. default_frags.      sidewinder          =       2              
  125. default_frags.      timberland          =       2              
  126. default_frags.      wizard              =       1
  127.  
  128. -- Default plasma grenades count = Number of frags player will spawn with
  129. --                  Map:                        # Plasmas:
  130. default_plasma.     beavercreek         =       1 -- battle creek
  131. default_plasma.     bloodgulch          =       1              
  132. default_plasma.     boardingaction      =       1              
  133. default_plasma.     carousel            =       1 -- derelict
  134. default_plasma.     chillout            =       1              
  135. default_plasma.     damnation           =       1              
  136. default_plasma.     dangercanyon        =       1              
  137. default_plasma.     deathisland         =       1          
  138. default_plasma.     gephyrophobia       =       1              
  139. default_plasma.     hangemhigh          =       1              
  140. default_plasma.     icefields           =       1              
  141. default_plasma.     infinity            =       1              
  142. default_plasma.     longest             =       1              
  143. default_plasma.     prisoner            =       1              
  144. default_plasma.     putput              =       1 -- chiron tl34
  145. default_plasma.     ratrace             =       1              
  146. default_plasma.     sidewinder          =       1              
  147. default_plasma.     timberland          =       1              
  148. default_plasma.     wizard              =       1
  149.  
  150. function GetRequiredVersion()
  151.     return 200
  152. end
  153.  
  154. function OnScriptLoad(process, game, persistent)
  155.     if game == true or game == "PC" then
  156.         GAME = "PC"
  157.         gametype_base = 0x671340
  158.         map_name = readstring(0x698F21)
  159.     else
  160.         GAME = "CE"
  161.         gametype_base = 0x5F5498   
  162.         map_name = readstring(0x61D151)
  163.     end
  164.     if getteamplay() == true then team_play = true else team_play = false end  
  165.     -- setup default values if the map name is not listed in the tables
  166.     if map_name then falldamage[map_name] = falldamage[map_name] or false end
  167.     if map_name then allowgrenades[map_name] = allowgrenades[map_name] or false end
  168.     if map_name then default_frags[map_name] = default_frags[map_name] or 0 end
  169.     if map_name then default_plasma[map_name] = default_plasma[map_name] or 0 end
  170.     if map_name then allowcamo[map_name] = allowcamo[map_name] or false end
  171.     if map_name then allowovershield[map_name] = allowovershield[map_name] or false end
  172. end
  173.  
  174. function OnNewGame(map)
  175.     if GAME == "PC" then
  176.         gametype_base = 0x671340
  177.         map_name = readstring(0x698F21)
  178.     elseif GAME == "CE" then
  179.         gametype_base = 0x5F5498
  180.         map_name = readstring(0x61D151)
  181.     end
  182.     if getteamplay() == true then team_play = true else team_play = false end
  183.     -- setup default values if the map name is not listed in the tables
  184.     if map_name then falldamage[map_name] = falldamage[map_name] or false end
  185.     if map_name then allowgrenades[map_name] = allowgrenades[map_name] or false end
  186.     if map_name then default_frags[map_name] = default_frags[map_name] or 0 end
  187.     if map_name then default_plasma[map_name] = default_plasma[map_name] or 0 end
  188.     if map_name then allowcamo[map_name] = allowcamo[map_name] or false end
  189.     if map_name then allowovershield[map_name] = allowovershield[map_name] or false end    
  190. end
  191.  
  192. function getteamplay()
  193.     if readbyte(gametype_base + 0x34) == 1 then
  194.         return true
  195.     else
  196.         return false
  197.     end
  198. end
  199.  
  200. function OnPlayerJoin(player)
  201.     if getplayer(player) then
  202.         if not falldamage[map_name] then
  203.             sendconsoletext(player, "Fall Damage is OFF")
  204.         end
  205.     end
  206. end
  207.  
  208. function OnPlayerSpawn(player, m_objectId)
  209.     if getplayer(player) then
  210.         local m_objectId = getplayerobjectid(player)
  211.         if m_objectId then
  212.             local m_object = getobject(m_objectId)
  213.             if m_object then
  214.                 if allowgrenades[map_name] then
  215.                     writebyte(m_object + 0x31E, default_frags[map_name])
  216.                     writebyte(m_object + 0x31F, default_plasma[map_name])
  217.                 else
  218.                     writebyte(m_object + 0x31E, 0)
  219.                     writebyte(m_object + 0x31F, 0)
  220.                 end
  221.             end
  222.         end
  223.     end
  224. end
  225.  
  226. function OnDamageLookup(receiving, causing, mapId)
  227.     local tagname, tagtype = gettaginfo(mapId)
  228.     if causing and receiving then
  229.         local c_object = getobject(causing)
  230.         local r_object = getobject(receiving)
  231.         if c_object and r_object then
  232.             local causer = objectaddrtoplayer(c_object)
  233.             local receiver = objectaddrtoplayer(r_object)
  234.             if causer and receiver then
  235.                 local c_team = getteam(causer)
  236.                 local r_team = getteam(receiver)
  237.                 if team_play and c_team == r_team and causer ~= receiver then
  238.                     return false
  239.                 end            
  240.             end    
  241.         end
  242.     end
  243.     if falldamage[map_name] and (tagname == "globals\\distance" or tagname == "globals\\falling") then
  244.         odl_multiplier(1)
  245.     elseif not falldamage[map_name] and (tagname == "globals\\distance" or tagname == "globals\\falling") then
  246.         odl_multiplier(0.001)  
  247.     end        
  248.     return nil
  249. end
  250.  
  251. function OnObjectCreationAttempt(mapId, parentId, player)
  252.     if not allowcamo[map_name] then
  253.         if mapId == gettagid("eqip", "powerups\\active camouflage") then
  254.             return false
  255.         end
  256.     end
  257.     if not allowovershield[map_name] then  
  258.         if mapId == gettagid("eqip", "powerups\\over shield") then
  259.             return false
  260.         end
  261.     end
  262.     if not allowgrenades[map_name] then
  263.         if mapId == gettagid("eqip", "weapons\\frag grenade\\frag grenade") or mapId == gettagid("eqip", "weapons\\plasma grenade\\plasma grenade") then
  264.             return false   
  265.         end
  266.     end
  267.     return nil
  268. end
  269.  
  270. -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
  271. -- Visit http://halorace.org/forum/index.php?topic=514.0 or
  272. -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Advertisement
Add Comment
Please, Sign In to add comment