class 1 ai_agit02_doom_warrior_agit : warrior_aggressive_casting_enchant_clan
{
parameter:
	int	Unit = 0;

handler:
	EventHandler NO_DESIRE()
	{
		myself::AddDoNothingDesire(5,5);
	}

	EventHandler CREATED()
	{
		myself::AddTimerEx(4001,1000);
		myself.sm.flag = Unit;
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		if( timer_id == 4001 )
		{
			if( myself::InMyTerritory(myself.sm) == 0 && gg::Rand(3) < 1 )
			{
				myself::InstantTeleport(myself.sm,myself.start_x,myself.start_y,myself.start_z);
				myself::RemoveAllAttackDesire();
			}
			if( gg::Rand(5) < 1 )
			{
				myself::RandomizeAttackDesire();
			}
			myself::AddTimerEx(4001,( 60 * 1000 ));
		}
		super;
	}

	EventHandler CLAN_ATTACKED(attacker,victim,damage)
	{
		if( myself.sm.flag == victim.flag )
		{
			if( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) )
			{
				myself::AddAttackDesire(attacker,1,( ( ( damage / myself.sm.max_hp ) / 0.050000 ) * 100 ));
			}
		}
	}

}
