4ªU   b   txt   addoninfo OØiÀ  ÿ    C  ÿÿ  nut scripts/vscripts director_base_addon Š)K~  ÿC  ]  ÿÿ   // The addoninfo.txt file is a metadata file that is required by all Source Engine Add-ons.

"AddonInfo"
{
	addonSteamAppID		550							// 500 is the app ID for Left 4 Dead, 550 for Left 4 Dead 2
	addontitle		"Conditional Stumble Chargers"					// Add-on title that shows up in Add-ons list. ~20 chars max
	addonversion		1.0							// Add-on version.
	addontagline		"."					// Add-on tagline or wrap-up- a short description. ~100 chars max
	addonauthor		"Braix"						// Name/alias of the author
	addonauthorSteamID	"swadley"							// (Optional) Steam ID of author. We use this to construct a URL to the author's page.

	// short description that appears in the Add-on list screen...
	addonDescription	"Blunt melees and shoving can stumble the charger while he is charging."


	addonContent_Script 1								// Has Scripts
}printl("Charger can be shoved sometimes")

ChargerChronicBlunt <-
{
	function OnGameEvent_player_hurt( params )
	{
		local attacker = GetPlayerFromUserID(params.attacker);
		local victim = GetPlayerFromUserID(params.userid);
		if( attacker != null )
		{
			if( attacker.IsPlayer() && victim.GetZombieType() == 6 && attacker.GetActiveWeapon().GetClassname() == "weapon_melee" && NetProps.GetPropInt(victim, "m_nSequence") == 5 )
			{
				if ( ( params.type & DMG_CLUB ) == DMG_CLUB ) 
				{
					if ( ( params.type & DMG_BLAST ) == DMG_BLAST ) return //prevents inf loop that can crash the game
					victim.Stagger( attacker.GetOrigin() )
					attacker.Stagger( victim.GetOrigin() )
					victim.TakeDamage(0.1, DirectorScript.DMG_BLAST, attacker)
				}
			}
		}
	}

	function OnGameEvent_player_shoved( params )
	{
		local attacker = GetPlayerFromUserID(params.attacker);
		local victim = GetPlayerFromUserID(params.userid);
		
		if( attacker != null )
		{
			if( attacker.IsPlayer() && victim.GetZombieType() == 6 && NetProps.GetPropInt(victim, "m_nSequence") == 5 ) //6 is charger, 5 is charging
			{
				if ( ( params.type & DMG_BLAST ) == DMG_BLAST ) return
				victim.Stagger( attacker.GetOrigin() )
				attacker.Stagger( victim.GetOrigin() )
				victim.TakeDamage(0.1, DirectorScript.DMG_BLAST, attacker)
			}
		}
	}
}

__CollectGameEventCallbacks(ChargerChronicBlunt)