class 1 wizard_fiend_archer_selfbuff : wizard_fiend_archer
{
parameter:
	int	SelfBuff = 1031169;

handler:
	EventHandler CREATED()
	{
		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( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) )
		{
			if( myself.p_state != 3 && myself.p_state != 10 )
			{
				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);
					}
				}
			}
		}
		super;
	}

}
