;Undead Sacrifice Skill

;SendMessageToUser(#USERID,"Skill temporarily disabled.", #MSG_CRITICAL)
;Goto End

If GetMapType(GetUserMap(#USERID))=#MAPTYPE_FRIENDLY
	SendMessageToUser(#USERID,"You cannot sacrifice yourself here.", #MSG_SERVER)
	Goto End
Endif

If GetUserHP(#USERID)>Floor(GetUserMaxHP(#USERID)/4)
	SendMessageToUser(#USERID,"You need less than "+Floor(GetUserMaxHP(#USERID)/4)+" HP to use this skill!", #MSG_CRITICAL)
	Goto End
Endif

If GetUserWisdom(#USERID)>= 10
	SendMessageToAll("* "+GetUserName(#USERID)+" sacrifices themself to the darkness!",#MSG_CRITICAL)
	If GetUserWisdom(#USERID)>=30
		SpawnMonster(GetUserMap(#USERID),28,GetUserX(#USERID),GetUserY(#USERID))
	Else
	   If GetUserWisdom(#USERID)>=20
		  SpawnMonster(GetUserMap(#USERID),26,GetUserX(#USERID),GetUserY(#USERID))
  		Else
		  SpawnMonster(GetUserMap(#USERID),25,GetUserX(#USERID),GetUserY(#USERID))
	   Endif
	Endif
	SetUserHP(#USERID,0)
	DamageUser(#USERID,GetUserMaxHP(#USERID)*2)
Else
	SendMessageToUser(#USERID,"You need at least 10 wisdom to use this skill.",#MSG_CRITICAL)
Endif

Label End

Continue = 1