So basicly what I want is to merge my TP scroll (Scroll that currently sends you to temple of any town) into something like this: https://otland.net/threads/tfs-1-1-...ablo-3-teleport-great-for-rpg-servers.230015/ This is how my TP scroll looks like now:
What I want is that when you pick Edron for example, it opens a new window where you can see your unlocked locations. (Temple, cyclopolis, dragon cave etc.) I've already implented the catacomb teleporter I provided link to, to my server and I added the movements to unlock cyclopolis so far.
How would I change so that when I pick Edron it sends the modalwindow for the "catacombs" to the player?
I tried a few things and I did manage to make it work so that the new window pops up, but there were no choises and sometimes not even any buttons.
Here's my current TP scroll scripts:
Any help would be awesome!
Using tfs 1.1
What I want is that when you pick Edron for example, it opens a new window where you can see your unlocked locations. (Temple, cyclopolis, dragon cave etc.) I've already implented the catacomb teleporter I provided link to, to my server and I added the movements to unlock cyclopolis so far.
How would I change so that when I pick Edron it sends the modalwindow for the "catacombs" to the player?
I tried a few things and I did manage to make it work so that the new window pops up, but there were no choises and sometimes not even any buttons.
Here's my current TP scroll scripts:
Code:
local towns = {
"Thais",
"Carlin",
"Venore",
"Ab'dendriel",
"Liberty Bay",
"Port Hope",
"Ankrahmun",
"Darashia",
"Kazordoon",
"Edron",
"Svargrond",
"Yalahar",
"Farmine",
"Gray Beach",
"Roshamuul",
"Trainers"
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
player:sendCancelMessage("PZ locked!")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return true
end
local modalWindow = ModalWindow(2, "Destination", "Make your choice:")
for i = 1, #towns do
modalWindow:addChoice(i, i .. ". " .. towns[i])
end
modalWindow:addButton(1, 'Open')
modalWindow:setDefaultEnterButton(1)
modalWindow:addButton(2, 'Exit')
modalWindow:setDefaultEscapeButton(2)
modalWindow:sendToPlayer(player)
player:registerEvent("Destination")
return true
end
Code:
function onModalWindow(cid, modalWindowId, buttonId, choiceId)
if modalWindowId == 2 then
local player = Player(cid)
local thais = {x = 32369, y = 32241, z = 7}
local carlin = {x = 32360, y = 31782, z = 7}
local venore = {x = 32957, y = 32076, z = 7}
local ab = {x = 32732, y = 31634, z = 7}
local liberty = {x = 32317, y = 32826, z = 7}
local port = {x = 32594, y = 32745, z = 7}
local ankrahmun = {x = 33194, y = 32853, z = 7}
local darashia = {x = 33213, y = 32454, z = 1}
local kazordoon = {x = 32649, y = 31925, z = 11}
local edron = {x = 33217, y = 31814, z = 8}
local svargrond = {x = 32212, y = 31132, z = 7}
local yalahar = {x = 32787, y = 31276, z = 7}
local farmine = {x = 33023, y = 31521, z = 11}
local gray = {x = 33447, y = 31323, z = 9}
local roshamuul = {x = 33513, y = 32363, z = 6}
local trainers = {x = 32682, y = 32484, z = 7}
if buttonId == 2 then
return false
else
if choiceId == 1 then
player:teleportTo(thais)
return true
end
if choiceId == 2 then
player:teleportTo(carlin)
return true
end
if choiceId == 3 then
player:teleportTo(venore)
return true
end
if choiceId == 4 then
player:teleportTo(ab)
return true
end
if choiceId == 5 then
player:teleportTo(liberty)
return true
end
if choiceId == 6 then
player:teleportTo(port)
return true
end
if choiceId == 7 then
player:teleportTo(ankrahmun)
return true
end
if choiceId == 8 then
player:teleportTo(darashia)
return true
end
if choiceId == 9 then
player:teleportTo(kazordoon)
return true
end
if choiceId == 10 then
player:teleportTo(edron)
return true
end
if choiceId == 11 then
player:teleportTo(svargrond)
return true
end
if choiceId == 12 then
player:teleportTo(yalahar)
return true
end
if choiceId == 13 then
player:teleportTo(farmine)
return true
end
if choiceId == 14 then
player:teleportTo(gray)
return true
end
if choiceId == 15 then
player:teleportTo(roshamuul)
return true
end
if choiceId == 16 then
player:teleportTo(trainers)
return true
end
end
end
end
Using tfs 1.1
Last edited: