class 1 party_private_wizard_dd2_heal : party_private_wizard_dd2
{
parameter:
	int	W_ShortRangeDDMagic = 272039937;
	int	W_LongRangeDDMagic = 272629761;
	int	MagicHeal = 1040644;

handler:
	EventHandler ATTACKED(attacker,damage,i6)
	{
		super;
		if( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) )
		{
			if( gg::Rand(100) < 33 && myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) < 70 )
			{
				if( myself::Skill_GetConsumeMP(MagicHeal) < myself.sm.mp && myself::Skill_GetConsumeHP(MagicHeal) < myself.sm.hp && myself::Skill_InReuseDelay(MagicHeal) == 0 )
				{
					myself::AddUseSkillDesire(myself.sm,MagicHeal,1,1,1000000);
				}
			}
		}
	}

	EventHandler PARTY_ATTACKED(attacker,damage,private)
	{
		super;
		if( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) )
		{
			if( gg::Rand(100) < 33 && myself::FloatToInt(( ( private.hp / private.max_hp ) * 100 )) < 70 )
			{
				if( myself::Skill_GetConsumeMP(MagicHeal) < myself.sm.mp && myself::Skill_GetConsumeHP(MagicHeal) < myself.sm.hp && myself::Skill_InReuseDelay(MagicHeal) == 0 )
				{
					myself::AddUseSkillDesire(private,MagicHeal,1,1,1000000);
				}
			}
		}
	}

	EventHandler CLAN_ATTACKED(attacker,damage,victim,i6)
	{
		if( ( ( myself::GetLifeTime() > 7 && ( attacker.is_pc != 0 || myself::IsInCategory(11,attacker.npc_class_id) ) ) && myself::GetHateInfoCount() == 0 ) && gg::Rand(100) < 33 )
		{
			if( myself::Skill_GetConsumeMP(MagicHeal) < myself.sm.mp && myself::Skill_GetConsumeHP(MagicHeal) < myself.sm.hp && myself::Skill_InReuseDelay(MagicHeal) == 0 )
			{
				myself::AddUseSkillDesire(victim,MagicHeal,1,1,1000000);
			}
		}
		super;
	}

}
