/*
* --------------------------------------------------------------------------------
* --- 3 Hit Down GSC Script for Call of Duty: World at War Zombies ---
* --------------------------------------------------------------------------------
*
* Description:
* This script modifies the default player damage rules in Nazi Zombies to allow
* players to withstand two zombie hits before going down on the third hit.
* This script does not affect the damage boost provided by the Juggernog perk.
*
* Installation:
* 1. Create a new file named "three_hit_down.gsc" in your map's GSC folder,
* located at: /root/mods/your_map_name/maps/
* 2. Copy and paste the entire content of this script into the new file.
* 3. Open your main map GSC file (e.g., nazi_zombie_mapname.gsc).
* 4. At the top of your main map GSC file, add the following line:
* #include maps\three_hit_down;
* 5. In the main() function of your map's GSC file, add the following line
* BEFORE maps\_zombiemode::main();
* thread three_hit_down::init();
*
* Your main function should look something like this:
* main()
* {
* // Other pre-zombiemode threads
*
* thread three_hit_down::init();
*
* maps\_zombiemode::main();
*
* // Other post-zombiemode code
* }
*
* 6. Re-compile your map and run it.
*
* --------------------------------------------------------------------------------
*/
init()
{
// This function will wait until all players are connected and then start
// the monitoring process for each player.
level flag_wait( "all_players_connected" );
for(;;)
{
level waittill( "connected", player );
player thread onPlayerConnect();
}
}
onPlayerConnect()
{
// When a player connects, this function is threaded to them.
// It will end if the player disconnects.
self endon( "disconnect" );
// Initialize the hit counter for this player
self.hit_count = 0;
for(;;)
{
// This is the core loop that monitors player damage.
// It waits until the player is damaged. The 'eInflictor' is the entity
// that caused the damage (in this case, a zombie).
self waittill( "damage", damage, attacker, direction_vec, point, type, modelName, tagName, partName, iDFlags );
// We only care about damage from zombies. We check the attacker's script_noteworthy
// to ensure it's a zombie.
if ( isdefined( attacker.script_noteworthy ) && attacker.script_noteworthy == "zombie" )
{
// We also don't want this to interfere with Juggernog.
// If the player has Juggernog, we let the default damage logic handle it.
if( !self maps\_zombiemode_perks::player_has_perk("specialty_armorvest") )
{
// Increment the hit counter
self.hit_count++;
// If the hit count is less than 3, we prevent the player from taking damage.
if ( self.hit_count < 3 )
{
// Setting damage to 0 effectively negates the hit.
damage = 0;
}
else
{
// On the third hit, we reset the counter and let the player go down.
self.hit_count = 0;
}
}
}
}
}
This was made with AI, I just generated it as soon as I saw your question on the forum. No idea if it works havnt tested it, but maybe this could be a template to build off of. I did not write this simply asked AI to make it. Maybe this could work?