CreateEffect(0,3000,1000,#DIR_RIGHT,#MAPID,#XPOS,#YPOS,0,#USERID,0)
CreateEffect(0,2000,750,#DIR_RIGHT,#MAPID,#XPOS,#YPOS,0,#USERID,0)
CreateEffect(0,1000,500,#DIR_RIGHT,#MAPID,#XPOS,#YPOS,0,#USERID,0)

CreateEffect(0,3000,1000,#DIR_LEFT,#MAPID,#XPOS,#YPOS,0,#USERID,0)
CreateEffect(0,2000,750,#DIR_LEFT,#MAPID,#XPOS,#YPOS,0,#USERID,0)
CreateEffect(0,1000,500,#DIR_LEFT,#MAPID,#XPOS,#YPOS,0,#USERID,0)

CreateEffect(0,3000,1000,#DIR_UP,#MAPID,#XPOS,#YPOS,0,#USERID,0)
CreateEffect(0,2000,750,#DIR_UP,#MAPID,#XPOS,#YPOS,0,#USERID,0)
CreateEffect(0,1000,500,#DIR_UP,#MAPID,#XPOS,#YPOS,0,#USERID,0)

CreateEffect(0,3000,1000,#DIR_DOWN,#MAPID,#XPOS,#YPOS,0,#USERID,0)
CreateEffect(0,2000,750,#DIR_DOWN,#MAPID,#XPOS,#YPOS,0,#USERID,0)
CreateEffect(0,1000,500,#DIR_DOWN,#MAPID,#XPOS,#YPOS,0,#USERID,0)

SendMessageToMap(#MAPID,"The Undead Master has been defeated!", #MSG_SERVER)

GoldenPiece=Random(1,20)

If GoldenPiece=1
ItemNumber=17
Endif

If GoldenPiece=2
ItemNumber=18
Endif

If GoldenPiece=3
ItemNumber=70
Endif

If GoldenPiece=4
ItemNumber=71
Endif

If Random(1,25)=1
SpawnItem(#MAPID,90,#XPOS,#YPOS)
Endif

If Random(1,5)=1
SpawnItem(#MAPID,72,#XPOS,#YPOS)
Endif

If GoldenPiece<5
	SpawnItem(#MAPID,ItemNumber,#XPOS,#YPOS)
Endif

If Random(1,25)=1
	SpawnItem(#MAPID,175,#XPOS,#YPOS)
Endif

If Random(1,10)=1
	SpawnItem(#MAPID,280,#XPOS,#YPOS)
Endif

Continue = 1