cod5-sdk/raw/maps/nazi_zombie_sumpf.gsc
2009-04-10 00:00:00 +00:00

381 lines
9.6 KiB
Text

#include common_scripts\utility;
#include maps\_utility;
main()
{
// enable for dog rounds
level.dogs_enabled = true;
level thread maps\_callbacksetup::SetupCallbacks();
include_weapons();
include_powerups();
maps\nazi_zombie_sumpf_fx::main();
maps\_zombiemode::main();
// JMA - setting flags for treasure chest
/*
flag_init("magic_box_south");
flag_init("south_access_1");
flag_init("north_door1");
flag_init("north_upstairs_blocker");
flag_init("south_upstairs_blocker");
*/
init_sounds();
// If you want to modify/add to the weapons table, please copy over the _zombiemode_weapons init_weapons() and paste it here.
// I recommend putting it in it's own function...
// If not a MOD, you may need to provide new localized strings to reflect the proper cost.
randomize_vending_machines();
activate_zones();
level thread magic_box_limit_location_init();
}
activate_zones()
{
//managed zones are areas in the map that have associated spawners/goals that are turned on/off
//depending on where the players are in the map
volume_entity = getent("center_spawners","targetname");
volume_entity thread manage_zone();
}
init_sounds()
{
maps\_zombiemode_utility::add_sound( "break_stone", "break_stone" );
}
// Include the weapons that are only inr your level so that the cost/hints are accurate
// Also adds these weapons to the random treasure chest.
include_weapons()
{
// Pistols
//include_weapon( "colt" );
//include_weapon( "colt_dirty_harry" );
//include_weapon( "walther" );
include_weapon( "sw_357" );
// Semi Auto
include_weapon( "m1carbine" );
include_weapon( "m1garand" );
include_weapon( "gewehr43" );
// Full Auto
include_weapon( "stg44" );
include_weapon( "thompson" );
include_weapon( "mp40" );
// Bolt Action
include_weapon( "kar98k" );
include_weapon( "springfield" );
// Scoped
include_weapon( "ptrs41_zombie" );
include_weapon( "kar98k_scoped_zombie" );
// Grenade
include_weapon( "molotov" );
// JESSE: lets go all german grenades for consistency and to reduce annoyance factor
// include_weapon( "fraggrenade" );
include_weapon( "stielhandgranate" );
// Grenade Launcher
include_weapon( "m1garand_gl" );
include_weapon( "m7_launcher" );
// Flamethrower
include_weapon( "m2_flamethrower_zombie" );
// Shotgun
include_weapon( "doublebarrel" );
include_weapon( "doublebarrel_sawed_grip" );
include_weapon( "shotgun" );
// Bipod
include_weapon( "fg42_bipod" );
include_weapon( "mg42_bipod" );
include_weapon( "30cal_bipod" );
// Heavy MG
include_weapon( "bar" );
// Rocket Launcher
include_weapon( "panzerschrek" );
// Special
include_weapon( "ray_gun" );
}
include_powerups()
{
include_powerup( "nuke" );
include_powerup( "insta_kill" );
include_powerup( "double_points" );
include_powerup( "full_ammo" );
}
include_weapon( weapon_name )
{
maps\_zombiemode_weapons::include_zombie_weapon( weapon_name );
}
include_powerup( powerup_name )
{
maps\_zombiemode_powerups::include_zombie_powerup( powerup_name );
}
/*------------------------------------
have a info_volume target spawners
to turn them on/off - probably the best way to handle this
TODO: switch over the previous script_string stuff in the other function
------------------------------------*/
manage_zone()
{
spawners = undefined;
// JMA - here we separate the dog spawn points from the zombie spawn points
/* JMA - Dogs not implemented yet
dog_spawners = [];
*/
// JMA - if the zone is pointing to specific spawners
if(isDefined(self.target))
{
spawners = getentarray(self.target,"targetname");
/* JMA - Dogs not implemented yet
for (i = 0; i < spawners.size; i++)
{
if ( issubstr(spawners[i].classname, "dog") )
{
dog_spawners = array_add( dog_spawners, spawners[i] );
spawners = array_remove( spawners, spawners[i] );
}
}
*/
}
// JMA - here we gather all the barriers
//goals = getstructarray(self.targetname + "_goal","script_string"); // put all barriers into goals array
goals = getstructarray("exterior_goal","targetname");
while(1)
{
//test to see if any players are in the volume
zone_active = false;
players = get_players();
for(i=0;i<players.size;i++)
{
if(players[i] istouching(self))
{
zone_active = true;
}
}
//players are in the volume, activate any associated spawners
if( zone_active )
{
if(isDefined(spawners))
{
for(x=0;x<spawners.size;x++)
{
//make sure that there are no duplicate spawners
no_dupes = array_check_for_dupes( level.enemy_spawns, spawners[x] );
if(no_dupes)
{
if( (!isDefined(spawners[x].locked_spawner)) || ( isDefined(spawners[x].locked_spawner && !spawners[x].locked_spawner)) )
{
level.enemy_spawns = add_to_array(level.enemy_spawns,spawners[x]);
}
}
}
// do check again for dogs
/* JMA - dogs not implemented yet
for(x=0;x<dog_spawners.size;x++)
{
//make sure that there are no duplicate spawners
no_dupes = array_check_for_dupes( level.enemy_dog_spawns, dog_spawners[x] );
if(no_dupes)
{
if( (!isDefined(dog_spawners[x].locked_spawner)) || ( isDefined(dog_spawners[x].locked_spawner && !dog_spawners[x].locked_spawner)) )
{
level.enemy_dog_spawns = add_to_array(level.enemy_dog_spawns, dog_spawners[x]);
}
}
}
*/
}
//activate the associated goals
for(x=0;x<goals.size;x++)
{
goals[x].is_active = 1;
goals[x] thread trigger_on();
}
}
//players are not in the volume, so disable the spawners
else
{
if(isDefined(spawners))
{
for(x=0;x<spawners.size;x++)
{
if(isDefined(spawners[x].script_string) && spawners[x].script_string == self.targetname)
{
// JMA - we disable this for now until we figure out the logic
//level.enemy_spawns = array_remove_nokeys(level.enemy_spawns, spawners[x]);
}
}
// check again for dogs
/* JMA - dogs not implemented yet
for(x=0;x<dog_spawners.size;x++)
{
if(isDefined(dog_spawners[x].script_string) && dog_spawners[x].script_string == self.targetname)
{
level.enemy_dog_spawns = array_remove_nokeys(level.enemy_dog_spawns, dog_spawners[x]);
}
}
*/
}
//disable the associated goals
for(x=0;x<goals.size;x++)
{
goals[x].is_active = undefined;
goals[x] thread trigger_off();
}
}
//wait a second before another check
wait(1);
}
}
randomize_vending_machines()
{
// grab all the vending machines
vending_machines = [];
vending_machines = getentarray("zombie_vending","targetname");
// grab all vending machine start locations
start_locations = [];
start_locations[0] = getent("random_vending_start_location_0", "script_noteworthy");
start_locations[1] = getent("random_vending_start_location_1", "script_noteworthy");
start_locations[2] = getent("random_vending_start_location_2", "script_noteworthy");
start_locations[3] = getent("random_vending_start_location_3", "script_noteworthy");
start_locations = array_randomize(start_locations);
for(i=0;i<vending_machines.size;i++)
{
vending_parts = [];
vending_parts = vending_machines[i] get_vending_machine_pieces();
for(j=0; j< vending_parts.size; j++)
{
vending_parts[j].origin = start_locations[i].origin;
vending_parts[j].angles = start_locations[i].angles;
if(vending_parts[j].classname == "trigger_use")
{
vending_parts[j] trigger_on();
}
}
}
activate_vending_machines();
}
activate_vending_machines()
{
//activate perks-a-cola
level notify( "master_switch_activated" );
level notify( "specialty_armorvest_power_on" );
level notify( "specialty_rof_power_on" );
level notify( "specialty_quickrevive_power_on" );
level notify( "specialty_fastreload_power_on" );
clientnotify("revive_on");
clientnotify("middle_door_open");
clientnotify("fast_reload_on");
clientnotify("doubletap_on");
clientnotify("jugger_on");
}
get_vending_machine_pieces()
{
// self = trigger
machine = GetEnt(self.target, "targetname");
pieces = [];
pieces[pieces.size] = self;
pieces[pieces.size] = machine;
return pieces;
}
magic_box_limit_location_init()
{
level.open_chest_location = [];
level.open_chest_location[0] = "start_chest";
level.open_chest_location[1] = "magic_box_1";
level.open_chest_location[2] = "magic_box_2";
level.open_chest_location[3] = undefined; //"magic_box_3";
level.open_chest_location[4] = undefined; //"magic_box_4";
// JMA - wait until we get doors that unlock these available locations
/*
level thread waitfor_flag_open_chest_location("magic_box_1");
level thread waitfor_flag_open_chest_location("magic_box_2");
level thread waitfor_flag_open_chest_location("magic_box_3");
level thread waitfor_flag_open_chest_location("magic_box_4");
*/
}
waitfor_flag_open_chest_location(which)
{
wait(3);
switch(which)
{
case "magic_box_1":
flag_wait("magic_box_1");
level.open_chest_location[1] = "magic_box_1";
break;
case "magic_box_2":
flag_wait("magic_box_2");
level.open_chest_location[2] = "magic_box_2";
break;
case "magic_box_3":
flag_wait("magic_box_3");
level.open_chest_location[3] = "magic_box_3";
break;
case "magic_box_4":
flag_wait("magic_box_4");
level.open_chest_location[4] = "magic_box_4";
break;
default:
return;
}
}