"Catacombs" Teleporter for TFS 1.1
(Movements, CreatureScripts, Global.lua)
(Movements, CreatureScripts, Global.lua)
* How it looks? * (Not loading? CLICK > gif (lenght is 1 minute)
GIF:
Image (after unlock all 3 teleporters):
Image (after unlock all 3 teleporters):
☛ Short About it
`Catacombs Teleporter` it's a simple teleport system of catacombs.
You can make and create more teleporters if you want to, just use brain.
`Catacombs Teleporter` it's a simple teleport system of catacombs.
You can make and create more teleporters if you want to, just use brain.
☛ How it works?
It teleports player (when player had unlocked teleport before (visited the catacomb one time at least))
to other catacomb place (player can choose between unlocked teleporters where he want get teleported).
It teleports player (when player had unlocked teleport before (visited the catacomb one time at least))
to other catacomb place (player can choose between unlocked teleporters where he want get teleported).
☛ Scripts
Create in data folder, file: catacombs.lua, put in:
Add in file global.lua on top, this:
Create in creaturescripts\scripts file catacomb_window.lua, put in:
In data\creaturescripts.xml add this:
And declare it in data\creaturescripts\login.lua by paste this:
In data\movements.xml add this:
Create folder "catacombs" in data\movements\scripts
In folder data\movements\scripts\catacombs\
Create in sequence files: azsharanorth.lua, azsharawest.lua, teleporter.lua, zenoyagraveyard.lua
Files:
Create in data folder, file: catacombs.lua, put in:
Code:
places =
{
[1] = {placeName = "Zenoya Graveyard", placeStorage = 6661, placepos = {x = 443, y = 527, z = 8}},
[2] = {placeName = "Azshara West Catacomb", placeStorage = 6662, placepos = {x = 246, y = 485, z = 8}},
[3] = {placeName = "Azshara North Catacomb", placeStorage = 6663, placepos = {x = 259, y = 401, z = 7}}
}
function getCatacombByName(name)
for k, v in pairs(places) do
if v.placeName:lower() == name:lower() then
return k
end
end
return false
end
function sendCatacombWindow(cid)
CatacombWindow = ModalWindow(1900, "Catacombs Teleporter", "Select place:")
if CatacombWindow:getId() == 1900 then
CatacombWindow:addButton(1, "Teleport")
CatacombWindow:setDefaultEnterButton(1)
CatacombWindow:addButton(2, "Cancel")
CatacombWindow:setDefaultEscapeButton(2)
for i = 1, #places do
if getCreatureStorage(cid, places[i].placeStorage) == 1 then
CatacombWindow:addChoice(i, places[i].placeName)
end
end
end
CatacombWindow:sendToPlayer(cid)
return true
end
Add in file global.lua on top, this:
Code:
dofile('data/catacombs.lua')
Create in creaturescripts\scripts file catacomb_window.lua, put in:
Code:
function onModalWindow(cid, modalWindowId, buttonId, choiceId)
local player = Player(cid)
local pos = player:getPosition()
if modalWindowId ~= 1900 then
return false
end
if buttonId == 1 then -- Teleport
if getCreatureStorage(cid, places[choiceId].placeStorage) == 1 then
pos:sendMagicEffect(11)
player:teleportTo(places[choiceId].placepos)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have succesfully teleported to ' .. places[choiceId].placeName .. '.')
doSendMagicEffect(places[choiceId].placepos, 11)
else
sendCatacombWindow(cid)
end
elseif buttonId == 255 then
doPlayerPopupFYI(cid,"Please use a button.")
sendCatacombWindow(cid)
end
return true
end
In data\creaturescripts.xml add this:
Code:
<event type="modalwindow" name="catacombw" script="catacomb_window.lua"/>
And declare it in data\creaturescripts\login.lua by paste this:
Code:
player:registerEvent("catacombw")
In data\movements.xml add this:
Code:
<movevent event="StepIn" itemid="_ YOUR ITEMID of Teleport Rock on ground _" script="catacombs/teleporter.lua"/>
<movevent event="StepIn" uniqueid="6661" script="catacombs/zenoyagraveyard.lua"/>
<movevent event="StepIn" uniqueid="6662" script="catacombs/azsharawest.lua"/>
<movevent event="StepIn" uniqueid="6663" script="catacombs/azsharanorth.lua"/>
Create folder "catacombs" in data\movements\scripts
In folder data\movements\scripts\catacombs\
Create in sequence files: azsharanorth.lua, azsharawest.lua, teleporter.lua, zenoyagraveyard.lua
Files:
azsharanorth.lua
azsharawest.lua
teleporter.lua
zenoyagraveyard.lua
Code:
local t = {
pos = {x=259, y=400, z=7},
effect = CONST_ME_TUTORIALARROW
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
if player:getStorageValue(6663) < 1 then
player:setStorageValue(6663, 1)
player:say('It looks like a teleporter..', TALKTYPE_MONSTER_SAY)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have unlocked Catacomb Teleporter: Azshara North Catacomb.')
doSendMagicEffect(t.pos, t.effect, cid)
end
return true
end
Code:
local t = {
pos = {x=246, y=486, z=8},
effect = CONST_ME_TUTORIALARROW
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
if player:getStorageValue(6662) < 1 then
player:setStorageValue(6662, 1)
player:say('It looks like a teleporter..', TALKTYPE_MONSTER_SAY)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have unlocked Catacomb Teleporter: Azshara West Catacomb.')
doSendMagicEffect(t.pos, t.effect, cid)
end
return true
end
Code:
local choose = {}
function onStepIn(cid, item, position, fromPosition)
local player = Player(cid)
local pos = player:getPosition()
if not player then
return true
end
if getPlayerStorageValue(cid, 6661) == 1 then
return sendCatacombWindow(cid)
end
return true
end
Code:
local t = {
pos = {x=443, y=526, z=8},
effect = CONST_ME_TUTORIALARROW
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
if player:getStorageValue(6661) < 1 then
player:setStorageValue(6661, 1)
player:say('It looks like a teleporter..', TALKTYPE_MONSTER_SAY)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have unlocked Catacomb Teleporter: Zenoya Graveyard.')
doSendMagicEffect(t.pos, t.effect, cid)
end
return true
end
That's all,
Have fun with use.
Have fun with use.
PS.
For better quality of using this script,
I recommending you to read it and change yourself everything, so as to fit into your server.
Use your brain and humanity.
For better quality of using this script,
I recommending you to read it and change yourself everything, so as to fit into your server.
Use your brain and humanity.