Hugofasima
Website: thenosegang.servegame.com
- Joined
- Jun 24, 2015
- Messages
- 206
- Reaction score
- 23
I've made some changes and now it is working on TFS 1.0
Is the same script by @Fresh but converted to TFS 1.0
SCRIPT:
add this at the bottom of compat.lua
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:
I did my best
If someone wants to improve, it will be a pleasure to learn!
Is the same script by @Fresh but converted to TFS 1.0
SCRIPT:
add this at the bottom of compat.lua
getCreatureStorage = getPlayerStorageValue
Create in data folder, file: catacombs.lua, put in:
places =
{
[1] = {placeName = "Dorion (Depot)", placeStorage = 6671, placepos = {x = 80, y = 64, z = 6}},
[2] = {placeName = "Venonh (Pits of Inferno)", placeStorage = 6672, placepos = {x = 346, y = 359, z = 8}},
[3] = {placeName = "Roshamuul (Gaz'Haragoth Lair)", placeStorage = 6673, placepos = {x = 2074, y = 228, z = 9}}
}
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, "Waypoints reached", "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.placeStorage) == 1 then
CatacombWindow:addChoice(i, places.placeName)
end
end
end
CatacombWindow:sendToPlayer(cid)
return true
end
{
[1] = {placeName = "Dorion (Depot)", placeStorage = 6671, placepos = {x = 80, y = 64, z = 6}},
[2] = {placeName = "Venonh (Pits of Inferno)", placeStorage = 6672, placepos = {x = 346, y = 359, z = 8}},
[3] = {placeName = "Roshamuul (Gaz'Haragoth Lair)", placeStorage = 6673, placepos = {x = 2074, y = 228, z = 9}}
}
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, "Waypoints reached", "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.placeStorage) == 1 then
CatacombWindow:addChoice(i, places.placeName)
end
end
end
CatacombWindow:sendToPlayer(cid)
return true
end
Add in file global.lua on top, this:
dofile('data/catacombs.lua')
Create in creaturescripts\scripts file catacomb_window.lua, put in:
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
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:
<event type="modalwindow" name="catacombw" script="catacomb_window.lua"/>
And declare it in data\creaturescripts\login.lua by paste this:
player:registerEvent("catacombw")
In data\movements.xml add this:
<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"/>
<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=2073, y=228, z=9},
effect = CONST_ME_TUTORIALARROW
}
function onStepIn(creature, item, position, fromPosition)
local player = Player(creature)
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 a Waypoint: Gaz Haragoth.')
doSendMagicEffect(t.pos, t.effect, cid)
end
return true
end
azsharawest.lua
Code:
local t = {
pos = {x=346, y=358, z=8},
effect = CONST_ME_TUTORIALARROW
}
function onStepIn(creature, item, position, fromPosition)
local player = Player(creature)
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 a Waipoint: Pits of Inferno.')
doSendMagicEffect(t.pos, t.effect, cid)
end
return true
end
teleporter.lua
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
zenoyagraveyard.lua
Code:
local t = {
pos = {x=79, y=63, z=6},
effect = CONST_ME_TUTORIALARROW
}
function onStepIn(creature, item, position, fromPosition)
local player = Player(creature)
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 a Waypoint: Depot.')
doSendMagicEffect(t.pos, t.effect, cid)
end
return true
end
I did my best
If someone wants to improve, it will be a pleasure to learn!
Last edited: