Ir para conteúdo

Featured Replies

Postado

tem um scripts de catacombs, porém ta pra tfs 1.1 e não funciona, mas não acusa nenhum erro quando eu executo então nem sei aonde ou como arrumar, sou bem leigo se não tiver um warning ou error no console fica dificil hrhura

 

Create in data folder, file: catacombs.lua, put in:

Code (Text):
  1.  
  2. places =
  3. {
  4. [1] = {placeName = "Zenoya Graveyard", placeStorage = 6661, placepos = {x = 443, y = 527, z = 8}},
  5. [2] = {placeName = "Azshara West Catacomb", placeStorage = 6662, placepos = {x = 246, y = 485, z = 8}},
  6. [3] = {placeName = "Azshara North Catacomb", placeStorage = 6663, placepos = {x = 259, y = 401, z = 7}}
  7. }
  8.  
  9. function getCatacombByName(name)
  10. for k, v in pairs(places) do
  11. if v.placeName:lower() == name:lower() then
  12. return k
  13. end
  14. end
  15. return false
  16. end
  17.  
  18. function sendCatacombWindow(cid)
  19. CatacombWindow = ModalWindow(1900, "Catacombs Teleporter", "Select place:")
  20.  
  21. if CatacombWindow:getId() == 1900 then
  22.     CatacombWindow:addButton(1, "Teleport")
  23.     CatacombWindow:setDefaultEnterButton(1)
  24.     CatacombWindow:addButton(2, "Cancel")
  25.     CatacombWindow:setDefaultEscapeButton(2)
  26.  
  27. for i = 1, #places do
  28.     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:

Spoiler
Code (Text):
  1.  
dofile('data/catacombs.lua')
 


Create in creaturescripts\scripts file catacomb_window.lua, put in:

Spoiler
Code (Text):
  1.  
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:

Spoiler
Code (Text):
  1.  
<event type="modalwindow" name="catacombw" script="catacomb_window.lua"/>
 


And declare it in data\creaturescripts\login.lua by paste this:

Spoiler
Code (Text):
  1.  
player:registerEvent("catacombw")
 


In data\movements.xml add this:

Spoiler
Code (Text):
  1.  
<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:

Spoiler
azsharanorth.lua
Code (Text):
  1.  
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
 
 
azsharawest.lua
Code (Text):
  1.  
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
 
 
teleporter.lua
Code (Text):
  1.  
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 (Text):
  1.  
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
 
 

Editado por Jobs (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo