class 1 royal_rush_roomboss_2 : royal_rush_roomboss_basic
{
parameter:
	int	RangeDDMagic1 = 1032193;
	int	SelfBuff1 = 1040641;
	int	SelfBuff2 = 1040641;
	int	SelfBuff3 = 1040641;

handler:
	EventHandler CREATED()
	{
		myself.i_ai0 = 0;
	}

	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(RangeDDMagic1) < myself.sm.mp && myself::Skill_GetConsumeHP(RangeDDMagic1) < myself.sm.hp && myself::Skill_InReuseDelay(RangeDDMagic1) == 0 )
					{
						myself::AddUseSkillDesire(attacker,RangeDDMagic1,0,1,1000000);
					}
				}
			}
		}
		super;
	}

	EventHandler CLAN_DIED(victim,i0)
	{
		if( victim != myself.sm )
		{
			switch(myself.i_ai0)
			{
				case 2:
				{
					if( myself::Skill_GetConsumeMP(SelfBuff1) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfBuff1) < myself.sm.hp && myself::Skill_InReuseDelay(SelfBuff1) == 0 )
					{
						myself::AddUseSkillDesire(myself.sm,SelfBuff1,0,1,1000000);
					}
					break;
				}
				case 4:
				{
					if( myself::Skill_GetConsumeMP(SelfBuff2) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfBuff2) < myself.sm.hp && myself::Skill_InReuseDelay(SelfBuff2) == 0 )
					{
						myself::AddUseSkillDesire(myself.sm,SelfBuff2,0,1,1000000);
					}
					break;
				}
				case 6:
				{
					if( myself::Skill_GetConsumeMP(SelfBuff3) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfBuff3) < myself.sm.hp && myself::Skill_InReuseDelay(SelfBuff3) == 0 )
					{
						myself::AddUseSkillDesire(myself.sm,SelfBuff3,0,1,1000000);
					}
					break;
				}
			}
			myself.i_ai0 = ( myself.i_ai0 + 1 );
		}
		super;
	}

}
