local teleports = {
[0x00] = {cost = 0, pos = {x = 314, y = 102, z = 7}, text = "Rotworms"},
[0x01] = {cost = 0, pos = {x = 675, y = 245, z = 7}, text = "Hero Fortress"},
[0x02] = {cost = 0, pos = {x = 765, y = 451, z = 7}, text = "Asura Palace"},
[0x03] = {cost = 0, pos = {x = 862, y = 598, z = 7}, text = "Mistrock"},
[0x04] = {cost = 0, pos = {x = 846, y = 456, z = 6}, text = "Yielothax"},
[0x05] = {cost = 0, pos = {x = 1387, y = 1798, z = 7}, text = "Roshamuul"},
[0x06] = {cost = 0, pos = {x = 69, y = 771, z = 7}, text = "Wind Temple"},
[0x07] = {cost = 0, pos = {x = 54, y = 711, z = 7}, text = "Wind Depot"},
[0x08] = {cost = 0, pos = {x = 73, y = 733, z = 6}, text = "Magic Shop"},
[0x09] = {cost = 0, pos = {x = 35, y = 791, z = 7}, text = "Distance Shop"},
[0x10] = {cost = 0, pos = {x = 86, y = 755, z = 7}, text = "Rashid"},
[0x11] = {cost = 0, pos = {x = 229, y = 689, z = 7}, text = "Wrrm"},
[0x12] = {cost = 0, pos = {x = 276, y = 658, z = 7}, text = "Behemoth"},
[0x13] = {cost = 0, pos = {x = 468, y = 448, z = 7}, text = "Neutral Nation"},
[0x14] = {cost = 0, pos = {x = 950, y = 1082, z = 12}, text = "Glooth Bandit"},
[0x15] = {cost = 0, pos = {x = 872, y = 933, z = 6}, text = "Oramond"},
[0x16] = {cost = 0, pos = {x = 607, y = 603, z = 10}, text = "Fire Temple"},
[0x17] = {cost = 0, pos = {x = 586, y = 603, z = 10}, text = "Fire Depot"},
[0x18] = {cost = 0, pos = {x = 611, y = 637, z = 7}, text = "Magic Shop"},
[0x19] = {cost = 0, pos = {x = 554, y = 653, z = 7}, text = "Distance Shop"},
[0x20] = {cost = 0, pos = {x = 559, y = 589, z = 7}, text = "Rashid"},
[0x21] = {cost = 0, pos = {x = 367, y = 198, z = 7}, text = "Rotworms"},
[0x22] = {cost = 0, pos = {x = 750, y = 451, z = 7}, text = "Asura Palace"},
[0x23] = {cost = 0, pos = {x = 827, y = 943, z = 4}, text = "Oramond"},
[0x24] = {cost = 0, pos = {x = 1351, y = 1789, z = 7}, text = "Roshamuul"},
[0x25] = {cost = 0, pos = {x = 858, y = 599, z = 7}, text = "Mistrock"},
[0x26] = {cost = 0, pos = {x = 282, y = 419, z = 7}, text = "Dragons"},
[0x27] = {cost = 0, pos = {x = 488, y = 440, z = 6}, text = "Neutral Nation"},
[0x28] = {cost = 0, pos = {x = 672, y = 241, z = 7}, text = "Hero Fortress"},
[0x29] = {cost = 0, pos = {x = 871, y = 965, z = 12}, text = "Glooth Bandits"},
[0x30] = {cost = 0, pos = {x = 681, y = 487, z = 8}, text = "Earth Temple"},
[0x31] = {cost = 0, pos = {x = 700, y = 494, z = 7}, text = "Earth Depot"},
[0x32] = {cost = 0, pos = {x = 660, y = 426, z = 7}, text = "Magic Shop"},
[0x33] = {cost = 0, pos = {x = 599, y = 402, z = 6}, text = "Distance Shop"},
[0x34] = {cost = 0, pos = {x = 696, y = 478, z = 6}, text = "Rashid"},
[0x35] = {cost = 0, pos = {x = 274, y = 194, z = 6}, text = "Rotworms"},
[0x36] = {cost = 0, pos = {x = 695, y = 360, z = 8}, text = "Medusa Tower"},
[0x37] = {cost = 0, pos = {x = 827, y = 191, z = 7}, text = "Serpent Spawn"},
[0x38] = {cost = 0, pos = {x = 774, y = 449, z = 7}, text = "Asura Palace"},
[0x39] = {cost = 0, pos = {x = 846, y = 941, z = 6}, text = "Oramond"},
[0x40] = {cost = 0, pos = {x = 1366, y = 1799, z = 7}, text = "Roshamuul"},
[0x41] = {cost = 0, pos = {x = 856, y = 605, z = 7}, text = "Mistrock"},
[0x42] = {cost = 0, pos = {x = 586, y = 400, z = 7}, text = "Earth Elemental"},
[0x43] = {cost = 0, pos = {x = 953, y = 1089, z = 12}, text = "Glooth Bandit"},
[0x44] = {cost = 0, pos = {x = 472, y = 463, z = 7}, text = "Neutral Nation"},
[0x45] = {cost = 0, pos = {x = 667, y = 251, z = 7}, text = "Hero Fortress"}
}
function onModalWindow(player, modalWindowId, buttonId, choiceId)
if modalWindowId ~= 1860 then return true end
if buttonId == 0x01 then return true end
local CHOICE = teleports[choiceId]
if not CHOICE then return true end
if player:removeMoney(CHOICE.cost) then
player:teleportTo(CHOICE.pos)
player:say(CHOICE.text, TALKTYPE_MONSTER_SAY, 0, 1, player:getPosition())
else
player:sendCancelMessage("This teleport costs "..CHOICE.cost.." to use.")
end
return true
end