local timetoreset = 1 -- Resets stone after X minutes
local stoneId = 1304 -- Id of the stone to spawn
local storage = 1001
local p = {
Position(5, 5, 7), -- Stone if quest is not done
Position(7, 7, 7), -- Stone if quest is done
}
function onStepIn(player, item, position, fromPosition)
if getThingFromPos(p[1]) == stoneId then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "A stone is already summoned.")
return false
elseif getThingFromPos(p[2]) == stoneId then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "A stone is already summoned.")
return false
end
if player:getStorageValue(storage) ~= 1 then
local stone = Tile(p[1])
Game.createItem(stoneId, 1, stonePos)
addEvent(function(stonePos)
stone:getItemById(stoneId):remove()
end, timetoreset * 60000, stone:getPosition())
elseif player:getStorageValue(storage) >= 1 then
local stone = Tile(p[2])
Game.createItem(stoneId, 1, stonePos)
addEvent(function(stonePos)
stone:getItemById(stoneId):remove()
end, timetoreset * 60000, stone:getPosition())
end
return true
end