class 1 royal_rush_party_private_bomb : party_private
{
parameter:
	int	PhysicalSpecial1 = 1024257;
	int	MagicHeal = 1040641;
	int	Bomb = 1040641;

handler:
	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 )
					{
						if( myself::Skill_GetConsumeMP(PhysicalSpecial1) < myself.sm.mp && myself::Skill_GetConsumeHP(PhysicalSpecial1) < myself.sm.hp && myself::Skill_InReuseDelay(PhysicalSpecial1) == 0 )
						{
							myself::AddUseSkillDesire(attacker,PhysicalSpecial1,0,1,1000000);
						}
					}
					if( gg::Rand(100) < 33 && myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) < 40 )
					{
						if( myself.boss.alive == 1 )
						{
							if( myself::Skill_GetConsumeMP(MagicHeal) < myself.sm.mp && myself::Skill_GetConsumeHP(MagicHeal) < myself.sm.hp && myself::Skill_InReuseDelay(MagicHeal) == 0 )
							{
								myself::AddUseSkillDesire(myself.boss,MagicHeal,0,1,1000000);
							}
							if( myself::Skill_GetConsumeMP(Bomb) < myself.sm.mp && myself::Skill_GetConsumeHP(Bomb) < myself.sm.hp && myself::Skill_InReuseDelay(Bomb) == 0 )
							{
								myself::AddUseSkillDesire(myself.sm,Bomb,0,1,1000000);
							}
						}
					}
				}
			}
		}
		super;
	}

	EventHandler PARTY_ATTACKED(attacker,private,damage)
	{
		if( gg::Rand(100) < 33 && myself::FloatToInt(( ( myself.sm.hp / myself.sm.max_hp ) * 100 )) < 40 )
		{
			if( myself.boss.alive == 1 )
			{
				if( myself::Skill_GetConsumeMP(MagicHeal) < myself.sm.mp && myself::Skill_GetConsumeHP(MagicHeal) < myself.sm.hp && myself::Skill_InReuseDelay(MagicHeal) == 0 )
				{
					myself::AddUseSkillDesire(myself.boss,MagicHeal,0,1,1000000);
				}
				if( myself::Skill_GetConsumeMP(Bomb) < myself.sm.mp && myself::Skill_GetConsumeHP(Bomb) < myself.sm.hp && myself::Skill_InReuseDelay(Bomb) == 0 )
				{
					myself::AddUseSkillDesire(myself.sm,Bomb,0,1,1000000);
				}
			}
		}
		super;
	}

}
