Since SSA equip exhaustion seems to be a popular request, I've decided to share a small code I wrote. This is to be placed in /events/scripts/player.lua
amuletId = Amulet item ID
storage = Storage value to store last placement
delay = Delay (in seconds) to how fast players should have to wait to place the amulet again.
Enjoy,
Red
amuletId = Amulet item ID
storage = Storage value to store last placement
delay = Delay (in seconds) to how fast players should have to wait to place the amulet again.
Code:
local amuletId = 2197
local storage = 1000
local delay = 0.5 -- seconds
function Player:onMoveItem(item, count, fromPosition, toPosition)
if item:getId() == amuletId then
if toPosition.y == CONST_SLOT_NECKLACE then
if os.time() > self:getStorageValue(storage) then
self:setStorageValue(storage, os.time() + delay)
else
self:sendCancelMessage("Sorry, not possible.")
return false
end
end
end
return true
end
Enjoy,
Red