Ir para conteúdo

Tenho no meu ot um Castle chamado Castle war, já adicionei o mapa, e as hunts, ja está tudo funcionando certo, mas quando eu clico na alavanca aparece o seguinte erro:

Featured Replies

Postado

image.thumb.png.0939e262ad891b4885e0a505194dcc46.png

data/globalevents/scripts/events/realCastle.lua

Citar

--[[

                Real Castle Event
    Desenvolvido por Vítor Bertolucci (Killua)

]]

function onTime()
    if not realCastle.isOpen() then
        realCastle.open()
    else
        realCastle.close()
    end
    return true
end

Citar

--[[

                Real Castle Event
    Desenvolvido por Vítor Bertolucci (Killua)

]]

realCastle = {
    
    open_storage = 100005,
    guild_storage = 100006,
    date_storages = {100007,100008,100009},
    frompos = {x = 1741, y = 1590, z = 7},
    topos = {x = 1861, y = 1655, z = 7}

}

realCastle.removePlayers = function()
    local first_cave = getPlayersInArea({x = 1727, y = 1584, z = 8},{x = 1793, y = 1653, z = 8})
    local second_cave = getPlayersInArea({x = 1817, y = 1590, z = 8},{x = 1922, y = 1655, z = 8})
    local fifith_cave = getPlayersInArea({x = 1730, y = 1672, z = 8},{x = 1777, y = 1741, z = 8})
    local sixth_cave = getPlayersInArea({x = 1583, y = 1676, z = 8},{x = 1710, y = 1764, z = 8})
    local seventh_cave = getPlayersInArea({x = 1806, y = 1671, z = 8},{x = 1889, y = 1747, z = 8})
    local eight_cave = getPlayersInArea({x = 1918, y = 1673, z = 8},{x = 2029, y = 1755, z = 8})
    local ninth_cave = getPlayersInArea({x = 1665, y = 1501, z = 8},{x = 1742, y = 1595, z = 8})
    local tenth_cave = getPlayersInArea({x = 1713, y = 1516, z = 7},{x = 1800, y = 1572, z = 7})
    local eleventh_cave = getPlayersInArea({x = 1433, y = 1585, z = 7},{x = 1531, y = 1649, z = 7})
    local castle_area = getPlayersInArea(realCastle.frompos,realCastle.topos)
    if first_cave then
        for _, pid in pairs(first_cave) do
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(pid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    if second_cave then
        for _, pid in pairs(second_cave) do
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(pid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    for _, tid in pairs(getPlayersOnline()) do
        local pos = getThingPos(tid)
        if pos.x >= 2829 and pos.x <= 3118 and pos.y >= 7 and pos.y <= 467 then
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(tid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    for _, tid in pairs(getPlayersOnline()) do
        local pos = getThingPos(tid)
        if pos.x >= 2902 and pos.x <= 3445 and pos.y >= 340 and pos.y <= 585 then
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(tid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    for _, tid in pairs(getPlayersOnline()) do
        local pos = getThingPos(tid)
        if pos.x >= 3304 and pos.x <= 3687 and pos.y >= 192 and pos.y <= 340 then
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(tid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    if fifith_cave then
        for _, pid in pairs(fifith_cave) do
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(pid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    if sixth_cave then
        for _, pid in pairs(sixth_cave) do
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(pid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    if seventh_cave then
        for _, pid in pairs(seventh_cave) do
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(pid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    if eight_cave then
        for _, pid in pairs(eight_cave) do
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(pid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    if ninth_cave then
        for _, pid in pairs(ninth_cave) do
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(pid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    if tenth_cave then
        for _, pid in pairs(tenth_cave) do
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(pid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    if eleventh_cave then
        for _, pid in pairs(eleventh_cave) do
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(pid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
    if castle_area then
        for _, pid in pairs(castle_area) do
            doTeleportThing(pid,getTownTemplePosition(1))
            doPlayerPopupFYI(pid,"O domínio de sua guild sob o castelo acabou e uma nova batalha está se iniciando.")
        end
    end
end

realCastle.open = function()
    setGlobalStorageValue(realCastle.open_storage,1)
    setGlobalStorageValue(realCastle.guild_storage,-1)
    realCastle.removePlayers()
end

realCastle.close = function()
    setGlobalStorageValue(realCastle.open_storage,-1)
    local players = getPlayersInArea(realCastle.frompos, realCastle.topos)
    if players then
        for _, pid in pairs(players) do
            doTeleportThing(pid,getTownTemplePosition(1))
        end
    end
    if getGlobalStorageValue(realCastle.guild_storage) == -1 then
        doBroadcastMessage("[New Castle] A batalhar terminou e nenhuma guild conseguiu dominar o castelo! Amanhã às 21:00 vocês podem tentar novamente!")
    else
        doBroadcastMessage("[New Castle] A batalha terminou e a guild vencedora foi "..getGuildNameByID(getGlobalStorageValue(realCastle.guild_storage)).."! Todos os jogadores dessa guild agora podem aproveitar o castelo até amanhâ às 21:00!")
    end
    doSaveServer()
end

realCastle.broadcast = function(message)
    local players = getPlayersInArea(realCastle.frompos, realCastle.topos)
    if players then
        for _, pid in pairs(players) do
            doPlayerSendTextMessage(pid,MESSAGE_STATUS_WARNING,message)
        end
    end
end

realCastle.domain = function(cid)
    local guild_id = getPlayerGuildId(cid)
    setGlobalStorageValue(realCastle.guild_storage,guild_id)
    realCastle.broadcast("[New Castle] O jogador "..getPlayerName(cid).." da guild "..getPlayerGuildName(cid).." dominou o castelo! As outras guilds têm até às 22:30 para conseguir tirar o domínio deles, não desistam!")
end

realCastle.isDominating = function(cid)
    local guild_id = getPlayerGuildId(cid)
    return guild_id == getGlobalStorageValue(realCastle.guild_storage)
end

realCastle.isOpen = function()
    return getGlobalStorageValue(realCastle.open_storage) == 1
end

Abaixo está o  data/lib/realCastle.lua

Postado

Qual a versão do seu .EXE, me parece que o script está usando uma função que não existe na suas libs.

 

e outro erro deve ser algo relacionado ao .xml do globalevents, dá uma verificada novamente na configuração se não esqueceu nenhum passo.

Postado
  • Autor

[19:22:15.920] The Forgotten Server, version 0.4_DEV (rev 3777)
[19:22:15.935] Compilada por luanluciano93 em Mar 28 2017 - version 1.0.6

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.6k

Informação Importante

Confirmação de Termo