2014-11-30 06:17:28 +00:00
|
|
|
-- ff_openfire.lua
|
|
|
|
-- based on aardvark 15/09/07
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
-- includes
|
|
|
|
-----------------------------------------------------------------------------
|
2014-12-02 00:49:42 +00:00
|
|
|
IncludeScript("base_shutdown");
|
2014-11-30 06:17:28 +00:00
|
|
|
IncludeScript("base_location");
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
-- global overrides
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
POINTS_PER_CAPTURE = 10;
|
|
|
|
FLAG_RETURN_TIME = 60;
|
2014-12-02 00:49:42 +00:00
|
|
|
SECURITY_LENGTH = 30;
|
2014-11-30 06:17:28 +00:00
|
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
-- unique openfire locations
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
location_redspawn = location_info:new({ text = "Respawn", team = Team.kRed })
|
|
|
|
location_redsec = location_info:new({ text = "Fire Control", team = Team.kRed })
|
|
|
|
location_redfr = location_info:new({ text = "Flag Room", team = Team.kRed })
|
|
|
|
location_redwater = location_info:new({ text = "Perilous Passage", team = Team.kRed })
|
|
|
|
location_redfrontdoor = location_info:new({ text = "Front Door Corridor", team = Team.kRed })
|
|
|
|
location_redbalcony = location_info:new({ text = "Balcony", team = Team.kRed })
|
|
|
|
|
|
|
|
location_bluespawn = location_info:new({ text = "Respawn", team = Team.kBlue })
|
|
|
|
location_bluesec = location_info:new({ text = "Fire Control", team = Team.kBlue })
|
|
|
|
location_bluefr = location_info:new({ text = "Flag Room", team = Team.kBlue })
|
|
|
|
location_bluewater = location_info:new({ text = "Perilous Passage", team = Team.kBlue })
|
|
|
|
location_bluefrontdoor = location_info:new({ text = "Front Door Corridor", team = Team.kBlue })
|
|
|
|
location_bluebalcony = location_info:new({ text = "Balcony", team = Team.kBlue })
|
|
|
|
|
|
|
|
location_midmap = location_info:new({ text = "Outside", team = NO_TEAM })
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
-- bagless resupply
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
aardvarkresup = trigger_ff_script:new({ team = Team.kUnassigned })
|
|
|
|
|
|
|
|
function aardvarkresup:ontouch( touch_entity )
|
|
|
|
if IsPlayer( touch_entity ) then
|
|
|
|
local player = CastToPlayer( touch_entity )
|
|
|
|
if player:GetTeamId() == self.team then
|
|
|
|
player:AddHealth( 400 )
|
|
|
|
player:AddArmor( 400 )
|
|
|
|
player:AddAmmo( Ammo.kNails, 400 )
|
|
|
|
player:AddAmmo( Ammo.kShells, 400 )
|
|
|
|
player:AddAmmo( Ammo.kRockets, 400 )
|
|
|
|
player:AddAmmo( Ammo.kCells, 400 )
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
blue_aardvarkresup = aardvarkresup:new({ team = Team.kBlue })
|
|
|
|
red_aardvarkresup = aardvarkresup:new({ team = Team.kRed })
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
2014-12-02 01:05:40 +00:00
|
|
|
-- security
|
2014-11-30 06:17:28 +00:00
|
|
|
-----------------------------------------------------------------------------
|
2014-12-02 00:49:42 +00:00
|
|
|
red_aardvarksec = red_security_trigger:new()
|
|
|
|
blue_aardvarksec = blue_security_trigger:new()
|
2014-11-30 06:17:28 +00:00
|
|
|
|
2014-12-02 02:37:55 +00:00
|
|
|
-- utility function for getting the name of the opposite team,
|
|
|
|
-- where team is a string, like "red"
|
|
|
|
local function get_opposite_team(team)
|
|
|
|
if team == "red" then return "blue" else return "red" end
|
|
|
|
end
|
|
|
|
|
|
|
|
local security_off_base = security_off
|
2014-12-02 00:49:42 +00:00
|
|
|
function security_off( team )
|
|
|
|
security_off_base( team )
|
2014-11-30 06:17:28 +00:00
|
|
|
|
2014-12-02 00:49:42 +00:00
|
|
|
OpenDoor(team.."_aardvarkdoorhack")
|
2014-12-02 02:37:55 +00:00
|
|
|
local opposite_team = get_opposite_team(team)
|
2014-12-02 00:49:42 +00:00
|
|
|
OutputEvent("sec_"..opposite_team.."_slayer", "Disable")
|
2014-11-30 06:17:28 +00:00
|
|
|
|
2014-12-02 01:05:40 +00:00
|
|
|
AddSchedule("secup10"..team, SECURITY_LENGTH - 10, function()
|
2014-12-02 00:49:42 +00:00
|
|
|
BroadCastMessage("#FF_"..team:upper().."_SEC_10")
|
|
|
|
end)
|
2014-11-30 06:17:28 +00:00
|
|
|
end
|
|
|
|
|
2014-12-02 02:37:55 +00:00
|
|
|
local security_on_base = security_on
|
2014-12-02 00:49:42 +00:00
|
|
|
function security_on( team )
|
|
|
|
security_on_base( team )
|
2014-11-30 06:17:28 +00:00
|
|
|
|
2014-12-02 00:49:42 +00:00
|
|
|
CloseDoor(team.."_aardvarkdoorhack")
|
2014-12-02 02:37:55 +00:00
|
|
|
local opposite_team = get_opposite_team(team)
|
2014-12-02 00:49:42 +00:00
|
|
|
OutputEvent("sec_"..opposite_team.."_slayer", "Enable")
|
2014-11-30 06:17:28 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
2014-12-02 01:05:40 +00:00
|
|
|
-- lasers and respawn shields
|
2014-11-30 06:17:28 +00:00
|
|
|
-----------------------------------------------------------------------------
|
2014-12-02 00:49:42 +00:00
|
|
|
blue_slayer = not_red_trigger:new()
|
|
|
|
red_slayer = not_blue_trigger:new()
|
|
|
|
sec_blue_slayer = not_red_trigger:new()
|
|
|
|
sec_red_slayer = not_blue_trigger:new()
|
2014-11-30 06:17:28 +00:00
|
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
-- custom openfire pack
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
aardvarkpack = genericbackpack:new({
|
|
|
|
health = 50,
|
|
|
|
armor = 50,
|
|
|
|
grenades = 400,
|
|
|
|
nails = 400,
|
|
|
|
shells = 400,
|
|
|
|
rockets = 400,
|
|
|
|
cells = 130,
|
|
|
|
respawntime = 8,
|
|
|
|
model = "models/items/backpack/backpack.mdl",
|
|
|
|
materializesound = "Item.Materialize",
|
|
|
|
touchsound = "Backpack.Touch",
|
|
|
|
botgoaltype = Bot.kBackPack_Ammo
|
|
|
|
})
|
|
|
|
|
|
|
|
function aardvarkpack:dropatspawn() return false end
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
-- backpack entity setup (modified for aardvarkpack)
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
function build_backpacks(tf)
|
|
|
|
return healthkit:new({touchflags = tf}),
|
|
|
|
armorkit:new({touchflags = tf}),
|
|
|
|
ammobackpack:new({touchflags = tf}),
|
|
|
|
bigpack:new({touchflags = tf}),
|
|
|
|
grenadebackpack:new({touchflags = tf}),
|
|
|
|
aardvarkpack:new({touchflags = tf})
|
|
|
|
end
|
|
|
|
|
|
|
|
blue_healthkit, blue_armorkit, blue_ammobackpack, blue_bigpack, blue_grenadebackpack, blue_aardvarkpack = build_backpacks({AllowFlags.kOnlyPlayers,AllowFlags.kBlue})
|
|
|
|
red_healthkit, red_armorkit, red_ammobackpack, red_bigpack ,red_grenadebackpack, red_aardvarkpack = build_backpacks({AllowFlags.kOnlyPlayers,AllowFlags.kRed})
|
|
|
|
yellow_healthkit, yellow_armorkit, yellow_ammobackpack, yellow_bigpack, yellow_grenadebackpack, yellow_aardvarkpack = build_backpacks({AllowFlags.kOnlyPlayers,AllowFlags.kYellow})
|
|
|
|
green_healthkit, green_armorkit, green_ammobackpack, green_bigpack, green_grenadebackpack, green_aardvarkpack = build_backpacks({AllowFlags.kOnlyPlayers,AllowFlags.kGreen})
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
-- SPAWNS
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
red_o_only = function(self,player) return ((player:GetTeamId() == Team.kRed) and ((player:GetClass() == Player.kScout) or (player:GetClass() == Player.kMedic) or (player:GetClass() == Player.kSpy) or (player:GetClass() == Player.kSniper))) end
|
|
|
|
red_d_only = function(self,player) return ((player:GetTeamId() == Team.kRed) and (((player:GetClass() == Player.kScout) == false) and ((player:GetClass() == Player.kMedic) == false) and ((player:GetClass() == Player.kSpy) == false) and ((player:GetClass() == Player.kSniper) == false))) end
|
|
|
|
|
|
|
|
redspawn_balc = { validspawn = red_o_only }
|
|
|
|
redspawn_fr = { validspawn = red_d_only }
|
|
|
|
|
|
|
|
blue_o_only = function(self,player) return ((player:GetTeamId() == Team.kBlue) and ((player:GetClass() == Player.kScout) or (player:GetClass() == Player.kMedic) or (player:GetClass() == Player.kSpy) or (player:GetClass() == Player.kSniper))) end
|
|
|
|
blue_d_only = function(self,player) return ((player:GetTeamId() == Team.kBlue) and (((player:GetClass() == Player.kScout) == false) and ((player:GetClass() == Player.kMedic) == false) and ((player:GetClass() == Player.kSpy) == false) and ((player:GetClass() == Player.kSniper) == false))) end
|
|
|
|
|
|
|
|
bluespawn_balc = { validspawn = blue_o_only }
|
|
|
|
bluespawn_fr = { validspawn = blue_d_only }
|