function Player_OnRespawn(player) if (player:getVehicle():vehicletypeid()= 104) then player:inventory_modify("AC Rounds", -1000) player:inventory_modify("AC Rounds", 300) player:inventory_modify("Incinerator Charge", -1000) player:inventory_modify("Incinerator Charge", 80) player:inventory_modify("Hand Grenade", -10) player:inventory_modify("Hand Grenade", 3) elseif (player:getVehicle():vehicletypeid() = 100) then player:inventory_modify("Bullets", -1000) player:inventory_modify("Bullets", 300) player:inventory_modify("Shotgun Shells", -1000) player:inventory_modify("Shotgun Shells", 80) player:inventory_modify("Hand Grenade", -10) player:inventory_modify("Hand Grenade", 3) elseif (player:getVehicle():vehicletypeid() = 102) then player:inventory_modify("Bullets", -1000) player:inventory_modify("Bullets", 300) player:inventory_modify("Hand Grenade", -10) player:inventory_modify("Hand Grenade", 3) elseif (player:getVehicle():vehicletypeid() = 101) then player:inventory_modify("Bullets", -1000) player:inventory_modify("Bullets", 300) player:inventory_modify("Hand Grenade", -10) player:inventory_modify("Hand Grenade", 3) elseif (player:getVehicle():vehicletypeid() = 103) then player:inventory_modify("Hand Grenade", -10) player:inventory_modify("Hand Grenade", 3) endreturn trueendfunction Player_OnUnspec(player) local marineteam = g_arena:getteam(1) local skrallteam = g_arena:getteam(2) local nummmarine = marineteam:num() local numskrall = skrallteam:num() local difference = nummarine - numskrall if ( difference >= 1 ) if (player:getVehicle():vehicletypeid() >= 110) then player:teamchange("Skrall", "") else player:message("&Need more Skrall. Please change class.") elseif ( difference <= -1 ) if (player:getVehicle():vehicletypeid() > 110) then player:teamchange("Marines", "") else player:message("&Need more Marines. Please change class.") else if (player:getVehicle():vehicletypeid() >= 110) then player:teamchange("Skrall", "") else player:teamchange("Marines", "") endreturn trueendfunction Arena_OnCreate(arena) g_arena = arena local cfg = GameSettings() cfg.minplayers = 1 cfg.gamedelay = 20 cfg.str_pregame = "Game starting in " cfg.str_noplayers = "Not Enough Players" cfg.bDesertedGameEnd = false cfg.bIngameTicker = true cfg.tckrUpdateSpacing = 1000 g_state = g_arena:Takeover_State(cfg) math.randomseed(os.time())end--Bughunt script--- [[ Global Variables ]] ----------g_arena = nil -- The global arena class, to avoid having to pass it around functionsg_bGameRunning = false -- Is the game running?g_statsEvent = 0 -- holds the event for displaying stats when the game endsg_gameTime = nil -- holds the game timeg_startTime = nil -- for timer stuff--- Flags ---g_personA = nil -- the person currently holding Ag_startTimeA = nil -- the start time of when the flag has first entered the drop areag_currentDiffA = nilg_eventA = nilg_wonA = falseg_personB = nil -- the person currently holding Bg_startTimeB = nil -- the start time of when the flag has first entered the drop areag_currentDiffB = nilg_eventB = nilg_wonB = falseg_personC = nil -- the person currently holding Cg_startTimeC = nil -- the start time of when the flag has first entered the drop areag_currentDiffC = nilg_eventC = nilg_wonC = falseg_personD = nil -- the person currently holding Dg_startTimeD = nil -- the start time of when the flag has first entered the drop areag_currentDiffD = nilg_eventD = nilg_wonD = falseg_personE = nil -- the person currently holding Eg_startTimeE = nil -- the start time of when the flag has first entered the drop areag_currentDiffE = nilg_eventE = nilg_wonE = falseg_personF = nil -- the person currently holding Fg_startTimeF = nil -- the start time of when the flag has first entered the drop areag_currentDiffF = nilg_eventF = nilg_wonF = falseg_personG = nil -- the person currently holding Gg_startTimeG = nil -- the start time of when the flag has first entered the drop areag_currentDiffG = nilg_eventG = nilg_wonG = falseg_personH = nil -- the person currently holding Hg_startTimeH = nil -- the start time of when the flag has first entered the drop areag_currentDiffH = nilg_eventH = nilg_wonH = falseg_ax1 = 9824g_ay1 = 8976g_ax2 = 10464g_ay2 = 9152g_bx1 = 9808g_by1 = 9920g_bx2 = 10640g_by2 = 1004g_cx1 = 2800g_cy1 = 3344g_cx2 = 1728g_cy2 = 3744g_dx = 7760g_dy = 7344g_ex = 784g_ey = 4192g_fx = 6208g_fy = 8176g_gx = 1536g_gy = 816g_hx = 3840g_hy = 1824g_x1 = 7856g_y1 = 11216g_x2 = 8560g_y2 = 11472g_flag1 = nilg_flag2 = nilg_flag3 = nil-- when a player kills another player drop some body parts for the killerfunction Player_OnDeath(killer, victim) if (victim:inventory_find("Object A") >= 1) then if (g_flag1 > 5 ) g_arena:item_create("Object A", 1, g_ax1, g_ay1) Removeobjects(victim) event_destroy(g_eventA) g_eventA = nil else g_arena:item_create("Object A", 1, g_ax2, g_ay2) Removeobjects(victim) event_destroy(g_eventA) g_eventA = nil end end if (victim:inventory_find("Object B") >= 1) then if (g_flag2 > 5 ) g_arena:item_create("Object B", 1, g_bx1, g_by1) Removeobjects(victim) event_destroy(g_eventB) g_eventB = nil else g_arena:item_create("Object B", 1, g_bx2, g_by2) Removeobjects(victim) event_destroy(g_eventB) g_eventB = nil end end if (victim:inventory_find("Object C") >= 1) then if (g_flag3 > 5 ) g_arena:item_create("Object C", 1, g_cx1, g_cy1) Removeobjects(victim) event_destroy(g_eventC) g_eventC = nil else g_arena:item_create("Object C", 1, g_cx2, g_cy2) Removeobjects(victim) event_destroy(g_eventC) g_eventC = nil end end if (victim:inventory_find("Object D") >= 1) then g_arena:item_create("Object D", 1, g_dx, g_dy) Removeobjects(victim) event_destroy(g_eventD) g_eventD = nil end if (victim:inventory_find("Object E") >= 1) then g_arena:item_create("Object E", 1, g_ex, g_ey) Removeobjects(victim) event_destroy(g_eventE) g_eventE = nil end if (victim:inventory_find("Object F") >= 1) then g_arena:item_create("Object F", 1, g_fx, g_fy) Removeobjects(victim) event_destroy(g_eventD) g_eventD = nil end if (victim:inventory_find("Object G") >= 1) then g_arena:item_create("Object G", 1, g_gx, g_gy) Removeobjects(victim) event_destroy(g_eventG) g_eventG = nil end if (victim:inventory_find("Object H") >= 1) then g_arena:item_create("Object H", 1, g_hx, g_hy) Removeobjects(victim) event_destroy(g_eventH) g_eventH = nil end local pos = victim:coords() local randx1 = math.random(0, 50) local randx2 = math.random(0, 50) local xoff = randx1 - randx2 local posX1 = pos.x + xoff local posX2 = pos.x - xoff local randy1 = math.random(0, 50) local randy2 = math.random(0, 50) local yoff = randy1 - randy2 local posY1 = pos.y + yoff local posY2 = pos.y - yoff if (victim:getVehicle():vehicletypeid() == 104) then g_arena:item_create("AC Rounds", 150, posX2, posY2) g_arena:item_create("Hand Grenade", 1, posX1, posY1) g_arena:item_create("Marine Heart", 1, pos.x, pos.y) return true elseif (victim:getVehicle():vehicletypeid() == 100) then g_arena:item_create("Bullets", 150, posX2, posY2) g_arena:item_create("Hand Grenade", 1, posX1, posY1) g_arena:item_create("Marine Heart", 1, pos.x, pos.y) return true elseif (victim:getVehicle():vehicletypeid() == 102) then g_arena:item_create("Bullets", 150, posX2, posY2) g_arena:item_create("Hand Grenade", 1, posX1, posY1) g_arena:item_create("Marine Heart", 1, pos.x, pos.y) return true elseif (victim:getVehicle():vehicletypeid() == 101) then g_arena:item_create("Bullets", 150, posX2, posY2) g_arena:item_create("Hand Grenade", 1, posX1, posY1) g_arena:item_create("Marine Heart", 1, pos.x, pos.y) return true endendfunction FlagEventA(eventA) if (g_personA:valid() == false) then event_destroy(g_eventA) g_eventA = nil return elseif (g_personA:spectator() == true) then if (g_flag1 > 5 ) g_arena:item_create("Object A", 1, g_ax1, g_ay1) g_personA:inventory_modify("Object A", -1000) event_destroy(g_eventA) g_eventA = nil else g_arena:item_create("Object A", 1, g_ax2, g_ay2) g_personA:inventory_modify("Object A", -1000) event_destroy(g_eventA) g_eventA = nil endreturn elseif (g_personA:inventory_find("Object A") == 0) then -- Is the player still alive? (if he dies this item will be removed) event_destroy(g_eventA) g_eventA = nil return end if (g_startTimeA ~= nil) then g_currentDiffA = (os.time() - g_startTimeA) end local coords = g_personA:coords() if ( ((coords.x > g_x1) and (coords.x < g_x2) and (coords.y > g_y1) and (coords.y < g_y2)) == true ) then -- are they in a position to drop the flag? if (g_startTimeA == nil) then g_startTimeA = os.time() g_personA:message("Dropping flag A in 20 seconds") elseif (g_currentDiffA == 5) then g_personA:message("Dropping flag A in 15 seconds") elseif (g_currentDiffA == 10) then g_personA:message("Dropping flag A in 10 seconds") elseif (g_currentDiffA == 15) then g_personA:message("Dropping flag A in 5 seconds") elseif (g_currentDiffA >= 20) then g_personA:message("Flag A Dropped") g_personA:inventory_modify("Object A", -100) g_arena:item_create("Object A Captured", 1, coords.x, coords.y) g_wonA = true event_destroy(g_eventA) g_eventA = nil if ((g_wonB == true) and (g_wonC == true) and (g_wonD == true) and (g_wonE == true) and (g_wonF == true) and (g_wonG == true) and (g_wonH == true)) then g_arena:message("&The Marines have Captured the Objectives! Game Over") g_state:Endgame() end end elseif (g_startTimeA ~= nil) then g_startTimeA = nil g_personA:message("You exited the flag drop area, timer has been reset") endendfunction FlagEventB(eventB) if (g_personB:valid() == false) then event_destroy(g_eventB) g_eventB = nil return elseif (g_personB:spectator() == true) then if (g_flag2 > 5 ) g_arena:item_create("Object B", 1, g_bx1, g_by1) g_personB:inventory_modify("Object B", -1000) event_destroy(g_eventB) g_eventB = nil else g_arena:item_create("Object B", 1, g_bx2, g_by2) g_personB:inventory_modify("Object B", -1000) event_destroy(g_eventB) g_eventB = nil endreturn elseif (g_personB:inventory_find("Object B") == 0) then -- Is the player still alive? (if he dies this item will be removed) event_destroy(g_eventB) g_eventB = nil return end if (g_startTimeB ~= nil) then g_currentDiffB = (os.time() - g_startTimeB) end local coords = g_personB:coords() if ( ((coords.x > g_x1) and (coords.x < g_x2) and (coords.y > g_y1) and (coords.y < g_y2)) == true ) then -- are they in a position to drop the flag? if (g_startTimeB == nil) then g_startTimeB = os.time() g_personB:message("Dropping flag B in 20 seconds") elseif (g_currentDiffB == 5) then g_personB:message("Dropping flag B in 15 seconds") elseif (g_currentDiffB == 10) then g_personB:message("Dropping flag B in 10 seconds") elseif (g_currentDiffB == 15) then g_personB:message("Dropping flag B in 5 seconds") elseif (g_currentDiffB >= 20) then g_personB:message("Flag B Dropped") g_personB:inventory_modify("Object B", -100) g_arena:item_create("Object B Captured", 1, coords.x, coords.y) g_wonB = true event_destroy(g_eventB) g_eventB = nil if ((g_wonA == true) and (g_wonC == true) and (g_wonD == true) and (g_wonE == true) and (g_wonF == true) and (g_wonG == true) and (g_wonH == true)) then g_arena:message("&The Marines have Captured the Objectives! Game Over") g_state:Endgame() end end elseif (g_startTimeB ~= nil) then g_startTimeB = nil g_personB:message("You exited the flag drop area, timer has been reset") endendfunction FlagEventC(eventC) if (g_personC:valid() == false) then event_destroy(g_eventC) g_eventC = nil return elseif (g_personC:spectator() == true) then if (g_flag3 > 5 ) g_arena:item_create("Object C", 1, g_cx1, g_cy1) g_personC:inventory_modify("Object C", -1000) event_destroy(g_eventC) g_eventC = nil else g_arena:item_create("Object C", 1, g_cx2, g_cy2) g_personC:inventory_modify("Object C", -1000) event_destroy(g_eventC) g_eventC = nil endreturn elseif (g_personC:inventory_find("Object C") == 0) then -- Is the player still alive? (if he dies this item will be removed) event_destroy(g_eventC) g_eventC = nil return end if (g_startTimeC ~= nil) then g_currentDiffC = (os.time() - g_startTimeC) end local coords = g_personC:coords() if ( ((coords.x > g_x1) and (coords.x < g_x2) and (coords.y > g_y1) and (coords.y < g_y2)) == true ) then -- are they in a position to drop the flag? if (g_startTimeC == nil) then g_startTimeC = os.time() g_personC:message("Dropping flag C in 20 seconds") elseif (g_currentDiffC == 5) then g_personC:message("Dropping flag C in 15 seconds") elseif (g_currentDiffC == 10) then g_personC:message("Dropping flag C in 10 seconds") elseif (g_currentDiffC == 15) then g_personC:message("Dropping flag C in 5 seconds") elseif (g_currentDiffC >= 20) then g_personC:message("Flag C Dropped") g_personC:inventory_modify("Object C", -100) g_arena:item_create("Object C Captured", 1, coords.x, coords.y) g_wonC = true event_destroy(g_eventC) g_eventC = nil if ((g_wonA == true) and (g_wonB == true) and (g_wonD == true) and (g_wonE == true) and (g_wonF == true) and (g_wonG == true) and (g_wonH == true)) then g_arena:message("&The Marines have Captured the Objectives! Game Over") g_state:Endgame() end end elseif (g_startTimeC ~= nil) then g_startTimeC = nil g_personC:message("You exited the flag drop area, timer has been reset") endendfunction FlagEventD(eventD) if (g_personD:valid() == false) then event_destroy(g_eventD) g_eventD = nil return elseif (g_personD:spectator() == true) then g_arena:item_create("Object D", 1, g_dx, g_dy) g_personD:inventory_modify("Object D", -1000) event_destroy(g_eventD) g_eventD = nilreturn elseif (g_personD:inventory_find("Object D") == 0) then event_destroy(g_eventD) g_eventD = nil return end if (g_startTimeD ~= nil) then g_currentDiffD = (os.time() - g_startTimeD) end local coords = g_personD:coords() if ( ((coords.x > g_x1) and (coords.x < g_x2) and (coords.y > g_y1) and (coords.y < g_y2)) == true ) then -- are they in a position to drop the flag? if (g_startTimeD == nil) then g_startTimeD = os.time() g_personD:message("Dropping flag D in 20 seconds") elseif (g_currentDiffD == 5) then g_personD:message("Dropping flag D in 15 seconds") elseif (g_currentDiffD == 10) then g_personD:message("Dropping flag D in 10 seconds") elseif (g_currentDiffD == 15) then g_personD:message("Dropping flag D in 5 seconds") elseif (g_currentDiffD >= 20) then g_personD:message("Flag D Dropped") g_personD:inventory_modify("Object D", -100) g_arena:item_create("Object D Captured", 1, coords.x, coords.y) g_wonD = true event_destroy(g_eventD) g_eventD = nil if ((g_wonA == true) and (g_wonB == true) and (g_wonC == true) and (g_wonE == true) and (g_wonF == true) and (g_wonG == true) and (g_wonH == true)) then g_arena:message("&The Marines have Captured the Objectives! Game Over") g_state:Endgame() end end elseif (g_startTimeD ~= nil) then g_startTimeD = nil g_personD:message("You exited the flag drop area, timer has been reset") endendfunction FlagEventE(eventE) if (g_personE:valid() == false) then event_destroy(g_eventE) g_eventE = nil return elseif (g_personE:spectator() == true) then g_arena:item_create("Object E", 1, g_ex, g_ey) g_personE:inventory_modify("Object E", -1000) event_destroy(g_eventE) g_eventE = nilreturn elseif (g_personE:inventory_find("Object E") == 0) then event_destroy(g_eventE) g_eventE = nil return end if (g_startTimeE ~= nil) then g_currentEiffE = (os.time() - g_startTimeE) end local coords = g_personE:coords() if ( ((coords.x > g_x1) and (coords.x < g_x2) and (coords.y > g_y1) and (coords.y < g_y2)) == true ) then -- are they in a position to drop the flag? if (g_startTimeE == nil) then g_startTimeE = os.time() g_personE:message("Dropping flag E in 20 seconds") elseif (g_currentEiffE == 5) then g_personE:message("Dropping flag E in 15 seconds") elseif (g_currentEiffE == 10) then g_personE:message("Dropping flag E in 10 seconds") elseif (g_currentEiffE == 15) then g_personE:message("Dropping flag E in 5 seconds") elseif (g_currentEiffE >= 20) then g_personE:message("Flag E Dropped") g_personE:inventory_modify("Object E", -100) g_arena:item_create("Object E Captured", 1, coords.x, coords.y) g_wonE = true event_destroy(g_eventE) g_eventE = nil if ((g_wonA == true) and (g_wonB == true) and (g_wonC == true) and (g_wonD == true) and (g_wonF == true) and (g_wonG == true) and (g_wonH == true)) then g_arena:message("&The Marines have Captured the Objectives! Game Over") g_state:Endgame() end end elseif (g_startTimeE ~= nil) then g_startTimeE = nil g_personE:message("You exited the flag drop area, timer has been reset") endendfunction FlagEventF(eventF) if (g_personF:valid() == false) then event_destroy(g_eventF) g_eventF = nil return elseif (g_personF:spectator() == true) then g_arena:item_create("Object F", 1, g_fx, g_fy) g_personF:inventory_modify("Object F", -1000) event_destroy(g_eventF) g_eventF = nilreturn elseif (g_personF:inventory_find("Object F") == 0) then event_destroy(g_eventF) g_eventF = nil return end if (g_startTimeF ~= nil) then g_currentFiffF = (os.time() - g_startTimeF) end local coords = g_personF:coords() if ( ((coords.x > g_x1) and (coords.x < g_x2) and (coords.y > g_y1) and (coords.y < g_y2)) == true ) then -- are they in a position to drop the flag? if (g_startTimeF == nil) then g_startTimeF = os.time() g_personF:message("Dropping flag F in 20 seconds") elseif (g_currentFiffF == 5) then g_personF:message("Dropping flag F in 15 seconds") elseif (g_currentFiffF == 10) then g_personF:message("Dropping flag F in 10 seconds") elseif (g_currentFiffF == 15) then g_personF:message("Dropping flag F in 5 seconds") elseif (g_currentFiffF >= 20) then g_personF:message("Flag F Dropped") g_personF:inventory_modify("Object F", -100) g_arena:item_create("Object F Captured", 1, coords.x, coords.y) g_wonF = true event_destroy(g_eventF) g_eventF = nil if ((g_wonA == true) and (g_wonB == true) and (g_wonC == true) and (g_wonD == true) and (g_wonE == true) and (g_wonG == true) and (g_wonH == true)) then g_arena:message("&The Marines have Captured the Objectives! Game Over") g_state:Endgame() end end elseif (g_startTimeF ~= nil) then g_startTimeF = nil g_personF:message("You exited the flag drop area, timer has been reset") endendfunction FlagEventG(eventG) if (g_personG:valid() == false) then event_destroy(g_eventG) g_eventG = nil return elseif (g_personG:spectator() == true) then g_arena:item_create("Object G", 1, g_gx, g_gy) g_personG:inventory_modify("Object G", -1000) event_destroy(g_eventG) g_eventG = nilreturn elseif (g_personG:inventory_find("Object G") == 0) then event_destroy(g_eventG) g_eventG = nil return end if (g_startTimeG ~= nil) then g_currentGiffG = (os.time() - g_startTimeG) end local coords = g_personG:coords() if ( ((coords.x > g_x1) and (coords.x < g_x2) and (coords.y > g_y1) and (coords.y < g_y2)) == true ) then -- are they in a position to drop the flag? if (g_startTimeG == nil) then g_startTimeG = os.time() g_personG:message("Dropping flag G in 20 seconds") elseif (g_currentGiffG == 5) then g_personG:message("Dropping flag G in 15 seconds") elseif (g_currentGiffG == 10) then g_personG:message("Dropping flag G in 10 seconds") elseif (g_currentGiffG == 15) then g_personG:message("Dropping flag G in 5 seconds") elseif (g_currentGiffG >= 20) then g_personG:message("Flag G Dropped") g_personG:inventory_modify("Object G", -100) g_arena:item_create("Object G Captured", 1, coords.x, coords.y) g_wonG = true event_destroy(g_eventG) g_eventG = nil if ((g_wonA == true) and (g_wonB == true) and (g_wonC == true) and (g_wonD == true) and (g_wonE == true) and (g_wonF == true) and (g_wonH == true)) then g_arena:message("&The Marines have Captured the Objectives! Game Over") g_state:Endgame() end end elseif (g_startTimeG ~= nil) then g_startTimeG = nil g_personG:message("You exited the flag drop area, timer has been reset") endendfunction FlagEventH(eventH) if (g_personH:valid() == false) then event_destroy(g_eventH) g_eventH = nil return elseif (g_personH:spectator() == true) then g_arena:item_create("Object H", 1, g_hx, g_hy) g_personH:inventory_modify("Object H", -1000) event_destroy(g_eventH) g_eventH = nilreturn elseif (g_personH:inventory_find("Object H") == 0) then event_destroy(g_eventH) g_eventH = nil return end if (g_startTimeH ~= nil) then g_currentHiffH = (os.time() - g_startTimeH) end local coords = g_personH:coords() if ( ((coords.x > g_x1) and (coords.x < g_x2) and (coords.y > g_y1) and (coords.y < g_y2)) == true ) then -- are they in a position to drop the flag? if (g_startTimeH == nil) then g_startTimeH = os.time() g_personH:message("Dropping flag H in 20 seconds") elseif (g_currentHiffH == 5) then g_personH:message("Dropping flag H in 15 seconds") elseif (g_currentHiffH == 10) then g_personH:message("Dropping flag H in 10 seconds") elseif (g_currentHiffH == 15) then g_personH:message("Dropping flag H in 5 seconds") elseif (g_currentHiffH >= 20) then g_personH:message("Flag H Dropped") g_personH:inventory_modify("Object H", -100) g_arena:item_create("Object H Captured", 1, coords.x, coords.y) g_wonH = true event_destroy(g_eventH) g_eventH = nil if ((g_wonA == true) and (g_wonB == true) and (g_wonC == true) and (g_wonD == true) and (g_wonE == true) and (g_wonF == true) and (g_wonG == true)) then g_arena:message("&The Marines have Captured the Objectives! Game Over") g_state:Endgame() end end elseif (g_startTimeH ~= nil) then g_startTimeH = nil g_personH:message("You exited the flag drop area, timer has been reset") endendfunction Item_OnPickUp(looter, loot, loot_type, amounttopickup) if (loot_type.m_name == "Object A") then if (looter:getVehicle():vehicletypeid() >= 200) then looter:message("You can't eat the science objects!") return false elseif (looter:getVehicle():vehicletypeid() ~= 101) then looter:message("Only the Sergeant may capture the Science objects!") return false elseif (looter:getVehicle():vehicletypeid() == 101) then g_personA = looter g_startTimeA = nil if (g_eventA == nil) then g_eventA = event_create(FlagEventA, -1000, g_arena) end return true else return false end elseif (loot_type.m_name == "Object A Captured") then looter:message("This objective has already been captured!") return false elseif (loot_type.m_name == "Object B") then if (looter:getVehicle():vehicletypeid() >= 200) then looter:message("You can't eat the science objects!") return false elseif (looter:getVehicle():vehicletypeid() ~= 101) then looter:message("Only the Sergeant may capture the Science objects!") return false elseif (looter:getVehicle():vehicletypeid() == 101) then g_personB = looter g_startTimeB = nil if (g_eventB == nil) then g_eventB = event_create(FlagEventB, -1000, g_arena) end return true else return false end elseif (loot_type.m_name == "Object B Captured") then looter:message("This objective has already been captured!") return false elseif (loot_type.m_name == "Object C") then if (looter:getVehicle():vehicletypeid() >= 200) then looter:message("You can't eat the science objects!") return false elseif (looter:getVehicle():vehicletypeid() ~= 101) then looter:message("Only the Sergeant may capture the Science objects!") return false elseif (looter:getVehicle():vehicletypeid() == 101) then g_personC = looter g_startTimeC = nil if (g_eventC == nil) then g_eventC = event_create(FlagEventC, -1000, g_arena) end return true else return false end elseif (loot_type.m_name == "Object C Captured") then looter:message("This objective has already been captured!") return false elseif (loot_type.m_name == "Object D") then if (looter:getVehicle():vehicletypeid() >= 200) then looter:message("You can't eat the science objects!") return false elseif (looter:getVehicle():vehicletypeid() ~= 101) then looter:message("Only the Sergeant may capture the Science objects!") return false elseif (looter:getVehicle():vehicletypeid() == 101) then g_personD = looter g_startTimeD = nil if (g_eventD == nil) then g_eventD = event_create(FlagEventD, -1000, g_arena) end return true else return false end elseif (loot_type.m_name == "Object D Captured") then looter:message("This objective has already been captured!") return false elseif (loot_type.m_name == "Object E") then if (looter:getVehicle():vehicletypeid() >= 200) then looter:message("You can't eat the science objects!") return false elseif (looter:getVehicle():vehicletypeid() ~= 101) then looter:message("Only the Sergeant may capture the Science objects!") return false elseif (looter:getVehicle():vehicletypeid() == 101) then g_personE = looter g_startTimeE = nil if (g_eventE == nil) then g_eventE = event_create(FlagEventE, -1000, g_arena) end return true else return false end elseif (loot_type.m_name == "Object E Captured") then looter:message("This objective has already been captured!") return false elseif (loot_type.m_name == "Object F") then if (looter:getVehicle():vehicletypeid() >= 200) then looter:message("You can't eat the science objects!") return false elseif (looter:getVehicle():vehicletypeid() ~= 101) then looter:message("Only the Sergeant may capture the Science objects!") return false elseif (looter:getVehicle():vehicletypeid() == 101) then g_personF = looter g_startTimeF = nil if (g_eventF == nil) then g_eventF = event_create(FlagEventF, -1000, g_arena) end return true else return false end elseif (loot_type.m_name == "Object F Captured") then looter:message("This objective has already been captured!") return false elseif (loot_type.m_name == "Object G") then if (looter:getVehicle():vehicletypeid() >= 200) then looter:message("You can't eat the science objects!") return false elseif (looter:getVehicle():vehicletypeid() ~= 101) then looter:message("Only the Sergeant may capture the Science objects!") return false elseif (looter:getVehicle():vehicletypeid() == 101) then g_personG = looter g_startTimeG = nil if (g_eventG == nil) then g_eventG = event_create(FlagEventG, -1000, g_arena) end return true else return false end elseif (loot_type.m_name == "Object G Captured") then looter:message("This objective has already been captured!") return false elseif (loot_type.m_name == "Object H") then if (looter:getVehicle():vehicletypeid() >= 200) then looter:message("You can't eat the science objects!") return false elseif (looter:getVehicle():vehicletypeid() ~= 101) then looter:message("Only the Sergeant may capture the Science objects!") return false elseif (looter:getVehicle():vehicletypeid() == 101) then g_personH = looter g_startTimeH = nil if (g_eventH == nil) then g_eventH = event_create(FlagEventH, -1000, g_arena) end return true else return false end elseif (loot_type.m_name == "Object H Captured") then looter:message("This objective has already been captured!") return false end return trueend-- when a player enters the zone, it gives them this messagefunction Player_OnJoin(player) player:message("&Welcome to Bug Hunt 2 : Escape from Relay Hub:128") WipePlayerStats(player) Removeobjects(player)end-- when the game starts, it sets gameRunning to truefunction Arena_OnGameStart() g_flag1 = math.random(1, 10) g_flag2 = math.random(1, 10) g_flag3 = math.random(1, 10) if (g_flag1 > 5 ) g_arena:item_create("Object A", 1, g_ax1, g_ay1) else g_arena:item_create("Object A", 1, g_ax2, g_ay2) end if (g_flag2 > 5 ) g_arena:item_create("Object B", 1, g_bx1, g_by1) else g_arena:item_create("Object B", 1, g_bx2, g_by2) end if (g_flag3 > 5 ) g_arena:item_create("Object C", 1, g_cx1, g_cy1) else g_arena:item_create("Object C", 1, g_cx2, g_cy2) end g_arena:item_create("Object D", 1, g_dx, g_dy) g_arena:item_create("Object E", 1, g_ex, g_ey) g_arena:item_create("Object F", 1, g_fx, g_fy) g_arena:item_create("Object G", 1, g_gx, g_gy) g_arena:item_create("Object H", 1, g_hx, g_hy) g_startTime = os.time() g_bGameRunning = true g_gameTime = os.time() for x = 1, g_arena:num() do local player = g_arena:get(x) Removeobjects(player) end --- Lets clear all the crap for the next game --- g_wonA = false g_wonB = false g_wonC = false g_wonD = false g_wonE = false g_wonF = false g_wonG = false g_wonH = falseend-- when the game finishes, it sets gameRunning to falsefunction Arena_OnGameEnd() event_flush(g_arena) g_eventA = nil g_eventB = nil g_eventC = nil g_eventD = nil g_eventE = nil g_eventF = nil g_eventG = nil g_eventH = nil g_bGameRunning = false if ((g_wonA == false) or (g_wonB == false) or (g_wonC == false) or (g_wonD == false) or (g_wonE == false) or (g_wonF == false) or (g_wonG == false) or (g_wonH == false)) then g_arena:message("Skrall are Victorious!") endendfunction Arena_TickerUpdate() -- Set some locals if g_startTime ~= nil then local currentTime = (900 - (os.time() - g_startTime)) if (currentTime == 0) then g_state:Endgame() end -- Show the timer g_state:SetNotice(0, "Game Time = " .. currentTime .. "") endendfunction Removeobjects(player) player:inventory_modify("Object A", -1000) player:inventory_modify("Object B", -1000) player:inventory_modify("Object C", -1000) player:inventory_modify("Object D", -1000) player:inventory_modify("Object E", -1000) player:inventory_modify("Object F", -1000) player:inventory_modify("Object G", -1000) player:inventory_modify("Object H", -1000)end