skill scroll
local skills = {"Magic Level", "Fist Fighting", "Club Fighting", "Sword Fighting", "Axe Fighting", "Distance Fighting", "Shielding", "Fishing"}
function Player:sendSkillVoucherWindow()
local modaltext = "Select skill you would like to improve:"
local modal = ModalWindow(7092, "Use voucher", modaltext)
for i = 1, #skills do
modal:addChoice(i, skills)
end
modal:addButton(1, "Select")
modal:setDefaultEnterButton(1)
modal:addButton(2, "Cancel")
modal:setDefaultEscapeButton(2)
return modal:sendToPlayer(self)
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
player:sendSkillVoucherWindow()
return true
end
STAMINA DOLL
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
local s = player:getStamina() / 60
local cfg = {}
cfg.refuel = 42
cfg.full = 40
if s >= cfg.full then
player:sendCancelMessage("Your stamina is already full.")
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina now is "..s.." h.")
else
player:setStamina(cfg.refuel*60)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled.")
item:remove(1)
end
return true
end