class 1 warrior_ag_selfrangeps_ps : warrior_casting_selfrangeps_ps
{
handler:
	EventHandler SEE_CREATURE(creature)
	{
		if( creature.is_pc == 0 && myself::IsInCategory(11,creature.npc_class_id) == 0 )
		{
			super;
			return;
		}
		if( myself::GetLifeTime() > 7 && myself::InMyTerritory(myself.sm) && myself.p_state != 3 && PhysicalSpecial != 0 )
		{
			if( gg::Rand(100) < 33 )
			{
				if( myself::Skill_GetConsumeMP(PhysicalSpecial) < myself.sm.mp && myself::Skill_GetConsumeHP(PhysicalSpecial) < myself.sm.hp && myself::Skill_InReuseDelay(PhysicalSpecial) == 0 )
				{
					myself::AddUseSkillDesire(creature,PhysicalSpecial,0,1,1000000);
				}
			}
		}
		if( creature.is_pc == 0 && myself::IsInCategory(11,creature.npc_class_id) == 0 )
		{
			return;
		}
		if( SetAggressiveTime == -1 )
		{
			if( myself::GetLifeTime() >= ( gg::Rand(5) + 3 ) && myself::InMyTerritory(myself.sm) )
			{
				myself::AddAttackDesire(creature,1,200);
			}
		}
		else if( SetAggressiveTime == 0 )
		{
			if( myself::InMyTerritory(myself.sm) )
			{
				myself::AddAttackDesire(creature,1,200);
			}
		}
		else if( myself::GetLifeTime() > ( SetAggressiveTime + gg::Rand(4) ) && myself::InMyTerritory(myself.sm) )
		{
			myself::AddAttackDesire(creature,1,200);
		}
		if( myself::GetLifeTime() > -1 && myself::InMyTerritory(myself.sm) )
		{
			myself::AddAttackDesire(creature,1,200);
		}
		super;
	}

}
