local config = {
reset = false, -- For testing purposes only. true/false
storage = 45001,
quest_required = false, -- true/false (if true, quest should set storage to 1)
give_hints = true, -- true/false
-- MAIN TILE, MAKE SURE TO UPDATE LINES 72, 73 and 94 WITH THIS UNIQUE_ID
[45000] = { teleport_positions = { --
[1] = {x = 1000, y = 1000, z = 7}, -- to room 1
[2] = {x = 1000, y = 1000, z = 7}, -- to room 2
[3] = {x = 1000, y = 1000, z = 7},
[4] = {x = 1000, y = 1000, z = 7},
[5] = {x = 1000, y = 1000, z = 7},
[6] = {x = 1000, y = 1000, z = 7} -- to reward area
}
},
[45001] = { items_required = {
[1] = { item_id = 1111, item_count = 1, position = {x = 1000, y = 1000, z = 7}}
}
},
[45002] = { items_required = {
[1] = { item_id = 1111, item_count = 1, position = {x = 1000, y = 1000, z = 7} },
[2] = { item_id = 2222, item_count = 2, position = {x = 2000, y = 2000, z = 7} }
}
},
[45003] = { items_required = {
[1] = { item_id = 1111, item_count = 1, position = {x = 1000, y = 1000, z = 7} },
[2] = { item_id = 2222, item_count = 2, position = {x = 2000, y = 2000, z = 7} },
[3] = { item_id = 3333, item_count = 3, position = {x = 3000, y = 3000, z = 7} }
}
},
[45004] = { items_required = {
[1] = { item_id = 1111, item_count = 1, position = {x = 1000, y = 1000, z = 7} },
[2] = { item_id = 2222, item_count = 2, position = {x = 2000, y = 2000, z = 7} },
[3] = { item_id = 3333, item_count = 3, position = {x = 3000, y = 3000, z = 7} },
[4] = { item_id = 4444, item_count = 4, position = {x = 4000, y = 4000, z = 7} }
}
},
[45005] = { items_required = {
[1] = { item_id = 1111, item_count = 1, position = {x = 1000, y = 1000, z = 7} },
[2] = { item_id = 2222, item_count = 2, position = {x = 2000, y = 2000, z = 7} },
[3] = { item_id = 3333, item_count = 3, position = {x = 3000, y = 3000, z = 7} },
[4] = { item_id = 4444, item_count = 4, position = {x = 4000, y = 4000, z = 7} },
[5] = { item_id = 5555, item_count = 5, position = {x = 5000, y = 5000, z = 7} }
}
}
}
function onStepIn(cid, item, position, fromPosition)
if not isPlayer(cid) then
return false
end
if config.reset == true then
setPlayerStorageValue(cid, config.storage, -1)
doPlayerSendCancel(cid, "Quest storage set to -1.")
doTeleportThing(cid, fromPosition)
return true
end
if config.quest_required == true and getPlayerStorageValue(cid, config.storage) < 1 then
doTeleportThing(cid, fromPosition)
if config.give_hints == true then
doPlayerSendCancel(cid, "You require a quest to enter this area.")
end
return true
elseif config.quest_required ~= true and getPlayerStorageValue(cid, config.storage) < 1 then
setPlayerStorageValue(cid, config.storage, 1)
end
if item.uid == 45000 then
doTeleportThing(cid, config[45000].teleport_positions[(getPlayerStorageValue(cid, config.storage))])
return true
end
if config[item.uid] then
local x = config[item.uid].items_required
for i = 1, #x do
if getItemCountFromPosition(x[i].item_id, x[i].position) < x[i].item_count then
doTeleportThing(cid, fromPosition)
if config.give_hints == true then
doPlayerSendCancel(cid, "Item on altar " .. i .. " is either incorrect or is not enough!")
end
return true
end
end
for i = 1, #x do
for n = 1, x[i].item_count do
doRemoveItem(getTileItemById(x[i].position, x[i].item_id).uid, 1)
end
end
setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) + 1)
doTeleportThing(cid, config[45000].teleport_positions[(getPlayerStorageValue(cid, config.storage))])
end
return true
end