Post: Decompressing Black Ops FF Files
03-19-2011, 04:55 PM #1
Hawkin
Lord of the Undead
(adsbygoogle = window.adsbygoogle || []).push({}); I haven't been keeping up with Black Oops hacking as much as I'd like to lately. So this questions may of been answered, but I couldn't find it.

Has anyone successfully decompressed the black ops .ff files. More importantly the Zombies .ff files. I want to look at the gsc coding to find the box logic. To find out what factors contribute to getting the more rare guns. Plus I'd like to get a look at the code structure of Black Ops, for future patches. I'm good with the c++ but decryption not so much. If its possible let me know and a link would be cool. Thanks.
(adsbygoogle = window.adsbygoogle || []).push({});
03-19-2011, 05:07 PM #2
cjmurder123
What do I say here?
Originally posted by Hawkin View Post
I haven't been keeping up with Black Oops hacking as much as I'd like to lately. So this questions may of been answered, but I couldn't find it.

Has anyone successfully decompressed the black ops .ff files. More importantly the Zombies .ff files. I want to look at the gsc coding to find the box logic. To find out what factors contribute to getting the more rare guns. Plus I'd like to get a look at the code structure of Black Ops, for future patches. I'm good with the c++ but decryption not so much. If its possible let me know and a link would be cool. Thanks.


I'm not sure if this will help because it's kinda old yet try it.
You must login or register to view this content.

The following user thanked cjmurder123 for this useful post:

Hawkin
03-19-2011, 06:41 PM #3
*SCHAOS*
ILLUMINATUS
Originally posted by Hawkin View Post
I haven't been keeping up with Black Oops hacking as much as I'd like to lately. So this questions may of been answered, but I couldn't find it.

Has anyone successfully decompressed the black ops .ff files. More importantly the Zombies .ff files. I want to look at the gsc coding to find the box logic. To find out what factors contribute to getting the more rare guns. Plus I'd like to get a look at the code structure of Black Ops, for future patches. I'm good with the c++ but decryption not so much. If its possible let me know and a link would be cool. Thanks.


Its not publicly possible. As far as the getting the good guns in the box, there is a table of % ratio chances. Let me dig it up and Ill post it for you.

Here is some weapon info ( I havnt found the table yet)


#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_zombiemode_audio;
init()
{
init_weapons();
init_weapon_upgrade();
init_pay_turret();
treasure_chest_init();
level thread add_limited_tesla_gun();
PreCacheShader( "minimap_icon_mystery_box" );
PrecacheShader( "specialty_instakill_zombies" );
PrecacheShader( "specialty_firesale_zombies" );
}
add_zombie_weapon( weapon_name, upgrade_name, hint, cost, weaponVO, weaponVOresp, ammo_cost )
{
if( IsDefined( level.zombie_include_weapons ) && !IsDefined( level.zombie_include_weapons[weapon_name] ) )
{
return;
}
table = "mp/zombiemode.csv";
table_cost = TableLookUp( table, 0, weapon_name, 1 );
table_ammo_cost = TableLookUp( table, 0, weapon_name, 2 );
if( IsDefined( table_cost ) && table_cost != "" )
{
cost = round_up_to_ten( int( table_cost ) );
}
if( IsDefined( table_ammo_cost ) && table_ammo_cost != "" )
{
ammo_cost = round_up_to_ten( int( table_ammo_cost ) );
}
PrecacheString( hint );
struct = SpawnStruct();
if( !IsDefined( level.zombie_weapons ) )
{
level.zombie_weapons = [];
}
struct.weapon_name = weapon_name;
struct.upgrade_name = upgrade_name;
struct.weapon_classname = "weapon_" + weapon_name;
struct.hint = hint;
struct.cost = cost;
struct.vox = weaponVO;
struct.vox_response = weaponVOresp;
struct.is_in_box = level.zombie_include_weapons[weapon_name];
if( !IsDefined( ammo_cost ) )
{
ammo_cost = round_up_to_ten( int( cost * 0.5 ) );
}
struct.ammo_cost = ammo_cost;
level.zombie_weapons[weapon_name] = struct;
}
default_weighting_func()
{
return 1;
}
default_tesla_weighting_func()
{
num_to_add = 1;
if( isDefined( level.pulls_since_last_tesla_gun ) )
{
if( isDefined(level.player_drops_tesla_gun) && level.player_drops_tesla_gun == true )
{
num_to_add += int(.2 * level.zombie_include_weapons.size);
}
if( !isDefined(level.player_seen_tesla_gun) || level.player_seen_tesla_gun == false )
{
if( level.round_number > 10 )
{
num_to_add += int(.2 * level.zombie_include_weapons.size);
}
else if( level.round_number > 5 )
{
num_to_add += int(.15 * level.zombie_include_weapons.size);
}
}
}
return num_to_add;
}
default_1st_move_weighting_func()
{
if( level.chest_moves > 0 )
{
num_to_add = 1;
return num_to_add;
}
else
{
return 0;
}
}
default_upgrade_weapon_weighting_func()
{
if ( level.chest_moves > 1 )
{
return 1;
}
else
{
return 0;
}
}
default_cymbal_monkey_weighting_func()
{
players = get_players();
count = 0;
for( i = 0; i < players.size; i++ )
{
if( players has_weapon_or_upgrade( "zombie_cymbal_monkey" ) )
{
count++;
}
}
if ( count > 0 )
{
return 1;
}
else
{
if( level.round_number < 10 )
{
return 3;
}
else
{
return 5;
}
}
}
is_weapon_included( weapon_name )
{
if( !IsDefined( level.zombie_weapons ) )
{
return false;
}
return IsDefined( level.zombie_weapons[weapon_name] );
}
include_zombie_weapon( weapon_name, in_box, collector, weighting_func )
{
if( !IsDefined( level.zombie_include_weapons ) )
{
level.zombie_include_weapons = [];
level.collector_achievement_weapons = [];
}
if( !isDefined( in_box ) )
{
in_box = true;
}
if( isDefined( collector ) && collector )
{
level.collector_achievement_weapons = array_add( level.collector_achievement_weapons, weapon_name );
}
level.zombie_include_weapons[weapon_name] = in_box;
PrecacheItem( weapon_name );
if( !isDefined( weighting_func ) )
{
level.weapon_weighting_funcs[weapon_name] = maps\_zombiemode_weapons::default_weighting_func;
}
else
{
level.weapon_weighting_funcs[weapon_name] = weighting_func;
}
}
init_weapons()
{
add_zombie_weapon( "m1911_zm", "m1911_upgraded_zm", &"ZOMBIE_WEAPON_M1911", 50, "pistol", "", undefined );
add_zombie_weapon( "python_zm", "python_upgraded_zm", &"ZOMBIE_WEAPON_PYTHON", 2200, "pistol", "", undefined );
add_zombie_weapon( "cz75_zm", "cz75_upgraded_zm", &"ZOMBIE_WEAPON_CZ75", 50, "pistol", "", undefined );
add_zombie_weapon( "ak74u_zm", "ak74u_upgraded_zm", &"ZOMBIE_WEAPON_AK74U", 1200, "smg", "", undefined );
add_zombie_weapon( "mp5k_zm", "mp5k_upgraded_zm", &"ZOMBIE_WEAPON_MP5K", 1000, "smg", "", undefined );
add_zombie_weapon( "mp40_zm", "mp40_upgraded_zm", &"ZOMBIE_WEAPON_MP40", 1000, "smg", "", undefined );
add_zombie_weapon( "mpl_zm", "mpl_upgraded_zm", &"ZOMBIE_WEAPON_MPL", 1000, "smg", "", undefined );
add_zombie_weapon( "pm63_zm", "pm63_upgraded_zm", &"ZOMBIE_WEAPON_PM63", 1000, "smg", "", undefined );
add_zombie_weapon( "spectre_zm", "spectre_upgraded_zm", &"ZOMBIE_WEAPON_SPECTRE", 50, "smg", "", undefined );
add_zombie_weapon( "cz75dw_zm", "cz75dw_upgraded_zm", &"ZOMBIE_WEAPON_CZ75DW", 50, "dualwield", "", undefined );
add_zombie_weapon( "ithaca_zm", "ithaca_upgraded_zm", &"ZOMBIE_WEAPON_ITHACA", 1500, "shotgun", "", undefined );
add_zombie_weapon( "spas_zm", "spas_upgraded_zm", &"ZOMBIE_WEAPON_SPAS", 2000, "shotgun", "", undefined );
add_zombie_weapon( "rottweil72_zm", "rottweil72_upgraded_zm", &"ZOMBIE_WEAPON_ROTTWEIL72", 500, "shotgun", "", undefined );
add_zombie_weapon( "hs10_zm", "hs10_upgraded_zm", &"ZOMBIE_WEAPON_HS10", 50, "shotgun", "", undefined );
add_zombie_weapon( "m14_zm", "m14_upgraded_zm", &"ZOMBIE_WEAPON_M14", 500, "rifle", "", undefined );
add_zombie_weapon( "m16_zm", "m16_gl_upgraded_zm", &"ZOMBIE_WEAPON_M16", 1200, "burstrifle", "", undefined );
add_zombie_weapon( "g11_lps_zm", "g11_lps_upgraded_zm", &"ZOMBIE_WEAPON_G11", 900, "burstrifle", "", undefined );
add_zombie_weapon( "famas_zm", "famas_upgraded_zm", &"ZOMBIE_WEAPON_FAMAS", 50, "burstrifle", "", undefined );
add_zombie_weapon( "aug_acog_zm", "aug_acog_mk_upgraded_zm", &"ZOMBIE_WEAPON_AUG", 1200, "assault", "", undefined );
add_zombie_weapon( "galil_zm", "galil_upgraded_zm", &"ZOMBIE_WEAPON_GALIL", 100, "assault", "", undefined );
add_zombie_weapon( "commando_zm", "commando_upgraded_zm", &"ZOMBIE_WEAPON_COMMANDO", 100, "assault", "", undefined );
add_zombie_weapon( "fnfal_zm", "fnfal_upgraded_zm", &"ZOMBIE_WEAPON_FNFAL", 100, "burstrifle", "", undefined );
add_zombie_weapon( "dragunov_zm", "dragunov_upgraded_zm", &"ZOMBIE_WEAPON_DRAGUNOV", 2500, "sniper", "", undefined );
add_zombie_weapon( "l96a1_zm", "l96a1_upgraded_zm", &"ZOMBIE_WEAPON_L96A1", 50, "sniper", "", undefined );
add_zombie_weapon( "rpk_zm", "rpk_upgraded_zm", &"ZOMBIE_WEAPON_RPK", 4000, "mg", "", undefined );
add_zombie_weapon( "hk21_zm", "hk21_upgraded_zm", &"ZOMBIE_WEAPON_HK21", 50, "mg", "", undefined );
add_zombie_weapon( "frag_grenade_zm", undefined, &"ZOMBIE_WEAPON_FRAG_GRENADE", 250, "grenade", "", undefined );
add_zombie_weapon( "claymore_zm", undefined, &"ZOMBIE_WEAPON_CLAYMORE", 1000, "grenade", "", undefined );
add_zombie_weapon( "m72_law_zm", "m72_law_upgraded_zm", &"ZOMBIE_WEAPON_M72_LAW", 2000, "launcher", "", undefined );
add_zombie_weapon( "china_lake_zm", "china_lake_upgraded_zm", &"ZOMBIE_WEAPON_CHINA_LAKE", 2000, "launcher", "", undefined );
add_zombie_weapon( "zombie_cymbal_monkey", undefined, &"ZOMBIE_WEAPON_SATCHEL_2000", 2000, "monkey", "", undefined );
add_zombie_weapon( "ray_gun_zm", "ray_gun_upgraded_zm", &"ZOMBIE_WEAPON_RAYGUN", 10000, "raygun", "", undefined );
add_zombie_weapon( "tesla_gun_zm", "tesla_gun_upgraded_zm", &"ZOMBIE_WEAPON_TESLA", 10, "tesla", "", undefined );
add_zombie_weapon( "thundergun_zm", "thundergun_upgraded_zm", &"ZOMBIE_WEAPON_THUNDERGUN", 10, "thunder", "", undefined );
add_zombie_weapon( "crossbow_explosive_zm", "crossbow_explosive_upgraded_zm", &"ZOMBIE_WEAPON_CROSSBOW_EXPOLOSIVE", 10, "crossbow", "", undefined );
add_zombie_weapon( "knife_ballistic_zm", "knife_ballistic_upgraded_zm", &"ZOMBIE_WEAPON_KNIFE_BALLISTIC", 10, "knife_ballistic", "", undefined );
add_zombie_weapon( "knife_ballistic_bowie_zm", "knife_ballistic_bowie_upgraded_zm", &"ZOMBIE_WEAPON_KNIFE_BALLISTIC", 10, "knife_ballistic", "", undefined );
add_zombie_weapon( "knife_ballistic_sickle_zm", "knife_ballistic_sickle_upgraded_zm", &"ZOMBIE_WEAPON_KNIFE_BALLISTIC", 10, "knife_ballistic", "", undefined );
add_zombie_weapon( "freezegun_zm", "freezegun_upgraded_zm", &"ZOMBIE_WEAPON_FREEZEGUN", 10, "freezegun", "", undefined );
add_zombie_weapon( "zombie_black_hole_bomb", undefined, &"ZOMBIE_WEAPON_SATCHEL_2000", 2000, "gersh", "", undefined );
add_zombie_weapon( "zombie_nesting_dolls", undefined, &"ZOMBIE_WEAPON_NESTING_DOLLS", 2000, "dolls", "", undefined );
Precachemodel("zombie_teddybear");
}
add_limited_tesla_gun()
{
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = weapon_spawns.zombie_weapon_upgrade;
if(hint_string == "tesla_gun_zm")
{
weapon_spawns waittill("trigger");
weapon_spawns disable_trigger();
break;
}
}
}
add_limited_weapon( weapon_name, amount )
{
if( !IsDefined( level.limited_weapons ) )
{
level.limited_weapons = [];
}
level.limited_weapons[weapon_name] = amount;
}
init_pay_turret()
{
pay_turrets = [];
pay_turrets = GetEntArray( "pay_turret", "targetname" );
for( i = 0; i < pay_turrets.size; i++ )
{
cost = level.pay_turret_cost;
if( !isDefined( cost ) )
{
cost = 1000;
}
pay_turrets SetHintString( &"ZOMBIE_PAY_TURRET", cost );
pay_turrets SetCursorHint( "HINT_NOICON" );
pay_turrets UseTriggerRequireLookAt();
pay_turrets thread pay_turret_think( cost );
}
}
init_weapon_upgrade()
{
weapon_spawns = [];
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = get_weapon_hint( weapon_spawns.zombie_weapon_upgrade );
cost = get_weapon_cost( weapon_spawns.zombie_weapon_upgrade );
weapon_spawns SetHintString( hint_string, cost );
weapon_spawns setCursorHint( "HINT_NOICON" );
weapon_spawns UseTriggerRequireLookAt();
weapon_spawns thread weapon_spawn_think();
model = getent( weapon_spawns.target, "targetname" );
model useweaponhidetags( weapon_spawns.zombie_weapon_upgrade );
model hide();
}
}
init_weapon_cabinet()
{
weapon_cabs = GetEntArray( "weapon_cabinet_use", "targetname" );
for( i = 0; i < weapon_cabs.size; i++ )
{
weapon_cabs SetHintString( &"ZOMBIE_CABINET_OPEN_1500" );
weapon_cabs setCursorHint( "HINT_NOICON" );
weapon_cabs UseTriggerRequireLookAt();
}
}
get_weapon_hint( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].hint;
}
get_weapon_cost( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].cost;
}
get_ammo_cost( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].ammo_cost;
}
get_is_in_box( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].is_in_box;
}
is_weapon_upgraded( weaponname )
{
if( !isdefined( weaponname ) || weaponname == "" )
{
return false;
}
weaponname = ToLower( weaponname );
ziw_keys = GetArrayKeys( level.zombie_weapons );
for ( i=0; i<level.zombie_weapons.size; i++ )
{
if ( IsDefined(level.zombie_weapons[ ziw_keys ].upgrade_name) &&
level.zombie_weapons[ ziw_keys ].upgrade_name == weaponname )
{
return true;
}
}
return false;
}
has_upgrade( weaponname )
{
has_upgrade = false;
if( IsDefined(level.zombie_weapons[weaponname]) && IsDefined(level.zombie_weapons[weaponname].upgrade_name) )
{
has_upgrade = self HasWeapon( level.zombie_weapons[weaponname].upgrade_name );
}
if ( !has_upgrade && "knife_ballistic_zm" == weaponname )
{
has_upgrade = has_upgrade( "knife_ballistic_bowie_zm" ) || has_upgrade( "knife_ballistic_sickle_zm" );
}
return has_upgrade;
}
has_weapon_or_upgrade( weaponname )
{
upgradedweaponname = weaponname;
if ( IsDefined( level.zombie_weapons[weaponname] ) && IsDefined( level.zombie_weapons[weaponname].upgrade_name ) )
{
upgradedweaponname = level.zombie_weapons[weaponname].upgrade_name;
}
has_weapon = false;
if( IsDefined( level.zombie_weapons[weaponname] ) )
{
has_weapon = self HasWeapon( weaponname ) || self has_upgrade( weaponname );
}
if ( !has_weapon && "knife_ballistic_zm" == weaponname )
{
has_weapon = has_weapon_or_upgrade( "knife_ballistic_bowie_zm" ) || has_weapon_or_upgrade( "knife_ballistic_sickle_zm" );
}
return has_weapon;
}
treasure_chest_init()
{
if( level.mutators["mutator_noMagicBox"] )
{
chests = GetEntArray( "treasure_chest_use", "targetname" );
for( i=0; i < chests.size; i++ )
{
chests get_chest_pieces();
chests hide_chest();
}
return;
}
flag_init("moving_chest_enabled");
flag_init("moving_chest_now");
flag_init("chest_has_been_used");
level.chest_moves = 0;
level.chest_level = 0;
level.chests = GetEntArray( "treasure_chest_use", "targetname" );
for (i=0; i<level.chests.size; i++ )
{
level.chests.orig_origin = level.chests.origin;
level.chests get_chest_pieces();
if ( isDefined( level.chests.zombie_cost ) )
{
level.chests.old_cost = level.chests.zombie_cost;
}
else
{
level.chests.old_cost = 950;
}
}
level.chest_accessed = 0;
if (level.chests.size > 1)
{
flag_set("moving_chest_enabled");
level.chests = array_randomize(level.chests);
init_starting_chest_location();
}
else
{
level.chest_index = 0;
}
array_thread( level.chests, ::treasure_chest_think );
}
init_starting_chest_location()
{
level.chest_index = 0;
start_chest_found = false;
for( i = 0; i < level.chests.size; i++ )
{
if( isdefined( level.random_pandora_box_start ) && level.random_pandora_box_start == true )
{
if ( start_chest_found || (IsDefined( level.chests.start_exclude ) && level.chests.start_exclude == 1) )
{
level.chests hide_chest();
}
else
{
level.chest_index = i;
level.chests[level.chest_index] hide_rubble();
start_chest_found = true;
}
}
else
{
if ( start_chest_found || !IsDefined(level.chests.script_noteworthy ) || ( !IsSubStr( level.chests.script_noteworthy, "start_chest" ) ) )
{
level.chests hide_chest();
}
else
{
level.chest_index = i;
level.chests[level.chest_index] hide_rubble();
start_chest_found = true;
}
}
}
if( !isDefined( level.pandora_show_func ) )
{
level.pandora_show_func = ::default_pandora_show_func;
}
level.chests[level.chest_index] thread [[ level.pandora_show_func ]]();
}
hide_rubble()
{
rubble = getentarray( self.script_noteworthy + "_rubble", "script_noteworthy" );
if ( IsDefined( rubble ) )
{
for ( x = 0; x < rubble.size; x++ )
{
rubble[x] hide();
}
}
else
{
println( "^3Warning: No rubble found for magic box" );
}
}
show_rubble()
{
if ( IsDefined( self.chest_rubble ) )
{
for ( x = 0; x < self.chest_rubble.size; x++ )
{
self.chest_rubble[x] show();
}
}
else
{
println( "^3Warning: No rubble found for magic box" );
}
}
set_treasure_chest_cost( cost )
{
level.zombie_treasure_chest_cost = cost;
}
get_chest_pieces()
{
self.chest_lid = GetEnt(self.target, "targetname");
self.chest_origin = GetEnt(self.chest_lid.target, "targetname");
self.chest_box = GetEnt(self.chest_origin.target, "targetname");
self.chest_rubble = [];
rubble = GetEntArray( self.script_noteworthy + "_rubble", "script_noteworthy" );
for ( i=0; i<rubble.size; i++ )
{
if ( DistanceSquared( self.origin, rubble.origin ) < 10000 )
{
self.chest_rubble[ self.chest_rubble.size ] = rubble;
}
}
}
play_crazi_sound()
{
self playlocalsound("zmb_laugh_child");
}
show_chest()
{
self thread [[ level.pandora_show_func ]]();
self enable_trigger();
self.chest_lid show();
self.chest_box show();
self.chest_lid playsound( "zmb_box_poof_land" );
self.chest_lid playsound( "zmb_couch_slam" );
}
hide_chest()
{
self disable_trigger();
self.chest_lid hide();
self.chest_box hide();
if ( IsDefined( self.pandora_light ) )
{
self.pandora_light delete();
}
}
default_pandora_fx_func( )
{
self.pandora_light = Spawn( "script_model", self.chest_origin.origin );
self.pandora_light.angles = self.chest_origin.angles + (-90, 0, 0);
self.pandora_light SetModel( "tag_origin" );
playfxontag(level._effect["lght_marker"], self.pandora_light, "tag_origin");
}
default_pandora_show_func( anchor, anchorTarget, pieces )
{
if ( !IsDefined(self.pandora_light) )
{
if( !IsDefined( level.pandora_fx_func ) )
{
level.pandora_fx_func = ::default_pandora_fx_func;
}
self thread [[ level.pandora_fx_func ]]();
}
playsoundatposition( "zmb_box_poof", self.chest_lid.origin );
wait(0.5);
playfx( level._effect["lght_marker_flare"],self.pandora_light.origin );
Objective_Add( 0, "active", "Mystery Box", self.chest_lid.origin, "minimap_icon_mystery_box" );
}
treasure_chest_think()
{
if( IsDefined(level.zombie_vars["zombie_powerup_fire_sale_on"]) && level.zombie_vars["zombie_powerup_fire_sale_on"] )
{
self set_hint_string( self, "powerup_fire_sale_cost" );
}
else
{
self set_hint_string( self, "default_treasure_chest_" + self.zombie_cost );
}
self setCursorHint( "HINT_NOICON" );
user = undefined;
user_cost = undefined;
while( 1 )
{
self waittill( "trigger", user );
if( user in_revive_trigger() )
{
wait( 0.1 );
continue;
}
if( user is_drinking() )
{
wait( 0.1 );
continue;
}
if ( is_true( self.disabled ) )
{
wait( 0.1 );
continue;
}
if( user GetCurrentWeapon() == "none" )
{
wait( 0.1 );
continue;
}
if( is_player_valid( user ) && user.score >= self.zombie_cost )
{
user maps\_zombiemode_score::minus_to_player_score( self.zombie_cost );
user_cost = self.zombie_cost;
self.chest_user = user;
break;
}
else if ( user.score < self.zombie_cost )
{
user maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 2 );
continue;
}
wait 0.05;
}
flag_set("chest_has_been_used");
self._box_open = true;
self._box_opened_by_fire_sale = false;
if ( is_true( level.zombie_vars["zombie_powerup_fire_sale_on"] ) )
{
self._box_opened_by_fire_sale = true;
}
self.chest_lid thread treasure_chest_lid_open();
self.timedOut = false;
self.chest_origin thread treasure_chest_weapon_spawn( self, user );
self.chest_origin thread treasure_chest_glowfx();
self disable_trigger();
self.chest_origin waittill( "randomization_done" );
if (flag("moving_chest_now") && !self._box_opened_by_fire_sale && IsDefined(user_cost))
{
user maps\_zombiemode_score::add_to_player_score( user_cost, false );
}
if (flag("moving_chest_now") && !level.zombie_vars["zombie_powerup_fire_sale_on"])
{
self.chest_user maps\_zombiemode_audio::create_and_play_dialog( "general", "box_move" );
self thread treasure_chest_move();
}
else
{
self.grab_weapon_hint = true;
self.chest_user = user;
self sethintstring( &"ZOMBIE_TRADE_WEAPONS" );
self setCursorHint( "HINT_NOICON" );
self thread decide_hide_show_hint( "weapon_grabbed");
self enable_trigger();
self thread treasure_chest_timeout();
while( 1 )
{
self waittill( "trigger", grabber );
if( IsDefined( grabber.is_drinking ) && grabber is_drinking() )
{
wait( 0.1 );
continue;
}
if ( grabber == user && user GetCurrentWeapon() == "none" )
{
wait( 0.1 );
continue;
}
if( grabber == user || grabber == level )
{
current_weapon = user GetCurrentWeapon();
if( grabber == user && is_player_valid( user ) && !user is_drinking() && !is_placeable_mine( current_weapon ) && "syrette_sp" != current_weapon )
{
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type magic_accept",
user.playername, user.score, level.team_pool[ user.team_num ].score, level.round_number, self.zombie_cost, self.chest_origin.weapon_string, self.origin );
self notify( "user_grabbed_weapon" );
user thread treasure_chest_give_weapon( self.chest_origin.weapon_string );
break;
}
else if( grabber == level )
{
self.timedOut = true;
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type magic_reject",
user.playername, user.score, level.team_pool[ user.team_num ].score, level.round_number, self.zombie_cost, self.chest_origin.weapon_string, self.origin );
break;
}
}
wait 0.05;
}
self.grab_weapon_hint = false;
self.chest_origin notify( "weapon_grabbed" );
if ( !is_true( self._box_opened_by_fire_sale ) )
{
level.chest_accessed += 1;
}
if( level.chest_moves > 0 && isDefined(level.pulls_since_last_ray_gun) )
{
level.pulls_since_last_ray_gun += 1;
}
if( isDefined(level.pulls_since_last_tesla_gun) )
{
level.pulls_since_last_tesla_gun += 1;
}
self disable_trigger();
self.chest_lid thread treasure_chest_lid_close( self.timedOut );
wait 3;
if ( is_true( level.zombie_vars["zombie_powerup_fire_sale_on"] ) || self == level.chests[level.chest_index] )
{
self enable_trigger();
self setvisibletoall();
}
}
self._box_open = false;
self._box_opened_by_fire_sale = false;
self.chest_user = undefined;
self notify( "chest_accessed" );
self thread treasure_chest_think();
}
decide_hide_show_chest_hint( endon_notify )
{
if( isDefined( endon_notify ) )
{
self endon( endon_notify );
}
while( true )
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
if ( (IsDefined(self.chest_user) && players != self.chest_user ) ||
!players can_buy_weapon() )
{
self SetInvisibleToPlayer( players, true );
}
else
{
self SetInvisibleToPlayer( players, false );
}
}
wait( 0.1 );
}
}
decide_hide_show_hint( endon_notify )
{
if( isDefined( endon_notify ) )
{
self endon( endon_notify );
}
while( true )
{
if(IsDefined(self.chest_user))
{
if( is_placeable_mine( self.chest_user GetCurrentWeapon() ) )
{
self SetInvisibleToPlayer( self.chest_user);
}
else
{
self SetVisibleToPlayer( self.chest_user );
}
}
else
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
if( players can_buy_weapon())
{
self SetInvisibleToPlayer( players, false );
}
else
{
self SetInvisibleToPlayer( players, true );
}
}
}
wait( 0.1 );
}
}
can_buy_weapon()
{
if( IsDefined( self.is_drinking ) && self is_drinking() )
{
return false;
}
current_weapon = self GetCurrentWeapon();
if( is_placeable_mine( current_weapon ) )
{
return false;
}
if( self in_revive_trigger() )
{
return false;
}
if( current_weapon == "none" )
{
return false;
}
return true;
}
treasure_chest_move()
{
level waittill("weapon_fly_away_start");
players = get_players();
array_thread(players, ::play_crazi_sound);
level waittill("weapon_fly_away_end");
self.chest_lid thread treasure_chest_lid_close(false);
self setvisibletoall();
self hide_chest();
fake_pieces = [];
fake_pieces[0] = spawn("script_model",self.chest_lid.origin);
fake_pieces[0].angles = self.chest_lid.angles;
fake_pieces[0] setmodel(self.chest_lid.model);
fake_pieces[1] = spawn("script_model",self.chest_box.origin);
fake_pieces[1].angles = self.chest_box.angles;
fake_pieces[1] setmodel(self.chest_box.model);
anchor = spawn("script_origin",fake_pieces[0].origin);
soundpoint = spawn("script_origin", self.chest_origin.origin);
anchor playsound("zmb_box_move");
for(i=0;i<fake_pieces.size;i++)
{
fake_pieces linkto(anchor);
}
playsoundatposition ("zmb_whoosh", soundpoint.origin );
playsoundatposition ("zmb_vox_ann_magicbox", soundpoint.origin );
anchor moveto(anchor.origin + (0,0,50),5);
if( isDefined( level.custom_vibrate_func ) )
{
[[ level.custom_vibrate_func ]]( anchor );
}
else
{
direction = self.chest_box.origin - self.chest_lid.origin;
direction = (direction[1], direction[0], 0);
if(direction[1] < 0 || (direction[0] > 0 && direction[1] > 0))
{
direction = (direction[0], direction[1] * -1, 0);
}
else if(direction[0] < 0)
{
direction = (direction[0] * -1, direction[1], 0);
}
anchor Vibrate( direction, 10, 0.5, 5);
}
anchor waittill("movedone");
playfx(level._effect["poltergeist"], self.chest_origin.origin);
playsoundatposition ("zmb_box_poof", soundpoint.origin);
for(i=0;i<fake_pieces.size;i++)
{
fake_pieces delete();
}
self show_rubble();
wait(0.1);
anchor delete();
soundpoint delete();
if(level.zombie_vars["zombie_powerup_fire_sale_on"] == true)
{
current_sale_time = level.zombie_vars["zombie_powerup_fire_sale_time"];
wait_network_frame();
self thread fire_sale_fix();
level.zombie_vars["zombie_powerup_fire_sale_time"] = current_sale_time;
while(level.zombie_vars["zombie_powerup_fire_sale_time"] > 0)
{
wait(0.1);
}
}
else
{
wait(5);
}
level.verify_chest = false;
index = -1;
for ( i=0; i<level.chests.size; i++ )
{
if ( IsSubStr( level.chests.script_noteworthy, ("move"+(level.chest_moves+1)) ) &&
i != level.chest_index )
{
index = i;
break;
}
}
if ( index != -1 )
{
level.chest_index = index;
}
else
{
level.chest_index++;
}
if (level.chest_index >= level.chests.size)
{
temp_chest_name = level.chests[level.chest_index - 1].script_noteworthy;
level.chest_index = 0;
level.chests = array_randomize(level.chests);
if (temp_chest_name == level.chests[level.chest_index].script_noteworthy)
{
level.chest_index++;
}
}
wait(0.01);
playfx(level._effect["poltergeist"], level.chests[level.chest_index].chest_origin.origin);
level.chests[level.chest_index] show_chest();
level.chests[level.chest_index] hide_rubble();
flag_clear("moving_chest_now");
}
fire_sale_fix()
{
if( !isdefined ( level.zombie_vars["zombie_powerup_fire_sale_on"] ) )
{
return;
}
if( level.zombie_vars["zombie_powerup_fire_sale_on"] )
{
self.old_cost = 950;
self thread show_chest();
self thread hide_rubble();
self.zombie_cost = 10;
self set_hint_string( self , "powerup_fire_sale_cost" );
wait_network_frame();
level waittill( "fire_sale_off" );
playfx(level._effect["poltergeist"], self.origin);
self playsound ( "zmb_box_poof_land" );
self playsound( "zmb_couch_slam" );
self thread hide_chest();
self thread show_rubble();
self.zombie_cost = self.old_cost;
self set_hint_string( self , "default_treasure_chest_" + self.zombie_cost );
}
}
check_for_desirable_chest_location()
{
if( !isdefined( level.desirable_chest_location ) )
return level.chest_index;
if( level.chests[level.chest_index].script_noteworthy == level.desirable_chest_location )
{
level.desirable_chest_location = undefined;
return level.chest_index;
}
for(i = 0 ; i < level.chests.size; i++ )
{
if( level.chests.script_noteworthy == level.desirable_chest_location )
{
level.desirable_chest_location = undefined;
return i;
}
}
level.desirable_chest_location = undefined;
return level.chest_index;
}
rotateroll_box()
{
angles = 40;
angles2 = 0;
while(isdefined(self))
{
self RotateRoll(angles + angles2, 0.5);
wait(0.7);
angles2 = 40;
self RotateRoll(angles * -2, 0.5);
wait(0.7);
}
}
verify_chest_is_open()
{
for (i = 0; i < level.open_chest_location.size; i++)
{
if(isdefined(level.open_chest_location))
{
if(level.open_chest_location == level.chests[level.chest_index].script_noteworthy)
{
level.verify_chest = true;
return;
}
}
}
level.verify_chest = false;
}
treasure_chest_timeout()
{
self endon( "user_grabbed_weapon" );
wait( 12 );
self notify( "trigger", level );
}
treasure_chest_lid_open()
{
openRoll = 105;
openTime = 0.5;
self RotateRoll( 105, openTime, ( openTime * 0.5 ) );
play_sound_at_pos( "open_chest", self.origin );
play_sound_at_pos( "music_chest", self.origin );
}
treasure_chest_lid_close( timedOut )
{
closeRoll = -105;
closeTime = 0.5;
self RotateRoll( closeRoll, closeTime, ( closeTime * 0.5 ) );
play_sound_at_pos( "close_chest", self.origin );
}
treasure_chest_ChooseRandomWeapon( player )
{
keys = GetArrayKeys( level.zombie_weapons );
return keys[RandomInt( keys.size )];
}
treasure_chest_ChooseWeightedRandomWeapon( player )
{
keys = GetArrayKeys( level.zombie_weapons );
filtered = [];
for( i = 0; i < keys.size; i++ )
{
if( !get_is_in_box( keys ) )
{
continue;
}
if( player has_weapon_or_upgrade( keys ) )
{
continue;
}
if( !IsDefined( keys ) )
{
continue;
}
num_entries = [[ level.weapon_weighting_funcs[keys] ]]();
for( j = 0; j < num_entries; j++ )
{
filtered[filtered.size] = keys;
}
}
if( IsDefined( level.limited_weapons ) )
{
keys2 = GetArrayKeys( level.limited_weapons );
players = get_players();
pap_triggers = GetEntArray("zombie_vending_upgrade", "targetname");
for( q = 0; q < keys2.size; q++ )
{
count = 0;
for( i = 0; i < players.size; i++ )
{
if( players has_weapon_or_upgrade( keys2[q] ) )
{
count++;
}
}
for ( k=0; k<pap_triggers.size; k++ )
{
if ( IsDefined(pap_triggers[k].current_weapon) && pap_triggers[k].current_weapon == keys2[q] )
{
count++;
}
}
for ( chestIndex = 0; chestIndex < level.chests.size; chestIndex++ )
{
if ( IsDefined( level.chests[chestIndex].chest_origin.weapon_string ) && level.chests[chestIndex].chest_origin.weapon_string == keys2[q] )
{
count++;
}
}
if( count >= level.limited_weapons[keys2[q]] )
{
filtered = array_remove( filtered, keys2[q] );
}
}
}
filtered = array_randomize( filtered );
return filtered[RandomInt( filtered.size )];
}
weapon_is_dual_wield(name)
{
switch(name)
{
case "cz75dw_zm":
case "cz75dw_upgraded_zm":
case "m1911_upgraded_zm":
case "hs10_upgraded_zm":
case "pm63_upgraded_zm":
return true;
default:
return false;
}
}
treasure_chest_weapon_spawn( chest, player )
{
assert(IsDefined(player));
self.weapon_string = undefined;
modelname = undefined;
rand = undefined;
number_cycles = 40;
chest.chest_box setclientflag(level._ZOMBIE_SCRIPTMOVER_FLAG_BOX_RANDOM);
for( i = 0; i < number_cycles; i++ )
{
if( i < 20 )
{
wait( 0.05 );
}
else if( i < 30 )
{
wait( 0.1 );
}
else if( i < 35 )
{
wait( 0.2 );
}
else if( i < 38 )
{
wait( 0.3 );
}
if( i + 1 < number_cycles )
{
rand = treasure_chest_ChooseRandomWeapon( player );
}
else
{
rand = treasure_chest_ChooseWeightedRandomWeapon( player );
}
}
chest.chest_box clearclientflag(level._ZOMBIE_SCRIPTMOVER_FLAG_BOX_RANDOM);
wait_network_frame();
floatHeight = 40;
model_dw = undefined;
model = spawn( "script_model", self.origin + ( 0, 0, floatHeight));
model.angles = self.angles +( 0, 90, 0 );
modelname = GetWeaponModel( rand );
model setmodel( modelname );
model useweaponhidetags( rand );
if ( weapon_is_dual_wield(rand))
{
model_dw = spawn( "script_model", model.origin - ( 3, 3, 3 ) );
model_dw.angles = self.angles +( 0, 90, 0 );
model_dw setmodel( modelname );
model_dw useweaponhidetags( rand );
}
self.weapon_string = rand;
if( (GetDvar( #"magic_chest_movable") == "1") && !is_true( chest._box_opened_by_fire_sale ) )
{
random = Randomint(100);
if( !isdefined( level.chest_min_move_usage ) )
{
level.chest_min_move_usage = 4;
}
if( level.chest_accessed < level.chest_min_move_usage )
{
chance_of_joker = -1;
}
else
{
chance_of_joker = level.chest_accessed + 20;
if ( level.chest_moves == 0 && level.chest_accessed >= 8 )
{
chance_of_joker = 100;
}
if( level.chest_accessed >= 4 && level.chest_accessed < 8 )
{
if( random < 15 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
if ( level.chest_moves > 0 )
{
if( level.chest_accessed >= 8 && level.chest_accessed < 13 )
{
if( random < 30 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
if( level.chest_accessed >= 13 )
{
if( random < 50 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
}
}
if ( chance_of_joker > random )
{
self.weapon_string = undefined;
model SetModel("zombie_teddybear");
model.angles = self.angles;
if(IsDefined(model_dw))
{
model_dw Delete();
model_dw = undefined;
}
wait 1;
flag_set("moving_chest_now");
level.chest_accessed = 0;
level.chest_moves++;
}
}
self notify( "randomization_done" );
if (flag("moving_chest_now") && !level.zombie_vars["zombie_powerup_fire_sale_on"])
{
wait .5;
level notify("weapon_fly_away_start");
wait 2;
model MoveZ(500, 4, 3);
if(IsDefined(model_dw))
{
model_dw MoveZ(500,4,3);
}
model waittill("movedone");
model delete();
if(IsDefined(model_dw))
{
model_dw Delete();
}
self notify( "box_moving" );
level notify("weapon_fly_away_end");
}
else
{
if( rand == "tesla_gun_zm" || rand == "ray_gun_zm" )
{
if( rand == "ray_gun_zm" )
{
level.pulls_since_last_ray_gun = 0;
}
if( rand == "tesla_gun_zm" )
{
level.pulls_since_last_tesla_gun = 0;
level.player_seen_tesla_gun = true;
}
}
model thread timer_til_despawn(floatHeight);
if(IsDefined(model_dw))
{
model_dw thread timer_til_despawn(floatHeight);
}
self waittill( "weapon_grabbed" );
if( !chest.timedOut )
{
model Delete();
if(IsDefined(model_dw))
{
model_dw Delete();
}
}
}
self.weapon_string = undefined;
}
chest_get_min_usage()
{
min_usage = 4;
return( min_usage );
}
chest_get_max_usage()
{
max_usage = 6;
players = get_players();
if( level.chest_moves == 0 )
{
if( players.size == 1 )
{
max_usage = 3;
}
else if( players.size == 2 )
{
max_usage = 4;
}
else if( players.size == 3 )
{
max_usage = 5;
}
else
{
max_usage = 6;
}
}
else
{
if( players.size == 1 )
{
max_usage = 4;
}
else if( players.size == 2 )
{
max_usage = 4;
}
else if( players.size == 3 )
{
max_usage = 5;
}
else
{
max_usage = 7;
}
}
return( max_usage );
}
timer_til_despawn(floatHeight)
{
putBackTime = 12;
self MoveTo( self.origin - ( 0, 0, floatHeight ), putBackTime, ( putBackTime * 0.5 ) );
wait( putBackTime );
if(isdefined(self))
{
self Delete();
}
}
treasure_chest_glowfx()
{
fxObj = spawn( "script_model", self.origin +( 0, 0, 0 ) );
fxobj setmodel( "tag_origin" );
fxobj.angles = self.angles +( 90, 0, 0 );
playfxontag( level._effect["chest_light"], fxObj, "tag_origin" );
self waittill_any( "weapon_grabbed", "box_moving" );
fxobj delete();
}
treasure_chest_give_weapon( weapon_string )
{
self.last_box_weapon = GetTime();
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;
weapon_limit = 2;
if( self HasWeapon( weapon_string ) )
{
if ( issubstr( weapon_string, "knife_ballistic_" ) )
{
self notify( "zmb_lost_knife" );
}
self GiveStartAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
return;
}
if( primaryWeapons.size >= weapon_limit )
{
current_weapon = self getCurrentWeapon();
if ( is_placeable_mine( current_weapon ) )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !is_offhand_weapon( weapon_string ) )
{
if( current_weapon == "tesla_gun_zm" )
{
level.player_drops_tesla_gun = true;
}
if ( issubstr( current_weapon, "knife_ballistic_" ) )
{
self notify( "zmb_lost_knife" );
}
self TakeWeapon( current_weapon );
if ( current_weapon == "m1911_zm" )
{
self.last_pistol_swap = GetTime();
}
}
}
}
self play_sound_on_ent( "purchase" );
if( IsDefined( level.zombiemode_offhand_weapon_give_override ) )
{
self [[ level.zombiemode_offhand_weapon_give_override ]]( weapon_string );
}
if( weapon_string == "zombie_cymbal_monkey" )
{
self maps\_zombiemode_weap_cymbal_monkey::player_give_cymbal_monkey();
self play_weapon_vo(weapon_string);
return;
}
else if ( weapon_string == "knife_ballistic_zm" && self HasWeapon( "bowie_knife_zm" ) )
{
weapon_string = "knife_ballistic_bowie_zm";
}
else if ( weapon_string == "knife_ballistic_zm" && self HasWeapon( "sickle_knife_zm" ) )
{
weapon_string = "knife_ballistic_sickle_zm";
}
if (weapon_string == "ray_gun_zm")
{
playsoundatposition ("mus_raygun_stinger", (0,0,0));
}
self GiveWeapon( weapon_string, 0 );
self GiveStartAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
self play_weapon_vo(weapon_string);
}
pay_turret_think( cost )
{
if( !isDefined( self.target ) )
{
return;
}
turret = GetEnt( self.target, "targetname" );
if( !isDefined( turret ) )
{
return;
}
turret makeTurretUnusable();
zone_name = turret get_current_zone();
if ( !IsDefined( zone_name ) )
{
zone_name = "";
}
while( true )
{
self waittill( "trigger", player );
if( !is_player_valid( player ) )
{
player thread ignore_triggers( 0.5 );
continue;
}
if( player in_revive_trigger() )
{
wait( 0.1 );
continue;
}
if( player is_drinking() )
{
wait(0.1);
continue;
}
if( player.score >= cost )
{
player maps\_zombiemode_score::minus_to_player_score( cost );
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type turret", player.playername, player.score, level.team_pool[ player.team_num ].score, level.round_number, cost, zone_name, self.origin );
turret makeTurretUsable();
turret UseBy( player );
self disable_trigger();
player.curr_pay_turret = turret;
turret thread watch_for_laststand( player );
turret thread watch_for_fake_death( player );
if( isDefined( level.turret_timer ) )
{
turret thread watch_for_timeout( player, level.turret_timer );
}
while( isDefined( turret getTurretOwner() ) && turret getTurretOwner() == player )
{
wait( 0.05 );
}
turret notify( "stop watching" );
player.curr_pay_turret = undefined;
turret makeTurretUnusable();
self enable_trigger();
}
else
{
play_sound_on_ent( "no_purchase" );
player maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 0 );
}
}
}
watch_for_laststand( player )
{
self endon( "stop watching" );
while( !player maps\_laststand::player_is_in_laststand() )
{
if( isDefined( level.intermission ) && level.intermission )
{
intermission = true;
}
wait( 0.05 );
}
if( isDefined( self getTurretOwner() ) && self getTurretOwner() == player )
{
self UseBy( player );
}
}
watch_for_fake_death( player )
{
self endon( "stop watching" );
player waittill( "fake_death" );
if( isDefined( self getTurretOwner() ) && self getTurretOwner() == player )
{
self UseBy( player );
}
}
watch_for_timeout( player, time )
{
self endon( "stop watching" );
self thread cancel_timer_on_end( player );
wait( time );
if( isDefined( self getTurretOwner() ) && self getTurretOwner() == player )
{
self UseBy( player );
}
}
cancel_timer_on_end( player )
{
self waittill( "stop watching" );
player notify( "stop watching" );
}
weapon_cabinet_door_open( left_or_right )
{
if( left_or_right == "left" )
{
self rotateyaw( 120, 0.3, 0.2, 0.1 );
}
else if( left_or_right == "right" )
{
self rotateyaw( -120, 0.3, 0.2, 0.1 );
}
}
check_collector_achievement( bought_weapon )
{
if ( !isdefined( self.bought_weapons ) )
{
self.bought_weapons = [];
self.bought_weapons = array_add( self.bought_weapons, bought_weapon );
}
else if ( !is_in_array( self.bought_weapons, bought_weapon ) )
{
self.bought_weapons = array_add( self.bought_weapons, bought_weapon );
}
else
{
return;
}
for( i = 0; i < level.collector_achievement_weapons.size; i++ )
{
if ( !is_in_array( self.bought_weapons, level.collector_achievement_weapons ) )
{
return;
}
}
self giveachievement_wrapper( "SP_ZOM_COLLECTOR" );
}
weapon_set_first_time_hint( cost, ammo_cost )
{
if ( isDefined( level.has_pack_a_punch ) && !level.has_pack_a_punch )
{
self SetHintString( &"ZOMBIE_WEAPONCOSTAMMO", cost, ammo_cost );
}
else
{
self SetHintString( &"ZOMBIE_WEAPONCOSTAMMO_UPGRADE", cost, ammo_cost );
}
}
weapon_spawn_think()
{
cost = get_weapon_cost( self.zombie_weapon_upgrade );
ammo_cost = get_ammo_cost( self.zombie_weapon_upgrade );
is_grenade = (WeaponType( self.zombie_weapon_upgrade ) == "grenade");
self thread decide_hide_show_hint();
self.first_time_triggered = false;
for( ;; )
{
self waittill( "trigger", player );
if( !is_player_valid( player ) )
{
player thread ignore_triggers( 0.5 );
continue;
}
if( !player can_buy_weapon() )
{
wait( 0.1 );
continue;
}
if( player GetCurrentWeapon() == "minigun_zm" )
{
wait( 0.1 );
continue;
}
player_has_weapon = player has_weapon_or_upgrade( self.zombie_weapon_upgrade );
if( !player_has_weapon )
{
if( player.score >= cost )
{
if( self.first_time_triggered == false )
{
model = getent( self.target, "targetname" );
model thread weapon_show( player );
self.first_time_triggered = true;
if(!is_grenade)
{
self weapon_set_first_time_hint( cost, ammo_cost );
}
}
player maps\_zombiemode_score::minus_to_player_score( cost );
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type weapon",
player.playername, player.score, level.team_pool[ player.team_num ].score, level.round_number, cost, self.zombie_weapon_upgrade, self.origin );
player weapon_give( self.zombie_weapon_upgrade );
player check_collector_achievement( self.zombie_weapon_upgrade );
}
else
{
play_sound_on_ent( "no_purchase" );
player maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 1 );
}
}
else
{
if ( player has_upgrade( self.zombie_weapon_upgrade ) )
{
ammo_cost = 4500;
}
else
{
ammo_cost = get_ammo_cost( self.zombie_weapon_upgrade );
}
if( player.score >= ammo_cost )
{
if( self.first_time_triggered == false )
{
model = getent( self.target, "targetname" );
model thread weapon_show( player );
self.first_time_triggered = true;
if(!is_grenade)
{
self weapon_set_first_time_hint( cost, get_ammo_cost( self.zombie_weapon_upgrade ) );
}
}
player check_collector_achievement( self.zombie_weapon_upgrade );
if( player has_upgrade( self.zombie_weapon_upgrade ) )
{
ammo_given = player ammo_give( level.zombie_weapons[ self.zombie_weapon_upgrade ].upgrade_name );
}
else
{
ammo_given = player ammo_give( self.zombie_weapon_upgrade );
}
if( ammo_given )
{
player maps\_zombiemode_score::minus_to_player_score( ammo_cost );
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type ammo",
player.playername, player.score, level.team_pool[ player.team_num ].score, level.round_number, ammo_cost, self.zombie_weapon_upgrade, self.origin );
}
}
else
{
play_sound_on_ent( "no_purchase" );
player maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 0 );
}
}
}
}
weapon_show( player )
{
player_angles = VectorToAngles( player.origin - self.origin );
player_yaw = player_angles[1];
weapon_yaw = self.angles[1];
if ( isdefined( self.script_int ) )
{
weapon_yaw -= self.script_int;
}
yaw_diff = AngleClamp180( player_yaw - weapon_yaw );
if( yaw_diff > 0 )
{
yaw = weapon_yaw - 90;
}
else
{
yaw = weapon_yaw + 90;
}
self.og_origin = self.origin;
self.origin = self.origin +( AnglesToForward( ( 0, yaw, 0 ) ) * 8 );
wait( 0.05 );
self Show();
play_sound_at_pos( "weapon_show", self.origin, self );
time = 1;
self MoveTo( self.og_origin, time );
}
get_pack_a_punch_weapon_options( weapon )
{
if ( !isDefined( self.pack_a_punch_weapon_options ) )
{
self.pack_a_punch_weapon_options = [];
}
if ( !is_weapon_upgraded( weapon ) )
{
return self CalcWeaponOptions( 0 );
}
if ( isDefined( self.pack_a_punch_weapon_options[weapon] ) )
{
return self.pack_a_punch_weapon_options[weapon];
}
smiley_face_reticle_index = 21;
camo_index = 15;
lens_index = randomIntRange( 0, 6 );
reticle_index = randomIntRange( 0, smiley_face_reticle_index );
reticle_color_index = randomIntRange( 0, 6 );
if ( "famas_upgraded_zm" == weapon )
{
reticle_index = smiley_face_reticle_index;
}
scary_eyes_reticle_index = 8;
purple_reticle_color_index = 3;
if ( reticle_index == scary_eyes_reticle_index )
{
reticle_color_index = purple_reticle_color_index;
}
letter_a_reticle_index = 2;
pink_reticle_color_index = 6;
if ( reticle_index == letter_a_reticle_index )
{
reticle_color_index = pink_reticle_color_index;
}
letter_e_reticle_index = 7;
green_reticle_color_index = 1;
if ( reticle_index == letter_e_reticle_index )
{
reticle_color_index = green_reticle_color_index;
}
self.pack_a_punch_weapon_options[weapon] = self CalcWeaponOptions( camo_index, lens_index, reticle_index, reticle_color_index );
return self.pack_a_punch_weapon_options[weapon];
}
weapon_give( weapon, is_upgrade )
{
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;
weapon_limit = 2;
if( !IsDefined( is_upgrade ) )
{
is_upgrade = false;
}
if( primaryWeapons.size >= weapon_limit )
{
current_weapon = self getCurrentWeapon();
if ( is_placeable_mine( current_weapon ) )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !is_offhand_weapon( weapon ) )
{
if ( issubstr( current_weapon, "knife_ballistic_" ) )
{
self notify( "zmb_lost_knife" );
}
self TakeWeapon( current_weapon );
if ( current_weapon == "m1911_zm" )
{
self.last_pistol_swap = GetTime();
}
}
}
}
if( IsDefined( level.zombiemode_offhand_weapon_give_override ) )
{
if( self [[ level.zombiemode_offhand_weapon_give_override ]]( weapon ) )
{
return;
}
}
if( weapon == "zombie_cymbal_monkey" )
{
self maps\_zombiemode_weap_cymbal_monkey::player_give_cymbal_monkey();
self play_weapon_vo( weapon );
return;
}
self play_sound_on_ent( "purchase" );
if ( !is_weapon_upgraded( weapon ) )
{
self GiveWeapon( weapon );
}
else
{
self GiveWeapon( weapon, 0, self get_pack_a_punch_weapon_options( weapon ) );
}
self GiveStartAmmo( weapon );
self SwitchToWeapon( weapon );
self play_weapon_vo(weapon);
}
play_weapon_vo(weapon)
{
type = self weapon_type_check(weapon);
self maps\_zombiemode_audio::create_and_play_dialog( "weapon_pickup", type );
}
weapon_type_check(weapon)
{
if( !IsDefined( self.entity_num ) )
return "crappy";
switch(self.entity_num)
{
case 0:
if( weapon == "m16_zm" )
return "favorite";
else if( weapon == "rottweil72_upgraded_zm" )
return "favorite_upgrade";
break;
case 1:
if( weapon == "fnfal_zm" )
return "favorite";
else if( weapon == "hk21_upgraded_zm" )
return "favorite_upgrade";
break;
case 2:
if( weapon == "china_lake_zm" )
return "favorite";
else if( weapon == "thundergun_upgraded_zm" )
return "favorite_upgrade";
break;
case 3:
if( weapon == "mp40_zm" )
return "favorite";
else if( weapon == "crossbow_explosive_upgraded_zm" )
return "favorite_upgrade";
break;
}
if( IsSubStr( weapon, "upgraded" ) )
return "upgrade";
else
return level.zombie_weapons[weapon].vox;
}
get_player_index(player)
{
assert( IsPlayer( player ) );
assert( IsDefined( player.entity_num ) );
return player.entity_num;
}
ammo_give( weapon )
{
give_ammo = false;
if( !is_offhand_weapon( weapon ) )
{
if( isdefined( weapon ) )
{
stockMax = 0;
stockMax = WeaponStartAmmo( weapon );
clipCount = self GetWeaponAmmoClip( weapon );
currStock = self GetAmmoCount( weapon );
if( ( currStock - clipcount ) >= stockMax )
{
give_ammo = false;
}
else
{
give_ammo = true;
}
}
}
else
{
if( self has_weapon_or_upgrade( weapon ) )
{
if( self getammocount( weapon ) < WeaponMaxAmmo( weapon ) )
{
give_ammo = true;
}
}
}
if( give_ammo )
{
self play_sound_on_ent( "purchase" );
self GiveStartAmmo( weapon );
return true;
}
if( !give_ammo )
{
return false;
}
}


---------- Post added at 02:41 PM ---------- Previous post was at 01:28 PM ----------

Originally posted by Hawkin View Post
I haven't been keeping up with Black Oops hacking as much as I'd like to lately. So this questions may of been answered, but I couldn't find it.

Has anyone successfully decompressed the black ops .ff files. More importantly the Zombies .ff files. I want to look at the gsc coding to find the box logic. To find out what factors contribute to getting the more rare guns. Plus I'd like to get a look at the code structure of Black Ops, for future patches. I'm good with the c++ but decryption not so much. If its possible let me know and a link would be cool. Thanks.


Here is the offsets for the common_zombie_patch.ff

- open input file: C:\Users\*SCHAOS*\Desktop\common_zombie_patch.zone
- enter in directory: C:\Users\*SCHAOS*\Desktop\Decryption
- zip data to check: 32 bytes
- zip windowBits: 15
- seek offset: 0x00000000 (0)
+------------+-------------+-------------------------+
| hex_offset | blocks_dots | zip_size --> unzip_size |
+------------+-------------+-------------------------+
0x00033eee . 259 --> 589
0x00034033 . 290 --> 787
0x00034198 . 292 --> 791
0x000342ff . 293 --> 791
0x00034467 . 295 --> 791
0x000345d1 . 312 --> 982
0x0003474c . 286 --> 783
0x000348ab . 309 --> 956
0x00034a11 ... 5825 --> 29385
0x00036104 .. 2930 --> 10939
0x00036ca7 .. 2292 --> 7699
0x000375cb . 1783 --> 8244
0x00037cf3 .. 2793 --> 13543
0x0003880e .. 2971 --> 12328
0x000393d9 ... 5568 --> 23584
0x0003a9cc .. 3250 --> 14910
0x0003b6b9 . 877 --> 3030
0x0003ba64 . 939 --> 4094
0x0003be52 . 1242 --> 5504
0x0003c355 .. 3936 --> 16343
0x0003d2dc .................. 35284 --> 172728
0x00045cda ........... 21621 --> 104183
0x0004b180 .... 7899 --> 39839
0x0004d08d ... 5844 --> 30690
0x0004e793 ... 4466 --> 17365
0x0004f935 ... 5151 --> 26890
0x00050d87 ..... 8506 --> 49791
0x00052ef1 . 1736 --> 5644
0x000535ec .. 2295 --> 7946
0x00053f14 . 70 --> 98
0x00053f8a . 128 --> 194
0x0005403a .... 6459 --> 31845
0x000559a8 .... 7067 --> 35225
0x00057572 ... 5038 --> 19302
0x00058952 ....... 14136 --> 78767
0x0005c0ba ... 4145 --> 17845
0x0005d11d ...... 10506 --> 57836
0x0005fa64 . 1430 --> 4661
0x0006002f .. 2859 --> 10723
0x00060b94 .. 2245 --> 9540
0x0006148b ..... 9472 --> 45573
0x0008b000
- 41 valid zip blocks found
C:\Users\*SCHAOS*>

The following user thanked *SCHAOS* for this useful post:

Hawkin
03-19-2011, 06:49 PM #4
TairyHesticles
Add Me on PSN/X-Box Live!
Originally posted by SCHAOS
Its not publicly possible. As far as the getting the good guns in the box, there is a table of % ratio chances. Let me dig it up and Ill post it for you.

Here is some weapon info ( I havnt found the table yet)


#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_zombiemode_audio;
init()
{
init_weapons();
init_weapon_upgrade();
init_pay_turret();
treasure_chest_init();
level thread add_limited_tesla_gun();
PreCacheShader( "minimap_icon_mystery_box" );
PrecacheShader( "specialty_instakill_zombies" );
PrecacheShader( "specialty_firesale_zombies" );
}
add_zombie_weapon( weapon_name, upgrade_name, hint, cost, weaponVO, weaponVOresp, ammo_cost )
{
if( IsDefined( level.zombie_include_weapons ) && !IsDefined( level.zombie_include_weapons[weapon_name] ) )
{
return;
}
table = "mp/zombiemode.csv";
table_cost = TableLookUp( table, 0, weapon_name, 1 );
table_ammo_cost = TableLookUp( table, 0, weapon_name, 2 );
if( IsDefined( table_cost ) && table_cost != "" )
{
cost = round_up_to_ten( int( table_cost ) );
}
if( IsDefined( table_ammo_cost ) && table_ammo_cost != "" )
{
ammo_cost = round_up_to_ten( int( table_ammo_cost ) );
}
PrecacheString( hint );
struct = SpawnStruct();
if( !IsDefined( level.zombie_weapons ) )
{
level.zombie_weapons = [];
}
struct.weapon_name = weapon_name;
struct.upgrade_name = upgrade_name;
struct.weapon_classname = "weapon_" + weapon_name;
struct.hint = hint;
struct.cost = cost;
struct.vox = weaponVO;
struct.vox_response = weaponVOresp;
struct.is_in_box = level.zombie_include_weapons[weapon_name];
if( !IsDefined( ammo_cost ) )
{
ammo_cost = round_up_to_ten( int( cost * 0.5 ) );
}
struct.ammo_cost = ammo_cost;
level.zombie_weapons[weapon_name] = struct;
}
default_weighting_func()
{
return 1;
}
default_tesla_weighting_func()
{
num_to_add = 1;
if( isDefined( level.pulls_since_last_tesla_gun ) )
{
if( isDefined(level.player_drops_tesla_gun) && level.player_drops_tesla_gun == true )
{
num_to_add += int(.2 * level.zombie_include_weapons.size);
}
if( !isDefined(level.player_seen_tesla_gun) || level.player_seen_tesla_gun == false )
{
if( level.round_number > 10 )
{
num_to_add += int(.2 * level.zombie_include_weapons.size);
}
else if( level.round_number > 5 )
{
num_to_add += int(.15 * level.zombie_include_weapons.size);
}
}
}
return num_to_add;
}
default_1st_move_weighting_func()
{
if( level.chest_moves > 0 )
{
num_to_add = 1;
return num_to_add;
}
else
{
return 0;
}
}
default_upgrade_weapon_weighting_func()
{
if ( level.chest_moves > 1 )
{
return 1;
}
else
{
return 0;
}
}
default_cymbal_monkey_weighting_func()
{
players = get_players();
count = 0;
for( i = 0; i < players.size; i++ )
{
if( players has_weapon_or_upgrade( "zombie_cymbal_monkey" ) )
{
count++;
}
}
if ( count > 0 )
{
return 1;
}
else
{
if( level.round_number < 10 )
{
return 3;
}
else
{
return 5;
}
}
}
is_weapon_included( weapon_name )
{
if( !IsDefined( level.zombie_weapons ) )
{
return false;
}
return IsDefined( level.zombie_weapons[weapon_name] );
}
include_zombie_weapon( weapon_name, in_box, collector, weighting_func )
{
if( !IsDefined( level.zombie_include_weapons ) )
{
level.zombie_include_weapons = [];
level.collector_achievement_weapons = [];
}
if( !isDefined( in_box ) )
{
in_box = true;
}
if( isDefined( collector ) && collector )
{
level.collector_achievement_weapons = array_add( level.collector_achievement_weapons, weapon_name );
}
level.zombie_include_weapons[weapon_name] = in_box;
PrecacheItem( weapon_name );
if( !isDefined( weighting_func ) )
{
level.weapon_weighting_funcs[weapon_name] = maps\_zombiemode_weapons::default_weighting_func;
}
else
{
level.weapon_weighting_funcs[weapon_name] = weighting_func;
}
}
init_weapons()
{
add_zombie_weapon( "m1911_zm", "m1911_upgraded_zm", &"ZOMBIE_WEAPON_M1911", 50, "pistol", "", undefined );
add_zombie_weapon( "python_zm", "python_upgraded_zm", &"ZOMBIE_WEAPON_PYTHON", 2200, "pistol", "", undefined );
add_zombie_weapon( "cz75_zm", "cz75_upgraded_zm", &"ZOMBIE_WEAPON_CZ75", 50, "pistol", "", undefined );
add_zombie_weapon( "ak74u_zm", "ak74u_upgraded_zm", &"ZOMBIE_WEAPON_AK74U", 1200, "smg", "", undefined );
add_zombie_weapon( "mp5k_zm", "mp5k_upgraded_zm", &"ZOMBIE_WEAPON_MP5K", 1000, "smg", "", undefined );
add_zombie_weapon( "mp40_zm", "mp40_upgraded_zm", &"ZOMBIE_WEAPON_MP40", 1000, "smg", "", undefined );
add_zombie_weapon( "mpl_zm", "mpl_upgraded_zm", &"ZOMBIE_WEAPON_MPL", 1000, "smg", "", undefined );
add_zombie_weapon( "pm63_zm", "pm63_upgraded_zm", &"ZOMBIE_WEAPON_PM63", 1000, "smg", "", undefined );
add_zombie_weapon( "spectre_zm", "spectre_upgraded_zm", &"ZOMBIE_WEAPON_SPECTRE", 50, "smg", "", undefined );
add_zombie_weapon( "cz75dw_zm", "cz75dw_upgraded_zm", &"ZOMBIE_WEAPON_CZ75DW", 50, "dualwield", "", undefined );
add_zombie_weapon( "ithaca_zm", "ithaca_upgraded_zm", &"ZOMBIE_WEAPON_ITHACA", 1500, "shotgun", "", undefined );
add_zombie_weapon( "spas_zm", "spas_upgraded_zm", &"ZOMBIE_WEAPON_SPAS", 2000, "shotgun", "", undefined );
add_zombie_weapon( "rottweil72_zm", "rottweil72_upgraded_zm", &"ZOMBIE_WEAPON_ROTTWEIL72", 500, "shotgun", "", undefined );
add_zombie_weapon( "hs10_zm", "hs10_upgraded_zm", &"ZOMBIE_WEAPON_HS10", 50, "shotgun", "", undefined );
add_zombie_weapon( "m14_zm", "m14_upgraded_zm", &"ZOMBIE_WEAPON_M14", 500, "rifle", "", undefined );
add_zombie_weapon( "m16_zm", "m16_gl_upgraded_zm", &"ZOMBIE_WEAPON_M16", 1200, "burstrifle", "", undefined );
add_zombie_weapon( "g11_lps_zm", "g11_lps_upgraded_zm", &"ZOMBIE_WEAPON_G11", 900, "burstrifle", "", undefined );
add_zombie_weapon( "famas_zm", "famas_upgraded_zm", &"ZOMBIE_WEAPON_FAMAS", 50, "burstrifle", "", undefined );
add_zombie_weapon( "aug_acog_zm", "aug_acog_mk_upgraded_zm", &"ZOMBIE_WEAPON_AUG", 1200, "assault", "", undefined );
add_zombie_weapon( "galil_zm", "galil_upgraded_zm", &"ZOMBIE_WEAPON_GALIL", 100, "assault", "", undefined );
add_zombie_weapon( "commando_zm", "commando_upgraded_zm", &"ZOMBIE_WEAPON_COMMANDO", 100, "assault", "", undefined );
add_zombie_weapon( "fnfal_zm", "fnfal_upgraded_zm", &"ZOMBIE_WEAPON_FNFAL", 100, "burstrifle", "", undefined );
add_zombie_weapon( "dragunov_zm", "dragunov_upgraded_zm", &"ZOMBIE_WEAPON_DRAGUNOV", 2500, "sniper", "", undefined );
add_zombie_weapon( "l96a1_zm", "l96a1_upgraded_zm", &"ZOMBIE_WEAPON_L96A1", 50, "sniper", "", undefined );
add_zombie_weapon( "rpk_zm", "rpk_upgraded_zm", &"ZOMBIE_WEAPON_RPK", 4000, "mg", "", undefined );
add_zombie_weapon( "hk21_zm", "hk21_upgraded_zm", &"ZOMBIE_WEAPON_HK21", 50, "mg", "", undefined );
add_zombie_weapon( "frag_grenade_zm", undefined, &"ZOMBIE_WEAPON_FRAG_GRENADE", 250, "grenade", "", undefined );
add_zombie_weapon( "claymore_zm", undefined, &"ZOMBIE_WEAPON_CLAYMORE", 1000, "grenade", "", undefined );
add_zombie_weapon( "m72_law_zm", "m72_law_upgraded_zm", &"ZOMBIE_WEAPON_M72_LAW", 2000, "launcher", "", undefined );
add_zombie_weapon( "china_lake_zm", "china_lake_upgraded_zm", &"ZOMBIE_WEAPON_CHINA_LAKE", 2000, "launcher", "", undefined );
add_zombie_weapon( "zombie_cymbal_monkey", undefined, &"ZOMBIE_WEAPON_SATCHEL_2000", 2000, "monkey", "", undefined );
add_zombie_weapon( "ray_gun_zm", "ray_gun_upgraded_zm", &"ZOMBIE_WEAPON_RAYGUN", 10000, "raygun", "", undefined );
add_zombie_weapon( "tesla_gun_zm", "tesla_gun_upgraded_zm", &"ZOMBIE_WEAPON_TESLA", 10, "tesla", "", undefined );
add_zombie_weapon( "thundergun_zm", "thundergun_upgraded_zm", &"ZOMBIE_WEAPON_THUNDERGUN", 10, "thunder", "", undefined );
add_zombie_weapon( "crossbow_explosive_zm", "crossbow_explosive_upgraded_zm", &"ZOMBIE_WEAPON_CROSSBOW_EXPOLOSIVE", 10, "crossbow", "", undefined );
add_zombie_weapon( "knife_ballistic_zm", "knife_ballistic_upgraded_zm", &"ZOMBIE_WEAPON_KNIFE_BALLISTIC", 10, "knife_ballistic", "", undefined );
add_zombie_weapon( "knife_ballistic_bowie_zm", "knife_ballistic_bowie_upgraded_zm", &"ZOMBIE_WEAPON_KNIFE_BALLISTIC", 10, "knife_ballistic", "", undefined );
add_zombie_weapon( "knife_ballistic_sickle_zm", "knife_ballistic_sickle_upgraded_zm", &"ZOMBIE_WEAPON_KNIFE_BALLISTIC", 10, "knife_ballistic", "", undefined );
add_zombie_weapon( "freezegun_zm", "freezegun_upgraded_zm", &"ZOMBIE_WEAPON_FREEZEGUN", 10, "freezegun", "", undefined );
add_zombie_weapon( "zombie_black_hole_bomb", undefined, &"ZOMBIE_WEAPON_SATCHEL_2000", 2000, "gersh", "", undefined );
add_zombie_weapon( "zombie_nesting_dolls", undefined, &"ZOMBIE_WEAPON_NESTING_DOLLS", 2000, "dolls", "", undefined );
Precachemodel("zombie_teddybear");
}
add_limited_tesla_gun()
{
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = weapon_spawns.zombie_weapon_upgrade;
if(hint_string == "tesla_gun_zm")
{
weapon_spawns waittill("trigger");
weapon_spawns disable_trigger();
break;
}
}
}
add_limited_weapon( weapon_name, amount )
{
if( !IsDefined( level.limited_weapons ) )
{
level.limited_weapons = [];
}
level.limited_weapons[weapon_name] = amount;
}
init_pay_turret()
{
pay_turrets = [];
pay_turrets = GetEntArray( "pay_turret", "targetname" );
for( i = 0; i < pay_turrets.size; i++ )
{
cost = level.pay_turret_cost;
if( !isDefined( cost ) )
{
cost = 1000;
}
pay_turrets SetHintString( &"ZOMBIE_PAY_TURRET", cost );
pay_turrets SetCursorHint( "HINT_NOICON" );
pay_turrets UseTriggerRequireLookAt();
pay_turrets thread pay_turret_think( cost );
}
}
init_weapon_upgrade()
{
weapon_spawns = [];
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = get_weapon_hint( weapon_spawns.zombie_weapon_upgrade );
cost = get_weapon_cost( weapon_spawns.zombie_weapon_upgrade );
weapon_spawns SetHintString( hint_string, cost );
weapon_spawns setCursorHint( "HINT_NOICON" );
weapon_spawns UseTriggerRequireLookAt();
weapon_spawns thread weapon_spawn_think();
model = getent( weapon_spawns.target, "targetname" );
model useweaponhidetags( weapon_spawns.zombie_weapon_upgrade );
model hide();
}
}
init_weapon_cabinet()
{
weapon_cabs = GetEntArray( "weapon_cabinet_use", "targetname" );
for( i = 0; i < weapon_cabs.size; i++ )
{
weapon_cabs SetHintString( &"ZOMBIE_CABINET_OPEN_1500" );
weapon_cabs setCursorHint( "HINT_NOICON" );
weapon_cabs UseTriggerRequireLookAt();
}
}
get_weapon_hint( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].hint;
}
get_weapon_cost( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].cost;
}
get_ammo_cost( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].ammo_cost;
}
get_is_in_box( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].is_in_box;
}
is_weapon_upgraded( weaponname )
{
if( !isdefined( weaponname ) || weaponname == "" )
{
return false;
}
weaponname = ToLower( weaponname );
ziw_keys = GetArrayKeys( level.zombie_weapons );
for ( i=0; i<level.zombie_weapons.size; i++ )
{
if ( IsDefined(level.zombie_weapons[ ziw_keys ].upgrade_name) &&
level.zombie_weapons[ ziw_keys ].upgrade_name == weaponname )
{
return true;
}
}
return false;
}
has_upgrade( weaponname )
{
has_upgrade = false;
if( IsDefined(level.zombie_weapons[weaponname]) && IsDefined(level.zombie_weapons[weaponname].upgrade_name) )
{
has_upgrade = self HasWeapon( level.zombie_weapons[weaponname].upgrade_name );
}
if ( !has_upgrade && "knife_ballistic_zm" == weaponname )
{
has_upgrade = has_upgrade( "knife_ballistic_bowie_zm" ) || has_upgrade( "knife_ballistic_sickle_zm" );
}
return has_upgrade;
}
has_weapon_or_upgrade( weaponname )
{
upgradedweaponname = weaponname;
if ( IsDefined( level.zombie_weapons[weaponname] ) && IsDefined( level.zombie_weapons[weaponname].upgrade_name ) )
{
upgradedweaponname = level.zombie_weapons[weaponname].upgrade_name;
}
has_weapon = false;
if( IsDefined( level.zombie_weapons[weaponname] ) )
{
has_weapon = self HasWeapon( weaponname ) || self has_upgrade( weaponname );
}
if ( !has_weapon && "knife_ballistic_zm" == weaponname )
{
has_weapon = has_weapon_or_upgrade( "knife_ballistic_bowie_zm" ) || has_weapon_or_upgrade( "knife_ballistic_sickle_zm" );
}
return has_weapon;
}
treasure_chest_init()
{
if( level.mutators["mutator_noMagicBox"] )
{
chests = GetEntArray( "treasure_chest_use", "targetname" );
for( i=0; i < chests.size; i++ )
{
chests get_chest_pieces();
chests hide_chest();
}
return;
}
flag_init("moving_chest_enabled");
flag_init("moving_chest_now");
flag_init("chest_has_been_used");
level.chest_moves = 0;
level.chest_level = 0;
level.chests = GetEntArray( "treasure_chest_use", "targetname" );
for (i=0; i<level.chests.size; i++ )
{
level.chests.orig_origin = level.chests.origin;
level.chests get_chest_pieces();
if ( isDefined( level.chests.zombie_cost ) )
{
level.chests.old_cost = level.chests.zombie_cost;
}
else
{
level.chests.old_cost = 950;
}
}
level.chest_accessed = 0;
if (level.chests.size > 1)
{
flag_set("moving_chest_enabled");
level.chests = array_randomize(level.chests);
init_starting_chest_location();
}
else
{
level.chest_index = 0;
}
array_thread( level.chests, ::treasure_chest_think );
}
init_starting_chest_location()
{
level.chest_index = 0;
start_chest_found = false;
for( i = 0; i < level.chests.size; i++ )
{
if( isdefined( level.random_pandora_box_start ) && level.random_pandora_box_start == true )
{
if ( start_chest_found || (IsDefined( level.chests.start_exclude ) && level.chests.start_exclude == 1) )
{
level.chests hide_chest();
}
else
{
level.chest_index = i;
level.chests[level.chest_index] hide_rubble();
start_chest_found = true;
}
}
else
{
if ( start_chest_found || !IsDefined(level.chests.script_noteworthy ) || ( !IsSubStr( level.chests.script_noteworthy, "start_chest" ) ) )
{
level.chests hide_chest();
}
else
{
level.chest_index = i;
level.chests[level.chest_index] hide_rubble();
start_chest_found = true;
}
}
}
if( !isDefined( level.pandora_show_func ) )
{
level.pandora_show_func = ::default_pandora_show_func;
}
level.chests[level.chest_index] thread [[ level.pandora_show_func ]]();
}
hide_rubble()
{
rubble = getentarray( self.script_noteworthy + "_rubble", "script_noteworthy" );
if ( IsDefined( rubble ) )
{
for ( x = 0; x < rubble.size; x++ )
{
rubble[x] hide();
}
}
else
{
println( "^3Warning: No rubble found for magic box" );
}
}
show_rubble()
{
if ( IsDefined( self.chest_rubble ) )
{
for ( x = 0; x < self.chest_rubble.size; x++ )
{
self.chest_rubble[x] show();
}
}
else
{
println( "^3Warning: No rubble found for magic box" );
}
}
set_treasure_chest_cost( cost )
{
level.zombie_treasure_chest_cost = cost;
}
get_chest_pieces()
{
self.chest_lid = GetEnt(self.target, "targetname");
self.chest_origin = GetEnt(self.chest_lid.target, "targetname");
self.chest_box = GetEnt(self.chest_origin.target, "targetname");
self.chest_rubble = [];
rubble = GetEntArray( self.script_noteworthy + "_rubble", "script_noteworthy" );
for ( i=0; i<rubble.size; i++ )
{
if ( DistanceSquared( self.origin, rubble.origin ) < 10000 )
{
self.chest_rubble[ self.chest_rubble.size ] = rubble;
}
}
}
play_crazi_sound()
{
self playlocalsound("zmb_laugh_child");
}
show_chest()
{
self thread [[ level.pandora_show_func ]]();
self enable_trigger();
self.chest_lid show();
self.chest_box show();
self.chest_lid playsound( "zmb_box_poof_land" );
self.chest_lid playsound( "zmb_couch_slam" );
}
hide_chest()
{
self disable_trigger();
self.chest_lid hide();
self.chest_box hide();
if ( IsDefined( self.pandora_light ) )
{
self.pandora_light delete();
}
}
default_pandora_fx_func( )
{
self.pandora_light = Spawn( "script_model", self.chest_origin.origin );
self.pandora_light.angles = self.chest_origin.angles + (-90, 0, 0);
self.pandora_light SetModel( "tag_origin" );
playfxontag(level._effect["lght_marker"], self.pandora_light, "tag_origin");
}
default_pandora_show_func( anchor, anchorTarget, pieces )
{
if ( !IsDefined(self.pandora_light) )
{
if( !IsDefined( level.pandora_fx_func ) )
{
level.pandora_fx_func = ::default_pandora_fx_func;
}
self thread [[ level.pandora_fx_func ]]();
}
playsoundatposition( "zmb_box_poof", self.chest_lid.origin );
wait(0.5);
playfx( level._effect["lght_marker_flare"],self.pandora_light.origin );
Objective_Add( 0, "active", "Mystery Box", self.chest_lid.origin, "minimap_icon_mystery_box" );
}
treasure_chest_think()
{
if( IsDefined(level.zombie_vars["zombie_powerup_fire_sale_on"]) && level.zombie_vars["zombie_powerup_fire_sale_on"] )
{
self set_hint_string( self, "powerup_fire_sale_cost" );
}
else
{
self set_hint_string( self, "default_treasure_chest_" + self.zombie_cost );
}
self setCursorHint( "HINT_NOICON" );
user = undefined;
user_cost = undefined;
while( 1 )
{
self waittill( "trigger", user );
if( user in_revive_trigger() )
{
wait( 0.1 );
continue;
}
if( user is_drinking() )
{
wait( 0.1 );
continue;
}
if ( is_true( self.disabled ) )
{
wait( 0.1 );
continue;
}
if( user GetCurrentWeapon() == "none" )
{
wait( 0.1 );
continue;
}
if( is_player_valid( user ) && user.score >= self.zombie_cost )
{
user maps\_zombiemode_score::minus_to_player_score( self.zombie_cost );
user_cost = self.zombie_cost;
self.chest_user = user;
break;
}
else if ( user.score < self.zombie_cost )
{
user maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 2 );
continue;
}
wait 0.05;
}
flag_set("chest_has_been_used");
self._box_open = true;
self._box_opened_by_fire_sale = false;
if ( is_true( level.zombie_vars["zombie_powerup_fire_sale_on"] ) )
{
self._box_opened_by_fire_sale = true;
}
self.chest_lid thread treasure_chest_lid_open();
self.timedOut = false;
self.chest_origin thread treasure_chest_weapon_spawn( self, user );
self.chest_origin thread treasure_chest_glowfx();
self disable_trigger();
self.chest_origin waittill( "randomization_done" );
if (flag("moving_chest_now") && !self._box_opened_by_fire_sale && IsDefined(user_cost))
{
user maps\_zombiemode_score::add_to_player_score( user_cost, false );
}
if (flag("moving_chest_now") && !level.zombie_vars["zombie_powerup_fire_sale_on"])
{
self.chest_user maps\_zombiemode_audio::create_and_play_dialog( "general", "box_move" );
self thread treasure_chest_move();
}
else
{
self.grab_weapon_hint = true;
self.chest_user = user;
self sethintstring( &"ZOMBIE_TRADE_WEAPONS" );
self setCursorHint( "HINT_NOICON" );
self thread decide_hide_show_hint( "weapon_grabbed");
self enable_trigger();
self thread treasure_chest_timeout();
while( 1 )
{
self waittill( "trigger", grabber );
if( IsDefined( grabber.is_drinking ) && grabber is_drinking() )
{
wait( 0.1 );
continue;
}
if ( grabber == user && user GetCurrentWeapon() == "none" )
{
wait( 0.1 );
continue;
}
if( grabber == user || grabber == level )
{
current_weapon = user GetCurrentWeapon();
if( grabber == user && is_player_valid( user ) && !user is_drinking() && !is_placeable_mine( current_weapon ) && "syrette_sp" != current_weapon )
{
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type magic_accept",
user.playername, user.score, level.team_pool[ user.team_num ].score, level.round_number, self.zombie_cost, self.chest_origin.weapon_string, self.origin );
self notify( "user_grabbed_weapon" );
user thread treasure_chest_give_weapon( self.chest_origin.weapon_string );
break;
}
else if( grabber == level )
{
self.timedOut = true;
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type magic_reject",
user.playername, user.score, level.team_pool[ user.team_num ].score, level.round_number, self.zombie_cost, self.chest_origin.weapon_string, self.origin );
break;
}
}
wait 0.05;
}
self.grab_weapon_hint = false;
self.chest_origin notify( "weapon_grabbed" );
if ( !is_true( self._box_opened_by_fire_sale ) )
{
level.chest_accessed += 1;
}
if( level.chest_moves > 0 && isDefined(level.pulls_since_last_ray_gun) )
{
level.pulls_since_last_ray_gun += 1;
}
if( isDefined(level.pulls_since_last_tesla_gun) )
{
level.pulls_since_last_tesla_gun += 1;
}
self disable_trigger();
self.chest_lid thread treasure_chest_lid_close( self.timedOut );
wait 3;
if ( is_true( level.zombie_vars["zombie_powerup_fire_sale_on"] ) || self == level.chests[level.chest_index] )
{
self enable_trigger();
self setvisibletoall();
}
}
self._box_open = false;
self._box_opened_by_fire_sale = false;
self.chest_user = undefined;
self notify( "chest_accessed" );
self thread treasure_chest_think();
}
decide_hide_show_chest_hint( endon_notify )
{
if( isDefined( endon_notify ) )
{
self endon( endon_notify );
}
while( true )
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
if ( (IsDefined(self.chest_user) && players != self.chest_user ) ||
!players can_buy_weapon() )
{
self SetInvisibleToPlayer( players, true );
}
else
{
self SetInvisibleToPlayer( players, false );
}
}
wait( 0.1 );
}
}
decide_hide_show_hint( endon_notify )
{
if( isDefined( endon_notify ) )
{
self endon( endon_notify );
}
while( true )
{
if(IsDefined(self.chest_user))
{
if( is_placeable_mine( self.chest_user GetCurrentWeapon() ) )
{
self SetInvisibleToPlayer( self.chest_user);
}
else
{
self SetVisibleToPlayer( self.chest_user );
}
}
else
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
if( players can_buy_weapon())
{
self SetInvisibleToPlayer( players, false );
}
else
{
self SetInvisibleToPlayer( players, true );
}
}
}
wait( 0.1 );
}
}
can_buy_weapon()
{
if( IsDefined( self.is_drinking ) && self is_drinking() )
{
return false;
}
current_weapon = self GetCurrentWeapon();
if( is_placeable_mine( current_weapon ) )
{
return false;
}
if( self in_revive_trigger() )
{
return false;
}
if( current_weapon == "none" )
{
return false;
}
return true;
}
treasure_chest_move()
{
level waittill("weapon_fly_away_start");
players = get_players();
array_thread(players, ::play_crazi_sound);
level waittill("weapon_fly_away_end");
self.chest_lid thread treasure_chest_lid_close(false);
self setvisibletoall();
self hide_chest();
fake_pieces = [];
fake_pieces[0] = spawn("script_model",self.chest_lid.origin);
fake_pieces[0].angles = self.chest_lid.angles;
fake_pieces[0] setmodel(self.chest_lid.model);
fake_pieces[1] = spawn("script_model",self.chest_box.origin);
fake_pieces[1].angles = self.chest_box.angles;
fake_pieces[1] setmodel(self.chest_box.model);
anchor = spawn("script_origin",fake_pieces[0].origin);
soundpoint = spawn("script_origin", self.chest_origin.origin);
anchor playsound("zmb_box_move");
for(i=0;i<fake_pieces.size;i++)
{
fake_pieces linkto(anchor);
}
playsoundatposition ("zmb_whoosh", soundpoint.origin );
playsoundatposition ("zmb_vox_ann_magicbox", soundpoint.origin );
anchor moveto(anchor.origin + (0,0,50),5);
if( isDefined( level.custom_vibrate_func ) )
{
[[ level.custom_vibrate_func ]]( anchor );
}
else
{
direction = self.chest_box.origin - self.chest_lid.origin;
direction = (direction[1], direction[0], 0);
if(direction[1] < 0 || (direction[0] > 0 && direction[1] > 0))
{
direction = (direction[0], direction[1] * -1, 0);
}
else if(direction[0] < 0)
{
direction = (direction[0] * -1, direction[1], 0);
}
anchor Vibrate( direction, 10, 0.5, 5);
}
anchor waittill("movedone");
playfx(level._effect["poltergeist"], self.chest_origin.origin);
playsoundatposition ("zmb_box_poof", soundpoint.origin);
for(i=0;i<fake_pieces.size;i++)
{
fake_pieces delete();
}
self show_rubble();
wait(0.1);
anchor delete();
soundpoint delete();
if(level.zombie_vars["zombie_powerup_fire_sale_on"] == true)
{
current_sale_time = level.zombie_vars["zombie_powerup_fire_sale_time"];
wait_network_frame();
self thread fire_sale_fix();
level.zombie_vars["zombie_powerup_fire_sale_time"] = current_sale_time;
while(level.zombie_vars["zombie_powerup_fire_sale_time"] > 0)
{
wait(0.1);
}
}
else
{
wait(5);
}
level.verify_chest = false;
index = -1;
for ( i=0; i<level.chests.size; i++ )
{
if ( IsSubStr( level.chests.script_noteworthy, ("move"+(level.chest_moves+1)) ) &&
i != level.chest_index )
{
index = i;
break;
}
}
if ( index != -1 )
{
level.chest_index = index;
}
else
{
level.chest_index++;
}
if (level.chest_index >= level.chests.size)
{
temp_chest_name = level.chests[level.chest_index - 1].script_noteworthy;
level.chest_index = 0;
level.chests = array_randomize(level.chests);
if (temp_chest_name == level.chests[level.chest_index].script_noteworthy)
{
level.chest_index++;
}
}
wait(0.01);
playfx(level._effect["poltergeist"], level.chests[level.chest_index].chest_origin.origin);
level.chests[level.chest_index] show_chest();
level.chests[level.chest_index] hide_rubble();
flag_clear("moving_chest_now");
}
fire_sale_fix()
{
if( !isdefined ( level.zombie_vars["zombie_powerup_fire_sale_on"] ) )
{
return;
}
if( level.zombie_vars["zombie_powerup_fire_sale_on"] )
{
self.old_cost = 950;
self thread show_chest();
self thread hide_rubble();
self.zombie_cost = 10;
self set_hint_string( self , "powerup_fire_sale_cost" );
wait_network_frame();
level waittill( "fire_sale_off" );
playfx(level._effect["poltergeist"], self.origin);
self playsound ( "zmb_box_poof_land" );
self playsound( "zmb_couch_slam" );
self thread hide_chest();
self thread show_rubble();
self.zombie_cost = self.old_cost;
self set_hint_string( self , "default_treasure_chest_" + self.zombie_cost );
}
}
check_for_desirable_chest_location()
{
if( !isdefined( level.desirable_chest_location ) )
return level.chest_index;
if( level.chests[level.chest_index].script_noteworthy == level.desirable_chest_location )
{
level.desirable_chest_location = undefined;
return level.chest_index;
}
for(i = 0 ; i < level.chests.size; i++ )
{
if( level.chests.script_noteworthy == level.desirable_chest_location )
{
level.desirable_chest_location = undefined;
return i;
}
}
level.desirable_chest_location = undefined;
return level.chest_index;
}
rotateroll_box()
{
angles = 40;
angles2 = 0;
while(isdefined(self))
{
self RotateRoll(angles + angles2, 0.5);
wait(0.7);
angles2 = 40;
self RotateRoll(angles * -2, 0.5);
wait(0.7);
}
}
verify_chest_is_open()
{
for (i = 0; i < level.open_chest_location.size; i++)
{
if(isdefined(level.open_chest_location))
{
if(level.open_chest_location == level.chests[level.chest_index].script_noteworthy)
{
level.verify_chest = true;
return;
}
}
}
level.verify_chest = false;
}
treasure_chest_timeout()
{
self endon( "user_grabbed_weapon" );
wait( 12 );
self notify( "trigger", level );
}
treasure_chest_lid_open()
{
openRoll = 105;
openTime = 0.5;
self RotateRoll( 105, openTime, ( openTime * 0.5 ) );
play_sound_at_pos( "open_chest", self.origin );
play_sound_at_pos( "music_chest", self.origin );
}
treasure_chest_lid_close( timedOut )
{
closeRoll = -105;
closeTime = 0.5;
self RotateRoll( closeRoll, closeTime, ( closeTime * 0.5 ) );
play_sound_at_pos( "close_chest", self.origin );
}
treasure_chest_ChooseRandomWeapon( player )
{
keys = GetArrayKeys( level.zombie_weapons );
return keys[RandomInt( keys.size )];
}
treasure_chest_ChooseWeightedRandomWeapon( player )
{
keys = GetArrayKeys( level.zombie_weapons );
filtered = [];
for( i = 0; i < keys.size; i++ )
{
if( !get_is_in_box( keys ) )
{
continue;
}
if( player has_weapon_or_upgrade( keys ) )
{
continue;
}
if( !IsDefined( keys ) )
{
continue;
}
num_entries = [[ level.weapon_weighting_funcs[keys] ]]();
for( j = 0; j < num_entries; j++ )
{
filtered[filtered.size] = keys;
}
}
if( IsDefined( level.limited_weapons ) )
{
keys2 = GetArrayKeys( level.limited_weapons );
players = get_players();
pap_triggers = GetEntArray("zombie_vending_upgrade", "targetname");
for( q = 0; q < keys2.size; q++ )
{
count = 0;
for( i = 0; i < players.size; i++ )
{
if( players has_weapon_or_upgrade( keys2[q] ) )
{
count++;
}
}
for ( k=0; k<pap_triggers.size; k++ )
{
if ( IsDefined(pap_triggers[k].current_weapon) && pap_triggers[k].current_weapon == keys2[q] )
{
count++;
}
}
for ( chestIndex = 0; chestIndex < level.chests.size; chestIndex++ )
{
if ( IsDefined( level.chests[chestIndex].chest_origin.weapon_string ) && level.chests[chestIndex].chest_origin.weapon_string == keys2[q] )
{
count++;
}
}
if( count >= level.limited_weapons[keys2[q]] )
{
filtered = array_remove( filtered, keys2[q] );
}
}
}
filtered = array_randomize( filtered );
return filtered[RandomInt( filtered.size )];
}
weapon_is_dual_wield(name)
{
switch(name)
{
case "cz75dw_zm":
case "cz75dw_upgraded_zm":
case "m1911_upgraded_zm":
case "hs10_upgraded_zm":
case "pm63_upgraded_zm":
return true;
default:
return false;
}
}
treasure_chest_weapon_spawn( chest, player )
{
assert(IsDefined(player));
self.weapon_string = undefined;
modelname = undefined;
rand = undefined;
number_cycles = 40;
chest.chest_box setclientflag(level._ZOMBIE_SCRIPTMOVER_FLAG_BOX_RANDOM);
for( i = 0; i < number_cycles; i++ )
{
if( i < 20 )
{
wait( 0.05 );
}
else if( i < 30 )
{
wait( 0.1 );
}
else if( i < 35 )
{
wait( 0.2 );
}
else if( i < 38 )
{
wait( 0.3 );
}
if( i + 1 < number_cycles )
{
rand = treasure_chest_ChooseRandomWeapon( player );
}
else
{
rand = treasure_chest_ChooseWeightedRandomWeapon( player );
}
}
chest.chest_box clearclientflag(level._ZOMBIE_SCRIPTMOVER_FLAG_BOX_RANDOM);
wait_network_frame();
floatHeight = 40;
model_dw = undefined;
model = spawn( "script_model", self.origin + ( 0, 0, floatHeight));
model.angles = self.angles +( 0, 90, 0 );
modelname = GetWeaponModel( rand );
model setmodel( modelname );
model useweaponhidetags( rand );
if ( weapon_is_dual_wield(rand))
{
model_dw = spawn( "script_model", model.origin - ( 3, 3, 3 ) );
model_dw.angles = self.angles +( 0, 90, 0 );
model_dw setmodel( modelname );
model_dw useweaponhidetags( rand );
}
self.weapon_string = rand;
if( (GetDvar( #"magic_chest_movable") == "1") && !is_true( chest._box_opened_by_fire_sale ) )
{
random = Randomint(100);
if( !isdefined( level.chest_min_move_usage ) )
{
level.chest_min_move_usage = 4;
}
if( level.chest_accessed < level.chest_min_move_usage )
{
chance_of_joker = -1;
}
else
{
chance_of_joker = level.chest_accessed + 20;
if ( level.chest_moves == 0 && level.chest_accessed >= 8 )
{
chance_of_joker = 100;
}
if( level.chest_accessed >= 4 && level.chest_accessed < 8 )
{
if( random < 15 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
if ( level.chest_moves > 0 )
{
if( level.chest_accessed >= 8 && level.chest_accessed < 13 )
{
if( random < 30 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
if( level.chest_accessed >= 13 )
{
if( random < 50 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
}
}
if ( chance_of_joker > random )
{
self.weapon_string = undefined;
model SetModel("zombie_teddybear");
model.angles = self.angles;
if(IsDefined(model_dw))
{
model_dw Delete();
model_dw = undefined;
}
wait 1;
flag_set("moving_chest_now");
level.chest_accessed = 0;
level.chest_moves++;
}
}
self notify( "randomization_done" );
if (flag("moving_chest_now") && !level.zombie_vars["zombie_powerup_fire_sale_on"])
{
wait .5;
level notify("weapon_fly_away_start");
wait 2;
model MoveZ(500, 4, 3);
if(IsDefined(model_dw))
{
model_dw MoveZ(500,4,3);
}
model waittill("movedone");
model delete();
if(IsDefined(model_dw))
{
model_dw Delete();
}
self notify( "box_moving" );
level notify("weapon_fly_away_end");
}
else
{
if( rand == "tesla_gun_zm" || rand == "ray_gun_zm" )
{
if( rand == "ray_gun_zm" )
{
level.pulls_since_last_ray_gun = 0;
}
if( rand == "tesla_gun_zm" )
{
level.pulls_since_last_tesla_gun = 0;
level.player_seen_tesla_gun = true;
}
}
model thread timer_til_despawn(floatHeight);
if(IsDefined(model_dw))
{
model_dw thread timer_til_despawn(floatHeight);
}
self waittill( "weapon_grabbed" );
if( !chest.timedOut )
{
model Delete();
if(IsDefined(model_dw))
{
model_dw Delete();
}
}
}
self.weapon_string = undefined;
}
chest_get_min_usage()
{
min_usage = 4;
return( min_usage );
}
chest_get_max_usage()
{
max_usage = 6;
players = get_players();
if( level.chest_moves == 0 )
{
if( players.size == 1 )
{
max_usage = 3;
}
else if( players.size == 2 )
{
max_usage = 4;
}
else if( players.size == 3 )
{
max_usage = 5;
}
else
{
max_usage = 6;
}
}
else
{
if( players.size == 1 )
{
max_usage = 4;
}
else if( players.size == 2 )
{
max_usage = 4;
}
else if( players.size == 3 )
{
max_usage = 5;
}
else
{
max_usage = 7;
}
}
return( max_usage );
}
timer_til_despawn(floatHeight)
{
putBackTime = 12;
self MoveTo( self.origin - ( 0, 0, floatHeight ), putBackTime, ( putBackTime * 0.5 ) );
wait( putBackTime );
if(isdefined(self))
{
self Delete();
}
}
treasure_chest_glowfx()
{
fxObj = spawn( "script_model", self.origin +( 0, 0, 0 ) );
fxobj setmodel( "tag_origin" );
fxobj.angles = self.angles +( 90, 0, 0 );
playfxontag( level._effect["chest_light"], fxObj, "tag_origin" );
self waittill_any( "weapon_grabbed", "box_moving" );
fxobj delete();
}
treasure_chest_give_weapon( weapon_string )
{
self.last_box_weapon = GetTime();
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;
weapon_limit = 2;
if( self HasWeapon( weapon_string ) )
{
if ( issubstr( weapon_string, "knife_ballistic_" ) )
{
self notify( "zmb_lost_knife" );
}
self GiveStartAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
return;
}
if( primaryWeapons.size >= weapon_limit )
{
current_weapon = self getCurrentWeapon();
if ( is_placeable_mine( current_weapon ) )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !is_offhand_weapon( weapon_string ) )
{
if( current_weapon == "tesla_gun_zm" )
{
level.player_drops_tesla_gun = true;
}
if ( issubstr( current_weapon, "knife_ballistic_" ) )
{
self notify( "zmb_lost_knife" );
}
self TakeWeapon( current_weapon );
if ( current_weapon == "m1911_zm" )
{
self.last_pistol_swap = GetTime();
}
}
}
}
self play_sound_on_ent( "purchase" );
if( IsDefined( level.zombiemode_offhand_weapon_give_override ) )
{
self [[ level.zombiemode_offhand_weapon_give_override ]]( weapon_string );
}
if( weapon_string == "zombie_cymbal_monkey" )
{
self maps\_zombiemode_weap_cymbal_monkey::player_give_cymbal_monkey();
self play_weapon_vo(weapon_string);
return;
}
else if ( weapon_string == "knife_ballistic_zm" && self HasWeapon( "bowie_knife_zm" ) )
{
weapon_string = "knife_ballistic_bowie_zm";
}
else if ( weapon_string == "knife_ballistic_zm" && self HasWeapon( "sickle_knife_zm" ) )
{
weapon_string = "knife_ballistic_sickle_zm";
}
if (weapon_string == "ray_gun_zm")
{
playsoundatposition ("mus_raygun_stinger", (0,0,0));
}
self GiveWeapon( weapon_string, 0 );
self GiveStartAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
self play_weapon_vo(weapon_string);
}
pay_turret_think( cost )
{
if( !isDefined( self.target ) )
{
return;
}
turret = GetEnt( self.target, "targetname" );
if( !isDefined( turret ) )
{
return;
}
turret makeTurretUnusable();
zone_name = turret get_current_zone();
if ( !IsDefined( zone_name ) )
{
zone_name = "";
}
while( true )
{
self waittill( "trigger", player );
if( !is_player_valid( player ) )
{
player thread ignore_triggers( 0.5 );
continue;
}
if( player in_revive_trigger() )
{
wait( 0.1 );
continue;
}
if( player is_drinking() )
{
wait(0.1);
continue;
}
if( player.score >= cost )
{
player maps\_zombiemode_score::minus_to_player_score( cost );
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type turret", player.playername, player.score, level.team_pool[ player.team_num ].score, level.round_number, cost, zone_name, self.origin );
turret makeTurretUsable();
turret UseBy( player );
self disable_trigger();
player.curr_pay_turret = turret;
turret thread watch_for_laststand( player );
turret thread watch_for_fake_death( player );
if( isDefined( level.turret_timer ) )
{
turret thread watch_for_timeout( player, level.turret_timer );
}
while( isDefined( turret getTurretOwner() ) && turret getTurretOwner() == player )
{
wait( 0.05 );
}
turret notify( "stop watching" );
player.curr_pay_turret = undefined;
turret makeTurretUnusable();
self enable_trigger();
}
else
{
play_sound_on_ent( "no_purchase" );
player maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 0 );
}
}
}
watch_for_laststand( player )
{
self endon( "stop watching" );
while( !player maps\_laststand::player_is_in_laststand() )
{
if( isDefined( level.intermission ) && level.intermission )
{
intermission = true;
}
wait( 0.05 );
}
if( isDefined( self getTurretOwner() ) && self getTurretOwner() == player )
{
self UseBy( player );
}
}
watch_for_fake_death( player )
{
self endon( "stop watching" );
player waittill( "fake_death" );
if( isDefined( self getTurretOwner() ) && self getTurretOwner() == player )
{
self UseBy( player );
}
}
watch_for_timeout( player, time )
{
self endon( "stop watching" );
self thread cancel_timer_on_end( player );
wait( time );
if( isDefined( self getTurretOwner() ) && self getTurretOwner() == player )
{
self UseBy( player );
}
}
cancel_timer_on_end( player )
{
self waittill( "stop watching" );
player notify( "stop watching" );
}
weapon_cabinet_door_open( left_or_right )
{
if( left_or_right == "left" )
{
self rotateyaw( 120, 0.3, 0.2, 0.1 );
}
else if( left_or_right == "right" )
{
self rotateyaw( -120, 0.3, 0.2, 0.1 );
}
}
check_collector_achievement( bought_weapon )
{
if ( !isdefined( self.bought_weapons ) )
{
self.bought_weapons = [];
self.bought_weapons = array_add( self.bought_weapons, bought_weapon );
}
else if ( !is_in_array( self.bought_weapons, bought_weapon ) )
{
self.bought_weapons = array_add( self.bought_weapons, bought_weapon );
}
else
{
return;
}
for( i = 0; i < level.collector_achievement_weapons.size; i++ )
{
if ( !is_in_array( self.bought_weapons, level.collector_achievement_weapons ) )
{
return;
}
}
self giveachievement_wrapper( "SP_ZOM_COLLECTOR" );
}
weapon_set_first_time_hint( cost, ammo_cost )
{
if ( isDefined( level.has_pack_a_punch ) && !level.has_pack_a_punch )
{
self SetHintString( &"ZOMBIE_WEAPONCOSTAMMO", cost, ammo_cost );
}
else
{
self SetHintString( &"ZOMBIE_WEAPONCOSTAMMO_UPGRADE", cost, ammo_cost );
}
}
weapon_spawn_think()
{
cost = get_weapon_cost( self.zombie_weapon_upgrade );
ammo_cost = get_ammo_cost( self.zombie_weapon_upgrade );
is_grenade = (WeaponType( self.zombie_weapon_upgrade ) == "grenade");
self thread decide_hide_show_hint();
self.first_time_triggered = false;
for( ;; )
{
self waittill( "trigger", player );
if( !is_player_valid( player ) )
{
player thread ignore_triggers( 0.5 );
continue;
}
if( !player can_buy_weapon() )
{
wait( 0.1 );
continue;
}
if( player GetCurrentWeapon() == "minigun_zm" )
{
wait( 0.1 );
continue;
}
player_has_weapon = player has_weapon_or_upgrade( self.zombie_weapon_upgrade );
if( !player_has_weapon )
{
if( player.score >= cost )
{
if( self.first_time_triggered == false )
{
model = getent( self.target, "targetname" );
model thread weapon_show( player );
self.first_time_triggered = true;
if(!is_grenade)
{
self weapon_set_first_time_hint( cost, ammo_cost );
}
}
player maps\_zombiemode_score::minus_to_player_score( cost );
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type weapon",
player.playername, player.score, level.team_pool[ player.team_num ].score, level.round_number, cost, self.zombie_weapon_upgrade, self.origin );
player weapon_give( self.zombie_weapon_upgrade );
player check_collector_achievement( self.zombie_weapon_upgrade );
}
else
{
play_sound_on_ent( "no_purchase" );
player maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 1 );
}
}
else
{
if ( player has_upgrade( self.zombie_weapon_upgrade ) )
{
ammo_cost = 4500;
}
else
{
ammo_cost = get_ammo_cost( self.zombie_weapon_upgrade );
}
if( player.score >= ammo_cost )
{
if( self.first_time_triggered == false )
{
model = getent( self.target, "targetname" );
model thread weapon_show( player );
self.first_time_triggered = true;
if(!is_grenade)
{
self weapon_set_first_time_hint( cost, get_ammo_cost( self.zombie_weapon_upgrade ) );
}
}
player check_collector_achievement( self.zombie_weapon_upgrade );
if( player has_upgrade( self.zombie_weapon_upgrade ) )
{
ammo_given = player ammo_give( level.zombie_weapons[ self.zombie_weapon_upgrade ].upgrade_name );
}
else
{
ammo_given = player ammo_give( self.zombie_weapon_upgrade );
}
if( ammo_given )
{
player maps\_zombiemode_score::minus_to_player_score( ammo_cost );
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type ammo",
player.playername, player.score, level.team_pool[ player.team_num ].score, level.round_number, ammo_cost, self.zombie_weapon_upgrade, self.origin );
}
}
else
{
play_sound_on_ent( "no_purchase" );
player maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 0 );
}
}
}
}
weapon_show( player )
{
player_angles = VectorToAngles( player.origin - self.origin );
player_yaw = player_angles[1];
weapon_yaw = self.angles[1];
if ( isdefined( self.script_int ) )
{
weapon_yaw -= self.script_int;
}
yaw_diff = AngleClamp180( player_yaw - weapon_yaw );
if( yaw_diff > 0 )
{
yaw = weapon_yaw - 90;
}
else
{
yaw = weapon_yaw + 90;
}
self.og_origin = self.origin;
self.origin = self.origin +( AnglesToForward( ( 0, yaw, 0 ) ) * 8 );
wait( 0.05 );
self Show();
play_sound_at_pos( "weapon_show", self.origin, self );
time = 1;
self MoveTo( self.og_origin, time );
}
get_pack_a_punch_weapon_options( weapon )
{
if ( !isDefined( self.pack_a_punch_weapon_options ) )
{
self.pack_a_punch_weapon_options = [];
}
if ( !is_weapon_upgraded( weapon ) )
{
return self CalcWeaponOptions( 0 );
}
if ( isDefined( self.pack_a_punch_weapon_options[weapon] ) )
{
return self.pack_a_punch_weapon_options[weapon];
}
smiley_face_reticle_index = 21;
camo_index = 15;
lens_index = randomIntRange( 0, 6 );
reticle_index = randomIntRange( 0, smiley_face_reticle_index );
reticle_color_index = randomIntRange( 0, 6 );
if ( "famas_upgraded_zm" == weapon )
{
reticle_index = smiley_face_reticle_index;
}
scary_eyes_reticle_index = 8;
purple_reticle_color_index = 3;
if ( reticle_index == scary_eyes_reticle_index )
{
reticle_color_index = purple_reticle_color_index;
}
letter_a_reticle_index = 2;
pink_reticle_color_index = 6;
if ( reticle_index == letter_a_reticle_index )
{
reticle_color_index = pink_reticle_color_index;
}
letter_e_reticle_index = 7;
green_reticle_color_index = 1;
if ( reticle_index == letter_e_reticle_index )
{
reticle_color_index = green_reticle_color_index;
}
self.pack_a_punch_weapon_options[weapon] = self CalcWeaponOptions( camo_index, lens_index, reticle_index, reticle_color_index );
return self.pack_a_punch_weapon_options[weapon];
}
weapon_give( weapon, is_upgrade )
{
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;
weapon_limit = 2;
if( !IsDefined( is_upgrade ) )
{
is_upgrade = false;
}
if( primaryWeapons.size >= weapon_limit )
{
current_weapon = self getCurrentWeapon();
if ( is_placeable_mine( current_weapon ) )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !is_offhand_weapon( weapon ) )
{
if ( issubstr( current_weapon, "knife_ballistic_" ) )
{
self notify( "zmb_lost_knife" );
}
self TakeWeapon( current_weapon );
if ( current_weapon == "m1911_zm" )
{
self.last_pistol_swap = GetTime();
}
}
}
}
if( IsDefined( level.zombiemode_offhand_weapon_give_override ) )
{
if( self [[ level.zombiemode_offhand_weapon_give_override ]]( weapon ) )
{
return;
}
}
if( weapon == "zombie_cymbal_monkey" )
{
self maps\_zombiemode_weap_cymbal_monkey::player_give_cymbal_monkey();
self play_weapon_vo( weapon );
return;
}
self play_sound_on_ent( "purchase" );
if ( !is_weapon_upgraded( weapon ) )
{
self GiveWeapon( weapon );
}
else
{
self GiveWeapon( weapon, 0, self get_pack_a_punch_weapon_options( weapon ) );
}
self GiveStartAmmo( weapon );
self SwitchToWeapon( weapon );
self play_weapon_vo(weapon);
}
play_weapon_vo(weapon)
{
type = self weapon_type_check(weapon);
self maps\_zombiemode_audio::create_and_play_dialog( "weapon_pickup", type );
}
weapon_type_check(weapon)
{
if( !IsDefined( self.entity_num ) )
return "crappy";
switch(self.entity_num)
{
case 0:
if( weapon == "m16_zm" )
return "favorite";
else if( weapon == "rottweil72_upgraded_zm" )
return "favorite_upgrade";
break;
case 1:
if( weapon == "fnfal_zm" )
return "favorite";
else if( weapon == "hk21_upgraded_zm" )
return "favorite_upgrade";
break;
case 2:
if( weapon == "china_lake_zm" )
return "favorite";
else if( weapon == "thundergun_upgraded_zm" )
return "favorite_upgrade";
break;
case 3:
if( weapon == "mp40_zm" )
return "favorite";
else if( weapon == "crossbow_explosive_upgraded_zm" )
return "favorite_upgrade";
break;
}
if( IsSubStr( weapon, "upgraded" ) )
return "upgrade";
else
return level.zombie_weapons[weapon].vox;
}
get_player_index(player)
{
assert( IsPlayer( player ) );
assert( IsDefined( player.entity_num ) );
return player.entity_num;
}
ammo_give( weapon )
{
give_ammo = false;
if( !is_offhand_weapon( weapon ) )
{
if( isdefined( weapon ) )
{
stockMax = 0;
stockMax = WeaponStartAmmo( weapon );
clipCount = self GetWeaponAmmoClip( weapon );
currStock = self GetAmmoCount( weapon );
if( ( currStock - clipcount ) >= stockMax )
{
give_ammo = false;
}
else
{
give_ammo = true;
}
}
}
else
{
if( self has_weapon_or_upgrade( weapon ) )
{
if( self getammocount( weapon ) < WeaponMaxAmmo( weapon ) )
{
give_ammo = true;
}
}
}
if( give_ammo )
{
self play_sound_on_ent( "purchase" );
self GiveStartAmmo( weapon );
return true;
}
if( !give_ammo )
{
return false;
}
}


---------- Post added at 02:41 PM ---------- Previous post was at 01:28 PM ----------



Here is the offsets for the common_zombie_patch.ff

- open input file: C:\Users\*SCHAOS*\Desktop\common_zombie_patch.zone
- enter in directory: C:\Users\*SCHAOS*\Desktop\Decryption
- zip data to check: 32 bytes
- zip windowBits: 15
- seek offset: 0x00000000 (0)
+------------+-------------+-------------------------+
| hex_offset | blocks_dots | zip_size --> unzip_size |
+------------+-------------+-------------------------+
0x00033eee . 259 --> 589
0x00034033 . 290 --> 787
0x00034198 . 292 --> 791
0x000342ff . 293 --> 791
0x00034467 . 295 --> 791
0x000345d1 . 312 --> 982
0x0003474c . 286 --> 783
0x000348ab . 309 --> 956
0x00034a11 ... 5825 --> 29385
0x00036104 .. 2930 --> 10939
0x00036ca7 .. 2292 --> 7699
0x000375cb . 1783 --> 8244
0x00037cf3 .. 2793 --> 13543
0x0003880e .. 2971 --> 12328
0x000393d9 ... 5568 --> 23584
0x0003a9cc .. 3250 --> 14910
0x0003b6b9 . 877 --> 3030
0x0003ba64 . 939 --> 4094
0x0003be52 . 1242 --> 5504
0x0003c355 .. 3936 --> 16343
0x0003d2dc .................. 35284 --> 172728
0x00045cda ........... 21621 --> 104183
0x0004b180 .... 7899 --> 39839
0x0004d08d ... 5844 --> 30690
0x0004e793 ... 4466 --> 17365
0x0004f935 ... 5151 --> 26890
0x00050d87 ..... 8506 --> 49791
0x00052ef1 . 1736 --> 5644
0x000535ec .. 2295 --> 7946
0x00053f14 . 70 --> 98
0x00053f8a . 128 --> 194
0x0005403a .... 6459 --> 31845
0x000559a8 .... 7067 --> 35225
0x00057572 ... 5038 --> 19302
0x00058952 ....... 14136 --> 78767
0x0005c0ba ... 4145 --> 17845
0x0005d11d ...... 10506 --> 57836
0x0005fa64 . 1430 --> 4661
0x0006002f .. 2859 --> 10723
0x00060b94 .. 2245 --> 9540
0x0006148b ..... 9472 --> 45573
0x0008b000
- 41 valid zip blocks found
C:\Users\*SCHAOS*>


Put tags around that so it doesn't take up a long ass page. But other than that nice find bro Smile

/facepalm sowwy. i didn't know i clicked "Show" lol
03-20-2011, 04:55 PM #5
Hawkin
Lord of the Undead
Originally posted by SCHAOS
... :bro:


Thanks this is cool. Do you know what gsc this is called? I found a zip with almost all gsc, csc, csv, and cfg files for black ops, but it didn't have the zombiemode.csv. I'm not sure if it had this gsc but I couldn't find it. ( so many files)
Thanks again because this is going to be very helpful. +REP to you.
03-20-2011, 06:35 PM #6
Are those for ps3?
03-20-2011, 10:08 PM #7
Originally posted by SCHAOS
Its not publicly possible. As far as the getting the good guns in the box, there is a table of % ratio chances. Let me dig it up and Ill post it for you.

Here is some weapon info ( I havnt found the table yet)


#include maps\_utility;
#include common_scripts\utility;
#include maps\_zombiemode_utility;
#include maps\_zombiemode_audio;
init()
{
init_weapons();
init_weapon_upgrade();
init_pay_turret();
treasure_chest_init();
level thread add_limited_tesla_gun();
PreCacheShader( "minimap_icon_mystery_box" );
PrecacheShader( "specialty_instakill_zombies" );
PrecacheShader( "specialty_firesale_zombies" );
}
add_zombie_weapon( weapon_name, upgrade_name, hint, cost, weaponVO, weaponVOresp, ammo_cost )
{
if( IsDefined( level.zombie_include_weapons ) && !IsDefined( level.zombie_include_weapons[weapon_name] ) )
{
return;
}
table = "mp/zombiemode.csv";
table_cost = TableLookUp( table, 0, weapon_name, 1 );
table_ammo_cost = TableLookUp( table, 0, weapon_name, 2 );
if( IsDefined( table_cost ) && table_cost != "" )
{
cost = round_up_to_ten( int( table_cost ) );
}
if( IsDefined( table_ammo_cost ) && table_ammo_cost != "" )
{
ammo_cost = round_up_to_ten( int( table_ammo_cost ) );
}
PrecacheString( hint );
struct = SpawnStruct();
if( !IsDefined( level.zombie_weapons ) )
{
level.zombie_weapons = [];
}
struct.weapon_name = weapon_name;
struct.upgrade_name = upgrade_name;
struct.weapon_classname = "weapon_" + weapon_name;
struct.hint = hint;
struct.cost = cost;
struct.vox = weaponVO;
struct.vox_response = weaponVOresp;
struct.is_in_box = level.zombie_include_weapons[weapon_name];
if( !IsDefined( ammo_cost ) )
{
ammo_cost = round_up_to_ten( int( cost * 0.5 ) );
}
struct.ammo_cost = ammo_cost;
level.zombie_weapons[weapon_name] = struct;
}
default_weighting_func()
{
return 1;
}
default_tesla_weighting_func()
{
num_to_add = 1;
if( isDefined( level.pulls_since_last_tesla_gun ) )
{
if( isDefined(level.player_drops_tesla_gun) && level.player_drops_tesla_gun == true )
{
num_to_add += int(.2 * level.zombie_include_weapons.size);
}
if( !isDefined(level.player_seen_tesla_gun) || level.player_seen_tesla_gun == false )
{
if( level.round_number > 10 )
{
num_to_add += int(.2 * level.zombie_include_weapons.size);
}
else if( level.round_number > 5 )
{
num_to_add += int(.15 * level.zombie_include_weapons.size);
}
}
}
return num_to_add;
}
default_1st_move_weighting_func()
{
if( level.chest_moves > 0 )
{
num_to_add = 1;
return num_to_add;
}
else
{
return 0;
}
}
default_upgrade_weapon_weighting_func()
{
if ( level.chest_moves > 1 )
{
return 1;
}
else
{
return 0;
}
}
default_cymbal_monkey_weighting_func()
{
players = get_players();
count = 0;
for( i = 0; i < players.size; i++ )
{
if( players has_weapon_or_upgrade( "zombie_cymbal_monkey" ) )
{
count++;
}
}
if ( count > 0 )
{
return 1;
}
else
{
if( level.round_number < 10 )
{
return 3;
}
else
{
return 5;
}
}
}
is_weapon_included( weapon_name )
{
if( !IsDefined( level.zombie_weapons ) )
{
return false;
}
return IsDefined( level.zombie_weapons[weapon_name] );
}
include_zombie_weapon( weapon_name, in_box, collector, weighting_func )
{
if( !IsDefined( level.zombie_include_weapons ) )
{
level.zombie_include_weapons = [];
level.collector_achievement_weapons = [];
}
if( !isDefined( in_box ) )
{
in_box = true;
}
if( isDefined( collector ) && collector )
{
level.collector_achievement_weapons = array_add( level.collector_achievement_weapons, weapon_name );
}
level.zombie_include_weapons[weapon_name] = in_box;
PrecacheItem( weapon_name );
if( !isDefined( weighting_func ) )
{
level.weapon_weighting_funcs[weapon_name] = maps\_zombiemode_weapons::default_weighting_func;
}
else
{
level.weapon_weighting_funcs[weapon_name] = weighting_func;
}
}
init_weapons()
{
add_zombie_weapon( "m1911_zm", "m1911_upgraded_zm", &"ZOMBIE_WEAPON_M1911", 50, "pistol", "", undefined );
add_zombie_weapon( "python_zm", "python_upgraded_zm", &"ZOMBIE_WEAPON_PYTHON", 2200, "pistol", "", undefined );
add_zombie_weapon( "cz75_zm", "cz75_upgraded_zm", &"ZOMBIE_WEAPON_CZ75", 50, "pistol", "", undefined );
add_zombie_weapon( "ak74u_zm", "ak74u_upgraded_zm", &"ZOMBIE_WEAPON_AK74U", 1200, "smg", "", undefined );
add_zombie_weapon( "mp5k_zm", "mp5k_upgraded_zm", &"ZOMBIE_WEAPON_MP5K", 1000, "smg", "", undefined );
add_zombie_weapon( "mp40_zm", "mp40_upgraded_zm", &"ZOMBIE_WEAPON_MP40", 1000, "smg", "", undefined );
add_zombie_weapon( "mpl_zm", "mpl_upgraded_zm", &"ZOMBIE_WEAPON_MPL", 1000, "smg", "", undefined );
add_zombie_weapon( "pm63_zm", "pm63_upgraded_zm", &"ZOMBIE_WEAPON_PM63", 1000, "smg", "", undefined );
add_zombie_weapon( "spectre_zm", "spectre_upgraded_zm", &"ZOMBIE_WEAPON_SPECTRE", 50, "smg", "", undefined );
add_zombie_weapon( "cz75dw_zm", "cz75dw_upgraded_zm", &"ZOMBIE_WEAPON_CZ75DW", 50, "dualwield", "", undefined );
add_zombie_weapon( "ithaca_zm", "ithaca_upgraded_zm", &"ZOMBIE_WEAPON_ITHACA", 1500, "shotgun", "", undefined );
add_zombie_weapon( "spas_zm", "spas_upgraded_zm", &"ZOMBIE_WEAPON_SPAS", 2000, "shotgun", "", undefined );
add_zombie_weapon( "rottweil72_zm", "rottweil72_upgraded_zm", &"ZOMBIE_WEAPON_ROTTWEIL72", 500, "shotgun", "", undefined );
add_zombie_weapon( "hs10_zm", "hs10_upgraded_zm", &"ZOMBIE_WEAPON_HS10", 50, "shotgun", "", undefined );
add_zombie_weapon( "m14_zm", "m14_upgraded_zm", &"ZOMBIE_WEAPON_M14", 500, "rifle", "", undefined );
add_zombie_weapon( "m16_zm", "m16_gl_upgraded_zm", &"ZOMBIE_WEAPON_M16", 1200, "burstrifle", "", undefined );
add_zombie_weapon( "g11_lps_zm", "g11_lps_upgraded_zm", &"ZOMBIE_WEAPON_G11", 900, "burstrifle", "", undefined );
add_zombie_weapon( "famas_zm", "famas_upgraded_zm", &"ZOMBIE_WEAPON_FAMAS", 50, "burstrifle", "", undefined );
add_zombie_weapon( "aug_acog_zm", "aug_acog_mk_upgraded_zm", &"ZOMBIE_WEAPON_AUG", 1200, "assault", "", undefined );
add_zombie_weapon( "galil_zm", "galil_upgraded_zm", &"ZOMBIE_WEAPON_GALIL", 100, "assault", "", undefined );
add_zombie_weapon( "commando_zm", "commando_upgraded_zm", &"ZOMBIE_WEAPON_COMMANDO", 100, "assault", "", undefined );
add_zombie_weapon( "fnfal_zm", "fnfal_upgraded_zm", &"ZOMBIE_WEAPON_FNFAL", 100, "burstrifle", "", undefined );
add_zombie_weapon( "dragunov_zm", "dragunov_upgraded_zm", &"ZOMBIE_WEAPON_DRAGUNOV", 2500, "sniper", "", undefined );
add_zombie_weapon( "l96a1_zm", "l96a1_upgraded_zm", &"ZOMBIE_WEAPON_L96A1", 50, "sniper", "", undefined );
add_zombie_weapon( "rpk_zm", "rpk_upgraded_zm", &"ZOMBIE_WEAPON_RPK", 4000, "mg", "", undefined );
add_zombie_weapon( "hk21_zm", "hk21_upgraded_zm", &"ZOMBIE_WEAPON_HK21", 50, "mg", "", undefined );
add_zombie_weapon( "frag_grenade_zm", undefined, &"ZOMBIE_WEAPON_FRAG_GRENADE", 250, "grenade", "", undefined );
add_zombie_weapon( "claymore_zm", undefined, &"ZOMBIE_WEAPON_CLAYMORE", 1000, "grenade", "", undefined );
add_zombie_weapon( "m72_law_zm", "m72_law_upgraded_zm", &"ZOMBIE_WEAPON_M72_LAW", 2000, "launcher", "", undefined );
add_zombie_weapon( "china_lake_zm", "china_lake_upgraded_zm", &"ZOMBIE_WEAPON_CHINA_LAKE", 2000, "launcher", "", undefined );
add_zombie_weapon( "zombie_cymbal_monkey", undefined, &"ZOMBIE_WEAPON_SATCHEL_2000", 2000, "monkey", "", undefined );
add_zombie_weapon( "ray_gun_zm", "ray_gun_upgraded_zm", &"ZOMBIE_WEAPON_RAYGUN", 10000, "raygun", "", undefined );
add_zombie_weapon( "tesla_gun_zm", "tesla_gun_upgraded_zm", &"ZOMBIE_WEAPON_TESLA", 10, "tesla", "", undefined );
add_zombie_weapon( "thundergun_zm", "thundergun_upgraded_zm", &"ZOMBIE_WEAPON_THUNDERGUN", 10, "thunder", "", undefined );
add_zombie_weapon( "crossbow_explosive_zm", "crossbow_explosive_upgraded_zm", &"ZOMBIE_WEAPON_CROSSBOW_EXPOLOSIVE", 10, "crossbow", "", undefined );
add_zombie_weapon( "knife_ballistic_zm", "knife_ballistic_upgraded_zm", &"ZOMBIE_WEAPON_KNIFE_BALLISTIC", 10, "knife_ballistic", "", undefined );
add_zombie_weapon( "knife_ballistic_bowie_zm", "knife_ballistic_bowie_upgraded_zm", &"ZOMBIE_WEAPON_KNIFE_BALLISTIC", 10, "knife_ballistic", "", undefined );
add_zombie_weapon( "knife_ballistic_sickle_zm", "knife_ballistic_sickle_upgraded_zm", &"ZOMBIE_WEAPON_KNIFE_BALLISTIC", 10, "knife_ballistic", "", undefined );
add_zombie_weapon( "freezegun_zm", "freezegun_upgraded_zm", &"ZOMBIE_WEAPON_FREEZEGUN", 10, "freezegun", "", undefined );
add_zombie_weapon( "zombie_black_hole_bomb", undefined, &"ZOMBIE_WEAPON_SATCHEL_2000", 2000, "gersh", "", undefined );
add_zombie_weapon( "zombie_nesting_dolls", undefined, &"ZOMBIE_WEAPON_NESTING_DOLLS", 2000, "dolls", "", undefined );
Precachemodel("zombie_teddybear");
}
add_limited_tesla_gun()
{
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = weapon_spawns.zombie_weapon_upgrade;
if(hint_string == "tesla_gun_zm")
{
weapon_spawns waittill("trigger");
weapon_spawns disable_trigger();
break;
}
}
}
add_limited_weapon( weapon_name, amount )
{
if( !IsDefined( level.limited_weapons ) )
{
level.limited_weapons = [];
}
level.limited_weapons[weapon_name] = amount;
}
init_pay_turret()
{
pay_turrets = [];
pay_turrets = GetEntArray( "pay_turret", "targetname" );
for( i = 0; i < pay_turrets.size; i++ )
{
cost = level.pay_turret_cost;
if( !isDefined( cost ) )
{
cost = 1000;
}
pay_turrets SetHintString( &"ZOMBIE_PAY_TURRET", cost );
pay_turrets SetCursorHint( "HINT_NOICON" );
pay_turrets UseTriggerRequireLookAt();
pay_turrets thread pay_turret_think( cost );
}
}
init_weapon_upgrade()
{
weapon_spawns = [];
weapon_spawns = GetEntArray( "weapon_upgrade", "targetname" );
for( i = 0; i < weapon_spawns.size; i++ )
{
hint_string = get_weapon_hint( weapon_spawns.zombie_weapon_upgrade );
cost = get_weapon_cost( weapon_spawns.zombie_weapon_upgrade );
weapon_spawns SetHintString( hint_string, cost );
weapon_spawns setCursorHint( "HINT_NOICON" );
weapon_spawns UseTriggerRequireLookAt();
weapon_spawns thread weapon_spawn_think();
model = getent( weapon_spawns.target, "targetname" );
model useweaponhidetags( weapon_spawns.zombie_weapon_upgrade );
model hide();
}
}
init_weapon_cabinet()
{
weapon_cabs = GetEntArray( "weapon_cabinet_use", "targetname" );
for( i = 0; i < weapon_cabs.size; i++ )
{
weapon_cabs SetHintString( &"ZOMBIE_CABINET_OPEN_1500" );
weapon_cabs setCursorHint( "HINT_NOICON" );
weapon_cabs UseTriggerRequireLookAt();
}
}
get_weapon_hint( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].hint;
}
get_weapon_cost( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].cost;
}
get_ammo_cost( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].ammo_cost;
}
get_is_in_box( weapon_name )
{
AssertEx( IsDefined( level.zombie_weapons[weapon_name] ), weapon_name + " was not included or is not part of the zombie weapon list." );
return level.zombie_weapons[weapon_name].is_in_box;
}
is_weapon_upgraded( weaponname )
{
if( !isdefined( weaponname ) || weaponname == "" )
{
return false;
}
weaponname = ToLower( weaponname );
ziw_keys = GetArrayKeys( level.zombie_weapons );
for ( i=0; i<level.zombie_weapons.size; i++ )
{
if ( IsDefined(level.zombie_weapons[ ziw_keys ].upgrade_name) &&
level.zombie_weapons[ ziw_keys ].upgrade_name == weaponname )
{
return true;
}
}
return false;
}
has_upgrade( weaponname )
{
has_upgrade = false;
if( IsDefined(level.zombie_weapons[weaponname]) && IsDefined(level.zombie_weapons[weaponname].upgrade_name) )
{
has_upgrade = self HasWeapon( level.zombie_weapons[weaponname].upgrade_name );
}
if ( !has_upgrade && "knife_ballistic_zm" == weaponname )
{
has_upgrade = has_upgrade( "knife_ballistic_bowie_zm" ) || has_upgrade( "knife_ballistic_sickle_zm" );
}
return has_upgrade;
}
has_weapon_or_upgrade( weaponname )
{
upgradedweaponname = weaponname;
if ( IsDefined( level.zombie_weapons[weaponname] ) && IsDefined( level.zombie_weapons[weaponname].upgrade_name ) )
{
upgradedweaponname = level.zombie_weapons[weaponname].upgrade_name;
}
has_weapon = false;
if( IsDefined( level.zombie_weapons[weaponname] ) )
{
has_weapon = self HasWeapon( weaponname ) || self has_upgrade( weaponname );
}
if ( !has_weapon && "knife_ballistic_zm" == weaponname )
{
has_weapon = has_weapon_or_upgrade( "knife_ballistic_bowie_zm" ) || has_weapon_or_upgrade( "knife_ballistic_sickle_zm" );
}
return has_weapon;
}
treasure_chest_init()
{
if( level.mutators["mutator_noMagicBox"] )
{
chests = GetEntArray( "treasure_chest_use", "targetname" );
for( i=0; i < chests.size; i++ )
{
chests get_chest_pieces();
chests hide_chest();
}
return;
}
flag_init("moving_chest_enabled");
flag_init("moving_chest_now");
flag_init("chest_has_been_used");
level.chest_moves = 0;
level.chest_level = 0;
level.chests = GetEntArray( "treasure_chest_use", "targetname" );
for (i=0; i<level.chests.size; i++ )
{
level.chests.orig_origin = level.chests.origin;
level.chests get_chest_pieces();
if ( isDefined( level.chests.zombie_cost ) )
{
level.chests.old_cost = level.chests.zombie_cost;
}
else
{
level.chests.old_cost = 950;
}
}
level.chest_accessed = 0;
if (level.chests.size > 1)
{
flag_set("moving_chest_enabled");
level.chests = array_randomize(level.chests);
init_starting_chest_location();
}
else
{
level.chest_index = 0;
}
array_thread( level.chests, ::treasure_chest_think );
}
init_starting_chest_location()
{
level.chest_index = 0;
start_chest_found = false;
for( i = 0; i < level.chests.size; i++ )
{
if( isdefined( level.random_pandora_box_start ) && level.random_pandora_box_start == true )
{
if ( start_chest_found || (IsDefined( level.chests.start_exclude ) && level.chests.start_exclude == 1) )
{
level.chests hide_chest();
}
else
{
level.chest_index = i;
level.chests[level.chest_index] hide_rubble();
start_chest_found = true;
}
}
else
{
if ( start_chest_found || !IsDefined(level.chests.script_noteworthy ) || ( !IsSubStr( level.chests.script_noteworthy, "start_chest" ) ) )
{
level.chests hide_chest();
}
else
{
level.chest_index = i;
level.chests[level.chest_index] hide_rubble();
start_chest_found = true;
}
}
}
if( !isDefined( level.pandora_show_func ) )
{
level.pandora_show_func = ::default_pandora_show_func;
}
level.chests[level.chest_index] thread [[ level.pandora_show_func ]]();
}
hide_rubble()
{
rubble = getentarray( self.script_noteworthy + "_rubble", "script_noteworthy" );
if ( IsDefined( rubble ) )
{
for ( x = 0; x < rubble.size; x++ )
{
rubble[x] hide();
}
}
else
{
println( "^3Warning: No rubble found for magic box" );
}
}
show_rubble()
{
if ( IsDefined( self.chest_rubble ) )
{
for ( x = 0; x < self.chest_rubble.size; x++ )
{
self.chest_rubble[x] show();
}
}
else
{
println( "^3Warning: No rubble found for magic box" );
}
}
set_treasure_chest_cost( cost )
{
level.zombie_treasure_chest_cost = cost;
}
get_chest_pieces()
{
self.chest_lid = GetEnt(self.target, "targetname");
self.chest_origin = GetEnt(self.chest_lid.target, "targetname");
self.chest_box = GetEnt(self.chest_origin.target, "targetname");
self.chest_rubble = [];
rubble = GetEntArray( self.script_noteworthy + "_rubble", "script_noteworthy" );
for ( i=0; i<rubble.size; i++ )
{
if ( DistanceSquared( self.origin, rubble.origin ) < 10000 )
{
self.chest_rubble[ self.chest_rubble.size ] = rubble;
}
}
}
play_crazi_sound()
{
self playlocalsound("zmb_laugh_child");
}
show_chest()
{
self thread [[ level.pandora_show_func ]]();
self enable_trigger();
self.chest_lid show();
self.chest_box show();
self.chest_lid playsound( "zmb_box_poof_land" );
self.chest_lid playsound( "zmb_couch_slam" );
}
hide_chest()
{
self disable_trigger();
self.chest_lid hide();
self.chest_box hide();
if ( IsDefined( self.pandora_light ) )
{
self.pandora_light delete();
}
}
default_pandora_fx_func( )
{
self.pandora_light = Spawn( "script_model", self.chest_origin.origin );
self.pandora_light.angles = self.chest_origin.angles + (-90, 0, 0);
self.pandora_light SetModel( "tag_origin" );
playfxontag(level._effect["lght_marker"], self.pandora_light, "tag_origin");
}
default_pandora_show_func( anchor, anchorTarget, pieces )
{
if ( !IsDefined(self.pandora_light) )
{
if( !IsDefined( level.pandora_fx_func ) )
{
level.pandora_fx_func = ::default_pandora_fx_func;
}
self thread [[ level.pandora_fx_func ]]();
}
playsoundatposition( "zmb_box_poof", self.chest_lid.origin );
wait(0.5);
playfx( level._effect["lght_marker_flare"],self.pandora_light.origin );
Objective_Add( 0, "active", "Mystery Box", self.chest_lid.origin, "minimap_icon_mystery_box" );
}
treasure_chest_think()
{
if( IsDefined(level.zombie_vars["zombie_powerup_fire_sale_on"]) && level.zombie_vars["zombie_powerup_fire_sale_on"] )
{
self set_hint_string( self, "powerup_fire_sale_cost" );
}
else
{
self set_hint_string( self, "default_treasure_chest_" + self.zombie_cost );
}
self setCursorHint( "HINT_NOICON" );
user = undefined;
user_cost = undefined;
while( 1 )
{
self waittill( "trigger", user );
if( user in_revive_trigger() )
{
wait( 0.1 );
continue;
}
if( user is_drinking() )
{
wait( 0.1 );
continue;
}
if ( is_true( self.disabled ) )
{
wait( 0.1 );
continue;
}
if( user GetCurrentWeapon() == "none" )
{
wait( 0.1 );
continue;
}
if( is_player_valid( user ) && user.score >= self.zombie_cost )
{
user maps\_zombiemode_score::minus_to_player_score( self.zombie_cost );
user_cost = self.zombie_cost;
self.chest_user = user;
break;
}
else if ( user.score < self.zombie_cost )
{
user maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 2 );
continue;
}
wait 0.05;
}
flag_set("chest_has_been_used");
self._box_open = true;
self._box_opened_by_fire_sale = false;
if ( is_true( level.zombie_vars["zombie_powerup_fire_sale_on"] ) )
{
self._box_opened_by_fire_sale = true;
}
self.chest_lid thread treasure_chest_lid_open();
self.timedOut = false;
self.chest_origin thread treasure_chest_weapon_spawn( self, user );
self.chest_origin thread treasure_chest_glowfx();
self disable_trigger();
self.chest_origin waittill( "randomization_done" );
if (flag("moving_chest_now") && !self._box_opened_by_fire_sale && IsDefined(user_cost))
{
user maps\_zombiemode_score::add_to_player_score( user_cost, false );
}
if (flag("moving_chest_now") && !level.zombie_vars["zombie_powerup_fire_sale_on"])
{
self.chest_user maps\_zombiemode_audio::create_and_play_dialog( "general", "box_move" );
self thread treasure_chest_move();
}
else
{
self.grab_weapon_hint = true;
self.chest_user = user;
self sethintstring( &"ZOMBIE_TRADE_WEAPONS" );
self setCursorHint( "HINT_NOICON" );
self thread decide_hide_show_hint( "weapon_grabbed");
self enable_trigger();
self thread treasure_chest_timeout();
while( 1 )
{
self waittill( "trigger", grabber );
if( IsDefined( grabber.is_drinking ) && grabber is_drinking() )
{
wait( 0.1 );
continue;
}
if ( grabber == user && user GetCurrentWeapon() == "none" )
{
wait( 0.1 );
continue;
}
if( grabber == user || grabber == level )
{
current_weapon = user GetCurrentWeapon();
if( grabber == user && is_player_valid( user ) && !user is_drinking() && !is_placeable_mine( current_weapon ) && "syrette_sp" != current_weapon )
{
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type magic_accept",
user.playername, user.score, level.team_pool[ user.team_num ].score, level.round_number, self.zombie_cost, self.chest_origin.weapon_string, self.origin );
self notify( "user_grabbed_weapon" );
user thread treasure_chest_give_weapon( self.chest_origin.weapon_string );
break;
}
else if( grabber == level )
{
self.timedOut = true;
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type magic_reject",
user.playername, user.score, level.team_pool[ user.team_num ].score, level.round_number, self.zombie_cost, self.chest_origin.weapon_string, self.origin );
break;
}
}
wait 0.05;
}
self.grab_weapon_hint = false;
self.chest_origin notify( "weapon_grabbed" );
if ( !is_true( self._box_opened_by_fire_sale ) )
{
level.chest_accessed += 1;
}
if( level.chest_moves > 0 && isDefined(level.pulls_since_last_ray_gun) )
{
level.pulls_since_last_ray_gun += 1;
}
if( isDefined(level.pulls_since_last_tesla_gun) )
{
level.pulls_since_last_tesla_gun += 1;
}
self disable_trigger();
self.chest_lid thread treasure_chest_lid_close( self.timedOut );
wait 3;
if ( is_true( level.zombie_vars["zombie_powerup_fire_sale_on"] ) || self == level.chests[level.chest_index] )
{
self enable_trigger();
self setvisibletoall();
}
}
self._box_open = false;
self._box_opened_by_fire_sale = false;
self.chest_user = undefined;
self notify( "chest_accessed" );
self thread treasure_chest_think();
}
decide_hide_show_chest_hint( endon_notify )
{
if( isDefined( endon_notify ) )
{
self endon( endon_notify );
}
while( true )
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
if ( (IsDefined(self.chest_user) && players != self.chest_user ) ||
!players can_buy_weapon() )
{
self SetInvisibleToPlayer( players, true );
}
else
{
self SetInvisibleToPlayer( players, false );
}
}
wait( 0.1 );
}
}
decide_hide_show_hint( endon_notify )
{
if( isDefined( endon_notify ) )
{
self endon( endon_notify );
}
while( true )
{
if(IsDefined(self.chest_user))
{
if( is_placeable_mine( self.chest_user GetCurrentWeapon() ) )
{
self SetInvisibleToPlayer( self.chest_user);
}
else
{
self SetVisibleToPlayer( self.chest_user );
}
}
else
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
if( players can_buy_weapon())
{
self SetInvisibleToPlayer( players, false );
}
else
{
self SetInvisibleToPlayer( players, true );
}
}
}
wait( 0.1 );
}
}
can_buy_weapon()
{
if( IsDefined( self.is_drinking ) && self is_drinking() )
{
return false;
}
current_weapon = self GetCurrentWeapon();
if( is_placeable_mine( current_weapon ) )
{
return false;
}
if( self in_revive_trigger() )
{
return false;
}
if( current_weapon == "none" )
{
return false;
}
return true;
}
treasure_chest_move()
{
level waittill("weapon_fly_away_start");
players = get_players();
array_thread(players, ::play_crazi_sound);
level waittill("weapon_fly_away_end");
self.chest_lid thread treasure_chest_lid_close(false);
self setvisibletoall();
self hide_chest();
fake_pieces = [];
fake_pieces[0] = spawn("script_model",self.chest_lid.origin);
fake_pieces[0].angles = self.chest_lid.angles;
fake_pieces[0] setmodel(self.chest_lid.model);
fake_pieces[1] = spawn("script_model",self.chest_box.origin);
fake_pieces[1].angles = self.chest_box.angles;
fake_pieces[1] setmodel(self.chest_box.model);
anchor = spawn("script_origin",fake_pieces[0].origin);
soundpoint = spawn("script_origin", self.chest_origin.origin);
anchor playsound("zmb_box_move");
for(i=0;i<fake_pieces.size;i++)
{
fake_pieces linkto(anchor);
}
playsoundatposition ("zmb_whoosh", soundpoint.origin );
playsoundatposition ("zmb_vox_ann_magicbox", soundpoint.origin );
anchor moveto(anchor.origin + (0,0,50),5);
if( isDefined( level.custom_vibrate_func ) )
{
[[ level.custom_vibrate_func ]]( anchor );
}
else
{
direction = self.chest_box.origin - self.chest_lid.origin;
direction = (direction[1], direction[0], 0);
if(direction[1] < 0 || (direction[0] > 0 && direction[1] > 0))
{
direction = (direction[0], direction[1] * -1, 0);
}
else if(direction[0] < 0)
{
direction = (direction[0] * -1, direction[1], 0);
}
anchor Vibrate( direction, 10, 0.5, 5);
}
anchor waittill("movedone");
playfx(level._effect["poltergeist"], self.chest_origin.origin);
playsoundatposition ("zmb_box_poof", soundpoint.origin);
for(i=0;i<fake_pieces.size;i++)
{
fake_pieces delete();
}
self show_rubble();
wait(0.1);
anchor delete();
soundpoint delete();
if(level.zombie_vars["zombie_powerup_fire_sale_on"] == true)
{
current_sale_time = level.zombie_vars["zombie_powerup_fire_sale_time"];
wait_network_frame();
self thread fire_sale_fix();
level.zombie_vars["zombie_powerup_fire_sale_time"] = current_sale_time;
while(level.zombie_vars["zombie_powerup_fire_sale_time"] > 0)
{
wait(0.1);
}
}
else
{
wait(5);
}
level.verify_chest = false;
index = -1;
for ( i=0; i<level.chests.size; i++ )
{
if ( IsSubStr( level.chests.script_noteworthy, ("move"+(level.chest_moves+1)) ) &&
i != level.chest_index )
{
index = i;
break;
}
}
if ( index != -1 )
{
level.chest_index = index;
}
else
{
level.chest_index++;
}
if (level.chest_index >= level.chests.size)
{
temp_chest_name = level.chests[level.chest_index - 1].script_noteworthy;
level.chest_index = 0;
level.chests = array_randomize(level.chests);
if (temp_chest_name == level.chests[level.chest_index].script_noteworthy)
{
level.chest_index++;
}
}
wait(0.01);
playfx(level._effect["poltergeist"], level.chests[level.chest_index].chest_origin.origin);
level.chests[level.chest_index] show_chest();
level.chests[level.chest_index] hide_rubble();
flag_clear("moving_chest_now");
}
fire_sale_fix()
{
if( !isdefined ( level.zombie_vars["zombie_powerup_fire_sale_on"] ) )
{
return;
}
if( level.zombie_vars["zombie_powerup_fire_sale_on"] )
{
self.old_cost = 950;
self thread show_chest();
self thread hide_rubble();
self.zombie_cost = 10;
self set_hint_string( self , "powerup_fire_sale_cost" );
wait_network_frame();
level waittill( "fire_sale_off" );
playfx(level._effect["poltergeist"], self.origin);
self playsound ( "zmb_box_poof_land" );
self playsound( "zmb_couch_slam" );
self thread hide_chest();
self thread show_rubble();
self.zombie_cost = self.old_cost;
self set_hint_string( self , "default_treasure_chest_" + self.zombie_cost );
}
}
check_for_desirable_chest_location()
{
if( !isdefined( level.desirable_chest_location ) )
return level.chest_index;
if( level.chests[level.chest_index].script_noteworthy == level.desirable_chest_location )
{
level.desirable_chest_location = undefined;
return level.chest_index;
}
for(i = 0 ; i < level.chests.size; i++ )
{
if( level.chests.script_noteworthy == level.desirable_chest_location )
{
level.desirable_chest_location = undefined;
return i;
}
}
level.desirable_chest_location = undefined;
return level.chest_index;
}
rotateroll_box()
{
angles = 40;
angles2 = 0;
while(isdefined(self))
{
self RotateRoll(angles + angles2, 0.5);
wait(0.7);
angles2 = 40;
self RotateRoll(angles * -2, 0.5);
wait(0.7);
}
}
verify_chest_is_open()
{
for (i = 0; i < level.open_chest_location.size; i++)
{
if(isdefined(level.open_chest_location))
{
if(level.open_chest_location == level.chests[level.chest_index].script_noteworthy)
{
level.verify_chest = true;
return;
}
}
}
level.verify_chest = false;
}
treasure_chest_timeout()
{
self endon( "user_grabbed_weapon" );
wait( 12 );
self notify( "trigger", level );
}
treasure_chest_lid_open()
{
openRoll = 105;
openTime = 0.5;
self RotateRoll( 105, openTime, ( openTime * 0.5 ) );
play_sound_at_pos( "open_chest", self.origin );
play_sound_at_pos( "music_chest", self.origin );
}
treasure_chest_lid_close( timedOut )
{
closeRoll = -105;
closeTime = 0.5;
self RotateRoll( closeRoll, closeTime, ( closeTime * 0.5 ) );
play_sound_at_pos( "close_chest", self.origin );
}
treasure_chest_ChooseRandomWeapon( player )
{
keys = GetArrayKeys( level.zombie_weapons );
return keys[RandomInt( keys.size )];
}
treasure_chest_ChooseWeightedRandomWeapon( player )
{
keys = GetArrayKeys( level.zombie_weapons );
filtered = [];
for( i = 0; i < keys.size; i++ )
{
if( !get_is_in_box( keys ) )
{
continue;
}
if( player has_weapon_or_upgrade( keys ) )
{
continue;
}
if( !IsDefined( keys ) )
{
continue;
}
num_entries = [[ level.weapon_weighting_funcs[keys] ]]();
for( j = 0; j < num_entries; j++ )
{
filtered[filtered.size] = keys;
}
}
if( IsDefined( level.limited_weapons ) )
{
keys2 = GetArrayKeys( level.limited_weapons );
players = get_players();
pap_triggers = GetEntArray("zombie_vending_upgrade", "targetname");
for( q = 0; q < keys2.size; q++ )
{
count = 0;
for( i = 0; i < players.size; i++ )
{
if( players has_weapon_or_upgrade( keys2[q] ) )
{
count++;
}
}
for ( k=0; k<pap_triggers.size; k++ )
{
if ( IsDefined(pap_triggers[k].current_weapon) && pap_triggers[k].current_weapon == keys2[q] )
{
count++;
}
}
for ( chestIndex = 0; chestIndex < level.chests.size; chestIndex++ )
{
if ( IsDefined( level.chests[chestIndex].chest_origin.weapon_string ) && level.chests[chestIndex].chest_origin.weapon_string == keys2[q] )
{
count++;
}
}
if( count >= level.limited_weapons[keys2[q]] )
{
filtered = array_remove( filtered, keys2[q] );
}
}
}
filtered = array_randomize( filtered );
return filtered[RandomInt( filtered.size )];
}
weapon_is_dual_wield(name)
{
switch(name)
{
case "cz75dw_zm":
case "cz75dw_upgraded_zm":
case "m1911_upgraded_zm":
case "hs10_upgraded_zm":
case "pm63_upgraded_zm":
return true;
default:
return false;
}
}
treasure_chest_weapon_spawn( chest, player )
{
assert(IsDefined(player));
self.weapon_string = undefined;
modelname = undefined;
rand = undefined;
number_cycles = 40;
chest.chest_box setclientflag(level._ZOMBIE_SCRIPTMOVER_FLAG_BOX_RANDOM);
for( i = 0; i < number_cycles; i++ )
{
if( i < 20 )
{
wait( 0.05 );
}
else if( i < 30 )
{
wait( 0.1 );
}
else if( i < 35 )
{
wait( 0.2 );
}
else if( i < 38 )
{
wait( 0.3 );
}
if( i + 1 < number_cycles )
{
rand = treasure_chest_ChooseRandomWeapon( player );
}
else
{
rand = treasure_chest_ChooseWeightedRandomWeapon( player );
}
}
chest.chest_box clearclientflag(level._ZOMBIE_SCRIPTMOVER_FLAG_BOX_RANDOM);
wait_network_frame();
floatHeight = 40;
model_dw = undefined;
model = spawn( "script_model", self.origin + ( 0, 0, floatHeight));
model.angles = self.angles +( 0, 90, 0 );
modelname = GetWeaponModel( rand );
model setmodel( modelname );
model useweaponhidetags( rand );
if ( weapon_is_dual_wield(rand))
{
model_dw = spawn( "script_model", model.origin - ( 3, 3, 3 ) );
model_dw.angles = self.angles +( 0, 90, 0 );
model_dw setmodel( modelname );
model_dw useweaponhidetags( rand );
}
self.weapon_string = rand;
if( (GetDvar( #"magic_chest_movable") == "1") && !is_true( chest._box_opened_by_fire_sale ) )
{
random = Randomint(100);
if( !isdefined( level.chest_min_move_usage ) )
{
level.chest_min_move_usage = 4;
}
if( level.chest_accessed < level.chest_min_move_usage )
{
chance_of_joker = -1;
}
else
{
chance_of_joker = level.chest_accessed + 20;
if ( level.chest_moves == 0 && level.chest_accessed >= 8 )
{
chance_of_joker = 100;
}
if( level.chest_accessed >= 4 && level.chest_accessed < 8 )
{
if( random < 15 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
if ( level.chest_moves > 0 )
{
if( level.chest_accessed >= 8 && level.chest_accessed < 13 )
{
if( random < 30 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
if( level.chest_accessed >= 13 )
{
if( random < 50 )
{
chance_of_joker = 100;
}
else
{
chance_of_joker = -1;
}
}
}
}
if ( chance_of_joker > random )
{
self.weapon_string = undefined;
model SetModel("zombie_teddybear");
model.angles = self.angles;
if(IsDefined(model_dw))
{
model_dw Delete();
model_dw = undefined;
}
wait 1;
flag_set("moving_chest_now");
level.chest_accessed = 0;
level.chest_moves++;
}
}
self notify( "randomization_done" );
if (flag("moving_chest_now") && !level.zombie_vars["zombie_powerup_fire_sale_on"])
{
wait .5;
level notify("weapon_fly_away_start");
wait 2;
model MoveZ(500, 4, 3);
if(IsDefined(model_dw))
{
model_dw MoveZ(500,4,3);
}
model waittill("movedone");
model delete();
if(IsDefined(model_dw))
{
model_dw Delete();
}
self notify( "box_moving" );
level notify("weapon_fly_away_end");
}
else
{
if( rand == "tesla_gun_zm" || rand == "ray_gun_zm" )
{
if( rand == "ray_gun_zm" )
{
level.pulls_since_last_ray_gun = 0;
}
if( rand == "tesla_gun_zm" )
{
level.pulls_since_last_tesla_gun = 0;
level.player_seen_tesla_gun = true;
}
}
model thread timer_til_despawn(floatHeight);
if(IsDefined(model_dw))
{
model_dw thread timer_til_despawn(floatHeight);
}
self waittill( "weapon_grabbed" );
if( !chest.timedOut )
{
model Delete();
if(IsDefined(model_dw))
{
model_dw Delete();
}
}
}
self.weapon_string = undefined;
}
chest_get_min_usage()
{
min_usage = 4;
return( min_usage );
}
chest_get_max_usage()
{
max_usage = 6;
players = get_players();
if( level.chest_moves == 0 )
{
if( players.size == 1 )
{
max_usage = 3;
}
else if( players.size == 2 )
{
max_usage = 4;
}
else if( players.size == 3 )
{
max_usage = 5;
}
else
{
max_usage = 6;
}
}
else
{
if( players.size == 1 )
{
max_usage = 4;
}
else if( players.size == 2 )
{
max_usage = 4;
}
else if( players.size == 3 )
{
max_usage = 5;
}
else
{
max_usage = 7;
}
}
return( max_usage );
}
timer_til_despawn(floatHeight)
{
putBackTime = 12;
self MoveTo( self.origin - ( 0, 0, floatHeight ), putBackTime, ( putBackTime * 0.5 ) );
wait( putBackTime );
if(isdefined(self))
{
self Delete();
}
}
treasure_chest_glowfx()
{
fxObj = spawn( "script_model", self.origin +( 0, 0, 0 ) );
fxobj setmodel( "tag_origin" );
fxobj.angles = self.angles +( 90, 0, 0 );
playfxontag( level._effect["chest_light"], fxObj, "tag_origin" );
self waittill_any( "weapon_grabbed", "box_moving" );
fxobj delete();
}
treasure_chest_give_weapon( weapon_string )
{
self.last_box_weapon = GetTime();
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;
weapon_limit = 2;
if( self HasWeapon( weapon_string ) )
{
if ( issubstr( weapon_string, "knife_ballistic_" ) )
{
self notify( "zmb_lost_knife" );
}
self GiveStartAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
return;
}
if( primaryWeapons.size >= weapon_limit )
{
current_weapon = self getCurrentWeapon();
if ( is_placeable_mine( current_weapon ) )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !is_offhand_weapon( weapon_string ) )
{
if( current_weapon == "tesla_gun_zm" )
{
level.player_drops_tesla_gun = true;
}
if ( issubstr( current_weapon, "knife_ballistic_" ) )
{
self notify( "zmb_lost_knife" );
}
self TakeWeapon( current_weapon );
if ( current_weapon == "m1911_zm" )
{
self.last_pistol_swap = GetTime();
}
}
}
}
self play_sound_on_ent( "purchase" );
if( IsDefined( level.zombiemode_offhand_weapon_give_override ) )
{
self [[ level.zombiemode_offhand_weapon_give_override ]]( weapon_string );
}
if( weapon_string == "zombie_cymbal_monkey" )
{
self maps\_zombiemode_weap_cymbal_monkey::player_give_cymbal_monkey();
self play_weapon_vo(weapon_string);
return;
}
else if ( weapon_string == "knife_ballistic_zm" && self HasWeapon( "bowie_knife_zm" ) )
{
weapon_string = "knife_ballistic_bowie_zm";
}
else if ( weapon_string == "knife_ballistic_zm" && self HasWeapon( "sickle_knife_zm" ) )
{
weapon_string = "knife_ballistic_sickle_zm";
}
if (weapon_string == "ray_gun_zm")
{
playsoundatposition ("mus_raygun_stinger", (0,0,0));
}
self GiveWeapon( weapon_string, 0 );
self GiveStartAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
self play_weapon_vo(weapon_string);
}
pay_turret_think( cost )
{
if( !isDefined( self.target ) )
{
return;
}
turret = GetEnt( self.target, "targetname" );
if( !isDefined( turret ) )
{
return;
}
turret makeTurretUnusable();
zone_name = turret get_current_zone();
if ( !IsDefined( zone_name ) )
{
zone_name = "";
}
while( true )
{
self waittill( "trigger", player );
if( !is_player_valid( player ) )
{
player thread ignore_triggers( 0.5 );
continue;
}
if( player in_revive_trigger() )
{
wait( 0.1 );
continue;
}
if( player is_drinking() )
{
wait(0.1);
continue;
}
if( player.score >= cost )
{
player maps\_zombiemode_score::minus_to_player_score( cost );
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type turret", player.playername, player.score, level.team_pool[ player.team_num ].score, level.round_number, cost, zone_name, self.origin );
turret makeTurretUsable();
turret UseBy( player );
self disable_trigger();
player.curr_pay_turret = turret;
turret thread watch_for_laststand( player );
turret thread watch_for_fake_death( player );
if( isDefined( level.turret_timer ) )
{
turret thread watch_for_timeout( player, level.turret_timer );
}
while( isDefined( turret getTurretOwner() ) && turret getTurretOwner() == player )
{
wait( 0.05 );
}
turret notify( "stop watching" );
player.curr_pay_turret = undefined;
turret makeTurretUnusable();
self enable_trigger();
}
else
{
play_sound_on_ent( "no_purchase" );
player maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 0 );
}
}
}
watch_for_laststand( player )
{
self endon( "stop watching" );
while( !player maps\_laststand::player_is_in_laststand() )
{
if( isDefined( level.intermission ) && level.intermission )
{
intermission = true;
}
wait( 0.05 );
}
if( isDefined( self getTurretOwner() ) && self getTurretOwner() == player )
{
self UseBy( player );
}
}
watch_for_fake_death( player )
{
self endon( "stop watching" );
player waittill( "fake_death" );
if( isDefined( self getTurretOwner() ) && self getTurretOwner() == player )
{
self UseBy( player );
}
}
watch_for_timeout( player, time )
{
self endon( "stop watching" );
self thread cancel_timer_on_end( player );
wait( time );
if( isDefined( self getTurretOwner() ) && self getTurretOwner() == player )
{
self UseBy( player );
}
}
cancel_timer_on_end( player )
{
self waittill( "stop watching" );
player notify( "stop watching" );
}
weapon_cabinet_door_open( left_or_right )
{
if( left_or_right == "left" )
{
self rotateyaw( 120, 0.3, 0.2, 0.1 );
}
else if( left_or_right == "right" )
{
self rotateyaw( -120, 0.3, 0.2, 0.1 );
}
}
check_collector_achievement( bought_weapon )
{
if ( !isdefined( self.bought_weapons ) )
{
self.bought_weapons = [];
self.bought_weapons = array_add( self.bought_weapons, bought_weapon );
}
else if ( !is_in_array( self.bought_weapons, bought_weapon ) )
{
self.bought_weapons = array_add( self.bought_weapons, bought_weapon );
}
else
{
return;
}
for( i = 0; i < level.collector_achievement_weapons.size; i++ )
{
if ( !is_in_array( self.bought_weapons, level.collector_achievement_weapons ) )
{
return;
}
}
self giveachievement_wrapper( "SP_ZOM_COLLECTOR" );
}
weapon_set_first_time_hint( cost, ammo_cost )
{
if ( isDefined( level.has_pack_a_punch ) && !level.has_pack_a_punch )
{
self SetHintString( &"ZOMBIE_WEAPONCOSTAMMO", cost, ammo_cost );
}
else
{
self SetHintString( &"ZOMBIE_WEAPONCOSTAMMO_UPGRADE", cost, ammo_cost );
}
}
weapon_spawn_think()
{
cost = get_weapon_cost( self.zombie_weapon_upgrade );
ammo_cost = get_ammo_cost( self.zombie_weapon_upgrade );
is_grenade = (WeaponType( self.zombie_weapon_upgrade ) == "grenade");
self thread decide_hide_show_hint();
self.first_time_triggered = false;
for( ;; )
{
self waittill( "trigger", player );
if( !is_player_valid( player ) )
{
player thread ignore_triggers( 0.5 );
continue;
}
if( !player can_buy_weapon() )
{
wait( 0.1 );
continue;
}
if( player GetCurrentWeapon() == "minigun_zm" )
{
wait( 0.1 );
continue;
}
player_has_weapon = player has_weapon_or_upgrade( self.zombie_weapon_upgrade );
if( !player_has_weapon )
{
if( player.score >= cost )
{
if( self.first_time_triggered == false )
{
model = getent( self.target, "targetname" );
model thread weapon_show( player );
self.first_time_triggered = true;
if(!is_grenade)
{
self weapon_set_first_time_hint( cost, ammo_cost );
}
}
player maps\_zombiemode_score::minus_to_player_score( cost );
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type weapon",
player.playername, player.score, level.team_pool[ player.team_num ].score, level.round_number, cost, self.zombie_weapon_upgrade, self.origin );
player weapon_give( self.zombie_weapon_upgrade );
player check_collector_achievement( self.zombie_weapon_upgrade );
}
else
{
play_sound_on_ent( "no_purchase" );
player maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 1 );
}
}
else
{
if ( player has_upgrade( self.zombie_weapon_upgrade ) )
{
ammo_cost = 4500;
}
else
{
ammo_cost = get_ammo_cost( self.zombie_weapon_upgrade );
}
if( player.score >= ammo_cost )
{
if( self.first_time_triggered == false )
{
model = getent( self.target, "targetname" );
model thread weapon_show( player );
self.first_time_triggered = true;
if(!is_grenade)
{
self weapon_set_first_time_hint( cost, get_ammo_cost( self.zombie_weapon_upgrade ) );
}
}
player check_collector_achievement( self.zombie_weapon_upgrade );
if( player has_upgrade( self.zombie_weapon_upgrade ) )
{
ammo_given = player ammo_give( level.zombie_weapons[ self.zombie_weapon_upgrade ].upgrade_name );
}
else
{
ammo_given = player ammo_give( self.zombie_weapon_upgrade );
}
if( ammo_given )
{
player maps\_zombiemode_score::minus_to_player_score( ammo_cost );
bbPrint( "zombie_uses: playername %s playerscore %d teamscore %d round %d cost %d name %s x %f y %f z %f type ammo",
player.playername, player.score, level.team_pool[ player.team_num ].score, level.round_number, ammo_cost, self.zombie_weapon_upgrade, self.origin );
}
}
else
{
play_sound_on_ent( "no_purchase" );
player maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 0 );
}
}
}
}
weapon_show( player )
{
player_angles = VectorToAngles( player.origin - self.origin );
player_yaw = player_angles[1];
weapon_yaw = self.angles[1];
if ( isdefined( self.script_int ) )
{
weapon_yaw -= self.script_int;
}
yaw_diff = AngleClamp180( player_yaw - weapon_yaw );
if( yaw_diff > 0 )
{
yaw = weapon_yaw - 90;
}
else
{
yaw = weapon_yaw + 90;
}
self.og_origin = self.origin;
self.origin = self.origin +( AnglesToForward( ( 0, yaw, 0 ) ) * 8 );
wait( 0.05 );
self Show();
play_sound_at_pos( "weapon_show", self.origin, self );
time = 1;
self MoveTo( self.og_origin, time );
}
get_pack_a_punch_weapon_options( weapon )
{
if ( !isDefined( self.pack_a_punch_weapon_options ) )
{
self.pack_a_punch_weapon_options = [];
}
if ( !is_weapon_upgraded( weapon ) )
{
return self CalcWeaponOptions( 0 );
}
if ( isDefined( self.pack_a_punch_weapon_options[weapon] ) )
{
return self.pack_a_punch_weapon_options[weapon];
}
smiley_face_reticle_index = 21;
camo_index = 15;
lens_index = randomIntRange( 0, 6 );
reticle_index = randomIntRange( 0, smiley_face_reticle_index );
reticle_color_index = randomIntRange( 0, 6 );
if ( "famas_upgraded_zm" == weapon )
{
reticle_index = smiley_face_reticle_index;
}
scary_eyes_reticle_index = 8;
purple_reticle_color_index = 3;
if ( reticle_index == scary_eyes_reticle_index )
{
reticle_color_index = purple_reticle_color_index;
}
letter_a_reticle_index = 2;
pink_reticle_color_index = 6;
if ( reticle_index == letter_a_reticle_index )
{
reticle_color_index = pink_reticle_color_index;
}
letter_e_reticle_index = 7;
green_reticle_color_index = 1;
if ( reticle_index == letter_e_reticle_index )
{
reticle_color_index = green_reticle_color_index;
}
self.pack_a_punch_weapon_options[weapon] = self CalcWeaponOptions( camo_index, lens_index, reticle_index, reticle_color_index );
return self.pack_a_punch_weapon_options[weapon];
}
weapon_give( weapon, is_upgrade )
{
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;
weapon_limit = 2;
if( !IsDefined( is_upgrade ) )
{
is_upgrade = false;
}
if( primaryWeapons.size >= weapon_limit )
{
current_weapon = self getCurrentWeapon();
if ( is_placeable_mine( current_weapon ) )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !is_offhand_weapon( weapon ) )
{
if ( issubstr( current_weapon, "knife_ballistic_" ) )
{
self notify( "zmb_lost_knife" );
}
self TakeWeapon( current_weapon );
if ( current_weapon == "m1911_zm" )
{
self.last_pistol_swap = GetTime();
}
}
}
}
if( IsDefined( level.zombiemode_offhand_weapon_give_override ) )
{
if( self [[ level.zombiemode_offhand_weapon_give_override ]]( weapon ) )
{
return;
}
}
if( weapon == "zombie_cymbal_monkey" )
{
self maps\_zombiemode_weap_cymbal_monkey::player_give_cymbal_monkey();
self play_weapon_vo( weapon );
return;
}
self play_sound_on_ent( "purchase" );
if ( !is_weapon_upgraded( weapon ) )
{
self GiveWeapon( weapon );
}
else
{
self GiveWeapon( weapon, 0, self get_pack_a_punch_weapon_options( weapon ) );
}
self GiveStartAmmo( weapon );
self SwitchToWeapon( weapon );
self play_weapon_vo(weapon);
}
play_weapon_vo(weapon)
{
type = self weapon_type_check(weapon);
self maps\_zombiemode_audio::create_and_play_dialog( "weapon_pickup", type );
}
weapon_type_check(weapon)
{
if( !IsDefined( self.entity_num ) )
return "crappy";
switch(self.entity_num)
{
case 0:
if( weapon == "m16_zm" )
return "favorite";
else if( weapon == "rottweil72_upgraded_zm" )
return "favorite_upgrade";
break;
case 1:
if( weapon == "fnfal_zm" )
return "favorite";
else if( weapon == "hk21_upgraded_zm" )
return "favorite_upgrade";
break;
case 2:
if( weapon == "china_lake_zm" )
return "favorite";
else if( weapon == "thundergun_upgraded_zm" )
return "favorite_upgrade";
break;
case 3:
if( weapon == "mp40_zm" )
return "favorite";
else if( weapon == "crossbow_explosive_upgraded_zm" )
return "favorite_upgrade";
break;
}
if( IsSubStr( weapon, "upgraded" ) )
return "upgrade";
else
return level.zombie_weapons[weapon].vox;
}
get_player_index(player)
{
assert( IsPlayer( player ) );
assert( IsDefined( player.entity_num ) );
return player.entity_num;
}
ammo_give( weapon )
{
give_ammo = false;
if( !is_offhand_weapon( weapon ) )
{
if( isdefined( weapon ) )
{
stockMax = 0;
stockMax = WeaponStartAmmo( weapon );
clipCount = self GetWeaponAmmoClip( weapon );
currStock = self GetAmmoCount( weapon );
if( ( currStock - clipcount ) >= stockMax )
{
give_ammo = false;
}
else
{
give_ammo = true;
}
}
}
else
{
if( self has_weapon_or_upgrade( weapon ) )
{
if( self getammocount( weapon ) < WeaponMaxAmmo( weapon ) )
{
give_ammo = true;
}
}
}
if( give_ammo )
{
self play_sound_on_ent( "purchase" );
self GiveStartAmmo( weapon );
return true;
}
if( !give_ammo )
{
return false;
}
}


---------- Post added at 02:41 PM ---------- Previous post was at 01:28 PM ----------



Here is the offsets for the common_zombie_patch.ff

- open input file: C:\Users\*SCHAOS*\Desktop\common_zombie_patch.zone
- enter in directory: C:\Users\*SCHAOS*\Desktop\Decryption
- zip data to check: 32 bytes
- zip windowBits: 15
- seek offset: 0x00000000 (0)
+------------+-------------+-------------------------+
| hex_offset | blocks_dots | zip_size --> unzip_size |
+------------+-------------+-------------------------+
0x00033eee . 259 --> 589
0x00034033 . 290 --> 787
0x00034198 . 292 --> 791
0x000342ff . 293 --> 791
0x00034467 . 295 --> 791
0x000345d1 . 312 --> 982
0x0003474c . 286 --> 783
0x000348ab . 309 --> 956
0x00034a11 ... 5825 --> 29385
0x00036104 .. 2930 --> 10939
0x00036ca7 .. 2292 --> 7699
0x000375cb . 1783 --> 8244
0x00037cf3 .. 2793 --> 13543
0x0003880e .. 2971 --> 12328
0x000393d9 ... 5568 --> 23584
0x0003a9cc .. 3250 --> 14910
0x0003b6b9 . 877 --> 3030
0x0003ba64 . 939 --> 4094
0x0003be52 . 1242 --> 5504
0x0003c355 .. 3936 --> 16343
0x0003d2dc .................. 35284 --> 172728
0x00045cda ........... 21621 --> 104183
0x0004b180 .... 7899 --> 39839
0x0004d08d ... 5844 --> 30690
0x0004e793 ... 4466 --> 17365
0x0004f935 ... 5151 --> 26890
0x00050d87 ..... 8506 --> 49791
0x00052ef1 . 1736 --> 5644
0x000535ec .. 2295 --> 7946
0x00053f14 . 70 --> 98
0x00053f8a . 128 --> 194
0x0005403a .... 6459 --> 31845
0x000559a8 .... 7067 --> 35225
0x00057572 ... 5038 --> 19302
0x00058952 ....... 14136 --> 78767
0x0005c0ba ... 4145 --> 17845
0x0005d11d ...... 10506 --> 57836
0x0005fa64 . 1430 --> 4661
0x0006002f .. 2859 --> 10723
0x00060b94 .. 2245 --> 9540
0x0006148b ..... 9472 --> 45573
0x0008b000
- 41 valid zip blocks found
C:\Users\*SCHAOS*>


now just tell me the key to put it into a zone

---------- Post added at 06:05 PM ---------- Previous post was at 06:03 PM ----------

Originally posted by SCHAOS
Its not publicly possible. As far as the getting the good guns in the box, there is a table of % ratio chances. Let me dig it up and Ill post it for you.


Here is the offsets for the common_zombie_patch.ff

- open input file: C:\Users\*SCHAOS*\Desktop\common_zombie_patch.zone
- enter in directory: C:\Users\*SCHAOS*\Desktop\Decryption
- zip data to check: 32 bytes
- zip windowBits: 15
- seek offset: 0x00000000 (0)
+------------+-------------+-------------------------+
| hex_offset | blocks_dots | zip_size --> unzip_size |
+------------+-------------+-------------------------+
0x00033eee . 259 --> 589
0x00034033 . 290 --> 787
0x00034198 . 292 --> 791
0x000342ff . 293 --> 791
0x00034467 . 295 --> 791
0x000345d1 . 312 --> 982
0x0003474c . 286 --> 783
0x000348ab . 309 --> 956
0x00034a11 ... 5825 --> 29385
0x00036104 .. 2930 --> 10939
0x00036ca7 .. 2292 --> 7699
0x000375cb . 1783 --> 8244
0x00037cf3 .. 2793 --> 13543
0x0003880e .. 2971 --> 12328
0x000393d9 ... 5568 --> 23584
0x0003a9cc .. 3250 --> 14910
0x0003b6b9 . 877 --> 3030
0x0003ba64 . 939 --> 4094
0x0003be52 . 1242 --> 5504
0x0003c355 .. 3936 --> 16343
0x0003d2dc .................. 35284 --> 172728
0x00045cda ........... 21621 --> 104183
0x0004b180 .... 7899 --> 39839
0x0004d08d ... 5844 --> 30690
0x0004e793 ... 4466 --> 17365
0x0004f935 ... 5151 --> 26890
0x00050d87 ..... 8506 --> 49791
0x00052ef1 . 1736 --> 5644
0x000535ec .. 2295 --> 7946
0x00053f14 . 70 --> 98
0x00053f8a . 128 --> 194
0x0005403a .... 6459 --> 31845
0x000559a8 .... 7067 --> 35225
0x00057572 ... 5038 --> 19302
0x00058952 ....... 14136 --> 78767
0x0005c0ba ... 4145 --> 17845
0x0005d11d ...... 10506 --> 57836
0x0005fa64 . 1430 --> 4661
0x0006002f .. 2859 --> 10723
0x00060b94 .. 2245 --> 9540
0x0006148b ..... 9472 --> 45573
0x0008b000
- 41 valid zip blocks found
C:\Users\*SCHAOS*>


now just tell me how to get it into a zone. Not Happy or Sad

---------- Post added at 06:06 PM ---------- Previous post was at 06:05 PM ----------

Originally posted by SCHAOS
Its not publicly possible. As far as the getting the good guns in the box, there is a table of % ratio chances. Let me dig it up and Ill post it for you.


now just tell me how to get it into a zone Not Happy or Sad

---------- Post added at 06:08 PM ---------- Previous post was at 06:06 PM ----------

SCHAOS just tell me how to get it to a zone Not Happy or Sad
03-22-2011, 04:37 PM #8
pm me 4 bo files

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo