;'SG - Guardian's Protection' - skill script

;Class only skill for the Skeleton Guardian. Doubles endurance for a minute.

SkillID = 45
SkillDuration = 60000
IncreaseAmount = GetUserEndurance(#USERID)
OrbItem = 36

If GetUserAccess(#USERID) < 5
	;Only Skeleton Guardians can use this skill
	If GetUserClass(#USERID) <> 7
		Goto END
	EndIf
EndIf

If HasItem(#USERID,OrbItem) = 0
	SendMessageToUser(#USERID,"You need a "+GetItemName(OrbItem)+" to use this skill.",#MSG_CRITICAL)
	GoTo END
EndIf
TakeItem(#USERID,OrbItem)

If GetUserSkill(#USERID,SkillID) > 1
	SendMessageToUser(#USERID,"You cannot use this skill again so soon.",#MSG_CRITICAL)
	GoTo END
EndIf

SendMessageToMap(#MAPID,GetUserName(#USERID)+" is protected by an unknown force!",#MSG_CRITICAL)
SendCombatMessage(#USERID,"Your endurance is doubled! ")

SetUserEnduranceBonus(#USERID,GetUserEnduranceBonus(#USERID)+IncreaseAmount)

SetUserSkill(#USERID,SkillID,IncreaseAmount)
Timer(585, SkillDuration, #USERID, 0, 0)

Label END

Continue = 1