rockbandcheeseman

Conquest2.0

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