canary/data/scripts/actions/items/blessed_steak.lua
2024-02-27 14:10:41 -03:00

19 lines
639 B
Lua

local blessedSteak = Action()
function blessedSteak.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:hasExhaustion("special-foods-cooldown") then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.")
return true
end
player:addMana(player:getMaxMana())
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your mana has been refilled.")
player:say("Chomp.", TALKTYPE_MONSTER_SAY)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
player:setExhaustion("special-foods-cooldown", 10 * 60)
item:remove(1)
return true
end
blessedSteak:id(9086)
blessedSteak:register()