local ITEM_ID = 38676 -- Item ID that the player can click to add mounts
local STORAGE_KEY = 941006 -- Unique storage key for tracking usage
local addMountSystem = Action()
function addMountSystem.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid ~= ITEM_ID then
return true
end
-- Check if the player has already used this item
if player:getStorageValue(STORAGE_KEY) == 1 then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You have already used this item.")
return true
end
-- Apply mounts without changing the outfit
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have received 3 free mounts.')
-- Mark the item as used
player:setStorageValue(STORAGE_KEY, 1)
-- Set specific storage values for mounts
local mountStorages = {90550, 90551, 90552}
for _, storage in ipairs(mountStorages) do
player:setStorageValue(storage, 1)
end
item:remove(1)
return true
end
addMountSystem:id(ITEM_ID)
addMountSystem:register()