class 1 warrior_corpse_vampire : warrior_physicalspecial
{
parameter:
	int	DeBuff = 1024257;
	int	DDMagic1 = 1024257;
	int	PhysicalSpecial = 264241153;
	int	SelfBuff = 1031169;

handler:
	EventHandler CREATED()
	{
		myself.i_ai0 = 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);
		}
		myself::AddTimerEx(2001,10000);
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id)
	{
		if( timer_id == 2001 )
		{
			if( 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);
		}
		super;
	}

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

}
