local config = {
-- Chest
actionId = 60000
storage = 60000,
-- Outfit
lookType = 136,
addons = 3,
-- Mount
mountId = 20
}
local chestAction = Action()
function chestAction.onUse(player, item, fromPos, target, toPos, isHotkey)
if player:getStorageValue(config.storage) ~= -1 then
player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
return true
end
player:addOutfitAddon(config.lookType, config.addons)
player:addMount(config.mountId)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You found a outfit and mount!")
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
player:setStorageValue(config.storage, 1)
return true
end
chestAction:aid(config.actionId)
chestAction:register()