Ir para conteúdo

Featured Replies

Postado

Na talkaction, removi apenas a parte que inicia o evento. Você poderá encerrá-lo e etc ainda.

Globalevent:

dofile("./_woe.lua")
local days = {"Friday", "Saturday"}        --Dia(s) da semana, em inglês.
function onTime()
    if isInArray(days, os.date("%A")) then
        if not Woe.isTime() then
            doBroadcastMessage("[Castle Domain] Será iniciado em até 5 minutos... Registre seu char para entrar no castle com !guildjoin (Obrigatório ter Guild)", woe_config.bcType)
            doBroadcastMessage("[Castle Domain] Terá uma duração de " .. woe_config.timeToEnd .. " minutos. Pàgina do Castle Domain: http://falconiaworld.com/?subtopic=domain", woe_config.bcType)
            setGlobalStorageValue(stor.WoeTime, 1)
        end
    end
    return true
end
Tag:
<globalevent name="WOE" time="xxx" event="script" value="nome_do_arquivo.lua"/>
Troque xxx pelo horário que o evento começará.
Exemplo:
<globalevent name="WOE" time="19:00" event="script" value="nome_do_arquivo.lua"/>
Talkaction alterada:
dofile("./_woe.lua")
local config = woe_config
function onSay(cid, words, param)
    if words == "/woe" and param == "/!/SETUP" then
        Woe.setup()
        return true
    end
    Woe.getInfo()
    local myTable = {}
    for _, i in ipairs({"%d", "%B", "%Y", "%X"}) do
        table.insert(myTable, os.date(i, infoLua[4]))
    end
    if Woe.isStarted() then
        text = "tempo restante = " ..  Woe.timeToEnd().mins .. ":" .. Woe.timeToEnd().secs .. "\nCastle " .. Castle.name .. " conquistado atualmente pela guild " .. Woe.guildName() .. ".\n" .. Woe.breakerName() .. " quebre o empe "..myTable[1].." / "..myTable[2].." / "..myTable[3].." no tempo "..myTable[4].."."
    else
        text = "o domínio do castelo passado foi vencido por " .. Woe.guildName() .. ".\n" .. Woe.breakerName() .. " quebre o empe "..myTable[1].." / "..myTable[2].." / "..myTable[3].." no tempo "..myTable[4].."."
    end
    if words == "/woe" then
        if getPlayerAccess(cid) >= config.accessToStar then          
            if param == "off" then
                if Woe.isTime() then
                    doBroadcastMessage("[Castle Domain] Cancelado!", config.bcType)
                    setGlobalStorageValue(stor.WoeTime, 0)
                    setGlobalStorageValue(stor.Started, 0)
                    if isCreature(getThingFromPos(Castle.empePos).uid) == TRUE then
                        doRemoveCreature(getThingFromPos(Castle.empePos).uid)
                    end
                    if getThingFromPos(Castle.desde).itemid > 0 then
                        doRemoveItem(getThingFromPos(Castle.desde).uid)
                    end
                    Woe.removePre()
                    Woe.removePortals()
                else
                    doPlayerSendCancel(cid, "[Castle Domain] Não está funcionando.")
                end
            elseif param == "empe" then
                doSummonCreature("empe", Castle.empePos)
            elseif param == "go" then
                local newPos = Castle.empePos
                newPos.y = newPos.y + 1
                doTeleportThing(cid, newPos, FALSE)
            elseif param == "info" then
                doPlayerPopupFYI(cid, text)
            else
                doPlayerSendCancel(cid, "Parametro invalido.")
            end
        elseif getPlayerAccess(cid) < config.accessToStar then
            if param == "info" then
                doPlayerPopupFYI(cid, text)
            end
        else
            doPlayerSendCancel(cid, "Não é possivel.")
        end 
    elseif words == "!recall" then
        if Woe.isStarted() == true then
            if getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER then
                if Woe.isInCastle(cid) == true then
                    local members = Woe.getGuildMembers(getPlayerGuildId(cid))
                    if #members > 1 then
                        if(exhaust(cid, stor.recall, config.recallTime) == 1) then
                            for _, i in ipairs(members) do
                                if getPlayerGuildLevel(i) ~= GUILDLEVEL_LEADER then
                                    local pos = getClosestFreeTile(cid, getCreaturePosition(cid), FALSE, TRUE)
                                    doTeleportThing(i, pos, FALSE)
                                end
                            end
                            doCreatureSay(cid, "Emergencia, juntem-se", TALKTYPE_SAY)
                        else
                            doPlayerSendCancel(cid, "[Castle Domain] Espere " .. config.recallTime / 60 .. " minutos, para usar o comando novamente.")
                        end 
                    else
                        doPlayerSendCancel(cid, "[Castle Domain] Nenhum membro online.")
                    end
                else
                    doPlayerSendCancel(cid, "[Castle Domain] Não pode ser usado no caslte.")
                end
            else
                doPlayerSendCancel(cid, "[Castle Domain] Você não é o lider.")
            end
        else
            doPlayerSendCancel(cid, "[Castle Domain] Não esta funcionando.")
        end
    end
    return true
end

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

não respondo pms solicitando suporte em programação/scripting

  • Respostas 5
  • Visualizações 292
  • Created
  • Última resposta

Top Posters In This Topic

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