class 1 warrior_summon_private_at_dying : warrior
{
parameter:
	string	Privates = "orc:party_private:1:20sec";
	int	SummonPrivateRate = 0;

handler:
	EventHandler ATTACKED(attacker,damage)
	{
		if( myself::IsNullCreature(myself.top_desire_target) == 0 )
		{
			if( myself.top_desire_target == attacker )
			{
				myself.i_ai3 = myself::GetIndexFromCreature(attacker);
			}
		}
		super;
	}

	EventHandler MY_DYING()
	{
		if( gg::Rand(100) < SummonPrivateRate )
		{
			myself::CreatePrivates(Privates);
			myself::BroadcastScriptEvent(10020,myself.i_ai3,500);
			myself::AddTimerEx(5001,1500);
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id,c0)
	{
		if( timer_id == 5001 )
		{
			myself::BroadcastScriptEvent(10020,myself.i_ai3,500);
			myself::AddTimerEx(5001,1500);
			super;
		}
	}

}
