class 1 warrior_see_skill : warrior
{
parameter:
	int	PhysicalSpecial = 1032193;
	int	SelfBuff = 1031169;

handler:
	EventHandler CREATED(c0)
	{
		myself::AddTimerEx(2001,10000);
		if( IsTransform == 0 )
		{
			if( myself::Skill_GetConsumeMP(SelfBuff) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfBuff) < myself.sm.hp && myself::Skill_InReuseDelay(SelfBuff) == 0 )
			{
				myself::AddUseSkillDesire(myself.sm,SelfBuff,1,1,1000000);
			}
		}
		else
		{
			myself::AddTimerEx(2002,3000);
			if( myself.sm.param1 == 1000 )
			{
				c0 = myself::GetCreatureFromIndex(myself.sm.param2);
				if( myself::IsNullCreature(c0) == 0 )
				{
					myself::AddUseSkillDesire(c0,1193729,0,1,10000);
					myself::AddAttackDesire(c0,1,500);
				}
			}
			super;
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		if( timer_id == 2001 )
		{
			if( myself::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(SelfBuff)) <= 0 && myself.p_state != 3 )
			{
				if( myself::Skill_GetConsumeMP(SelfBuff) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfBuff) < myself.sm.hp && myself::Skill_InReuseDelay(SelfBuff) == 0 )
				{
					myself::AddUseSkillDesire(myself.sm,SelfBuff,1,1,1000000);
				}
			}
			myself::AddTimerEx(2001,10000);
		}
		if( timer_id == 2002 )
		{
			if( myself::Skill_GetConsumeMP(SelfBuff) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfBuff) < myself.sm.hp && myself::Skill_InReuseDelay(SelfBuff) == 0 )
			{
				myself::AddUseSkillDesire(myself.sm,SelfBuff,1,1,1000000);
			}
		}
		super;
	}

	EventHandler ATTACKED(attacker,damage)
	{
		if( myself::GetAbnormalLevel(myself.sm,myself::Skill_GetAbnormalType(SelfBuff)) <= 0 )
		{
			if( myself::Skill_GetConsumeMP(SelfBuff) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfBuff) < myself.sm.hp && myself::Skill_InReuseDelay(SelfBuff) == 0 )
			{
				myself::AddUseSkillDesire(myself.sm,SelfBuff,1,1,1000000);
			}
		}
		if( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) )
		{
			if( myself::IsNullCreature(myself.top_desire_target) == 0 )
			{
				if( gg::Rand(100) < 33 && myself.top_desire_target == attacker )
				{
					if( myself::Skill_GetConsumeMP(PhysicalSpecial) < myself.sm.mp && myself::Skill_GetConsumeHP(PhysicalSpecial) < myself.sm.hp && myself::Skill_InReuseDelay(PhysicalSpecial) == 0 )
					{
						myself::AddUseSkillDesire(attacker,PhysicalSpecial,0,1,1000000);
					}
				}
			}
		}
		super;
	}

	EventHandler CLAN_ATTACKED(attacker,victim,damage,skill_name_id)
	{
		if( skill_name_id != 0 )
		{
			super;
		}
	}

}
