;'Sunset Scroll' use script

;'Arena of the Kings'
If #MAPID = 997
	SendMessageToUser(#USERID,"The Arena of the Kings supresses use of this item here.",#MSG_SERVER)
	GoTo END
ElseIf #MAPID = 998
	SendMessageToUser(#USERID,"The Arena of the Kings supresses use of this item here.",#MSG_SERVER)
	GoTo END
EndIf

If GetUserMana(#USERID) < GetUserMaxMana(#USERID) * 5
	If GetUserMana(#USERID) < GetUserMaxMana(#USERID) + 100
		CreateEffect(0,300,0,#DIR_DOWN,#MAPID,#XPOS,#YPOS,0,#USERID,0)

		SetUserMana(#USERID,GetUserMana(#USERID) + 50)
	
		TakeItem(#USERID,131)
	EndIf
EndIf

If GetUserMana(#USERID) > GetUserMaxMana(#USERID) * 5
	SetUserMana(#USERID,GetUserMaxMana(#USERID) * 5)
EndIf

If GetUserMana(#USERID) > GetUserMaxMana(#USERID) + 100
	SetUserMana(#USERID,GetUserMaxMana(#USERID) + 100)
EndIf

Label END

Continue = 1