Advertisement
rockbandcheeseman

Conquest2.0

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