Warning!
This is not directly compatible with ZCT Mod as it uses different weapons than this is programmed for.
Note
This script has not been verified as working. Some updates may need to be made to the script by its creator before it is in complete working order.
NOTE : Before reading this guide, determine where your World at War root directory is located.
Non-Steam Install : C:\Program Files (x86)\Activision\Call of Duty World at War\
Steam Install : C:\Program Files (x86)\Steam\steamapps\common\Call of Duty World at War\
For the rest of this guide, it will be assumed that the word "root" refers to the appropriate installation path shown above.
Say 'Yes to all' if Windows asks you about replacing files when dragging files into your root directory.
Updated the Script Implementation section to have a precacheMenu() line. - 03:31, 24 June 2012 (UTC)
Download ugx_upgrader_ammo.gsc and place it in mods/mapname/maps/. Download ugx_trader_files.rar and extract its contents to your root/mods/mapname/ directory, combining folders and overwriting files as it asks. The .rar contains weapons files for the weapons supported by this script, the menu file, the menu texture, and the menu material.
All that is required is a trigger - however you may create fancy brushes and place models and AI to make it look like a trader room if you wish. Create a trigger_use with this KvP:
Key |
Value |
---|---|
targetname |
upgrader |
In order for ugx_upgrader_ammo.gsc to run, it must be 'called' in your root/raw/maps/mapname.gsc. Open this file with any Text Editor you prefer, although Windows Notepad will suffice.
Find the line:
maps\_zombiemode::main();
Add:
level thread maps\ugx_upgrader_ammo::init();
immediately below the 'maps_zombiemode::main();' line
and add:
precacheMenu("ugx_upgrader");
precacheShader("trader_bg");
right before
maps\_zombiemode::main();
It should look like this:
precacheMenu("ugx_upgrader");
precacheShader("trader_bg");
maps\_zombiemode::main();
level thread maps\ugx_upgrader_ammo::init();
Copy dlc3_code.gsc and _zombiemode_weapons.gsc from your root/raw/maps folder to mods/mapname/maps. Open them both with any Text Editor , although Windows Notepad will suffice.
If you are on a 1.1 map,open (not copy) your mapname.gsc instead of dlc3_code.gsc.
In dlc3_code.gsc (if you have it - otherwise skip this part), highlight the entire include_weapons() function, and replace it with this:
include_weapons()
{
include_weapon( "zombie_colt" );
include_weapon( "zombie_colt_upgraded", false );
include_weapon( "zombie_sw_357" );
include_weapon( "zombie_sw_357_upgraded", false );
// Bolt Action
include_weapon( "zombie_kar98k" );
include_weapon( "zombie_kar98k_b" );
include_weapon( "zombie_kar98k_upgraded", false );
// Semi Auto
include_weapon( "zombie_m1carbine" );
include_weapon( "zombie_m1carbine_a_b" );
include_weapon( "zombie_m1carbine_a_b_e" );
include_weapon( "zombie_m1carbine_upgraded", false );
include_weapon( "zombie_m1garand" );
include_weapon( "zombie_m1garand_upgraded", false );
include_weapon( "zombie_gewehr43" );
include_weapon( "zombie_gewehr43_a" );
include_weapon( "zombie_gewehr43_a_e" );
include_weapon( "zombie_gewehr43_upgraded", false );
// Full Auto
include_weapon( "zombie_stg44" );
include_weapon( "zombie_stg44_a" );
include_weapon( "zombie_stg44_a_e" );
include_weapon( "zombie_stg44_upgraded", false );
include_weapon( "zombie_thompson" );
include_weapon( "zombie_thompson_a" );
include_weapon( "zombie_thompson_a_e" );
include_weapon( "zombie_thompson_upgraded", false );
include_weapon( "zombie_mp40" );
include_weapon( "zombie_mp40_a" );
include_weapon( "zombie_mp40_a_e" );
include_weapon( "zombie_mp40_upgraded", false );
include_weapon( "zombie_type100_smg" );
include_weapon( "zombie_type100_smg_upgraded", false );
// Scoped
include_weapon( "ptrs41_zombie" );
include_weapon( "ptrs41_zombie_upgraded", false );
// Grenade
include_weapon( "molotov" );
include_weapon( "stielhandgranate" );
// Grenade Launcher
include_weapon( "m1garand_gl_zombie" );
include_weapon( "m1garand_gl_zombie_upgraded", false );
include_weapon( "m7_launcher_zombie" );
include_weapon( "m7_launcher_zombie_upgraded", false );
// Flamethrower
include_weapon( "m2_flamethrower_zombie" );
include_weapon( "m2_flamethrower_zombie_upgraded", false );
// Shotgun
include_weapon( "zombie_doublebarrel" );
include_weapon( "zombie_doublebarrel_g" );
include_weapon( "zombie_doublebarrel_upgraded", false );
include_weapon( "zombie_shotgun" );
include_weapon( "zombie_shotgun_b_g" );
include_weapon( "zombie_shotgun_upgraded", false );
// Heavy MG
include_weapon( "zombie_bar" );
include_weapon( "zombie_bar_e" );
include_weapon( "zombie_bar_upgraded", false );
include_weapon( "zombie_fg42" );
include_weapon( "zombie_fg42_upgraded", false );
include_weapon( "zombie_30cal" );
include_weapon( "zombie_30cal_upgraded", false );
include_weapon( "zombie_mg42" );
include_weapon( "zombie_mg42_upgraded", false );
include_weapon( "zombie_ppsh" );
include_weapon( "zombie_ppsh_a" );
include_weapon( "zombie_ppsh_a_e" );
include_weapon( "zombie_ppsh_upgraded", false );
// Rocket Launcher
include_weapon( "panzerschrek_zombie" );
include_weapon( "panzerschrek_zombie_upgraded", false );
// Special
include_weapon( "ray_gun", true, ::factory_ray_gun_weighting_func );
include_weapon( "ray_gun_upgraded", false );
include_weapon( "tesla_gun", true );
include_weapon( "tesla_gun_upgraded", false );
include_weapon( "zombie_cymbal_monkey", true, ::factory_cymbal_monkey_weighting_func );
//include_weapon( "mortar_round" );
// Bouncing betties
include_weapon( "mine_bouncing_betty", false );
// Added By Sniperbolt
// include_weapon( "zombie_the_sniperbolt", true );
// include_weapon( "zombie_the_sniperbolt_upgrated", false );
// Limited weapons
//maps_zombiemode_weapons::add_limited_weapon( "zombie_colt", 0 );
//maps_zombiemode_weapons::add_limited_weapon( "zombie_gewehr43", 0 );
//maps_zombiemode_weapons::add_limited_weapon( "zombie_m1garand", 0 );
}
If you have mapname.gsc instead of dlc3_code.gsc, highlight and replace include_weapons() with this:
include_weapons()
{
include_weapon( "zombie_colt" );
include_weapon( "zombie_sw_357" );
// Bolt Action
include_weapon( "zombie_kar98k" );
include_weapon( "zombie_kar98k_b" );
// Semi Auto
include_weapon( "zombie_m1carbine" );
include_weapon( "zombie_m1carbine_a_b" );
include_weapon( "zombie_m1carbine_a_b_e" );
include_weapon( "zombie_m1garand" );
include_weapon( "zombie_gewehr43" );
include_weapon( "zombie_gewehr43_a" );
include_weapon( "zombie_gewehr43_a_e" );
// Full Auto
include_weapon( "zombie_stg44" );
include_weapon( "zombie_stg44_a" );
include_weapon( "zombie_stg44_a_e" );
include_weapon( "zombie_thompson" );
include_weapon( "zombie_thompson_a" );
include_weapon( "zombie_thompson_a_e" );
include_weapon( "zombie_mp40" );
include_weapon( "zombie_mp40_a" );
include_weapon( "zombie_mp40_a_e" );
include_weapon( "zombie_type100_smg" );
// Scoped
include_weapon( "ptrs41_zombie" );
// Grenade
include_weapon( "molotov" );
include_weapon( "stielhandgranate" );
// Grenade Launcher
include_weapon( "m1garand_gl_zombie" );
include_weapon( "m7_launcher_zombie" );
// Flamethrower
include_weapon( "m2_flamethrower_zombie" );
// Shotgun
include_weapon( "zombie_doublebarrel" );
include_weapon( "zombie_doublebarrel_g" );
include_weapon( "zombie_shotgun" );
include_weapon( "zombie_shotgun_b_g" );
// Heavy MG
include_weapon( "zombie_bar" );
include_weapon( "zombie_bar_e" );
include_weapon( "zombie_fg42" );
include_weapon( "zombie_30cal" );
include_weapon( "zombie_mg42" );
include_weapon( "zombie_ppsh" );
include_weapon( "zombie_ppsh_a" );
include_weapon( "zombie_ppsh_a_e" );
// Rocket Launcher
include_weapon( "panzerschrek_zombie" );
// Special
include_weapon( "ray_gun");
}
1.4 Tools: In _zombiemode_weapons.gsc, highlight the entire init_weapons() function and replace it with this:
init_weapons()
{
// Zombify
PrecacheItem( "zombie_melee" );
// Pistols
add_zombie_weapon( "colt", &"ZOMBIE_WEAPON_COLT_50", 50, "vox_crappy", 8 );
add_zombie_weapon( "colt_dirty_harry", &"ZOMBIE_WEAPON_COLT_DH_100", 100, "vox_357", 5 );
add_zombie_weapon( "nambu", &"ZOMBIE_WEAPON_NAMBU_50", 50, "vox_crappy", 8 );
add_zombie_weapon( "sw_357", &"ZOMBIE_WEAPON_SW357_100", 100, "vox_357", 5 );
add_zombie_weapon( "zombie_sw_357", &"ZOMBIE_WEAPON_SW357_100", 100, "vox_357", 5 );
add_zombie_weapon( "zombie_sw_357_upgraded", &"ZOMBIE_WEAPON_SW357_100", 100, "vox_357", 5 );
add_zombie_weapon( "tokarev", &"ZOMBIE_WEAPON_TOKAREV_50", 50, "vox_crappy", 8 );
add_zombie_weapon( "walther", &"ZOMBIE_WEAPON_WALTHER_50", 50, "vox_crappy", 8 );
add_zombie_weapon( "zombie_colt", &"ZOMBIE_WEAPON_ZOMBIECOLT_25", 25, "vox_crappy", 8 );
add_zombie_weapon( "zombie_colt_upgraded", &"ZOMBIE_WEAPON_ZOMBIECOLT_25", 25, "vox_crappy", 8 );
// Bolt Action
add_zombie_weapon( "kar98k", &"ZOMBIE_WEAPON_KAR98K_200", 200, "", 0);
add_zombie_weapon( "zombie_kar98k", &"ZOMBIE_WEAPON_KAR98K_200", 200, "", 0);
add_zombie_weapon( "zombie_kar98k_b", &"Purchase Kar98k Bayonet 200", 200, "", 0);
add_zombie_weapon( "zombie_kar98k_upgraded", &"ZOMBIE_WEAPON_KAR98K_200", 200, "", 0);
add_zombie_weapon( "kar98k_bayonet", &"ZOMBIE_WEAPON_KAR98K_B_200", 200, "", 0);
add_zombie_weapon( "mosin_rifle", &"ZOMBIE_WEAPON_MOSIN_200", 200, "", 0);
add_zombie_weapon( "mosin_rifle_bayonet", &"ZOMBIE_WEAPON_MOSIN_B_200", 200, "", 0 );
add_zombie_weapon( "springfield", &"ZOMBIE_WEAPON_SPRINGFIELD_200", 200, "", 0 );
add_zombie_weapon( "zombie_springfield", &"ZOMBIE_WEAPON_SPRINGFIELD_200", 200, "", 0 );
add_zombie_weapon( "springfield_bayonet", &"ZOMBIE_WEAPON_SPRINGFIELD_B_200", 200, "", 0 );
add_zombie_weapon( "zombie_type99_rifle", &"ZOMBIE_WEAPON_TYPE99_200", 200, "", 0 );
add_zombie_weapon( "zombie_type99_rifle_upgraded", &"ZOMBIE_WEAPON_TYPE99_200", 200, "", 0 );
add_zombie_weapon( "type99_rifle_bayonet", &"ZOMBIE_WEAPON_TYPE99_B_200", 200, "", 0 );
// Semi Auto
add_zombie_weapon( "zombie_gewehr43", &"ZOMBIE_WEAPON_GEWEHR43_600", 600, "" , 0 );
add_zombie_weapon( "zombie_gewehr43_a", &"ZOMBIE_WEAPON_GEWEHR43_600", 600, "" , 0 );
add_zombie_weapon( "zombie_gewehr43_a_e", &"ZOMBIE_WEAPON_GEWEHR43_600", 600, "" , 0 );
add_zombie_weapon( "zombie_gewehr43_upgraded", &"ZOMBIE_WEAPON_GEWEHR43_600", 600, "" , 0 );
add_zombie_weapon( "zombie_m1carbine", &"ZOMBIE_WEAPON_M1CARBINE_600", 600, "" , 0 );
add_zombie_weapon( "zombie_m1carbine_a_b", &"ZOMBIE_WEAPON_M1CARBINE_600", 600, "" , 0 );
add_zombie_weapon( "zombie_m1carbine_a_b_e", &"ZOMBIE_WEAPON_M1CARBINE_600", 600, "" , 0 );
add_zombie_weapon( "zombie_m1carbine_upgraded", &"ZOMBIE_WEAPON_M1CARBINE_600", 600, "" , 0 );
add_zombie_weapon( "m1carbine_bayonet", &"ZOMBIE_WEAPON_M1CARBINE_B_600", 600, "" , 0 );
add_zombie_weapon( "zombie_m1garand", &"ZOMBIE_WEAPON_M1GARAND_600", 600, "" , 0 );
add_zombie_weapon( "zombie_m1garand_upgraded", &"ZOMBIE_WEAPON_M1GARAND_600", 600, "" , 0 );
add_zombie_weapon( "m1garand_bayonet", &"ZOMBIE_WEAPON_M1GARAND_B_600", 600, "" , 0 );
add_zombie_weapon( "svt40", &"ZOMBIE_WEAPON_SVT40_600", 600, "" , 0 );
// Grenades
add_zombie_weapon( "fraggrenade", &"ZOMBIE_WEAPON_FRAGGRENADE_250", 250, "" , 0 );
add_zombie_weapon( "molotov", &"ZOMBIE_WEAPON_MOLOTOV_200", 200, "vox_crappy", 8 );
add_zombie_weapon( "molotov_zombie", &"ZOMBIE_WEAPON_MOLOTOV_200", 200, "vox_crappy", 8 );
add_zombie_weapon( "stick_grenade", &"ZOMBIE_WEAPON_STICKGRENADE_250", 250, "" , 0 );
add_zombie_weapon( "stielhandgranate", &"ZOMBIE_WEAPON_STIELHANDGRANATE_250", 250, "" , 0, 250 );
add_zombie_weapon( "type97_frag", &"ZOMBIE_WEAPON_TYPE97FRAG_250", 250, "" , 0 );
// Scoped
add_zombie_weapon( "kar98k_scoped_zombie", &"ZOMBIE_WEAPON_KAR98K_S_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "kar98k_scoped_bayonet_zombie", &"ZOMBIE_WEAPON_KAR98K_S_B_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "mosin_rifle_scoped_zombie", &"ZOMBIE_WEAPON_MOSIN_S_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "mosin_rifle_scoped_bayonet_zombie", &"ZOMBIE_WEAPON_MOSIN_S_B_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "ptrs41_zombie", &"ZOMBIE_WEAPON_PTRS41_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "ptrs41_zombie_upgraded", &"ZOMBIE_WEAPON_PTRS41_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "springfield_scoped_zombie", &"ZOMBIE_WEAPON_SPRINGFIELD_S_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "springfield_scoped_bayonet_zombie", &"ZOMBIE_WEAPON_SPRINGFIELD_S_B_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "type99_rifle_scoped_zombie", &"ZOMBIE_WEAPON_TYPE99_S_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "type99_rifle_scoped_bayonet_zombie", &"ZOMBIE_WEAPON_TYPE99_S_B_750", 750, "vox_ppsh", 5);
// Full Auto
add_zombie_weapon( "zombie_mp40", &"ZOMBIE_WEAPON_MP40_1000", 1000, "vox_mp40", 2 );
add_zombie_weapon( "zombie_mp40_a", &"ZOMBIE_WEAPON_MP40_1000", 1000, "vox_mp40", 2 );
add_zombie_weapon( "zombie_mp40_a_e", &"ZOMBIE_WEAPON_MP40_1000", 1000, "vox_mp40", 2 );
add_zombie_weapon( "zombie_mp40_upgraded", &"ZOMBIE_WEAPON_MP40_1000", 1000, "vox_mp40", 2 );
add_zombie_weapon( "zombie_ppsh", &"ZOMBIE_WEAPON_PPSH_2000", 2000, "vox_ppsh", 5 );
add_zombie_weapon( "zombie_ppsh_a", &"ZOMBIE_WEAPON_PPSH_2000", 2000, "vox_ppsh", 5 );
add_zombie_weapon( "zombie_ppsh_a_e", &"ZOMBIE_WEAPON_PPSH_2000", 2000, "vox_ppsh", 5 );
add_zombie_weapon( "zombie_ppsh_upgraded", &"ZOMBIE_WEAPON_PPSH_2000", 2000, "vox_ppsh", 5 );
add_zombie_weapon( "zombie_stg44", &"ZOMBIE_WEAPON_STG44_1200", 1200, "vox_mg", 9 );
add_zombie_weapon( "zombie_stg44_a", &"ZOMBIE_WEAPON_STG44_1200", 1200, "vox_mg", 9 );
add_zombie_weapon( "zombie_stg44_a_e", &"ZOMBIE_WEAPON_STG44_1200", 1200, "vox_mg", 9 );
add_zombie_weapon( "zombie_stg44_upgraded", &"ZOMBIE_WEAPON_STG44_1200", 1200, "vox_mg", 9 );
add_zombie_weapon( "zombie_thompson", &"ZOMBIE_WEAPON_THOMPSON_1200", 1200, "", 0 );
add_zombie_weapon( "zombie_thompson_a", &"ZOMBIE_WEAPON_THOMPSON_1200", 1200, "", 0 );
add_zombie_weapon( "zombie_thompson_a_e", &"ZOMBIE_WEAPON_THOMPSON_1200", 1200, "", 0 );
add_zombie_weapon( "zombie_thompson_upgraded", &"ZOMBIE_WEAPON_THOMPSON_1200", 1200, "", 0 );
add_zombie_weapon( "zombie_type100_smg", &"ZOMBIE_WEAPON_TYPE100_1000", 1000, "", 0 );
add_zombie_weapon( "zombie_type100_smg_upgraded", &"ZOMBIE_WEAPON_TYPE100_1000", 1000, "", 0 );
// Shotguns
add_zombie_weapon( "zombie_doublebarrel", &"ZOMBIE_WEAPON_DOUBLEBARREL_1200", 1200, "vox_shotgun", 6);
add_zombie_weapon( "zombie_doublebarrel_g", &"ZOMBIE_WEAPON_DOUBLEBARREL_1200", 1200, "vox_shotgun", 6);
add_zombie_weapon( "zombie_doublebarrel_upgraded", &"ZOMBIE_WEAPON_DOUBLEBARREL_1200", 1200, "vox_shotgun", 6);
add_zombie_weapon( "zombie_doublebarrel_sawed", &"ZOMBIE_WEAPON_DOUBLEBARREL_SAWED_1200", 1200, "vox_shotgun", 6);
add_zombie_weapon( "zombie_doublebarrel_sawed_upgraded", &"ZOMBIE_WEAPON_DOUBLEBARREL_SAWED_1200", 1200, "vox_shotgun", 6);
add_zombie_weapon( "zombie_shotgun", &"ZOMBIE_WEAPON_SHOTGUN_1500", 1500, "vox_shotgun", 6);
add_zombie_weapon( "zombie_shotgun_b", &"ZOMBIE_WEAPON_SHOTGUN_1500", 1500, "vox_shotgun", 6);
add_zombie_weapon( "zombie_shotgun_b_g", &"ZOMBIE_WEAPON_SHOTGUN_1500", 1500, "vox_shotgun", 6);
add_zombie_weapon( "zombie_shotgun_upgraded", &"ZOMBIE_WEAPON_SHOTGUN_1500", 1500, "vox_shotgun", 6);
// Heavy Machineguns
add_zombie_weapon( "zombie_30cal", &"ZOMBIE_WEAPON_30CAL_3000", 3000, "vox_mg", 9 );
add_zombie_weapon( "zombie_30cal_upgraded", &"ZOMBIE_WEAPON_30CAL_3000", 3000, "vox_mg", 9 );
add_zombie_weapon( "zombie_bar", &"ZOMBIE_WEAPON_BAR_1800", 1800, "vox_bar", 5 );
add_zombie_weapon( "zombie_bar_e", &"ZOMBIE_WEAPON_BAR_1800", 1800, "vox_bar", 5 );
add_zombie_weapon( "zombie_bar_upgraded", &"ZOMBIE_WEAPON_BAR_1800", 1800, "vox_bar", 5 );
add_zombie_weapon( "dp28", &"ZOMBIE_WEAPON_DP28_2250", 2250, "vox_mg" , 9 );
add_zombie_weapon( "zombie_fg42", &"ZOMBIE_WEAPON_FG42_1500", 1500, "vox_mg" , 9 );
add_zombie_weapon( "zombie_fg42_upgraded", &"ZOMBIE_WEAPON_FG42_1500", 1500, "vox_mg" , 9 );
add_zombie_weapon( "fg42_scoped", &"ZOMBIE_WEAPON_FG42_S_1500", 1500, "vox_mg" , 9 );
add_zombie_weapon( "zombie_mg42", &"ZOMBIE_WEAPON_MG42_3000", 3000, "vox_mg" , 9 );
add_zombie_weapon( "zombie_mg42_upgraded", &"ZOMBIE_WEAPON_MG42_3000", 3000, "vox_mg" , 9 );
add_zombie_weapon( "type99_lmg", &"ZOMBIE_WEAPON_TYPE99_LMG_1750", 1750, "vox_mg" , 9 );
// Grenade Launcher
add_zombie_weapon( "m1garand_gl_zombie", &"ZOMBIE_WEAPON_M1GARAND_GL_1500", 1500, "", 0 );
add_zombie_weapon( "m1garand_gl_zombie_upgraded", &"ZOMBIE_WEAPON_M1GARAND_GL_1500", 1500, "", 0 );
add_zombie_weapon( "mosin_launcher_zombie", &"ZOMBIE_WEAPON_MOSIN_GL_1200", 1200, "", 0 );
// Bipods
add_zombie_weapon( "30cal_bipod", &"ZOMBIE_WEAPON_30CAL_BIPOD_3500", 3500, "vox_mg", 5 );
add_zombie_weapon( "bar_bipod", &"ZOMBIE_WEAPON_BAR_BIPOD_2500", 2500, "vox_bar", 5 );
add_zombie_weapon( "dp28_bipod", &"ZOMBIE_WEAPON_DP28_BIPOD_2500", 2500, "vox_mg", 5 );
add_zombie_weapon( "fg42_bipod", &"ZOMBIE_WEAPON_FG42_BIPOD_2000", 2000, "vox_mg", 5 );
add_zombie_weapon( "mg42_bipod", &"ZOMBIE_WEAPON_MG42_BIPOD_3250", 3250, "vox_mg", 5 );
add_zombie_weapon( "type99_lmg_bipod", &"ZOMBIE_WEAPON_TYPE99_LMG_BIPOD_2250", 2250, "vox_mg", 5 );
// Rocket Launchers
add_zombie_weapon( "bazooka", &"ZOMBIE_WEAPON_BAZOOKA_2000", 2000, "", 0 );
add_zombie_weapon( "panzerschrek_zombie", &"ZOMBIE_WEAPON_PANZERSCHREK_2000", 2000, "vox_panzer", 5 );
add_zombie_weapon( "panzerschrek_zombie_upgraded", &"ZOMBIE_WEAPON_PANZERSCHREK_2000", 2000, "vox_panzer", 5 );
// Flamethrower
add_zombie_weapon( "m2_flamethrower_zombie", &"ZOMBIE_WEAPON_M2_FLAMETHROWER_3000", 3000, "vox_flame", 7);
add_zombie_weapon( "m2_flamethrower_zombie_upgraded", &"ZOMBIE_WEAPON_M2_FLAMETHROWER_3000", 3000, "vox_flame", 7);
// Special
add_zombie_weapon( "mine_bouncing_betty", &"ZOMBIE_WEAPON_SATCHEL_2000", 2000, "" );
add_zombie_weapon( "mortar_round", &"ZOMBIE_WEAPON_MORTARROUND_2000", 2000, "" );
add_zombie_weapon( "satchel_charge", &"ZOMBIE_WEAPON_SATCHEL_2000", 2000, "vox_monkey", 3 );
add_zombie_weapon( "zombie_cymbal_monkey", &"ZOMBIE_WEAPON_SATCHEL_2000", 2000, "vox_monkey", 3 );
add_zombie_weapon( "ray_gun", &"ZOMBIE_WEAPON_RAYGUN_10000", 10000, "vox_raygun", 6 );
add_zombie_weapon( "ray_gun_upgraded", &"ZOMBIE_WEAPON_RAYGUN_10000", 10000, "vox_raygun", 6 );
add_zombie_weapon( "tesla_gun", &"ZOMBIE_BUY_TESLA", 10, "vox_tesla", 5 );
add_zombie_weapon( "tesla_gun_upgraded", &"ZOMBIE_BUY_TESLA", 10, "vox_tesla", 5 );
if(level.script != "nazi_zombie_prototype")
{
Precachemodel("zombie_teddybear");
}
// ONLY 1 OF THE BELOW SHOULD BE ALLOWED
//add_limited_weapon( "m2_flamethrower_zombie", 1 );
add_limited_weapon( "tesla_gun", 1);
}
1.1 Tools: Replace the init_weapons() function in _zombiemode_weapons.gsc with this:
init_weapons()
{
// Zombify
PrecacheItem( "zombie_melee" );
// Pistols
add_zombie_weapon( "colt", &"ZOMBIE_WEAPON_COLT_50", 50, "vox_crappy", 8 );
add_zombie_weapon( "colt_dirty_harry", &"ZOMBIE_WEAPON_COLT_DH_100", 100, "vox_357", 5 );
add_zombie_weapon( "nambu", &"ZOMBIE_WEAPON_NAMBU_50", 50, "vox_crappy", 8 );
add_zombie_weapon( "sw_357", &"ZOMBIE_WEAPON_SW357_100", 100, "vox_357", 5 );
add_zombie_weapon( "zombie_sw_357", &"ZOMBIE_WEAPON_SW357_100", 100, "vox_357", 5 );
add_zombie_weapon( "tokarev", &"ZOMBIE_WEAPON_TOKAREV_50", 50, "vox_crappy", 8 );
add_zombie_weapon( "walther", &"ZOMBIE_WEAPON_WALTHER_50", 50, "vox_crappy", 8 );
add_zombie_weapon( "zombie_colt", &"ZOMBIE_WEAPON_ZOMBIECOLT_25", 25, "vox_crappy", 8 );
// Bolt Action
add_zombie_weapon( "kar98k", &"ZOMBIE_WEAPON_KAR98K_200", 200, "", 0);
add_zombie_weapon( "zombie_kar98k", &"ZOMBIE_WEAPON_KAR98K_200", 200, "", 0);
add_zombie_weapon( "zombie_kar98k_b", &"Purchase Kar98k Bayonet 200", 200, "", 0);
add_zombie_weapon( "kar98k_bayonet", &"ZOMBIE_WEAPON_KAR98K_B_200", 200, "", 0);
add_zombie_weapon( "mosin_rifle", &"ZOMBIE_WEAPON_MOSIN_200", 200, "", 0);
add_zombie_weapon( "mosin_rifle_bayonet", &"ZOMBIE_WEAPON_MOSIN_B_200", 200, "", 0 );
add_zombie_weapon( "springfield", &"ZOMBIE_WEAPON_SPRINGFIELD_200", 200, "", 0 );
add_zombie_weapon( "zombie_springfield", &"ZOMBIE_WEAPON_SPRINGFIELD_200", 200, "", 0 );
add_zombie_weapon( "springfield_bayonet", &"ZOMBIE_WEAPON_SPRINGFIELD_B_200", 200, "", 0 );
add_zombie_weapon( "zombie_type99_rifle", &"ZOMBIE_WEAPON_TYPE99_200", 200, "", 0 );
add_zombie_weapon( "type99_rifle_bayonet", &"ZOMBIE_WEAPON_TYPE99_B_200", 200, "", 0 );
// Semi Auto
add_zombie_weapon( "zombie_gewehr43", &"ZOMBIE_WEAPON_GEWEHR43_600", 600, "" , 0 );
add_zombie_weapon( "zombie_gewehr43_a", &"ZOMBIE_WEAPON_GEWEHR43_600", 600, "" , 0 );
add_zombie_weapon( "zombie_gewehr43_a_e", &"ZOMBIE_WEAPON_GEWEHR43_600", 600, "" , 0 );
add_zombie_weapon( "zombie_m1carbine", &"ZOMBIE_WEAPON_M1CARBINE_600", 600, "" , 0 );
add_zombie_weapon( "zombie_m1carbine_a_b", &"ZOMBIE_WEAPON_M1CARBINE_600", 600, "" , 0 );
add_zombie_weapon( "zombie_m1carbine_a_b_e", &"ZOMBIE_WEAPON_M1CARBINE_600", 600, "" , 0 );
add_zombie_weapon( "m1carbine_bayonet", &"ZOMBIE_WEAPON_M1CARBINE_B_600", 600, "" , 0 );
add_zombie_weapon( "zombie_m1garand", &"ZOMBIE_WEAPON_M1GARAND_600", 600, "" , 0 );
add_zombie_weapon( "m1garand_bayonet", &"ZOMBIE_WEAPON_M1GARAND_B_600", 600, "" , 0 );
add_zombie_weapon( "svt40", &"ZOMBIE_WEAPON_SVT40_600", 600, "" , 0 );
// Grenades
add_zombie_weapon( "fraggrenade", &"ZOMBIE_WEAPON_FRAGGRENADE_250", 250, "" , 0 );
add_zombie_weapon( "molotov", &"ZOMBIE_WEAPON_MOLOTOV_200", 200, "vox_crappy", 8 );
add_zombie_weapon( "molotov_zombie", &"ZOMBIE_WEAPON_MOLOTOV_200", 200, "vox_crappy", 8 );
add_zombie_weapon( "stick_grenade", &"ZOMBIE_WEAPON_STICKGRENADE_250", 250, "" , 0 );
add_zombie_weapon( "stielhandgranate", &"ZOMBIE_WEAPON_STIELHANDGRANATE_250", 250, "" , 0, 250 );
add_zombie_weapon( "type97_frag", &"ZOMBIE_WEAPON_TYPE97FRAG_250", 250, "" , 0 );
// Scoped
add_zombie_weapon( "kar98k_scoped_zombie", &"ZOMBIE_WEAPON_KAR98K_S_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "kar98k_scoped_bayonet_zombie", &"ZOMBIE_WEAPON_KAR98K_S_B_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "mosin_rifle_scoped_zombie", &"ZOMBIE_WEAPON_MOSIN_S_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "mosin_rifle_scoped_bayonet_zombie", &"ZOMBIE_WEAPON_MOSIN_S_B_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "ptrs41_zombie", &"ZOMBIE_WEAPON_PTRS41_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "springfield_scoped_zombie", &"ZOMBIE_WEAPON_SPRINGFIELD_S_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "springfield_scoped_bayonet_zombie", &"ZOMBIE_WEAPON_SPRINGFIELD_S_B_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "type99_rifle_scoped_zombie", &"ZOMBIE_WEAPON_TYPE99_S_750", 750, "vox_ppsh", 5);
add_zombie_weapon( "type99_rifle_scoped_bayonet_zombie", &"ZOMBIE_WEAPON_TYPE99_S_B_750", 750, "vox_ppsh", 5);
// Full Auto
add_zombie_weapon( "zombie_mp40", &"ZOMBIE_WEAPON_MP40_1000", 1000, "vox_mp40", 2 );
add_zombie_weapon( "zombie_mp40_a", &"ZOMBIE_WEAPON_MP40_1000", 1000, "vox_mp40", 2 );
add_zombie_weapon( "zombie_mp40_a_e", &"ZOMBIE_WEAPON_MP40_1000", 1000, "vox_mp40", 2 );
add_zombie_weapon( "zombie_ppsh", &"ZOMBIE_WEAPON_PPSH_2000", 2000, "vox_ppsh", 5 );
add_zombie_weapon( "zombie_ppsh_a", &"ZOMBIE_WEAPON_PPSH_2000", 2000, "vox_ppsh", 5 );
add_zombie_weapon( "zombie_ppsh_a_e", &"ZOMBIE_WEAPON_PPSH_2000", 2000, "vox_ppsh", 5 );
add_zombie_weapon( "zombie_stg44", &"ZOMBIE_WEAPON_STG44_1200", 1200, "vox_mg", 9 );
add_zombie_weapon( "zombie_stg44_a", &"ZOMBIE_WEAPON_STG44_1200", 1200, "vox_mg", 9 );
add_zombie_weapon( "zombie_stg44_a_e", &"ZOMBIE_WEAPON_STG44_1200", 1200, "vox_mg", 9 );
add_zombie_weapon( "zombie_thompson", &"ZOMBIE_WEAPON_THOMPSON_1200", 1200, "", 0 );
add_zombie_weapon( "zombie_thompson_a", &"ZOMBIE_WEAPON_THOMPSON_1200", 1200, "", 0 );
add_zombie_weapon( "zombie_thompson_a_e", &"ZOMBIE_WEAPON_THOMPSON_1200", 1200, "", 0 );
add_zombie_weapon( "zombie_type100_smg", &"ZOMBIE_WEAPON_TYPE100_1000", 1000, "", 0 );
// Shotguns
add_zombie_weapon( "zombie_doublebarrel", &"ZOMBIE_WEAPON_DOUBLEBARREL_1200", 1200, "vox_shotgun", 6);
add_zombie_weapon( "zombie_doublebarrel_g", &"ZOMBIE_WEAPON_DOUBLEBARREL_1200", 1200, "vox_shotgun", 6);
add_zombie_weapon( "zombie_doublebarrel_sawed", &"ZOMBIE_WEAPON_DOUBLEBARREL_SAWED_1200", 1200, "vox_shotgun", 6);
add_zombie_weapon( "zombie_shotgun", &"ZOMBIE_WEAPON_SHOTGUN_1500", 1500, "vox_shotgun", 6);
add_zombie_weapon( "zombie_shotgun_b", &"ZOMBIE_WEAPON_SHOTGUN_1500", 1500, "vox_shotgun", 6);
add_zombie_weapon( "zombie_shotgun_b_g", &"ZOMBIE_WEAPON_SHOTGUN_1500", 1500, "vox_shotgun", 6);
add_zombie_weapon( "zombie_shotgun_upgraded", &"ZOMBIE_WEAPON_SHOTGUN_1500", 1500, "vox_shotgun", 6);
// Heavy Machineguns
add_zombie_weapon( "zombie_30cal", &"ZOMBIE_WEAPON_30CAL_3000", 3000, "vox_mg", 9 );
add_zombie_weapon( "zombie_bar", &"ZOMBIE_WEAPON_BAR_1800", 1800, "vox_bar", 5 );
add_zombie_weapon( "zombie_bar_e", &"ZOMBIE_WEAPON_BAR_1800", 1800, "vox_bar", 5 );
add_zombie_weapon( "dp28", &"ZOMBIE_WEAPON_DP28_2250", 2250, "vox_mg" , 9 );
add_zombie_weapon( "zombie_fg42", &"ZOMBIE_WEAPON_FG42_1500", 1500, "vox_mg" , 9 );
add_zombie_weapon( "fg42_scoped", &"ZOMBIE_WEAPON_FG42_S_1500", 1500, "vox_mg" , 9 );
add_zombie_weapon( "zombie_mg42", &"ZOMBIE_WEAPON_MG42_3000", 3000, "vox_mg" , 9 );
add_zombie_weapon( "type99_lmg", &"ZOMBIE_WEAPON_TYPE99_LMG_1750", 1750, "vox_mg" , 9 );
// Grenade Launcher
add_zombie_weapon( "m1garand_gl_zombie", &"ZOMBIE_WEAPON_M1GARAND_GL_1500", 1500, "", 0 );
add_zombie_weapon( "m1garand_gl_zombie_upgraded", &"ZOMBIE_WEAPON_M1GARAND_GL_1500", 1500, "", 0 );
add_zombie_weapon( "mosin_launcher_zombie", &"ZOMBIE_WEAPON_MOSIN_GL_1200", 1200, "", 0 );
// Bipods
add_zombie_weapon( "30cal_bipod", &"ZOMBIE_WEAPON_30CAL_BIPOD_3500", 3500, "vox_mg", 5 );
add_zombie_weapon( "bar_bipod", &"ZOMBIE_WEAPON_BAR_BIPOD_2500", 2500, "vox_bar", 5 );
add_zombie_weapon( "dp28_bipod", &"ZOMBIE_WEAPON_DP28_BIPOD_2500", 2500, "vox_mg", 5 );
add_zombie_weapon( "fg42_bipod", &"ZOMBIE_WEAPON_FG42_BIPOD_2000", 2000, "vox_mg", 5 );
add_zombie_weapon( "mg42_bipod", &"ZOMBIE_WEAPON_MG42_BIPOD_3250", 3250, "vox_mg", 5 );
add_zombie_weapon( "type99_lmg_bipod", &"ZOMBIE_WEAPON_TYPE99_LMG_BIPOD_2250", 2250, "vox_mg", 5 );
// Rocket Launchers
add_zombie_weapon( "bazooka", &"ZOMBIE_WEAPON_BAZOOKA_2000", 2000, "", 0 );
add_zombie_weapon( "panzerschrek_zombie", &"ZOMBIE_WEAPON_PANZERSCHREK_2000", 2000, "vox_panzer", 5 );
// Flamethrower
add_zombie_weapon( "m2_flamethrower_zombie", &"ZOMBIE_WEAPON_M2_FLAMETHROWER_3000", 3000, "vox_flame", 7);
// Special
add_zombie_weapon( "mine_bouncing_betty", &"ZOMBIE_WEAPON_SATCHEL_2000", 2000, "" );
add_zombie_weapon( "mortar_round", &"ZOMBIE_WEAPON_MORTARROUND_2000", 2000, "" );
add_zombie_weapon( "satchel_charge", &"ZOMBIE_WEAPON_SATCHEL_2000", 2000, "vox_monkey", 3 );
add_zombie_weapon( "ray_gun", &"ZOMBIE_WEAPON_RAYGUN_10000", 10000, "vox_raygun", 6 );
if(level.script != "nazi_zombie_prototype")
{
Precachemodel("zombie_teddybear");
}
}
In order for the menu to work, it must be included in your CSV.
1.4 Map: Navigate to root/zone_source/nazi_zombie_mapname_patch.csv and open it with Notepad.
1.1 Map: Navigate to root/zone_source/nazi_zombie_mapname.csv and open it with Notepad.
Add these lines:
menufile,ui/scriptmenus/ugx_upgrader.menu
xanim,viewmodel_trenchgun_grip_idle
xanim,viewmodel_trenchgun_grip_ads_down
xanim,viewmodel_trenchgun_grip_ads_idle
xanim,viewmodel_trenchgun_grip_ads_up
xanim,viewmodel_trenchgun_grip_fire
xanim,viewmodel_trenchgun_grip_fire_ads
xanim,viewmodel_trenchgun_grip_reload_start
xanim,viewmodel_trenchgun_grip_idle
xanim,viewmodel_trenchgun_grip_melee
xanim,viewmodel_trenchgun_grip_pullout
xanim,viewmodel_trenchgun_grip_pullout_fast
xanim,viewmodel_trenchgun_grip_putaway
xanim,viewmodel_trenchgun_grip_putaway_fast
xanim,viewmodel_trenchgun_grip_rechamber
xanim,viewmodel_trenchgun_grip_reload_end
xanim,viewmodel_trenchgun_grip_reload_loop
xanim,viewmodel_carbine_bayonet_thrust
xanim,viewmodel_carbine_bayonet_first_raise
xanim,viewmodel_carbine_bayonet_swipe
weapon,sp/zombie_kar98k_b
weapon,sp/zombie_m1carbine_a_b
weapon,sp/zombie_m1carbine_a_b_e
weapon,sp/zombie_bar_e
weapon,sp/zombie_thompson_a
weapon,sp/zombie_thompson_a_e
weapon,sp/zombie_shotgun_b_g
weapon,sp/zombie_shotgun_b_g_e
weapon,sp/zombie_doublebarrel_g
weapon,sp/zombie_mp40_a
weapon,sp/zombie_mp40_a_e
weapon,sp/zombie_ppsh_a
weapon,sp/zombie_ppsh_a_e
weapon,sp/zombie_stg44_a
weapon,sp/zombie_stg44_a_e
weapon,sp/zombie_gewehr43_a
weapon,sp/zombie_gewehr43_a_e
material,mtl_weapon_mp_thompson_drum
material,mtl_weapon_mp40_expander
material,mtl_weapon_mp_ppsh41_clip
material,mtl_weapon_mp_ppsh41
material,mtl_usa_bayonet
material,mtl_weapon_aperture_and_acog
material,mtl_weapon_mp_apature_glass
material,mtl_weapon_mp_apature_crosshair
Open Launcher and go to the Mods tab. Select your map from the list. Scroll
down in the box on the left until you see ugx_upgrader_ammo.gsc. Check the box
next to it.
Add:
material,trader_bg
to the Mod FF box.
Once you have completed the above steps, compile your map, patch(1.4 only), and mod.
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//|||| Name : ugx_upgrader_ammo.gsc
//|||| Info : handles weapon upgrades and ammo handouts in armoury for UGX Cabin
//|||| Site : www.ugx-mods.com
//|||| Author : [UGX] treminaor
//|||| Notes : w = currentweapon, nw = newweapon
//|||| To-Do :n/a
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
init()
{
upgrade_trigger = getEnt("upgrader","targetname");
upgrade_trigger thread upgrade_think();
}
/*
weapons list:
===================
zombie_kar98k
zombie_m1carbine
zombie_bar
ptrs41_zombie
zombie_colt
zombie_thompson
zombie_sw_357
zombie_shotgun
zombie_doublebarrel
zombie_mp40
zombie_mg42
zombie_ppsh
zombie_stg44
zombie_walther
zombie_gewehr43
===================
*/
upgrade_think()
{
self setHintString("Press &&1 to open trader menu");
self setCursorHint("HINT_NOICON");
player = undefined;
players = getplayers();
for(i=0;i<players.size;i++)
{
players[i].trader_title = undefined;
players[i].trader_1 = undefined;
players[i].trader_2 = undefined;
players[i].trader_3 = undefined;
players[i].trader_end = undefined;
}
while(1)
{
self waittill("trigger", player);
menu_choice_wait(player);
}
}
menu_choice_wait(player)
{
close = false;
level endon( "intermission" );
level endon( "disconect" );
russian = getent("russian","targetname");
view = getStruct("russian_view","targetname");
viewTag = "tag_origin";
self.view = Spawn( "script_model", view.origin );
self.view SetModel( "tag_origin" );
self.view.angles = view.angles;
self.view.origin = view.origin;
self.view LinkTo( view, viewTag );
player freezeControls(true);
player disableWeapons();
player lerp_player_view_to_tag( self.view, "tag_origin", 0.5, 1, 20, 20, 10, 10 );
menu = "ugx_upgrader";
player openMenu( menu );
player trader_menu(1);
player waittill("menuresponse", menu, response);
if(menu == "ugx_upgrader")
switch( response )
{
case "1": // random weapon
player random_weapon_give();
player freezeControls(false);
player enableWeapons();
self.view delete();
player trader_menu(0);
if(isDefined(level.randweaponvox))
{
weapvox = randomint(2);
self playsound("trader_randweapon"+ (weapvox+1));
if(weapvox == 0)
wait 2;
else if(weapvox == 1)
wait 1;
else
wait 5;
}
else
{
nomoneyvox = randomint(2);
self playsound("trader_notenoughmoney"+ (nomoneyvox+1));
if(nomoneyvox == 0)
wait 1;
else if(nomoneyvox == 1)
wait 4;
else
wait 2;
}
return;
case "2": // attachments
player upgrade_decide();
player freezeControls(false);
player enableWeapons();
self.view delete();
player trader_menu(0);
if(isDefined(level.upgrade_vox))
{
weapvox = randomint(2);
self playsound("trader_weapupgrade"+ (weapvox+1));
if(weapvox == 1)
wait 3;
else
wait 2;
}
else if(isDefined(level.upgrade_nomoney))
{
nomoneyvox = randomint(2);
self playsound("trader_notenoughmoney"+ (nomoneyvox+1));
if(nomoneyvox == 0)
wait 1;
else if(nomoneyvox == 1)
wait 4;
else
wait 2;
}
return;
case "3": //ammo
player ammo_giver();
player freezeControls(false);
player enableWeapons();
self.view delete();
player trader_menu(0);
if(isDefined(level.ammo_vox))
{
vox = randomint(2);
self playsound("trader_ammo"+ (vox+1));
if(vox == 0)
wait 6;
else
wait 5;
}
else if(isDefined(level.nomoneyvox))
{
nomoneyvox = randomint(2);
self playsound("trader_notenoughmoney"+ (nomoneyvox+1));
if(nomoneyvox == 0)
wait 1;
else if(nomoneyvox == 1)
wait 4;
else
wait 2;
}
return;
case "4": //close
close = true;
player enableWeapons();
player freezeControls(false);
self.view delete();
player trader_menu(0);
break;
default:
close = true;
player enableWeapons();
player freezeControls(false);
self.view delete();
player trader_menu(0);
break;
}
//player enableWeapons();
//player freezeControls(false);
player closeMenu( "ugx_upgrader" );
player trader_menu(0);
player freezeControls(false);
player enableWeapons();
self.view delete();
}
trader_menu(alpha)
{
if(!isDefined(self.trader_title))
self.trader_title = create_simple_hud(self);
self.trader_title.foreground = true;
self.trader_title.sort = 3;
self.trader_title.hidewheninmenu = false;
self.trader_title.alignX = "center";
self.trader_title.alignY = "middle";
self.trader_title.horzAlign = "center";
self.trader_title.vertAlign = "middle";
self.trader_title.x = 0;
self.trader_title.y = -78;
self.trader_title.alpha = alpha;
self.trader_title.fontScale = 1;
self.trader_title.color = ( 1, 1, 1 );
self.trader_title SetText("Trader Menu");
if(!isDefined(self.trader_1))
self.trader_1 = create_simple_hud(self);
self.trader_1.foreground = true;
self.trader_1.sort = 3;
self.trader_1.hidewheninmenu = false;
self.trader_1.alignX = "center";
self.trader_1.alignY = "middle";
self.trader_1.horzAlign = "center";
self.trader_1.vertAlign = "middle";
self.trader_1.x = -35;
self.trader_1.y = -66;
self.trader_1.alpha = alpha;
self.trader_1.fontScale = 1;
self.trader_1.color = ( 1, 1, 1 );
self.trader_1 SetText("Press 1 for a Random Weapon [Cost: "+(1000*level.round_number) / 2.5+"]");
if(!isDefined(self.trader_2))
self.trader_2 = create_simple_hud(self);
self.trader_2.foreground = true;
self.trader_2.sort = 3;
self.trader_2.hidewheninmenu = false;
self.trader_2.alignX = "center";
self.trader_2.alignY = "middle";
self.trader_2.horzAlign = "center";
self.trader_2.vertAlign = "middle";
self.trader_2.x = 0;
self.trader_2.y = -54;
self.trader_2.alpha = alpha;
self.trader_2.fontScale = 1;
self.trader_2.color = ( 1, 1, 1 );
self.trader_2 SetText("Press 2 for an attachment [Cost: 1st is 3000, 2nd is 5000]");
if(!isDefined(self.trader_3))
self.trader_3 = create_simple_hud(self);
self.trader_3.foreground = true;
self.trader_3.sort = 3;
self.trader_3.hidewheninmenu = false;
self.trader_3.alignX = "center";
self.trader_3.alignY = "middle";
self.trader_3.horzAlign = "center";
self.trader_3.vertAlign = "middle";
self.trader_3.x = -65;
self.trader_3.y = -42;
self.trader_3.alpha = alpha;
self.trader_3.fontScale = 1;
self.trader_3.color = ( 1, 1, 1 );
self.trader_3 SetText("Press 3 for ammo [Cost: "+(1000*level.round_number) / 2.5+"]");
if(!isDefined(self.trader_end))
self.trader_end = create_simple_hud(self);
self.trader_end.foreground = true;
self.trader_end.sort = 3;
self.trader_end.hidewheninmenu = false;
self.trader_end.alignX = "center";
self.trader_end.alignY = "middle";
self.trader_end.horzAlign = "center";
self.trader_end.vertAlign = "middle";
self.trader_end.x = 70;
self.trader_end.y = -30;
self.trader_end.alpha = alpha;
self.trader_end.fontScale = 1;
self.trader_end.color = ( 1, 1, 1 );
self.trader_end SetText("Press ESC to close.");
////SHADOWS (its too hard to read otherwise)
if(!isDefined(self.trader_title_shadow))
self.trader_title_shadow = create_simple_hud(self);
self.trader_title_shadow.foreground = true;
self.trader_title_shadow.sort = 2;
self.trader_title_shadow.hidewheninmenu = false;
self.trader_title_shadow.alignX = "center";
self.trader_title_shadow.alignY = "middle";
self.trader_title_shadow.horzAlign = "center";
self.trader_title_shadow.vertAlign = "middle";
self.trader_title_shadow.x = -1;
self.trader_title_shadow.y = -77;
if(alpha > 0)
self.trader_title_shadow.alpha = .6;
else
self.trader_title_shadow.alpha = 0;
self.trader_title_shadow.fontScale = 1;
self.trader_title_shadow.color = ( 0.1, 0.1, 0.1 );
self.trader_title_shadow SetText("Trader Menu");
if(!isDefined(self.trader_1_shadow))
self.trader_1_shadow = create_simple_hud(self);
self.trader_1_shadow.foreground = true;
self.trader_1_shadow.sort = 2;
self.trader_1_shadow.hidewheninmenu = false;
self.trader_1_shadow.alignX = "center";
self.trader_1_shadow.alignY = "middle";
self.trader_1_shadow.horzAlign = "center";
self.trader_1_shadow.vertAlign = "middle";
self.trader_1_shadow.x = -36;
self.trader_1_shadow.y = -65;
if(alpha > 0)
self.trader_1_shadow.alpha = 0.6;
else
self.trader_1_shadow.alpha = 0;
self.trader_1_shadow.fontScale = 1;
self.trader_1_shadow.color = ( 0.1, 0.1, 0.1 );
self.trader_1_shadow SetText("Press 1 for a Random Weapon [Cost: "+(1000*level.round_number) / 2.5+"]");
if(!isDefined(self.trader_2_shadow))
self.trader_2_shadow = create_simple_hud(self);
self.trader_2_shadow.foreground = true;
self.trader_2_shadow.sort = 2;
self.trader_2_shadow.hidewheninmenu = false;
self.trader_2_shadow.alignX = "center";
self.trader_2_shadow.alignY = "middle";
self.trader_2_shadow.horzAlign = "center";
self.trader_2_shadow.vertAlign = "middle";
self.trader_2_shadow.x = -1;
self.trader_2_shadow.y = -53;
if(alpha > 0)
self.trader_2_shadow.alpha = 0.6;
else
self.trader_2_shadow.alpha = 0;
self.trader_2_shadow.fontScale = 1;
self.trader_2_shadow.color = ( 0.1, 0.1, 0.1 );
self.trader_2_shadow SetText("Press 2 for an attachment [Cost: 1st is 3000, 2nd is 5000]");
if(!isDefined(self.trader_3_shadow))
self.trader_3_shadow = create_simple_hud(self);
self.trader_3_shadow.foreground = true;
self.trader_3_shadow.sort = 2;
self.trader_3_shadow.hidewheninmenu = false;
self.trader_3_shadow.alignX = "center";
self.trader_3_shadow.alignY = "middle";
self.trader_3_shadow.horzAlign = "center";
self.trader_3_shadow.vertAlign = "middle";
self.trader_3_shadow.x = -66;
self.trader_3_shadow.y = -41;
if(alpha > 0)
self.trader_3_shadow.alpha = 0.6;
else
self.trader_3_shadow.alpha = 0;
self.trader_3_shadow.fontScale = 1;
self.trader_3_shadow.color = ( 0.1, 0.1, 0.1 );
self.trader_3_shadow SetText("Press 3 for ammo [Cost: "+(1000*level.round_number) / 2.5+"]");
if(!isDefined(self.trader_end_shadow))
self.trader_end_shadow = create_simple_hud(self);
self.trader_end_shadow.foreground = true;
self.trader_end_shadow.sort = 2;
self.trader_end_shadow.hidewheninmenu = false;
self.trader_end_shadow.alignX = "center";
self.trader_end_shadow.alignY = "middle";
self.trader_end_shadow.horzAlign = "center";
self.trader_end_shadow.vertAlign = "middle";
self.trader_end_shadow.x = 69;
self.trader_end_shadow.y = -29;
if(alpha > 0)
self.trader_end_shadow.alpha = 0.6;
else
self.trader_end_shadow.alpha = 0;
self.trader_end_shadow.fontScale = 1;
self.trader_end_shadow.color = ( 0.1, 0.1, 0.1 );
self.trader_end_shadow SetText("Press ESC to close.");
////END SHADOWS
if(!isDefined(self.trader_bg))
self.trader_bg = create_simple_hud(self);
self.trader_bg.foreground = false;
self.trader_bg.sort = 1;
self.trader_bg.hidewheninmenu = false;
self.trader_bg.alignX = "center";
self.trader_bg.alignY = "middle";
self.trader_bg.horzAlign = "center";
self.trader_bg.vertAlign = "middle";
self.trader_bg.x = 0;
self.trader_bg.y = -55;
if(alpha > 0)
self.trader_bg.alpha = 1;
else
self.trader_bg.alpha = 0;
self.trader_bg.fontScale = 1;
self.trader_bg.color = ( 1, 1, 1 );
self.trader_bg SetShader("trader_bg", 300, 72);
}
upgrade_decide()
{
w = self getCurrentWeapon();
if(w == "zombie_kar98k")
{
nw = "zombie_kar98k_b";
cost = 2000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_kar98k_b") //bayonet only
{
self upgrade_give("none", 0);
}
else if(w == "zombie_m1carbine")
{
nw = "zombie_m1carbine_a_b";
cost = 2000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_m1carbine_a_b") //give bayonet and aperture in one go
{
nw = "zombie_m1carbine_a_b_e";
cost = 4000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_m1carbine_a_b_e")
{
self upgrade_give("none", 0);
}
else if(w == "zombie_bar")
{
nw = "zombie_bar_e";
cost = 2000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_bar_e")
{
self upgrade_give("none", 0);
}
else if(w == "ptrs41_zombie")
{
self upgrade_give("none", 0);
}
else if(w == "zombie_colt")
{
self upgrade_give("none", 0);
}
else if(w == "zombie_thompson")
{
nw = "zombie_thompson_a";
cost = 2000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_thompson_a")
{
nw = "zombie_thompson_a_e";
cost = 4000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_thompson_a_e")
{
self upgrade_give("none", 0);
}
else if(w == "zombie_sw_357")
{
self upgrade_give("none", 0);
}
else if(w == "zombie_shotgun")
{
nw = "zombie_shotgun_b_g";
cost = 2000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_shotgun_b_g") // bayonet+grip one go
{
nw = "zombie_shotgun_b_g_e";
cost = 4000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_shotgun_b_g_e")
{
self upgrade_give("none");
}
else if(w == "zombie_doublebarrel")
{
self upgrade_give("none", 0);
}
else if(w == "zombie_doublebarrel_g")
{
self upgrade_give("none", 0);
}
else if(w == "zombie_mp40")
{
nw = "zombie_mp40_a";
cost = 2000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_mp40_a")
{
nw = "zombie_mp40_a_e";
cost = 4000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_mp40_a_e") // No grip?
{
self upgrade_give("none", 0);
}
else if(w == "zombie_mg42")
{
self upgrade_give("none", 0);
}
else if(w == "zombie_ppsh")
{
nw = "zombie_ppsh_a";
cost = 2000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_ppsh_a")
{
nw = "zombie_ppsh_a_e";
cost = 4000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_ppsh_a_e")
{
self upgrade_give("none", 0);
}
else if(w == "zombie_stg44")
{
nw = "zombie_stg44_a";
cost = 2000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_stg44_a")
{
nw = "zombie_stg44_a_e";
cost = 4000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_stg44_a_e") // no grip?
{
self upgrade_give("none", 0);
}
else if(w == "zombie_walther")
{
self upgrade_give("none", 0);
}
else if(w == "zombie_gewehr43")
{
nw = "zombie_gewehr43_a";
cost = 2000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_gewehr43_a")
{
nw = "zombie_gewehr43_a_e";
cost = 4000;
self upgrade_give(nw, cost);
}
else if(w == "zombie_gewehr43_a_e")
{
self upgrade_give("none", 0);
}
else
iPrintLn("ERROR: UNKNOWN GUN '"+w+"' - ADD TO UGX_UPGRADER.GSC");
}
upgrade_give(nw, cost)
{
level.upgrade_vox = undefined;
level.upgrade_nomoney = undefined;
if(nw == "none")
iPrintLn(self.playername+", there are no available upgrades for your current weapon.");
else
{
if(self.score >= cost)
{
w = self getCurrentWeapon();
self TakeWeapon(w);
self GiveWeapon(nw);
self SwitchtoWeapon(nw);
self maps\_zombiemode_score::minus_to_player_score( cost );
self playsound("cha_ching");
level.upgrade_vox = 1;
}
else
{
//self playsound("no_cha_ching");
level.upgrade_nomoney = 1;
}
}
}
ammo_giver()
{
level.ammo_vox = undefined;
level.nomoneyvox = undefined;
cost = (1000*level.round_number)/2.5;
if(self.score >= cost)
{
self playsound("cha_ching");
weapon = self GetCurrentWeapon();
self ammo_calc(weapon);
}
else
{
//self iPrintLn("Russian: Come back with a bit more incentive next time and I will probably help you.");
level.nomoneyvox = 1;
//self playsound("no_cha_ching");
}
}
ammo_calc(weapon) // ammo math is from ammobox.gsc - too lazy to rewrite it any better
{
chance = randomInt(100);
stock = self getWeaponAmmoStock(weapon);
current_ammo = stock + self getWeaponAmmoClip(weapon);
max_ammo = WeaponMaxAmmo(weapon);
max_ammo = max_ammo + WeaponClipSize(weapon);
if(current_ammo != max_ammo)
{
ammo = int(((max_ammo-current_ammo)*randomIntRange(30,80)) / 100);
self SetWeaponAmmoStock(weapon, ammo+stock);
level.ammo_vox = 1;
//if(vox == 1)
// self iPrintLn("Russian: Here's "+ammo+" bullets. Don't waste 'em.");
//else if(vox == 2)
// self iPrintLn("Russian: Here's "+ammo+" more fucking bullets.");
//else if(vox == 3)
// self iPrintLn("Russian: You need more already? Take "+ammo+" bullets.");
//else
// self iPrintLn("Russian: You're going to take all my bullets! Here's "+ammo+" more bullets. Don't waste 'em.");
}
else
iPrintLn("^1ADD VOX: ^7You already have enough ammo");
}
random_weapon_give()
{
cost = (1000*level.round_number)/2.5;
if(self.score >= cost)
{
tier = randomint(100);
if(tier >= 25) // worst, most common guns
{
rand = randomint(7); //index: kar98k, m1carbine, ptrs41, colt, doublebarrel, walther, gewehr43
if(rand == 0) //kar98k
{
self random_give(cost, "zombie_kar98k");
}
else if(rand == 1) //m1 carbine
{
self random_give(cost, "zombie_m1carbine");
}
else if(rand == 2) // ptrs41
{
self random_give(cost, "ptrs41_zombie");
}
else if(rand == 3) //colt
{
self random_give(cost, "zombie_colt");
}
else if(rand == 4) //double barrel
{
self random_give(cost, "zombie_doublebarrel");
}
else if(rand == 5) //walther
{
self random_give(cost, "walther");
}
else if(rand == 6)
{
self random_give(cost, "zombie_gewehr43");
}
else
{
iPrintLn("^2Index out of range (tier 1 weapons) index: ^5" +rand);
}
}
else if(tier > 8 && tier <= 24) // midline, less common guns
{
rand = randomint(6); //index: thompson, mp40, bar, 357, shotgun, stg44.
if(rand == 0) //thompson
{
self random_give(cost, "zombie_thompson");
}
else if(rand == 1) //mp40
{
self random_give(cost, "zombie_mp40");
}
else if(rand == 2) // bar
{
self random_give(cost, "zombie_bar");
}
else if(rand == 3) //357
{
self random_give(cost, "zombie_sw_357");
}
else if(rand == 4) //shotgun
{
self random_give(cost, "zombie_shotgun");
}
else if(rand == 5) //stg44
{
self random_give(cost, "zombie_stg44");
}
else
{
iPrintLn("^2Index out of range (tier 2 weapons) index: ^5" +rand);
}
}
else //rare, awesome, not common guns
{
rand = randomint(2); //index: ppsh, mg42
if(rand == 0)
{
self random_give(cost, "zombie_ppsh");
}
else if(rand == 1)
{
self random_give(cost, "zombie_mg42");
}
else
iPrintLn("Index out of range (tier 3 weapons) index: ^5" +rand);
}
}
else
{
//self playsound("no_cha_ching");
nomoneyvox = randomint(2);
self playsound("trader_notenoughmoney"+ (nomoneyvox+1));
if(nomoneyvox == 0)
wait 1;
else if(nomoneyvox == 1)
wait 4;
else
wait 2;
}
}
random_give(cost, weapon)
{
level.randweaponvox = undefined;
primaryWeapons = self GetWeaponsListPrimaries();
ammo = self decide_ammo(weapon);
if( primaryWeapons.size >= 2 ) // he has two weapons, replace his current
{
current_weapon = self getCurrentWeapon();
self TakeWeapon( current_weapon );
self GiveWeapon( weapon );
self SetWeaponAmmoStock( weapon, ammo );
}
else // he has one weapon, give him another
{
self GiveWeapon( weapon );
self SetWeaponAmmoStock( weapon, ammo );
}
self playsound("ammo_pickup_plr");
self SwitchToWeapon( weapon );
self maps\_zombiemode_score::minus_to_player_score( cost );
level.randweaponvox = 1;
}
decide_ammo(weapon) // Usage: trigger decide_ammo(); - returns ammo amount based on random int's.
{
if(weapon == "zombie_30cal" || weapon == "zombie_fg42" || weapon == "zombie_mg42" || weapon == "zombie_bar" || weapon == "zombie_ppsh")
{
ammo = randomInt(300); // auto's need more ammo
if(ammo <= 75)
ammo = 75;
}
else
{
ammo = randomInt(75); // semi's need less
if(ammo <= 15)
ammo = 15;
}
return ammo;
}
Credit: Treminaor