LUA 188
Base Conquest 2.01 By xdedeone on 25th February 2019 10:15:26 PM
  1. -- Conquest 2.0.01
  2.  
  3. -- This script requires that you run a CTF gametype.
  4. -- You should probably create a custom gametype which doesn't have Nav points; they are confusing and misleading for this gametype when the Ball of Faith and Staff of Influence are in play.
  5.  
  6. -- The object of the game is to take control of the opponent's base before they take control of yours.
  7. -- You regain control of your own base by standing in it unopposed and take control from the opposing base by standing in it unopposed.
  8. -- If at any point one team's control percentage is 0%, the other team wins.
  9. -- If there is a + next to a base's percentage, it is increasing.  If there is a - next to a base's percentage, it is decreasing.
  10. -- A base is contested if players from opposing teams occupy the same control sphere.  This is denoted by a * next to a base's percentage.
  11. -- There are also optional special items around the map: an oddball and a flagpole. The oddball is called the Ball of Faith; the flagpole is called the Staff of Influence.
  12. -- One who holds the Ball of Faith gives extra regeneration to their own base and increases the maximum control percentage of their base while the holder stands in their own control sphere.
  13. -- One who holds the Staff of Influence takes extra control from the opponent's base while standing in it.
  14. -- I've written this script intentionally to make it easy for inexperienced scripters to edit and flexible for more experienced scripters to customize.
  15. -- If any of my comments are confusing, or you have any questions about how the script works, you can PM me (Nuggets) at phasor.proboards.com
  16.  
  17.  
  18. -- Updates --
  19.  
  20. --[[
  21.        
  22.         August 27 2013 - Version 2.0.01:
  23.                 - Fixes sphere creation bug in Halo Custom Edition.
  24.                
  25. --]]
  26.  
  27. function GetRequiredVersion()
  28.  
  29.         return 200
  30. end
  31.  
  32. function OnScriptLoad(processId, game, persistent)
  33.  
  34.         -- Respawn Time
  35.         respawn_time = 7  -- Player respawn time in seconds.
  36.        
  37.         -- Help Command
  38.         help_command = "#help"  -- Chat command a player should use if they need help on how to play the gametype.
  39.        
  40.         -- Teams Table --
  41.         teams = {}     -- Stores attributes about each team's base
  42.        
  43.         teams[0] = {}  -- Team 0 (Red)
  44.         teams[1] = {}  -- Team 1 (Blue)
  45.        
  46.         -- Starting Percentages of Control --
  47.        
  48.         --  Team:            Percent:      Description:
  49.         teams[0].start =       75          -- Amount of control the Red Team has over their own base at the beginning of the game.
  50.         teams[1].start =       75          -- Amount of control the Blue Team has over their own base at the beginning of the game.
  51.        
  52.         -- Maximum Percentages of Control --
  53.        
  54.         --  Team:            Percent:      Description:
  55.         teams[0].max =         100         -- Maximum control the Red Team can have over their own base.
  56.         teams[1].max =         100         -- Maximum control the Blue Team can have over their own base.
  57.        
  58.         -- Sphere of Control Coordinates --
  59.        
  60.         --  Team:          Coordinates:    Description:
  61.         teams[0].center =      nil         -- Centered coordinates of Red Team's control sphere {x, y, z} (use nil to default to centering around the CTF flag spawn).
  62.         teams[1].center =      nil         -- Centered coordinates of Blue Team's control sphere {x, y, z} (use nil to default to centering around the CTF flag spawn).
  63.        
  64.         -- Control Sphere Radius --
  65.        
  66.         --  Team:             Radius:      Description:
  67.         teams[0].radius =      nil         -- Radius of control sphere centered at Red Base CTF flag spawn (use nil to default to value of current map as defined below in Control Sphere Radius by Map).
  68.         teams[1].radius =      nil         -- Radius of control sphere centered at Blue Base CTF flag spawn (use nil to default to value of current map as defined below in Control Sphere Radius by Map).
  69.        
  70.         -- Team Influence and Faith --
  71.        
  72.         -- Influence and Faith are values which define how much a team can change a control sphere's percentage by standing inside of it.
  73.         -- Note that by default, these values are not dependent on the amount of players within a control sphere.
  74.         -- If you want additional players to increase (or decrease) influence and faith, see "Presence".
  75.        
  76.         --  Team:         Percent/Second:  Description:
  77.         teams[0].influence =   1.50        -- Percent of control per second a Red Team player will take from Blue Base.
  78.         teams[1].influence =   1.50        -- Percent of control per second a Blue Team player will take from Red Base.
  79.        
  80.         teams[0].faith =       0.75        -- Percent of control per second a Red Team player will add to their own base.
  81.         teams[1].faith =       0.75        -- Percent of control per second a Blue Team player will add to their own base.
  82.        
  83.         -- Presence --
  84.        
  85.         --  Team:             Bonus:       Description:
  86.         teams[0].presence =    0.50        -- Bonus influence or faith applied per additional player of the Red Team within a control sphere (set to 0 if influence and faith should be the same no matter how many players are within a control sphere).
  87.         teams[1].presence =    0.50        -- Bonus influence or faith applied per additional player of the Blue Team within a control sphere (set to 0 if influence and faith should be the same no matter how many players are within a control sphere).
  88.        
  89.         -- Control Sphere Radius by Map --
  90.        
  91.         radius = {}         -- Stores information regarding control sphere radii of each team depending on the map currently running.
  92.        
  93.         radius[0] = {}      -- Radius of Red Base control spheres.
  94.         radius[1] = {}      -- Radius of Blue Base control spheres.
  95.        
  96.         --   Team:    Map:                 Radius:              Description:
  97.         radius[0].beavercreek =     4.00        -- Radius of Red Base control sphere in beavercreek.
  98.         radius[1].beavercreek =     4.00        -- Radius of Blue Base control sphere in beavercreek.
  99.        
  100.         radius[0].bloodgulch =      5.75        -- Radius of Red Base control sphere in bloodgulch.
  101.         radius[1].bloodgulch =      5.75        -- Radius of Blue Base control sphere in bloodgulch.
  102.        
  103.         radius[0].boardingaction =  6.00        -- Radius of Red Base control sphere in boardingaction.
  104.         radius[1].boardingaction =  6.00        -- Radius of Blue Base control sphere in boardingaction.
  105.        
  106.         radius[0].carousel =        4.50        -- Radius of Red Base control sphere in carousel.
  107.         radius[1].carousel =        4.50        -- Radius of Blue Base control sphere in carousel.
  108.        
  109.         radius[0].chillout =        6.00        -- Radius of Red Base control sphere in chillout.
  110.         radius[1].chillout =        6.00        -- Radius of Blue Base control sphere in chillout.
  111.        
  112.         radius[0].damnation =       7.00        -- Radius of Red Base control sphere in damnation.
  113.         radius[1].damnation =       7.00        -- Radius of Blue Base control sphere in damnation.
  114.        
  115.         radius[0].dangercanyon =    6.00        -- Radius of Red Base control sphere in dangercanyon.
  116.         radius[1].dangercanyon =    6.00        -- Radius of Blue Base control sphere in dangercanyon.
  117.        
  118.         radius[0].deathisland =     10.00       -- Radius of Red Base control sphere in deathisland.
  119.         radius[1].deathisland =     10.00       -- Radius of Blue Base control sphere in deathisland.
  120.        
  121.         radius[0].gephyrophobia =   10.00       -- Radius of Red Base control sphere in gephyrophobia.
  122.         radius[1].gephyrophobia =   10.00       -- Radius of Blue Base control sphere in gephyrophobia.
  123.        
  124.         radius[0].hangemhigh =      6.50        -- Radius of Red Base control sphere in hangemhigh.
  125.         radius[1].hangemhigh =      6.50        -- Radius of Blue Base control sphere in hangemhigh.
  126.        
  127.         radius[0].icefields =       3.50        -- Radius of Red Base control sphere in icefields.
  128.         radius[1].icefields =       3.50        -- Radius of Blue Base control sphere in icefields.
  129.        
  130.         radius[0].infinity =        6.00        -- Radius of Red Base control sphere in infinity.
  131.         radius[1].infinity =        6.00        -- Radius of Blue Base control sphere in infinity.
  132.        
  133.         radius[0].longest =         4.00        -- Radius of Red Base control sphere in longest.
  134.         radius[1].longest =         4.00        -- Radius of Blue Base control sphere in longest.
  135.        
  136.         radius[0].prisoner =        4.00        -- Radius of Red Base control sphere in prisoner.
  137.         radius[1].prisoner =        4.00        -- Radius of Blue Base control sphere in prisoner.
  138.        
  139.         radius[0].putput =          5.00        -- Radius of Red Base control sphere in putput.
  140.         radius[1].putput =          8.00        -- Radius of Blue Base control sphere in putput.
  141.        
  142.         radius[0].ratrace =         5.50        -- Radius of Red Base control sphere in ratrace.
  143.         radius[1].ratrace =         5.50        -- Radius of Blue Base control sphere in ratrace.
  144.        
  145.         radius[0].sidewinder =      14.00       -- Radius of Red Base control sphere in sidewinder.
  146.         radius[1].sidewinder =      14.00       -- Radius of Blue Base control sphere in sidewinder.
  147.        
  148.         radius[0].timberland =      14.00       -- Radius of Red Base control sphere in timberland.
  149.         radius[1].timberland =      14.00       -- Radius of Blue base control sphere in timberland.
  150.        
  151.         radius[0].wizard =          5.00        -- Radius of Red Base control sphere in wizard.
  152.         radius[1].wizard =          5.00        -- Radius of Blue Base control sphere in wizard.
  153.        
  154.        
  155.         -- Control Sphere Exceptions by Map --
  156.        
  157.         except = {}     -- Creates exceptions to the control sphere using highest and lowest x, y, and z coordinates the sphere can occupy.
  158.                                         -- Any part of the sphere outside of these coordinates will be considered outside of the sphere.
  159.                                         -- Use nil if there should be no exception to the sphere in the specific direction.
  160.        
  161.         except[0] = {}  -- Sphere exceptions for the red team.
  162.         except[1] = {}  -- Sphere exceptions for the blue team.
  163.        
  164.        
  165.         -- Don't edit the code below --
  166.         for k,v in pairs(radius[0]) do
  167.                 except[0][k] = {}
  168.                 except[1][k] = {}
  169.         end
  170.         -- Don't edit the code above --
  171.        
  172.        
  173.         --   Team:      Map:  Coord High/Low:   Coordinate:             Description:
  174.         except[0].beavercreek.xlow =            27.20       -- Lowest X coordinate considered to be in the Red Base control sphere in beavercreek.
  175.         except[0].beavercreek.xhigh =           30.50       -- Highest X coordinate considered to be in the Red Base control sphere in beavercreek.
  176.         except[0].beavercreek.ylow =            9.90        -- Lowest Y coordinate considered to be in the Red Base control sphere in beavercreek.
  177.         except[0].beavercreek.yhigh =           17.40       -- Highest Y coordinate considered to be in the Red Base control sphere in beavercreek.
  178.         except[0].beavercreek.zlow =            nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in beavercreek.
  179.         except[0].beavercreek.zhigh =           1.90        -- Highest Z coordinate considered to be in the Red Base control sphere in beavercreek.
  180.        
  181.         except[1].beavercreek.xlow =            -2.70       -- Lowest X coordinate considered to be in the Blue Base control sphere in beavercreek.
  182.         except[1].beavercreek.xhigh =           1.03        -- Highest X coordinate considered to be in the Blue base control sphere in beavercreek.
  183.         except[1].beavercreek.ylow =            9.90        -- Lowest Y coordinate considered to be in the Blue Base control sphere in beavercreek.
  184.         except[1].beavercreek.yhigh =           17.40       -- Highest Y coordinate considered to be in the Blue Base control sphere in beavercreek.
  185.         except[1].beavercreek.zlow =            nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in beavercreek.
  186.         except[1].beavercreek.zhigh =           1.90        -- Highest Z coordinate considered to be in the Blue Base control sphere in beavercreek.
  187.        
  188.         except[0].bloodgulch.xlow =             nil         -- Lowest X coordinate considered to be in the Red Base control sphere in bloodgulch.
  189.         except[0].bloodgulch.xhigh =            nil         -- Highest X coordinate considered to be in the Red Base control sphere in bloodgulch.
  190.         except[0].bloodgulch.ylow =             nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in bloodgulch.
  191.         except[0].bloodgulch.yhigh =            nil         -- Highest Y coordinate considered to be in the Red Base control sphere in bloodgulch.
  192.         except[0].bloodgulch.zlow =             nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in bloodgulch.
  193.         except[0].bloodgulch.zhigh =            nil         -- Highest Z coordinate considered to be in the Red Base control sphere in bloodgulch.
  194.        
  195.         except[1].bloodgulch.xlow =             nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in bloodgulch.
  196.         except[1].bloodgulch.xhigh =            nil         -- Highest X coordinate considered to be in the Blue base control sphere in bloodgulch.
  197.         except[1].bloodgulch.ylow =             nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in bloodgulch.
  198.         except[1].bloodgulch.yhigh =            nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in bloodgulch.
  199.         except[1].bloodgulch.zlow =             nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in bloodgulch.
  200.         except[1].bloodgulch.zhigh =            nil         -- Highest Z coordinate considered to be in the Blue Base control sphere in bloodgulch.
  201.        
  202.         except[0].boardingaction.xlow =         nil         -- Lowest X coordinate considered to be in the Red Base control sphere in boardingaction.
  203.         except[0].boardingaction.xhigh =        nil         -- Highest X coordinate considered to be in the Red Base control sphere in boardingaction.
  204.         except[0].boardingaction.ylow =         -3.7        -- Lowest Y coordinate considered to be in the Red Base control sphere in boardingaction.
  205.         except[0].boardingaction.yhigh =        4.60        -- Highest Y coordinate considered to be in the Red Base control sphere in boardingaction.
  206.         except[0].boardingaction.zlow =         -0.20       -- Lowest Z coordinate considered to be in the Red Base control sphere in boardingaction.
  207.         except[0].boardingaction.zhigh =        2.30        -- Highest Z coordinate considered to be in the Red Base control sphere in boardingaction.
  208.        
  209.         except[1].boardingaction.xlow =         nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in boardingaction.
  210.         except[1].boardingaction.xhigh =        nil         -- Highest X coordinate considered to be in the Blue base control sphere in boardingaction.
  211.         except[1].boardingaction.ylow =         -4.50       -- Lowest Y coordinate considered to be in the Blue Base control sphere in boardingaction.
  212.         except[1].boardingaction.yhigh =        3.74        -- Highest Y coordinate considered to be in the Blue Base control sphere in boardingaction.
  213.         except[1].boardingaction.zlow =         -0.20       -- Lowest Z coordinate considered to be in the Blue Base control sphere in boardingaction.
  214.         except[1].boardingaction.zhigh =        2.30        -- Highest Z coordinate considered to be in the Blue Base control sphere in boardingaction.
  215.        
  216.         except[0].carousel.xlow =               nil         -- Lowest X coordinate considered to be in the Red Base control sphere in carousel.
  217.         except[0].carousel.xhigh =              nil         -- Highest X coordinate considered to be in the Red Base control sphere in carousel.
  218.         except[0].carousel.ylow =               nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in carousel.
  219.         except[0].carousel.yhigh =              nil         -- Highest Y coordinate considered to be in the Red Base control sphere in carousel.
  220.         except[0].carousel.zlow =               nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in carousel.
  221.         except[0].carousel.zhigh =              -1.30       -- Highest Z coordinate considered to be in the Red Base control sphere in carousel.
  222.        
  223.         except[1].carousel.xlow =               nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in carousel.
  224.         except[1].carousel.xhigh =              nil         -- Highest X coordinate considered to be in the Blue base control sphere in carousel.
  225.         except[1].carousel.ylow =               nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in carousel.
  226.         except[1].carousel.yhigh =              nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in carousel.
  227.         except[1].carousel.zlow =               nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in carousel.
  228.         except[1].carousel.zhigh =              -1.30       -- Highest Z coordinate considered to be in the Blue Base control sphere in carousel.
  229.        
  230.         except[0].chillout.xlow =               5.60        -- Lowest X coordinate considered to be in the Red Base control sphere in chillout.
  231.         except[0].chillout.xhigh =              11.20       -- Highest X coordinate considered to be in the Red Base control sphere in chillout.
  232.         except[0].chillout.ylow =               nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in chillout.
  233.         except[0].chillout.yhigh =              1.40        -- Highest Y coordinate considered to be in the Red Base control sphere in chillout.
  234.         except[0].chillout.zlow =               1.80        -- Lowest Z coordinate considered to be in the Red Base control sphere in chillout.
  235.         except[0].chillout.zhigh =              nil         -- Highest Z coordinate considered to be in the Red Base control sphere in chillout.
  236.        
  237.         except[1].chillout.xlow =               nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in chillout.
  238.         except[1].chillout.xhigh =              -2.50       -- Highest X coordinate considered to be in the Blue base control sphere in chillout.
  239.         except[1].chillout.ylow =               2.90        -- Lowest Y coordinate considered to be in the Blue Base control sphere in chillout.
  240.         except[1].chillout.yhigh =              10.90       -- Highest Y coordinate considered to be in the Blue Base control sphere in chillout.
  241.         except[1].chillout.zlow =               nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in chillout.
  242.         except[1].chillout.zhigh =              nil         -- Highest Z coordinate considered to be in the Blue Base control sphere in chillout.
  243.        
  244.         except[0].damnation.xlow =              4.70        -- Lowest X coordinate considered to be in the Red Base control sphere in damnation.
  245.         except[0].damnation.xhigh =             nil         -- Highest X coordinate considered to be in the Red Base control sphere in damnation.
  246.         except[0].damnation.ylow =              nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in damnation.
  247.         except[0].damnation.yhigh =             -7.04       -- Highest Y coordinate considered to be in the Red Base control sphere in damnation.
  248.         except[0].damnation.zlow =              nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in damnation.
  249.         except[0].damnation.zhigh =             nil         -- Highest Z coordinate considered to be in the Red Base control sphere in damnation.
  250.        
  251.         except[1].damnation.xlow =              nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in damnation.
  252.         except[1].damnation.xhigh =             nil         -- Highest X coordinate considered to be in the Blue base control sphere in damnation.
  253.         except[1].damnation.ylow =              9.20        -- Lowest Y coordinate considered to be in the Blue Base control sphere in damnation.
  254.         except[1].damnation.yhigh =             nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in damnation.
  255.         except[1].damnation.zlow =              nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in damnation.
  256.         except[1].damnation.zhigh =             2.90        -- Highest Z coordinate considered to be in the Blue Base control sphere in damnation.
  257.  
  258.         except[0].dangercanyon.xlow =           nil         -- Lowest X coordinate considered to be in the Red Base control sphere in dangercanyon.
  259.         except[0].dangercanyon.xhigh =          nil         -- Highest X coordinate considered to be in the Red Base control sphere in dangercanyon.
  260.         except[0].dangercanyon.ylow =           nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in dangercanyon.
  261.         except[0].dangercanyon.yhigh =          2.70        -- Highest Y coordinate considered to be in the Red Base control sphere in dangercanyon.
  262.         except[0].dangercanyon.zlow =           nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in dangercanyon.
  263.         except[0].dangercanyon.zhigh =          nil         -- Highest Z coordinate considered to be in the Red Base control sphere in dangercanyon.
  264.        
  265.         except[1].dangercanyon.xlow =           nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in dangercanyon.
  266.         except[1].dangercanyon.xhigh =          nil         -- Highest X coordinate considered to be in the Blue base control sphere in dangercanyon.
  267.         except[1].dangercanyon.ylow =           nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in dangercanyon.
  268.         except[1].dangercanyon.yhigh =          2.70        -- Highest Y coordinate considered to be in the Blue Base control sphere in dangercanyon.
  269.         except[1].dangercanyon.zlow =           nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in dangercanyon.
  270.         except[1].dangercanyon.zhigh =          nil         -- Highest Z coordinate considered to be in the Blue Base control sphere in dangercanyon.
  271.        
  272.         except[0].deathisland.xlow =            -27.50      -- Lowest X coordinate considered to be in the Red Base control sphere in deathisland.
  273.         except[0].deathisland.xhigh =           nil         -- Highest X coordinate considered to be in the Red Base control sphere in deathisland.
  274.         except[0].deathisland.ylow =            -10.50      -- Lowest Y coordinate considered to be in the Red Base control sphere in deathisland.
  275.         except[0].deathisland.yhigh =           -3.75       -- Highest Y coordinate considered to be in the Red Base control sphere in deathisland.
  276.         except[0].deathisland.zlow =            9.00        -- Lowest Z coordinate considered to be in the Red Base control sphere in deathisland.
  277.         except[0].deathisland.zhigh =           11.10       -- Highest Z coordinate considered to be in the Red Base control sphere in deathisland.
  278.        
  279.         except[1].deathisland.xlow =            nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in deathisland.
  280.         except[1].deathisland.xhigh =           30.60       -- Highest X coordinate considered to be in the Blue base control sphere in deathisland.
  281.         except[1].deathisland.ylow =            12.80       -- Lowest Y coordinate considered to be in the Blue Base control sphere in deathisland.
  282.         except[1].deathisland.yhigh =           19.30       -- Highest Y coordinate considered to be in the Blue Base control sphere in deathisland.
  283.         except[1].deathisland.zlow =            7.70        -- Lowest Z coordinate considered to be in the Blue Base control sphere in deathisland.
  284.         except[1].deathisland.zhigh =           9.80        -- Highest Z coordinate considered to be in the Blue Base control sphere in deathisland.
  285.        
  286.         except[0].gephyrophobia.xlow =          22.45       -- Lowest X coordinate considered to be in the Red Base control sphere in gephyrophobia.
  287.         except[0].gephyrophobia.xhigh =         31.23       -- Highest X coordinate considered to be in the Red Base control sphere in gephyrophobia.
  288.         except[0].gephyrophobia.ylow =          nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in gephyrophobia.
  289.         except[0].gephyrophobia.yhigh =         nil         -- Highest Y coordinate considered to be in the Red Base control sphere in gephyrophobia.
  290.         except[0].gephyrophobia.zlow =          nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in gephyrophobia.
  291.         except[0].gephyrophobia.zhigh =         nil         -- Highest Z coordinate considered to be in the Red Base control sphere in gephyrophobia.
  292.        
  293.         except[1].gephyrophobia.xlow =          22.45       -- Lowest X coordinate considered to be in the Blue Base control sphere in gephyrophobia.
  294.         except[1].gephyrophobia.xhigh =         31.23       -- Highest X coordinate considered to be in the Blue base control sphere in gephyrophobia.
  295.         except[1].gephyrophobia.ylow =          nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in gephyrophobia.
  296.         except[1].gephyrophobia.yhigh =         nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in gephyrophobia.
  297.         except[1].gephyrophobia.zlow =          nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in gephyrophobia.
  298.         except[1].gephyrophobia.zhigh =         nil         -- Highest Z coordinate considered to be in the Blue Base control sphere in gephyrophobia.
  299.        
  300.         except[0].hangemhigh.xlow =             11.50       -- Lowest X coordinate considered to be in the Red Base control sphere in hangemhigh.
  301.         except[0].hangemhigh.xhigh =            17.50       -- Highest X coordinate considered to be in the Red Base control sphere in hangemhigh.
  302.         except[0].hangemhigh.ylow =             7.50        -- Lowest Y coordinate considered to be in the Red Base control sphere in hangemhigh.
  303.         except[0].hangemhigh.yhigh =            11.50       -- Highest Y coordinate considered to be in the Red Base control sphere in hangemhigh.
  304.         except[0].hangemhigh.zlow =             nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in hangemhigh.
  305.         except[0].hangemhigh.zhigh =            nil         -- Highest Z coordinate considered to be in the Red Base control sphere in hangemhigh.
  306.        
  307.         except[1].hangemhigh.xlow =             27.20       -- Lowest X coordinate considered to be in the Blue Base control sphere in hangemhigh.
  308.         except[1].hangemhigh.xhigh =            33.60       -- Highest X coordinate considered to be in the Blue base control sphere in hangemhigh.
  309.         except[1].hangemhigh.ylow =             -17.79      -- Lowest Y coordinate considered to be in the Blue Base control sphere in hangemhigh.
  310.         except[1].hangemhigh.yhigh =            -12.50      -- Highest Y coordinate considered to be in the Blue Base control sphere in hangemhigh.
  311.         except[1].hangemhigh.zlow =             -3.5        -- Lowest Z coordinate considered to be in the Blue Base control sphere in hangemhigh.
  312.         except[1].hangemhigh.zhigh =            nil         -- Highest Z coordinate considered to be in the Blue Base control sphere in hangemhigh.
  313.        
  314.         except[0].icefields.xlow =              nil         -- Lowest X coordinate considered to be in the Red Base control sphere in icefields.
  315.         except[0].icefields.xhigh =             nil         -- Highest X coordinate considered to be in the Red Base control sphere in icefields.
  316.         except[0].icefields.ylow =              nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in icefields.
  317.         except[0].icefields.yhigh =             nil         -- Highest Y coordinate considered to be in the Red Base control sphere in icefields.
  318.         except[0].icefields.zlow =              nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in icefields.
  319.         except[0].icefields.zhigh =             nil         -- Highest Z coordinate considered to be in the Red Base control sphere in icefields.
  320.        
  321.         except[1].icefields.xlow =              nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in icefields.
  322.         except[1].icefields.xhigh =             nil         -- Highest X coordinate considered to be in the Blue base control sphere in icefields.
  323.         except[1].icefields.ylow =              nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in icefields.
  324.         except[1].icefields.yhigh =             nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in icefields.
  325.         except[1].icefields.zlow =              nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in icefields.
  326.         except[1].icefields.zhigh =             nil         -- Highest Z coordinate considered to be in the Blue Base control sphere in icefields.
  327.        
  328.         except[0].infinity.xlow =               nil         -- Lowest X coordinate considered to be in the Red Base control sphere in infinity.
  329.         except[0].infinity.xhigh =              nil         -- Highest X coordinate considered to be in the Red Base control sphere in infinity.
  330.         except[0].infinity.ylow =               nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in infinity.
  331.         except[0].infinity.yhigh =              nil         -- Highest Y coordinate considered to be in the Red Base control sphere in infinity.
  332.         except[0].infinity.zlow =               nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in infinity.
  333.         except[0].infinity.zhigh =              nil         -- Highest Z coordinate considered to be in the Red Base control sphere in infinity.
  334.        
  335.         except[1].infinity.xlow =               nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in infinity.
  336.         except[1].infinity.xhigh =              nil         -- Highest X coordinate considered to be in the Blue base control sphere in infinity.
  337.         except[1].infinity.ylow =               nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in infinity.
  338.         except[1].infinity.yhigh =              nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in infinity.
  339.         except[1].infinity.zlow =               nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in infinity.
  340.         except[1].infinity.zhigh =              nil         -- Highest Z coordinate considered to be in the Blue Base control sphere in infinity.
  341.        
  342.         except[0].longest.xlow =                nil         -- Lowest X coordinate considered to be in the Red Base control sphere in longest.
  343.         except[0].longest.xhigh =               nil         -- Highest X coordinate considered to be in the Red Base control sphere in longest.
  344.         except[0].longest.ylow =                nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in longest.
  345.         except[0].longest.yhigh =               nil         -- Highest Y coordinate considered to be in the Red Base control sphere in longest.
  346.         except[0].longest.zlow =                nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in longest.
  347.         except[0].longest.zhigh =               nil         -- Highest Z coordinate considered to be in the Red Base control sphere in longest.
  348.        
  349.         except[1].longest.xlow =                nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in longest.
  350.         except[1].longest.xhigh =               nil         -- Highest X coordinate considered to be in the Blue base control sphere in longest.
  351.         except[1].longest.ylow =                nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in longest.
  352.         except[1].longest.yhigh =               nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in longest.
  353.         except[1].longest.zlow =                nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in longest.
  354.         except[1].longest.zhigh =               nil         -- Highest Z coordinate considered to be in the Blue Base control sphere in longest.
  355.        
  356.         except[0].prisoner.xlow =               nil         -- Lowest X coordinate considered to be in the Red Base control sphere in prisoner.
  357.         except[0].prisoner.xhigh =              nil         -- Highest X coordinate considered to be in the Red Base control sphere in prisoner.
  358.         except[0].prisoner.ylow =               nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in prisoner.
  359.         except[0].prisoner.yhigh =              nil         -- Highest Y coordinate considered to be in the Red Base control sphere in prisoner.
  360.         except[0].prisoner.zlow =               5.00        -- Lowest Z coordinate considered to be in the Red Base control sphere in prisoner.
  361.         except[0].prisoner.zhigh =              nil         -- Highest Z coordinate considered to be in the Red Base control sphere in prisoner.
  362.        
  363.         except[1].prisoner.xlow =               nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in prisoner.
  364.         except[1].prisoner.xhigh =              nil         -- Highest X coordinate considered to be in the Blue base control sphere in prisoner.
  365.         except[1].prisoner.ylow =               nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in prisoner.
  366.         except[1].prisoner.yhigh =              nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in prisoner.
  367.         except[1].prisoner.zlow =               5.00        -- Lowest Z coordinate considered to be in the Blue Base control sphere in prisoner.
  368.         except[1].prisoner.zhigh =              nil         -- Highest Z coordinate considered to be in the Blue Base control sphere in prisoner.
  369.        
  370.         except[0].putput.xlow =                 nil         -- Lowest X coordinate considered to be in the Red Base control sphere in putput.
  371.         except[0].putput.xhigh =                nil         -- Highest X coordinate considered to be in the Red Base control sphere in putput.
  372.         except[0].putput.ylow =                 nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in putput.
  373.         except[0].putput.yhigh =                nil         -- Highest Y coordinate considered to be in the Red Base control sphere in putput.
  374.         except[0].putput.zlow =                 nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in putput.
  375.         except[0].putput.zhigh =                1.90        -- Highest Z coordinate considered to be in the Red Base control sphere in putput.
  376.        
  377.         except[1].putput.xlow =                 nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in putput.
  378.         except[1].putput.xhigh =                nil         -- Highest X coordinate considered to be in the Blue base control sphere in putput.
  379.         except[1].putput.ylow =                 nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in putput.
  380.         except[1].putput.yhigh =                nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in putput.
  381.         except[1].putput.zlow =                 nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in putput.
  382.         except[1].putput.zhigh =                nil         -- Highest Z coordinate considered to be in the Blue Base control sphere in putput.
  383.        
  384.         except[0].ratrace.xlow =                nil         -- Lowest X coordinate considered to be in the Red Base control sphere in ratrace.
  385.         except[0].ratrace.xhigh =               nil         -- Highest X coordinate considered to be in the Red Base control sphere in ratrace.
  386.         except[0].ratrace.ylow =                nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in ratrace.
  387.         except[0].ratrace.yhigh =               nil         -- Highest Y coordinate considered to be in the Red Base control sphere in ratrace.
  388.         except[0].ratrace.zlow =                nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in ratrace.
  389.         except[0].ratrace.zhigh =               nil         -- Highest Z coordinate considered to be in the Red Base control sphere in ratrace.
  390.        
  391.         except[1].ratrace.xlow =                nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in ratrace.
  392.         except[1].ratrace.xhigh =               nil         -- Highest X coordinate considered to be in the Blue base control sphere in ratrace.
  393.         except[1].ratrace.ylow =                nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in ratrace.
  394.         except[1].ratrace.yhigh =               nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in ratrace.
  395.         except[1].ratrace.zlow =                nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in ratrace.
  396.         except[1].ratrace.zhigh =               -1.60       -- Highest Z coordinate considered to be in the Blue Base control sphere in ratrace.
  397.        
  398.         except[0].sidewinder.xlow =             -34.65      -- Lowest X coordinate considered to be in the Red Base control sphere in sidewinder.
  399.         except[0].sidewinder.xhigh =            -29.51      -- Highest X coordinate considered to be in the Red Base control sphere in sidewinder.
  400.         except[0].sidewinder.ylow =             nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in sidewinder.
  401.         except[0].sidewinder.yhigh =            -29.7       -- Highest Y coordinate considered to be in the Red Base control sphere in sidewinder.
  402.         except[0].sidewinder.zlow =             nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in sidewinder.
  403.         except[0].sidewinder.zhigh =            -2.48       -- Highest Z coordinate considered to be in the Red Base control sphere in sidewinder.
  404.        
  405.         except[1].sidewinder.xlow =             27.75       -- Lowest X coordinate considered to be in the Blue Base control sphere in sidewinder.
  406.         except[1].sidewinder.xhigh =            32.93       -- Highest X coordinate considered to be in the Blue base control sphere in sidewinder.
  407.         except[1].sidewinder.ylow =             nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in sidewinder.
  408.         except[1].sidewinder.yhigh =            -34.5       -- Highest Y coordinate considered to be in the Blue Base control sphere in sidewinder.
  409.         except[1].sidewinder.zlow =             nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in sidewinder.
  410.         except[1].sidewinder.zhigh =            -2.78       -- Highest Z coordinate considered to be in the Blue Base control sphere in sidewinder.
  411.        
  412.         except[0].timberland.xlow =             14.70       -- Lowest X coordinate considered to be in the Red Base control sphere in timberland.
  413.         except[0].timberland.xhigh =            19.90       -- Highest X coordinate considered to be in the Red Base control sphere in timberland.
  414.         except[0].timberland.ylow =             nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in timberland.
  415.         except[0].timberland.yhigh =            -49.15      -- Highest Y coordinate considered to be in the Red Base control sphere in timberland.
  416.         except[0].timberland.zlow =             nil         -- Lowest Z coordinate considered to be in the Red Base control sphere in timberland.
  417.         except[0].timberland.zhigh =            -16.90      -- Highest Z coordinate considered to be in the Red Base control sphere in timberland.
  418.        
  419.         except[1].timberland.xlow =             -18.96      -- Lowest X coordinate considered to be in the Blue Base control sphere in timberland.
  420.         except[1].timberland.xhigh =            -13.76      -- Highest X coordinate considered to be in the Blue base control sphere in timberland.
  421.         except[1].timberland.ylow =             48.70       -- Lowest Y coordinate considered to be in the Blue Base control sphere in timberland.
  422.         except[1].timberland.yhigh =            nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in timberland.
  423.         except[1].timberland.zlow =             nil         -- Lowest Z coordinate considered to be in the Blue Base control sphere in timberland.
  424.         except[1].timberland.zhigh =            -16.90      -- Highest Z coordinate considered to be in the Blue Base control sphere in timberland.
  425.        
  426.         except[0].wizard.xlow =                 nil         -- Lowest X coordinate considered to be in the Red Base control sphere in wizard.
  427.         except[0].wizard.xhigh =                nil         -- Highest X coordinate considered to be in the Red Base control sphere in wizard.
  428.         except[0].wizard.ylow =                 nil         -- Lowest Y coordinate considered to be in the Red Base control sphere in wizard.
  429.         except[0].wizard.yhigh =                nil         -- Highest Y coordinate considered to be in the Red Base control sphere in wizard.
  430.         except[0].wizard.zlow =                 -3.15       -- Lowest Z coordinate considered to be in the Red Base control sphere in wizard.
  431.         except[0].wizard.zhigh =                nil         -- Highest Z coordinate considered to be in the Red Base control sphere in wizard.
  432.        
  433.         except[1].wizard.xlow =                 nil         -- Lowest X coordinate considered to be in the Blue Base control sphere in wizard.
  434.         except[1].wizard.xhigh =                nil         -- Highest X coordinate considered to be in the Blue base control sphere in wizard.
  435.         except[1].wizard.ylow =                 nil         -- Lowest Y coordinate considered to be in the Blue Base control sphere in wizard.
  436.         except[1].wizard.yhigh =                nil         -- Highest Y coordinate considered to be in the Blue Base control sphere in wizard.
  437.         except[1].wizard.zlow =                 -3.15       -- Lowest Z coordinate considered to be in the Blue Base control sphere in wizard.
  438.         except[1].wizard.zhigh =                nil         -- Highest Z coordinate considered to be in the Blue Base control sphere in wizard.
  439.        
  440.        
  441.         -- Optional Gametype Modifiers --
  442.        
  443.         -- Modifier:         Boolean:          Description:
  444.         ball_of_faith =        true            -- One who holds the Ball of Faith (an oddball) will regenerate extra control percentage and increase maximum control while standing in their own control sphere.
  445.         staff_of_influence =   true            -- One who holds the Staff of Influence (a flagstaff) will take extra control percentage while standing in the opposing team's control sphere.
  446.        
  447.        
  448.         -- Ball of Faith --
  449.        
  450.         -- The following only apply if ball_of_faith = true.
  451.        
  452.         ball = {}
  453.        
  454.         -- Attribute:         Value:           Description:
  455.         ball.bonus =           1.00            -- Bonus faith applied to the player holding the Ball of Faith.
  456.         ball.max_bonus =       50.00           -- Bonus maximum control a team can have over their own base when a team member holds the Ball of Faith in their own control sphere.
  457.         ball.spawn_delay =     0.00            -- Amount of time (in seconds) before the Ball of Faith appears on the map.
  458.         ball.respawn =         45.0            -- Amount of time (in seconds) before the Ball of Faith respawns (use math.inf for no respawn).
  459.        
  460.         -- These are the messages a player will receive when they pick up the Ball of Faith.
  461.         ball.messages =        {"This is the Ball of Faith", "Stand in your own base with the ball to gain extra control percentage."}
  462.  
  463.        
  464.         -- Staff of Influence --
  465.        
  466.         -- The following only apply if staff_of_influence = true.
  467.        
  468.         staff = {}
  469.        
  470.         -- Attribute:            Value:        Description:
  471.         staff.bonus =             1.50         -- Bonus influence applied to the player holding the Staff of Influence.
  472.         staff.spawn_delay =       0.00         -- Amount of time (in seconds) before the Staff of Influence appears on the map.
  473.         staff.respawn =           45.0         -- Amount of time (in seconds) before the Staff of Influence respawns (use math.inf for no respawn).
  474.        
  475.         -- These are the messages a player will receive when they pick up the Staff of Influence.
  476.         staff.messages =          {"This is the Staff of Influence.", "Stand in the opposing team's base to take extra control percentage."}
  477.        
  478.        
  479.         -- Ball and Staff Spawn Options --
  480.        
  481.         shared_spawns =           false        -- If true, the Ball of Faith and Staff of Influence can spawn in the same place.  If false, they cannot.
  482.        
  483.        
  484.         -- Ball of Faith Spawnpoints --
  485.        
  486.         ball.spawns = {}         -- Spawnpoints of Ball of Faith depending on the current map
  487.                                                          -- Allows for multiple spawn points (if multiple spawnpoints are specified, they will be chosen at random at the beginning of each game).
  488.        
  489.         --    Map:                    {{x1, y1, z1}, {x2, y2, z2} ... etc}
  490.         ball.spawns.beavercreek =     { {15.38, 5.23, 4.05},
  491.                                                                         {14.13, 20.95, 3.37}
  492.                                                                         }
  493.  
  494.         ball.spawns.bloodgulch =      { {60.5, -150.5, 6.28},
  495.                                                                         {70.09, -88.32, 5.64}
  496.                                                                         }
  497.  
  498.         ball.spawns.boardingaction =  { {15.85, 12.82, 7.72},
  499.                                                                         {4.13, -12.78, 7.72}
  500.                                                                         }
  501.                                                                        
  502.         ball.spawns.carousel =        { {7.41, -7.58, 0.86},
  503.                                                                         {-8.07, 8.10, 0.86}
  504.                                                                         }
  505.                                                                        
  506.         ball.spawns.chillout =        { {9.82, 2.67, 0.5},
  507.                                                                         {-1.63, 11.08, 4.67}
  508.                                                                         }
  509.                                                                        
  510.         ball.spawns.damnation =       { {-7.76, 7.28, 3.90},
  511.                                                                         {-12.17, -6.04, 3.51}
  512.                                                                         }
  513.                                                                        
  514.         ball.spawns.dangercanyon =    { {-10.78, 44.82, 0.63},
  515.                                                                         {10.35, 44.2, 0.63}
  516.                                                                         }
  517.                                                                        
  518.         ball.spawns.deathisland =     { {-34.73, 50.47, 18.76},
  519.                                                                         {16.97, -32.19, 3.91}
  520.                                                                         }
  521.                                                                        
  522.         ball.spawns.gephyrophobia =   { {39.41, -67.38, -12.21},
  523.                                                                         {14.06, -76.64, -12.21}
  524.                                                                         }
  525.                                                                        
  526.         ball.spawns.hangemhigh =      { {21.04, -6.24, -3.63},
  527.                                                                         {20.46, -2.45, -8.75}
  528.                                                                         }
  529.                                                                        
  530.         ball.spawns.icefields =       { {-17.13, 34.29, 1.18},
  531.                                                                         {-35.86, 30.51, 1.18}
  532.                                                                         }
  533.                                                                        
  534.         ball.spawns.infinity =        { {-15.37, -46.22, 28.97},
  535.                                                                         {18.86, -81.41, 28.67}
  536.                                                                         }
  537.                                                                        
  538.         ball.spawns.longest =         { {-6.86, -10.53, 2.56},
  539.                                                                         {5.06, -18.55, 2.56}
  540.                                                                         }
  541.                                                                        
  542.         ball.spawns.prisoner =        { {9.19, -5.09, 3.69},
  543.                                                                         {-11.03, 5.01, 1.89}
  544.                                                                         }
  545.                                                                        
  546.         ball.spawns.putput =          { {-5.29, -22.25, 1.4},
  547.                                                                         {13.62, -32.25, 3.33}
  548.                                                                         }
  549.                                                                        
  550.         ball.spawns.ratrace =         { {16.22, -19.57, -0.66},
  551.                                                                         {-2.24, -12.94, 0.72}
  552.                                                                         }
  553.                                                                        
  554.         ball.spawns.sidewinder =      { {-1.49, 56.58, -2.54},
  555.                                                                         {6.6, 57.18, -2.36}
  556.                                                                         }
  557.                                                                        
  558.         ball.spawns.timberland =      { {5.8, 5.6, -18.84},
  559.                                                                         {-3.64, -6.4, -18.51}
  560.                                                                         }
  561.                                                                        
  562.         ball.spawns.wizard =          { {7.95, 7.95, -2.25},
  563.                                                                         {-7.95, -7.95, -2.25}
  564.                                                                         }
  565.                                                                        
  566.                                                                        
  567.         -- Staff of Influence Spawnpoints --
  568.        
  569.         staff.spawns = {}        -- Spawnpoints of Staff of Influence depending on the current map
  570.                                                          -- Allows for multiple spawn points (if multiple spawnpoints are specified, they will be chosen at random at the beginning of each game).
  571.        
  572.         --    Map:                    {{x1, y1, z1}, {x2, y2, z2} ... etc}
  573.         staff.spawns.beavercreek =     {{15.38, 5.23, 4.05},
  574.                                                                         {14.13, 20.95, 3.37}
  575.                                                                         }
  576.  
  577.         staff.spawns.bloodgulch =      {{60.5, -150.5, 6.28},
  578.                                                                         {70.09, -88.32, 5.64}
  579.                                                                         }
  580.  
  581.         staff.spawns.boardingaction =  {{15.85, 12.82, 7.72},
  582.                                                                         {4.13, -12.78, 7.72}
  583.                                                                         }
  584.                                                                        
  585.         staff.spawns.carousel =        {{7.41, -7.58, 0.86},
  586.                                                                         {-8.07, 8.10, 0.86}
  587.                                                                         }
  588.                                                                        
  589.         staff.spawns.chillout =        {{9.82, 2.67, 0.5},
  590.                                                                         {-1.63, 11.08, 4.67}
  591.                                                                         }
  592.                                                                        
  593.         staff.spawns.damnation =       {{-7.76, 7.28, 3.90},
  594.                                                                         {-12.17, -6.04, 3.51}
  595.                                                                         }
  596.                                                                        
  597.         staff.spawns.dangercanyon =    {{-10.78, 44.82, 0.63},
  598.                                                                         {10.35, 44.2, 0.63}
  599.                                                                         }
  600.                                                                        
  601.         staff.spawns.deathisland =     {{-34.73, 50.47, 18.76},
  602.                                                                         {16.97, -32.19, 3.91}
  603.                                                                         }
  604.                                                                        
  605.         staff.spawns.gephyrophobia =   {{39.41, -67.38, -12.21},
  606.                                                                         {14.06, -76.64, -12.21}
  607.                                                                         }
  608.                                                                        
  609.         staff.spawns.hangemhigh =      {{21.04, -6.24, -3.63},
  610.                                                                         {20.46, -2.45, -8.75}
  611.                                                                         }
  612.                                                                        
  613.         staff.spawns.icefields =       {{-17.13, 34.29, 1.18},
  614.                                                                         {-35.86, 30.51, 1.18}
  615.                                                                         }
  616.                                                                        
  617.         staff.spawns.infinity =        {{-15.37, -46.22, 28.97},
  618.                                                                         {18.86, -81.41, 28.67}
  619.                                                                         }
  620.                                                                        
  621.         staff.spawns.longest =         {{-6.86, -10.53, 2.56},
  622.                                                                         {5.06, -18.55, 2.56}
  623.                                                                         }
  624.                                                                        
  625.         staff.spawns.prisoner =        {{9.19, -5.09, 3.69},
  626.                                                                         {-11.03, 5.01, 1.89}
  627.                                                                         }
  628.                                                                        
  629.         staff.spawns.putput =          {{-5.29, -22.25, 1.4},
  630.                                                                         {13.62, -32.25, 3.33}
  631.                                                                         }
  632.                                                                        
  633.         staff.spawns.ratrace =         {{16.22, -19.57, -0.66},
  634.                                                                         {-2.24, -12.94, 0.72}
  635.                                                                         }
  636.                                                                        
  637.         staff.spawns.sidewinder =      { {-1.49, 56.58, -2.54},
  638.                                                                         {6.6, 57.18, -2.36}
  639.                                                                         }
  640.                                                                        
  641.         staff.spawns.timberland =      {{5.8, 5.6, -18.84},
  642.                                                                         {-3.64, -6.4, -18.51}
  643.                                                                         }
  644.                                                                        
  645.         staff.spawns.wizard =          {{7.95, 7.95, -2.25},
  646.                                                                         {-7.95, -7.95, -2.25}
  647.                                                                         }
  648.        
  649. -- **Do not edit the following code unless you know what you're doing** --
  650.  
  651.         Game = game
  652.  
  653.         game_end = false
  654.        
  655.         flag_respawn_addr = 0x488A7E
  656.  
  657.         if game == "PC" then
  658.                 gametype_base = 0x671340
  659.         else
  660.                 gametype_base = 0x5F5498
  661.         end
  662.        
  663.         writedword(flag_respawn_addr, 0, 0xFFFFFFFF)
  664.        
  665.         writedword(gametype_base, 0x48, respawn_time * 30)
  666.        
  667.         flags = {}
  668.         vehicles = {}
  669.         players = {}
  670.         weapons = {}
  671.        
  672.         teams[0].rate = 0
  673.         teams[1].rate = 0
  674.        
  675.         teams[0].prefix = ""
  676.         teams[1].prefix = ""
  677.        
  678.         teams[0].control = teams[0].start
  679.         teams[1].control = teams[1].start
  680.        
  681.         teams[0].previous_max = teams[0].max
  682.         teams[1].previous_max = teams[1].max
  683.        
  684.         teams[0].friendly = {}
  685.         teams[1].friendly = {}
  686.        
  687.         teams[0].enemy = {}
  688.         teams[1].enemy = {}
  689.        
  690.         registertimer(10, "ControlRate")
  691.         registertimer(1000, "CreationDelay")   
  692. end
  693.  
  694. --[[
  695. function OnScriptUnload()
  696.  
  697.        
  698. end
  699. --]]
  700.  
  701. function OnNewGame(map)
  702.  
  703.         this_map = map
  704.        
  705.         if Game == "PC" then
  706.                 ctf_globals = 0x639B98
  707.         else
  708.                 ctf_globals = 0x5BDBB8
  709.         end    
  710. end
  711.  
  712. function OnGameEnd(stage)
  713.  
  714.         if stage == 1 then
  715.                 if teams[1].control == 0 then
  716.                         writedword(ctf_globals, 0x10, 1)
  717.                 elseif teams[0].control == 0 then
  718.                         writedword(ctf_globals + 0x4, 0x10, 1)
  719.                 end
  720.         elseif stage == 2 then
  721.                 game_end = true
  722.                
  723.                 for i = 0,15 do
  724.                         if getplayer(i) then
  725.                                 local hash = gethash(i)
  726.                                 sendconsoletext(i, "Control Restored: " .. math.round(players[hash].restored, 2) .. "%")
  727.                                 sendconsoletext(i, "Control Taken: " .. math.round(players[hash].taken, 2) .. "%")
  728.                         end
  729.                 end
  730.         elseif stage == 3 then
  731.                 flag_respawn_addr = 0x488A7E
  732.                 writedword(flag_respawn_addr, 0, 17 * 30)
  733.         end
  734. end
  735.  
  736. function OnServerChat(player, type, message)
  737.        
  738.         if player then
  739.                 if message == help_command then
  740.                         sendconsoletext(player, "Conquest:", 15, order.help)
  741.                         sendconsoletext(player, "Take control of opposing base before the other team takes control of yours.", 15, order.help)
  742.                         sendconsoletext(player, "Regain control of your base by standing in it unopposed.", 15, order.help)
  743.                         sendconsoletext(player, "Take control from the other team by standing in their base unopposed.", 15, order.help)
  744.                         sendconsoletext(player, "If at any point one team's control percentage is 0%, the other team wins.", 15, order.help)
  745.                         return false
  746.                 end
  747.         end
  748. end
  749.  
  750. --[[
  751. function OnServerCommandAttempt(player, command, password)
  752.  
  753.         --return true
  754. end
  755. --]]
  756.  
  757. --[[
  758. function OnServerCommand(admin, command)
  759.  
  760.         --return true
  761. end
  762. --]]
  763.  
  764. --[[
  765. function OnNameRequest(hash, name)
  766.  
  767.         --return true, name
  768. end
  769. --]]
  770.  
  771. --[[
  772. function OnBanCheck(hash, ip)
  773.        
  774.         --return true
  775. end
  776. --]]
  777.  
  778. function OnPlayerJoin(player)
  779.  
  780.         newplayer(player)
  781.  
  782.         sendconsoletext(player, "Red Base Control: " .. math.round(teams[0].control, 2) .. "%", math.inf, order.redcontrol, "left", notgameover)
  783.         sendconsoletext(player, "Blue Base Control: " .. math.round(teams[1].control, 2) .. "%", math.inf, order.bluecontrol, "left", notgameover)
  784. end
  785.  
  786. function OnPlayerLeave(player)
  787.  
  788.         for i = 0,3 do
  789.                 if weapons[player][i] then
  790.                         OnWeaponDrop(player, weapons[player][i].weapId, i, weapons[player][i].mapId)
  791.                         weapons[player][i] = nil
  792.                 end
  793.         end
  794. end
  795.  
  796. --[[
  797. function OnPlayerKill(killer, victim, mode)
  798.  
  799.         -- mode 0: Killed by server
  800.         -- mode 1: Killed by fall damage
  801.         -- mode 2: Killed by guardians
  802.         -- mode 3: Killed by vehicle
  803.         -- mode 4: Killed by killer
  804.         -- mode 5: Betrayed by killer
  805.         -- mode 6: Suicide
  806. end
  807. --]]
  808.  
  809. --[[
  810. function OnKillMultiplier(player, multiplier)
  811.  
  812.         -- Multipliers:
  813.         -- 7: Double Kill
  814.         -- 9: Triple Kill
  815.         -- 10: Killtacular
  816.         -- 11: Killing Spree
  817.         -- 12: Running Riot
  818.         -- 16: Double Kill w/ Score
  819.         -- 17: Triple Kill w/ Score
  820.         -- 14: Killtacular w/ Score
  821.         -- 18: Killing Spree w/ Score
  822.         -- 17: Running Riot w/ Score
  823. end
  824. --]]
  825.  
  826. --[[
  827. function OnPlayerSpawn(player)
  828.        
  829.  
  830. end
  831. --]]
  832.  
  833. --[[
  834. function OnPlayerSpawnEnd(player)
  835.  
  836.  
  837. end
  838. --]]
  839.  
  840. --[[
  841. function OnWeaponAssignment(player, objId, slot, weapId)
  842.        
  843.         --return mapId
  844. end
  845. --]]
  846.  
  847. --[[
  848. function OnWeaponReload(player, weapId)
  849.  
  850.         --return true
  851. end
  852. --]]
  853.  
  854. --[[
  855. function OnObjectCreationAttempt(mapId, parentId, player)
  856.        
  857.         --return mapId
  858. end
  859. --]]
  860.  
  861. function OnObjectCreation(objId)
  862.  
  863.         local m_object = getobject(objId)
  864.         local mapId = readdword(m_object)
  865.         local tagname, tagtype = gettaginfo(mapId)
  866.         if tagtype == "weap" and tagname == "weapons\\flag\\flag" then
  867.                 local team = readbyte(m_object, 0xB8)
  868.                 if teams[team] then
  869.                         if not teams[team].center then
  870.                                 teams[team].center = {getobjectcoords(objId)}
  871.                         end
  872.                         if #flags < 2 then
  873.                                 table.insert(flags, objId)
  874.                         end
  875.                 end
  876.         end
  877. end
  878.  
  879. function OnObjectInteraction(player, objId, mapId)
  880.  
  881.         if table.find(flags, objId) then
  882.                 return false
  883.         end
  884.        
  885.         local tagname, tagtype = gettaginfo(mapId)
  886.         local hash = gethash(player)
  887.        
  888.         if players[hash].ball then
  889.                 if tagtype == "weap" and tagname == "weapons\\flag\\flag" then
  890.                         return false
  891.                 end
  892.         end
  893.        
  894.         if players[hash].staff then
  895.                 if tagtype == "weap" and tagname == "weapons\\ball\\ball" then
  896.                         return false
  897.                 end
  898.         end
  899. end
  900.  
  901. --[[
  902. function OnTeamDecision(team)
  903.        
  904.         --return team
  905. end
  906. --]]
  907.  
  908. --[[
  909. function OnTeamChange(player, old_team, new_team, voluntary)
  910.        
  911.         --return true
  912. end
  913. --]]
  914.  
  915. --[[
  916. function OnDamageLookup(receiver, causer, mapId)
  917.        
  918.         --return true
  919. end
  920. --]]
  921.  
  922. --[[
  923. function OnDamageApplication(receiver, causer, mapId, location, backtap)
  924.        
  925.         --return true
  926. end
  927. --]]
  928.  
  929. --[[
  930. function OnVehicleEntry(player, vehiId, seat, mapId, voluntary)
  931.        
  932.         --return true
  933. end
  934. --]]
  935.  
  936. --[[
  937. function OnVehicleEject(player, voluntary)
  938.  
  939.         --return true
  940. end
  941. --]]
  942.  
  943. --[[
  944. function OnClientUpdate(player)
  945.  
  946.  
  947. end
  948. --]]
  949.  
  950. function OnWeaponPickup(player, weapId, slot, mapId)
  951.  
  952.         local hash = gethash(player)
  953.         local tagname = gettaginfo(mapId)
  954.         if tagname == "weapons\\ball\\ball" then
  955.                 players[hash].ball = true
  956.                 players[hash].faith = players[hash].faith + ball.bonus
  957.                 ball.player = player
  958.                 local messages = getmessageblock(player, order.ballmessage)
  959.                 if not messages then
  960.                         for k,v in ipairs(messages) do
  961.                                 v:append(ball.messages[k], true)
  962.                         end
  963.                 else
  964.                         for k,v in ipairs(ball.messages) do
  965.                                 sendconsoletext(player, ball.messages[k], 10, order.ballmessage, "left", holdingball)
  966.                         end
  967.                 end
  968.         elseif tagname == "weapons\\flag\\flag" then
  969.                 players[hash].staff = true
  970.                 players[hash].influence = players[hash].faith + staff.bonus
  971.                 staff.player = player
  972.                 local messages = getmessageblock(player, order.staffmessage)
  973.                 if not messages then
  974.                         for k,v in ipairs(messages) do
  975.                                 v:append(staff.messages[k], true)
  976.                         end
  977.                 else
  978.                         for k,v in ipairs(staff.messages) do
  979.                                 sendconsoletext(player, staff.messages[k], 10, order.staffmessage, "left", holdingflag)
  980.                         end
  981.                 end
  982.         end
  983. end
  984.  
  985. function OnWeaponDrop(player, weapId, slot, mapId)
  986.  
  987.         local hash = gethash(player)
  988.         local tagname = gettaginfo(mapId)
  989.         if tagname == "weapons\\ball\\ball" then
  990.                 players[hash].ball = false
  991.                 players[hash].faith = players[hash].faith - ball.bonus
  992.                 ball.player = nil
  993.         elseif tagname == "weapons\\flag\\flag" then
  994.                 players[hash].staff = false
  995.                 players[hash].influence = players[hash].influence - staff.bonus
  996.                 staff.player = nil
  997.         end
  998. end
  999.  
  1000. function OnControlEnter(sphereteam, player)
  1001.  
  1002.         local hash = gethash(player)
  1003.         if players[hash].team == sphereteam then
  1004.                 teams[sphereteam].friendly[hash] = players[hash].faith
  1005.                 if players[hash].ball then
  1006.                         teams[sphereteam].max = teams[sphereteam].max + ball.max_bonus
  1007.                 end
  1008.         else
  1009.                 teams[sphereteam].enemy[hash] = players[hash].influence
  1010.         end
  1011. end
  1012.  
  1013. function OnControlExit(sphereteam, player)
  1014.  
  1015.         local hash = gethash(player)
  1016.         if players[hash].team == sphereteam then
  1017.                 teams[sphereteam].friendly[hash] = nil
  1018.                 if players[hash].ball then
  1019.                         teams[sphereteam].max = teams[sphereteam].max - ball.max_bonus
  1020.                 end
  1021.         else
  1022.                 teams[sphereteam].enemy[hash] = nil
  1023.         end
  1024. end
  1025.  
  1026. spheres = {}
  1027. spheres.__index = spheres
  1028.  
  1029. function controlsphere(team, radius, x, y, z)
  1030.  
  1031.         spheres[team] = {}
  1032.         spheres[team].radius = radius
  1033.         spheres[team].x = x
  1034.         spheres[team].y = y
  1035.         spheres[team].z = z
  1036.         spheres[team].team = team
  1037.         spheres[team].players = {}
  1038.        
  1039.         setmetatable(spheres[team], spheres)
  1040.         teams[team].sphere = spheres[team]
  1041.        
  1042.         return spheres[team]
  1043. end
  1044.  
  1045. function insphere(objId, sphere)
  1046.  
  1047.         local m_object = getobject(objId)
  1048.         if m_object then
  1049.                 local vehiId = readdword(m_object, 0x11C)
  1050.                 local m_vehicle = getobject(vehiId)
  1051.                 if m_vehicle then
  1052.                         objId = vehiId
  1053.                 end
  1054.                
  1055.                 local x, y, z = getobjectcoords(objId)
  1056.                 local dist = math.sqrt((x - sphere.x) ^  2 + (y - sphere.y) ^ 2 + (z - sphere.z) ^ 2)
  1057.                 if dist <= sphere.radius then
  1058.                         if x > (except[sphere.team][this_map].xlow or -math.inf) and x < (except[sphere.team][this_map].xhigh or math.inf) and y > (except[sphere.team][this_map].ylow or -math.inf) and y < (except[sphere.team][this_map].yhigh or math.inf) and z > (except[sphere.team][this_map].zlow or -math.inf) and z < (except[sphere.team][this_map].zhigh or math.inf) then
  1059.                                 return true
  1060.                         end
  1061.                 end
  1062.         end
  1063.        
  1064.         return false
  1065. end
  1066.  
  1067. function newplayer(player)
  1068.  
  1069.         local hash = gethash(player)
  1070.         local team = getteam(player)
  1071.        
  1072.         players[hash] = players[hash] or {}
  1073.         players[hash].team = team
  1074.         players[hash].influence = teams[team].influence
  1075.         players[hash].faith = teams[team].faith
  1076.         players[hash].presence = teams[team].presence
  1077.         players[hash].ball = false
  1078.         players[hash].staff = false
  1079.         players[hash].inred = false
  1080.         players[hash].inblue = false
  1081.         players[hash].restored = 0
  1082.         players[hash].taken = 0
  1083. end
  1084.  
  1085. function setscore(player, score)
  1086.  
  1087.         local m_player = getplayer(player)
  1088.         if m_player then
  1089.                 writeword(m_player, 0xC8, score)
  1090.         end
  1091. end
  1092.  
  1093. registertimer(10, "SphereMonitor")
  1094.  
  1095. function SphereMonitor(id, count)
  1096.  
  1097.         for player = 0,15 do
  1098.                 local m_player = getplayer(player)
  1099.                 if m_player then
  1100.                         local hash = gethash(player)
  1101.                         local objId = readdword(m_player, 0x34)
  1102.                         local m_object = getobject(objId)
  1103.                         if m_object then
  1104.                                 if insphere(objId, teams[0].sphere) then
  1105.                                         if not players[hash].inred then
  1106.                                                 OnControlEnter(0, player)
  1107.                                                 players[hash].inred = true
  1108.                                         end
  1109.                                 else
  1110.                                         if players[hash].inred then
  1111.                                                 OnControlExit(0, player)
  1112.                                                 players[hash].inred = false
  1113.                                         end
  1114.                                 end
  1115.                                
  1116.                                 if insphere(objId, teams[1].sphere) then
  1117.                                         if not players[hash].inblue then
  1118.                                                 OnControlEnter(1, player)
  1119.                                                 players[hash].inblue = true
  1120.                                         end
  1121.                                 else
  1122.                                         if players[hash].inblue then
  1123.                                                 OnControlExit(1, player)
  1124.                                                 players[hash].inblue = false
  1125.                                         end
  1126.                                 end
  1127.                         else
  1128.                                 if players[hash].inred then
  1129.                                         OnControlExit(0, player)
  1130.                                 end
  1131.                                
  1132.                                 if players[hash].inblue then
  1133.                                         OnControlExit(1, player)
  1134.                                 end
  1135.                         end
  1136.                 end
  1137.         end
  1138.        
  1139.         return true
  1140. end
  1141.  
  1142. registertimer(10, "ControlTimer")
  1143.  
  1144. function ControlTimer(id, count)
  1145.  
  1146.         local difference = {}
  1147.  
  1148.         for team = 0,1 do
  1149.        
  1150.                 teams[team].owned = false
  1151.        
  1152.                 if table.len(teams[team].friendly) > 0 and table.len(teams[team].enemy) > 0 then
  1153.                         teams[team].rate = 0
  1154.                         for hash,_ in pairs(teams[team].enemy) do
  1155.                                 if players[hash].staff then
  1156.                                         teams[team].rate = -(teams[1 - team].influence + table.len(teams[team].enemy) * teams[1 - team].presence)
  1157.                                         teams[team].owned = true
  1158.                                 end
  1159.                         end
  1160.                 elseif table.len(teams[team].friendly) > 0 then
  1161.                         local maxhash = table.max(teams[team].friendly)
  1162.                         local sum = players[maxhash].faith
  1163.                         for hash,_ in pairs(teams[team].friendly) do
  1164.                                 if hash ~= maxhash then
  1165.                                         sum = sum + teams[team].presence
  1166.                                 end
  1167.                                
  1168.                                 if players[hash].ball then
  1169.                                         teams[team].max = teams[team].previous_max + ball.max_bonus
  1170.                                 else
  1171.                                         teams[team].max = math.max(teams[team].previous_max, teams[team].control)
  1172.                                 end
  1173.                         end
  1174.                        
  1175.                         teams[team].rate = sum
  1176.                 elseif table.len(teams[team].enemy) > 0 then
  1177.                         if teams[team].control > 0 then
  1178.                                 local maxhash = table.max(teams[team].enemy)
  1179.                                 local sum = players[maxhash].influence
  1180.                                 for hash,_ in pairs(teams[team].enemy) do
  1181.                                         if hash ~= maxhash then
  1182.                                                 sum = sum + teams[team].presence
  1183.                                         end
  1184.                                 end
  1185.                                
  1186.                                 teams[team].rate = -sum
  1187.                         else
  1188.                                 teams[team].control = 0
  1189.                                 svcmd("sv_map_next")
  1190.                                 if team == 1 then
  1191.                                         say("Red Team wins!")
  1192.                                 else
  1193.                                         say("Blue Team wins!")
  1194.                                 end
  1195.                                
  1196.                                 return false
  1197.                         end
  1198.                 else
  1199.                         teams[team].rate = nil
  1200.                 end
  1201.                
  1202.                 local new_control = math.min(teams[team].max, teams[team].control + (teams[team].rate or 0) / 50)
  1203.                 difference[team] = math.abs(new_control - teams[team].control)
  1204.                 teams[team].control = new_control
  1205.         end
  1206.        
  1207.         for player = 0,15 do
  1208.                 local m_player = getplayer(player)
  1209.                 if m_player then
  1210.                         local hash = gethash(player)
  1211.                         local objId = readdword(m_player, 0x34)
  1212.                         local m_object = getobject(objId)
  1213.                        
  1214.                         if m_object then
  1215.                                 if getobject(readdword(m_object, 0x11C)) then
  1216.                                         objId = readdword(m_object, 0x11C)
  1217.                                 end
  1218.                                
  1219.                                 for team = 0,1 do
  1220.                                         if insphere(objId, teams[team].sphere) then
  1221.                                                 if players[hash].team == team then
  1222.                                                         players[hash].restored = players[hash].restored + difference[team]
  1223.                                                 else
  1224.                                                         players[hash].taken = players[hash].taken + difference[team]
  1225.                                                 end
  1226.                                         end
  1227.                                 end
  1228.                         end
  1229.  
  1230.                         setscore(player, math.floor(players[hash].restored + players[hash].taken))
  1231.                 end
  1232.         end
  1233.        
  1234.         return true
  1235. end
  1236.  
  1237. registertimer(10, "PrintTimer")
  1238.  
  1239. function PrintTimer(id, count)
  1240.  
  1241.         for i = 0,15 do
  1242.                 if getplayer(i) then
  1243.                         local redmessage = getmessage(i, order.redcontrol)
  1244.                         local bluemessage = getmessage(i, order.bluecontrol)
  1245.                         if redmessage and bluemessage then
  1246.                                 if not teams[0].rate then
  1247.                                         redmessage:append("Red Base Control: " .. math.round(teams[0].control, 2) .. "%")
  1248.                                 else
  1249.                                         if teams[0].rate > 0 then
  1250.                                                 redmessage:append("+ Red Base Control: " .. math.round(teams[0].control, 2) .. "%")
  1251.                                         elseif teams[0].rate < 0 then
  1252.                                                 if teams[0].owned then
  1253.                                                         redmessage:append("*- Red Base Control: " .. math.round(teams[0].control, 2) .. "%")
  1254.                                                 else
  1255.                                                         redmessage:append("- Red Base Control: " .. math.round(teams[0].control, 2) .. "%")
  1256.                                                 end
  1257.                                         else
  1258.                                                 redmessage:append("* Red Base Control: " .. math.round(teams[0].control, 2) .. "% (Contested)")
  1259.                                         end
  1260.                                 end
  1261.                                
  1262.                                 if not teams[1].rate then
  1263.                                         bluemessage:append("Blue Base Control: " .. math.round(teams[1].control, 2) .. "%")
  1264.                                 else
  1265.                                         if teams[1].rate > 0 then
  1266.                                                 bluemessage:append("+ Blue Base Control: " .. math.round(teams[1].control, 2) .. "%")
  1267.                                         elseif teams[1].rate < 0 then
  1268.                                                 if teams[1].owned then
  1269.                                                         bluemessage:append("*- Blue Base Control: " .. math.round(teams[1].control, 2) .. "%")
  1270.                                                 else
  1271.                                                         bluemessage:append("- Blue Base Control: " .. math.round(teams[1].control, 2) .. "%")
  1272.                                                 end
  1273.                                         else
  1274.                                                 bluemessage:append("* Blue Base Control: " .. math.round(teams[1].control, 2) .. "% (Contested)")
  1275.                                         end
  1276.                                 end
  1277.                         end
  1278.                 end
  1279.         end
  1280.        
  1281.         return not game_end
  1282. end
  1283.  
  1284. function CreationDelay(id, count)
  1285.        
  1286.         teams[0].radius = teams[0].radius or radius[0][this_map]
  1287.         teams[1].radius = teams[1].radius or radius[1][this_map]
  1288.        
  1289.         controlsphere(0, teams[0].radius, table.unpack(teams[0].center))
  1290.         controlsphere(1, teams[1].radius, table.unpack(teams[1].center))
  1291.        
  1292.         if ball_of_faith then
  1293.                 if #ball.spawns[this_map] > 0 then
  1294.                         local mapId = gettagid("weap", "weapons\\ball\\ball")
  1295.                         local rand = getrandomnumber(1, #ball.spawns[this_map] + 1)
  1296.                         ball.x = ball.spawns[this_map][rand][1]
  1297.                         ball.y = ball.spawns[this_map][rand][2]
  1298.                         ball.z = ball.spawns[this_map][rand][3]
  1299.                         ball.objId = createobject(mapId, 0, 0, false, ball.x, ball.y, ball.z)
  1300.                         ball.respawn_remain = ball.respawn
  1301.                        
  1302.                         registertimer(1000, "Respawn", "ball")
  1303.                        
  1304.                         if not shared_spawns then
  1305.                                 for k,t in ipairs(staff.spawns[this_map]) do
  1306.                                         if t[1] == ball.x and t[2] == ball.y and t[3] == ball.z then
  1307.                                                 table.remove(staff.spawns[this_map], k)
  1308.                                                 break
  1309.                                         end
  1310.                                 end
  1311.                         end
  1312.                 else
  1313.                         hprintf("There are no Ball of Faith spawn points for " .. this_map)
  1314.                 end
  1315.         end
  1316.        
  1317.         for i = 0,1 do
  1318.                 ctf_flag_coords_pointer = readdword(ctf_globals + i * 4, 0x0)
  1319.                 writefloat(ctf_flag_coords_pointer, 0)
  1320.                 writefloat(ctf_flag_coords_pointer + 4, 0)
  1321.                 writefloat(ctf_flag_coords_pointer + 8, -1000)
  1322.         end
  1323.        
  1324.         if staff_of_influence then
  1325.                 if #staff.spawns[this_map] > 0 then
  1326.                         local mapId = gettagid("weap", "weapons\\flag\\flag")
  1327.                         local rand = getrandomnumber(1, #staff.spawns[this_map] + 1)
  1328.                         staff.x = staff.spawns[this_map][rand][1]
  1329.                         staff.y = staff.spawns[this_map][rand][2]
  1330.                         staff.z = staff.spawns[this_map][rand][3]
  1331.                         staff.objId = createobject(mapId, 0, staff.respawn, true, staff.x, staff.y, staff.z)
  1332.                         staff.respawn_remain = staff.respawn
  1333.                        
  1334.                         registertimer(1000, "Respawn", "staff")
  1335.                 else
  1336.                         hprintf("There are no Staff of Influence spawn points for " .. this_map)
  1337.                 end
  1338.         end
  1339.        
  1340.         registertimer(10, "SphereMonitor")
  1341.        
  1342.         return false
  1343. end
  1344.  
  1345. function Respawn(id, count, item)
  1346.  
  1347.         if _G[item].player then
  1348.                 _G[item].respawn_remain = _G[item].respawn
  1349.         else
  1350.                 local objId = _G[item].objId
  1351.                 local m_object = getobject(objId)
  1352.                 if m_object then
  1353.                         local x, y, z = getobjectcoords(objId)
  1354.                         if math.round(x, 1) == math.round(_G[item].x, 1) and math.round(y, 1) == math.round(_G[item].y, 1) and math.round(z, 1) == math.round(_G[item].z, 1) then
  1355.                                 _G[item].respawn_remain = _G[item].respawn
  1356.                         else
  1357.                                 _G[item].respawn_remain = _G[item].respawn_remain - 1
  1358.                                 if _G[item].respawn_remain <= 0 then
  1359.                                         movobjectcoords(objId, _G[item].x, _G[item].y, _G[item].z)
  1360.                                         local m_object = getobject(_G[item].objId)
  1361.                                         writebit(m_object, 0x10, 5, 0)
  1362.                                         _G[item].respawn_remain = _G[item].respawn
  1363.                                 end
  1364.                         end
  1365.                 else
  1366.                         _G[item].respawn_remain = _G[item].respawn_remain - 1
  1367.                         if _G[item].respawn_remain <= 0 then
  1368.                                 local mapId
  1369.                                 if item == "ball" then
  1370.                                         mapId = gettaginfo("weap", "weapons\\ball\\ball")
  1371.                                 elseif item == "staff" then
  1372.                                         mapId = gettaginfo("weap", "weapons\\flag\\flag")
  1373.                                 end
  1374.                                
  1375.                                 _G[item].objId = createobject(mapId, 0, 0, false, _G[item].x, _G[item].y, _G[item].z)
  1376.                                 _G[item].respawn_remain = _G[item].respawn
  1377.                         end
  1378.                 end
  1379.         end
  1380.        
  1381.         return true
  1382. end
  1383.  
  1384. registertimer(10, "WeaponMonitor")
  1385.  
  1386. function WeaponMonitor(id, count)
  1387.  
  1388.         for player = 0,15 do
  1389.                 weapons[player] = weapons[player] or {}
  1390.                 local m_player = getplayer(player)
  1391.                 if m_player then
  1392.                         local temp = {}
  1393.                         local objId = readdword(m_player, 0x34)
  1394.                         local m_object = getobject(objId)
  1395.                         if m_object then
  1396.                                 for i = 0,3 do
  1397.                                         local weapId = readdword(m_object, 0x2F8 + (i * 4))
  1398.                                         local m_weapon = getobject(weapId)
  1399.                                         if m_weapon then
  1400.                                                 local mapId = readdword(m_weapon)
  1401.                                                 if weapons[player][i] then
  1402.                                                         if weapons[player][i].weapId ~= weapId then
  1403.                                                                 OnWeaponDrop(player, weapons[player][i].weapId, i, weapons[player][i].mapId)
  1404.                                                                 weapons[player][i] = {}
  1405.                                                                 weapons[player][i].weapId = weapId
  1406.                                                                 weapons[player][i].mapId = mapId
  1407.                                                                 OnWeaponPickup(player, weapId, i, mapId)
  1408.                                                         end
  1409.                                                 else
  1410.                                                         weapons[player][i] = {}
  1411.                                                         weapons[player][i].weapId = weapId
  1412.                                                         weapons[player][i].mapId = mapId
  1413.                                                         OnWeaponPickup(player, weapId, i, mapId)
  1414.                                                 end
  1415.                                         else
  1416.                                                 if weapons[player][i] then
  1417.                                                         OnWeaponDrop(player, weapons[player][i].weapId, i, weapons[player][i].mapId)
  1418.                                                         weapons[player][i] = nil
  1419.                                                 end
  1420.                                         end
  1421.                                 end
  1422.                         else
  1423.                                 for i = 0,3 do
  1424.                                         if weapons[player][i] then
  1425.                                                 OnWeaponDrop(player, weapons[player][i].weapId, i, weapons[player][i].mapId)
  1426.                                                 weapons[player][i] = nil
  1427.                                         end
  1428.                                 end
  1429.                         end
  1430.                 end    
  1431.         end
  1432.        
  1433.         return true
  1434. end
  1435.  
  1436. order = {}
  1437. order.help = 0
  1438. order.ballmessage = 1
  1439. order.staffmessage = 2
  1440. order.redcontrol = 3
  1441. order.bluecontrol = 4
  1442.  
  1443. console = {}
  1444. console.__index = console
  1445. registertimer(100, "ConsoleTimer")
  1446. phasor_sendconsoletext = sendconsoletext
  1447. math.inf = 1 / 0
  1448.  
  1449. function sendconsoletext(player, message, time, order, align, func)
  1450.  
  1451.         console[player] = console[player] or {}
  1452.        
  1453.         local temp = {}
  1454.         temp.player = player
  1455.         temp.id = nextid(player, order)
  1456.         temp.message = message or ""
  1457.         temp.time = time or 5
  1458.         temp.remain = temp.time
  1459.         temp.align = align or "left"
  1460.        
  1461.         if type(func) == "function" then
  1462.                 temp.func = func
  1463.         elseif type(func) == "string" then
  1464.                 temp.func = _G[func]
  1465.         end
  1466.        
  1467.         console[player][temp.id] = temp
  1468.         setmetatable(console[player][temp.id], console)
  1469.         return console[player][temp.id]
  1470. end
  1471.  
  1472. function nextid(player, order)
  1473.  
  1474.         if not order then
  1475.                 local x = 0
  1476.                 for k,v in pairs(console[player]) do
  1477.                         if k > x + 1 then
  1478.                                 return x + 1
  1479.                         end
  1480.                        
  1481.                         x = x + 1
  1482.                 end
  1483.                
  1484.                 return x + 1
  1485.         else
  1486.                 local original = order
  1487.                 while console[player][order] do
  1488.                         order = order + 0.001
  1489.                         if order == original + 0.999 then break end
  1490.                 end
  1491.                
  1492.                 return order
  1493.         end
  1494. end
  1495.  
  1496. function getmessage(player, order)
  1497.  
  1498.         if console[player] then
  1499.                 if order then
  1500.                         return console[player][order]
  1501.                 end
  1502.         end
  1503. end
  1504.  
  1505. function getmessages(player)
  1506.  
  1507.         return console[player]
  1508. end
  1509.  
  1510. function getmessageblock(player, order)
  1511.  
  1512.         local temp = {}
  1513.        
  1514.         for k,v in pairs(console[player]) do
  1515.                 if k >= order and k < order + 1 then
  1516.                         table.insert(temp, console[player][k])
  1517.                 end
  1518.         end
  1519.        
  1520.         return temp
  1521. end
  1522.  
  1523. function console:getmessage()
  1524.  
  1525.         return self.message
  1526. end
  1527.  
  1528. function console:append(message, reset)
  1529.  
  1530.         if console[self.player] then
  1531.                 if console[self.player][self.id] then
  1532.                         if getplayer(self.player) then
  1533.                                 if reset then
  1534.                                         if reset == true then
  1535.                                                 console[self.player][self.id].remain = console[self.player][self.id].time
  1536.                                         elseif tonumber(reset) then
  1537.                                                 console[self.player][self.id].time = tonumber(reset)
  1538.                                                 console[self.player][self.id].remain = tonumber(reset)
  1539.                                         end
  1540.                                 end
  1541.                                
  1542.                                 console[self.player][self.id].message = message or ""
  1543.                                 return true
  1544.                         end
  1545.                 end
  1546.         end
  1547. end
  1548.  
  1549. function console:shift(order)
  1550.  
  1551.         local temp = console[self.player][self.id]
  1552.         console[self.player][self.id] = console[self.player][order]
  1553.         console[self.player][order] = temp
  1554. end
  1555.  
  1556. function console:pause(time)
  1557.  
  1558.         console[self.player][self.id].pausetime = time or 5
  1559. end
  1560.  
  1561. function console:delete()
  1562.  
  1563.         console[self.player][self.id] = nil
  1564. end
  1565.  
  1566. function ConsoleTimer(id, count)
  1567.  
  1568.         for i,_ in opairs(console) do
  1569.                 if tonumber(i) then
  1570.                         if getplayer(i) then
  1571.                                 for k,v in opairs(console[i]) do
  1572.                                         if console[i][k].pausetime then
  1573.                                                 console[i][k].pausetime = console[i][k].pausetime - 0.1
  1574.                                                 if console[i][k].pausetime <= 0 then
  1575.                                                         console[i][k].pausetime = nil
  1576.                                                 end
  1577.                                         else
  1578.                                                 if console[i][k].func then
  1579.                                                         if not console[i][k].func(i) then
  1580.                                                                 console[i][k] = nil
  1581.                                                         end
  1582.                                                 end
  1583.                                                
  1584.                                                 if console[i][k] then
  1585.                                                         console[i][k].remain = console[i][k].remain - 0.1
  1586.                                                         if console[i][k].remain <= 0 then
  1587.                                                                 console[i][k] = nil
  1588.                                                         end
  1589.                                                 end
  1590.                                         end
  1591.                                 end
  1592.                                
  1593.                                 if table.len(console[i]) > 0 then
  1594.                                        
  1595.                                         local paused = 0
  1596.                                         for k,v in pairs(console[i]) do
  1597.                                                 if console[i][k].pausetime then
  1598.                                                         paused = paused + 1
  1599.                                                 end
  1600.                                         end
  1601.                                        
  1602.                                         if paused < table.len(console[i]) then
  1603.                                                 local str = ""
  1604.                                                 for i = 0,30 do
  1605.                                                         str = str .. " \n"
  1606.                                                 end
  1607.                                                
  1608.                                                 phasor_sendconsoletext(i, str)
  1609.                                                
  1610.                                                 for k,v in opairs(console[i]) do
  1611.                                                         if not console[i][k].pausetime then
  1612.                                                                 if console[i][k].align == "right" or console[i][k].align == "center" then
  1613.                                                                         phasor_sendconsoletext(i, consolecenter(string.sub(console[i][k].message, 1, 78)))
  1614.                                                                 else
  1615.                                                                         phasor_sendconsoletext(i, string.sub(console[i][k].message, 1, 78))
  1616.                                                                 end
  1617.                                                         end
  1618.                                                 end
  1619.                                         end
  1620.                                 end
  1621.                         else
  1622.                                 console[i] = nil
  1623.                         end
  1624.                 end
  1625.         end
  1626.        
  1627.         return true
  1628. end
  1629.  
  1630. function consolecenter(text)
  1631.  
  1632.         if text then
  1633.                 local len = string.len(text)
  1634.                 for i = len + 1, 78 do
  1635.                         text = " " .. text
  1636.                 end
  1637.                
  1638.                 return text
  1639.         end
  1640. end
  1641.  
  1642. function opairs(t)
  1643.        
  1644.         local keys = {}
  1645.         for k,v in pairs(t) do
  1646.                 table.insert(keys, k)
  1647.         end    
  1648.         table.sort(keys,
  1649.         function(a,b)
  1650.                 if type(a) == "number" and type(b) == "number" then
  1651.                         return a < b
  1652.                 end
  1653.                 an = string.lower(tostring(a))
  1654.                 bn = string.lower(tostring(b))
  1655.                 if an ~= bn then
  1656.                         return an < bn
  1657.                 else
  1658.                         return tostring(a) < tostring(b)
  1659.                 end
  1660.         end)
  1661.         local count = 1
  1662.         return function()
  1663.                 if table.unpack(keys) then
  1664.                         local key = keys[count]
  1665.                         local value = t[key]
  1666.                         count = count + 1
  1667.                         return key,value
  1668.                 end
  1669.         end
  1670. end
  1671.  
  1672. function table.len(t)
  1673.  
  1674.         local count = 0
  1675.         for k,v in pairs(t) do
  1676.                 count = count + 1
  1677.         end
  1678.        
  1679.         return count
  1680. end
  1681.  
  1682. function math.round(input, precision)
  1683.  
  1684.         return math.floor(input * (10 ^ precision) + 0.5) / (10 ^ precision)
  1685. end
  1686.  
  1687. function table.find(t, v, case)
  1688.  
  1689.         if case == nil then case = true end
  1690.  
  1691.         for k,val in pairs(t) do
  1692.                 if case then
  1693.                         if v == val then
  1694.                                 return k
  1695.                         end
  1696.                 else
  1697.                         if string.lower(v) == string.lower(val) then
  1698.                                 return k
  1699.                         end
  1700.                 end
  1701.         end
  1702. end
  1703.  
  1704. function table.max(t)
  1705.  
  1706.         local max = -math.inf
  1707.         local key
  1708.         for k,v in pairs(t) do
  1709.                 if type(v) == "number" then
  1710.                         if v > max then
  1711.                                 key = k
  1712.                                 max = v
  1713.                         end
  1714.                 end
  1715.         end
  1716.        
  1717.         return key, max
  1718. end
  1719.  
  1720. function holdingball(player)
  1721.  
  1722.         local m_player = getplayer(player)
  1723.         if m_player then
  1724.                 local hash = gethash(player)
  1725.                 if players[hash].ball then
  1726.                         return true
  1727.                 end
  1728.         end
  1729.        
  1730.         return false
  1731. end
  1732.  
  1733. function holdingflag(player)
  1734.  
  1735.         local m_player = getplayer(player)
  1736.         if m_player then
  1737.                 local hash = gethash(player)
  1738.                 if players[hash].staff then
  1739.                         return true
  1740.                 end
  1741.         end
  1742.        
  1743.         return false
  1744. end
  1745.  
  1746. function notgameover()
  1747.  
  1748.         return not game_end
  1749. end

HaloNet.Net is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.