;"Restore All" skill

;The cost of blood the skill takes
BloodCost = 12

;The amount of HP the skill will heal
HealthGain = 12

;The effect graphic to use
Graphic = 1

If GetUserWisdom(#USERID) > 39
   BloodCost = 45
   HealthGain = 65
ElseIf GetUserWisdom(#USERID) > 29
   BloodCost = 36
   HealthGain = 50
ElseIf GetUserWisdom(#USERID) > 19
   BloodCost = 28
   HealthGain = 35
ElseIf GetUserWisdom(#USERID) > 9
   BloodCost = 20
   HealthGain = 22
EndIf

If GetMapPlayerCount(#MAPID) = 1
   SendMessageToUser(#USERID, "There are no players except you here!", #MSG_EMOTE)
   GoTo END
EndIf

If GetUserMana(#USERID) < BloodCost
   SendMessageToUser(#USERID, "You do not have the required blood to use this skill!", #MSG_CRITICAL)
   GoTo END
EndIf

Blood = GetUserMana(#USERID)
Blood = Blood - BloodCost
SetUserMana(#USERID,Blood)

;Heal everyone on the map

X = 0
Y = 0
UserID = 0
;While Y < 21
;   While X < 21
;      UserID = GetUserAtXY(#MAPID,X,Y)
;      If UserID > 0
;         If UserID <> #USERID
;            SendMessageToUser(UserID, "Your flesh regenerates.", #MSG_EMOTE)
;         EndIf
;         
;         CreateEffect(Graphic,350,0,#DIR_UP,#MAPID,X,Y,0,UserID,0)
;         
;         Health = GetUserHP(UserID)
;         Health = Health + HealthGain
;         If Health > GetUserMaxHP(UserID)
;            Health = GetUserMaxHP(UserID)
;         EndIf
;         SetUserHP(UserID, Health)
;      EndIf
;   Wend
;Wend

SendMessageToUser(#USERID, "Everyone regenerated their health.", #MSG_EMOTE)

Label END

Continue = 1
