class 1 royal_rush_roomboss_basic : warrior
{
parameter:
	int	PhysicalSpecial1 = 1032193;
	int	KeyBox = 1012053;
	int	KeyBox_X = 0;
	int	KeyBox_Y = 0;
	int	KeyBox_Z = 0;

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

	EventHandler MY_DYING()
	{
		if( KeyBox_X != 0 && KeyBox_Y != 0 && KeyBox_Z != 0 )
		{
			myself::CreateOnePrivateEx(KeyBox,"royal_rush_keybox",0,0,myself::FloatToInt(KeyBox_X),myself::FloatToInt(KeyBox_Y),myself::FloatToInt(KeyBox_Z),0,0,0,0);
		}
		else
		{
			myself::CreateOnePrivateEx(KeyBox,"royal_rush_keybox",0,0,myself::FloatToInt(myself.sm.x),myself::FloatToInt(myself.sm.y),myself::FloatToInt(myself.sm.z),0,0,0,0);
		}
		super;
	}

}
