tp_pads = {
[8315] = {price = 0, name = "Temple"},
[8316] = {price = 0, name = "Depot"},
[8317] = {price = 0, name = "Magic Shop"},
[8318] = {price = 0, name = "Distance Shop"},
[8319] = {price = 0, name = "Rashid"},
[8320] = {price = 0, name = "Rotworms"},
[8321] = {price = 0, name = "Yielothax"},
[8322] = {price = 0, name = "Wyrm"},
[8323] = {price = 0, name = "Asura Palace"},
[8324] = {price = 0, name = "Oramond"},
[8325] = {price = 0, name = "Roshamuul"},
[8326] = {price = 0, name = "Mistrock"},
[8327] = {price = 0, name = "Behemoths"},
[8328] = {price = 0, name = "Glooth Bandits"},
[8329] = {price = 0, name = "Warlocks"},
[8330] = {price = 0, name = "Neutral Nation"},
[8331] = {price = 0, name = "Hero Fortress"}
}
function onStepIn(player, item, position, fromPosition)
if not tp_pads[item.uid] then return true end
if not isInRange(position, {x = fromPosition.x - 1, y = fromPosition.y - 1, z = fromPosition.z}, {x = fromPosition.x + 1, y = fromPosition.y + 1, z = fromPosition.z}) then
-- player got there from another pad
return true
end
if not player:isPlayer() then
return true
end
if tp_pads[item.uid].storage then
if player:getStorageValue(tp_pads[item.uid].storage) < 1 then
player:setStorageValue(tp_pads[item.uid].storage, 1)
player:say("You have unlocked the fire nation spots.", TALKTYPE_ORANGE_1, true, player, player:getPosition())
end
end
if player:isPzLocked() then
player:teleportTo(fromPosition)
player:say("The pad is not responding.", TALKTYPE_ORANGE_1, true, player, player:getPosition())
else
local padWindow = ModalWindow(1860, "Wind Nation Spots", "Select destination:")
for i = 8315, 8331 do
if i ~= item.uid then
if tp_pads[i].price then
if tp_pads[i].storage then
if player:getStorageValue(tp_pads[i].storage) > 0 then
padWindow:addChoice(i - 8300, tp_pads[i].name .. (tp_pads[i].price > 0 and " [" .. tp_pads[i].price .. " gold]" or ""))
end
else
padWindow:addChoice(i - 8300, tp_pads[i].name .. (tp_pads[i].price > 0 and " [" .. tp_pads[i].price .. " gold]" or ""))
end
else
if tp_pads[i].storage then
if player:getStorageValue(tp_pads[i].storage) > 0 then
padWindow:addChoice(i - 8300, tp_pads[i].name)
end
else
padWindow:addChoice(i - 8300, tp_pads[i].name)
end
end
end
end
padWindow:addButton(1, "Select")
padWindow:addButton(2, "Cancel")
padWindow:setDefaultEnterButton(1)
padWindow:setDefaultEscapeButton(2)
padWindow:sendToPlayer(player)
end
return true
end