;"Skeleton King" death script

SendMessageToMap(#MAPID,"The Skeleton King crumbles to the ground.", #MSG_SAY)

OpenDoor(#MAPID,14,5)
SpawnItem(383,45,8,7)

Key = Random(0,5)
Armor = Random(0,10)
Weapon = Random(0,15)

If Key = 0
	SpawnItem(#MAPID,8,#XPOS,#YPOS)
EndIf
If Armor = 0
	SpawnItem(#MAPID,184,#XPOS,#YPOS)
EndIf
If Weapon = 0
	SpawnItem(#MAPID,164,#XPOS,#YPOS)
ElseIf Weapon > 12
	SpawnItem(#MAPID,162,#XPOS,#YPOS)
EndIf

Continue = 1