class 1 royal_rush_roomboss_3 : royal_rush_roomboss_basic
{
parameter:
	int	SelfRangeDDMagic1 = 1032193;
	int	SummonSlave = 1000130;

handler:
	EventHandler CREATED()
	{
		myself.i_ai0 = 0;
		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( gg::Rand(100) < 33 && myself.top_desire_target != attacker )
				{
					if( myself::Skill_GetConsumeMP(SelfRangeDDMagic1) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfRangeDDMagic1) < myself.sm.hp && myself::Skill_InReuseDelay(SelfRangeDDMagic1) == 0 )
					{
						myself::AddUseSkillDesire(myself.sm,SelfRangeDDMagic1,1,1,1000000);
					}
				}
				if( gg::Rand(100) < 33 && myself.i_ai0 == 0 )
				{
					myself::CreateOnePrivateEx(SummonSlave,"royal_rush_bomb",0,0,myself::FloatToInt(attacker.x),myself::FloatToInt(attacker.y),myself::FloatToInt(attacker.z),0,1000,myself::GetIndexFromCreature(myself.top_desire_target),0);
					myself.i_ai0 = 1;
				}
			}
		}
		super;
	}

}
