Ir para conteúdo
  • 0

Tempo para começar WOE.


raulgamemaster

Pergunta

Seguinte, instalei a WOE do elite >http://www.xtibia.com/forum/topic/175368-video-aula-como-instalar-war-of-imperium/

Até ai Tudo bem... mas quando eu executo: /woe on , aparece:

 

"War of Emperium will start in next 5 minutes..."

"will have a duration of 30 Minutes.".

"War has started...".

 

ok, isso é normal, porém, assim que executo o comando, o Teleporte de acesso ao WOE aparece instantaneamente. Não é respeitado os 5 minutos dito na broadcast.

 

Quero simplesmente que, após o comando, o broadcast seja exibido normalmente, e DEPOIS dos 5 MINUTOS, o Teleporte seja criado.

 

Agradeço desde ja!!!

Link para o comentário
Compartilhar em outros sites

11 respostass a esta questão

Posts Recomendados

  • 0

Vá em data/globalevents/scripts, e troque o woe.lua por este:

 

 

dofile("./_woe.lua")

 

local config = woe_config

 

local reward = 200000 -- 200k

 

local function EndWoe()

Woe.getInfo()

 

setGlobalStorageValue(stor.Started, 0)

setGlobalStorageValue(stor.WoeTime, 0)

 

Woe.expulsar(infoLua[2], Castle.salas.a.fromx, Castle.salas.a.tox, Castle.salas.a.fromy, Castle.salas.a.toy, Castle.salas.a.z, Castle._exit)

Woe.expulsar(infoLua[2], Castle.salas.b.fromx, Castle.salas.b.tox, Castle.salas.b.fromy, Castle.salas.b.toy, Castle.salas.b.z, Castle._exit)

Woe.expulsar(infoLua[2], Castle.salas.c.fromx, Castle.salas.c.tox, Castle.salas.c.fromy, Castle.salas.c.toy, Castle.salas.c.z, Castle._exit)

 

doBroadcastMessage("WoE is finished", config.bcType)

doBroadcastMessage("The castle " .. Castle.name .. " is owned by ".. Woe.guildName() ..".", config.bcType)

 

if isCreature(getThingFromPos(Castle.empePos).uid) then

doRemoveCreature(getThingFromPos(Castle.empePos).uid)

end

 

Woe.removePre()

Woe.removePortals()

 

doRemoveItem(getThingFromPos(Castle.desde).uid)

 

Woe.save()

 

for _, cid in ipairs(getPlayersOnline()) do

if infoLua[2] == getPlayerGuildId(cid) then

doPlayerAddMoney(cid, reward)

end

end

 

Woe.remove()

setGlobalStorageValue(24503, -1)

 

end

 

function onThink(interval, lastExecution)

Woe.getInfo()

if Woe.isTime() then

if not Woe.isStarted() then

doSummonCreature("empe", Castle.empePos)

doSummonCreature("pre1", Castle.PreEmpes[1])

doSummonCreature("pre2", Castle.PreEmpes[2])

doBroadcastMessage("War has started...", config.bcType)

setGlobalStorageValue(stor.Started, 1)

Woe.updateInfo({os.time(), infoLua[2], infoLua[3], infoLua[4]})

addEvent(doCreateTeleport, 5*60*1000, 1387, Castle.pos, Castle.desde)

addEvent(EndWoe, config.timeToEnd * 60 * 1000)

end

end

return true

end

 

 

Boa sorte! Reinicie o servidor para obter results.

Link para o comentário
Compartilhar em outros sites

  • 0

Obrigado Roksas...

Muito bom , mas agora o problema é que quando executo /woe on, a msg:

 

21:10 War of Emperium will start in next 5 minutes...

21:10 will have a duration of 30 Minutes.

21:10 War has started...( GOSTARIA que especificamente esta, só aparecesse quando o TP fosse criado)

 

É possível?

Link para o comentário
Compartilhar em outros sites

  • 0

Troca o woe.lua da pasta data/talkactions/scripts por esse:

 

 

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 = "time left = " .. Woe.timeToEnd().mins .. ":" .. Woe.timeToEnd().secs .. "\nActually the castle " .. Castle.name .. " is owned by " .. Woe.guildName() .. ".\n" .. Woe.breakerName() .. " broke the empe at "..myTable[1].." / "..myTable[2].." / "..myTable[3].." at time "..myTable[4].."."

else

text = "the last woe was won by " .. Woe.guildName() .. ".\n" .. Woe.breakerName() .. " broke the empe at "..myTable[1].." / "..myTable[2].." / "..myTable[3].." at time "..myTable[4].."."

end

 

if words == "/woe" then

if getPlayerAccess(cid) >= config.accessToStar then

if param == "on" then

if Woe.isTime() ~= true then

addEvent(doBroadcastMessage, 5*60*1000, "War of Emperium will start in next 5 minutes...", config.bcType)

addEvent(doBroadcastMessage, 5*60*1000, "will have a duration of " .. config.timeToEnd .. " Minutes.", config.bcType)

setGlobalStorageValue(stor.WoeTime, 1)

else

doPlayerSendCancel(cid, "WoE is already running.")

end

elseif param == "off" then

if Woe.isTime() == true then

doBroadcastMessage("WoE was canceled...", 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, "WoE is not running.")

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, "not valid param.")

end

elseif getPlayerAccess(cid) < config.accessToStar then

if param == "info" then

doPlayerPopupFYI(cid, text)

end

else

doPlayerSendCancel(cid, "not possible.")

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, "Emergency Recall", TALKTYPE_SAY)

else

doPlayerSendCancel(cid, "you can only use this every " .. config.recallTime / 60 .. " minutes.")

end

else

doPlayerSendCancel(cid, "no members online.")

end

else

doPlayerSendCancel(cid, "only can be used in the castle.")

end

else

doPlayerSendCancel(cid, "you are not the leader.")

end

else

doPlayerSendCancel(cid, "woe is not running.")

end

end

return true

end

 

 

 

E o woe.lua do globalevents/scripts por esse:

 

 

dofile("./_woe.lua")

 

local config = woe_config

 

local reward = 200000 -- 200k

 

local function EndWoe()

Woe.getInfo()

 

setGlobalStorageValue(stor.Started, 0)

setGlobalStorageValue(stor.WoeTime, 0)

 

Woe.expulsar(infoLua[2], Castle.salas.a.fromx, Castle.salas.a.tox, Castle.salas.a.fromy, Castle.salas.a.toy, Castle.salas.a.z, Castle._exit)

Woe.expulsar(infoLua[2], Castle.salas.b.fromx, Castle.salas.b.tox, Castle.salas.b.fromy, Castle.salas.b.toy, Castle.salas.b.z, Castle._exit)

Woe.expulsar(infoLua[2], Castle.salas.c.fromx, Castle.salas.c.tox, Castle.salas.c.fromy, Castle.salas.c.toy, Castle.salas.c.z, Castle._exit)

 

doBroadcastMessage("WoE is finished", config.bcType)

doBroadcastMessage("The castle " .. Castle.name .. " is owned by ".. Woe.guildName() ..".", config.bcType)

 

if isCreature(getThingFromPos(Castle.empePos).uid) then

doRemoveCreature(getThingFromPos(Castle.empePos).uid)

end

 

Woe.removePre()

Woe.removePortals()

 

doRemoveItem(getThingFromPos(Castle.desde).uid)

 

Woe.save()

 

for _, cid in ipairs(getPlayersOnline()) do

if infoLua[2] == getPlayerGuildId(cid) then

doPlayerAddMoney(cid, reward)

end

end

 

Woe.remove()

setGlobalStorageValue(24503, -1)

 

end

 

function onThink(interval, lastExecution)

Woe.getInfo()

if Woe.isTime() then

if not Woe.isStarted() then

doSummonCreature("empe", Castle.empePos)

doSummonCreature("pre1", Castle.PreEmpes[1])

doSummonCreature("pre2", Castle.PreEmpes[2])

addEvent(doBroadcastMessage, 5*60*1000, "War has started...", config.bcType)

setGlobalStorageValue(stor.Started, 1)

Woe.updateInfo({os.time(), infoLua[2], infoLua[3], infoLua[4]})

addEvent(doCreateTeleport, 5*60*1000, 1387, Castle.pos, Castle.desde)

addEvent(EndWoe, config.timeToEnd * 60 * 1000)

end

end

return true

end

Editado por Roksas
Link para o comentário
Compartilhar em outros sites

  • 0

Dando erro:

 

 

Loading talkactions... [Error - LuaInterface::loadFile] data/talkactions/scripts/woe.lua:30: unexpected symbol near ')'

[13/4/2013 21:42:13] [Error - Event::checkScript] Cannot load script (data/talkactions/scripts/woe.lua)

[13/4/2013 21:42:13] data/talkactions/scripts/woe.lua:30: unexpected symbol near ')'

[13/4/2013 21:42:13] [Error - LuaInterface::loadFile] data/talkactions/scripts/woe.lua:30: unexpected symbol near ')'

[13/4/2013 21:42:13] [Error - Event::checkScript] Cannot load script (data/talkactions/scripts/woe.lua)

[13/4/2013 21:42:13] data/talkactions/scripts/woe.lua:30: unexpected symbol near ')'

 

e

 

[13/4/2013 21:42:15] >>> Loading globalscripts... [Error - LuaInterface::loadFile] data/globalevents/scripts/woe.lua:49: unexpected symbol near ')'

[13/4/2013 21:42:15] [Error - Event::checkScript] Cannot load script (data/globalevents/scripts/woe.lua)

[13/4/2013 21:42:15] data/globalevents/scripts/woe.lua:49: unexpected symbol near ')'

Link para o comentário
Compartilhar em outros sites

  • 0

Agora somente:

 

[13/4/2013 21:56:4] >>> Loading globalscripts... [Error - LuaInterface::loadFile] data/globalevents/scripts/woe.lua:49: unexpected symbol near ')'

[13/4/2013 21:56:4] [Error - Event::checkScript] Cannot load script (data/globalevents/scripts/woe.lua)

[13/4/2013 21:56:4] data/globalevents/scripts/woe.lua:49: unexpected symbol near ')'

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

Acho que resolvi, tirei um ")" que estava a mais na linha 49... vou testar...

Editado por raulgamemaster
Link para o comentário
Compartilhar em outros sites

  • 0

Você esperou os 5 min?

 

Ah ta entendi, nem li os broadcast haha, troca o da talkactionss/scripts por esse:

 

 

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 = "time left = " .. Woe.timeToEnd().mins .. ":" .. Woe.timeToEnd().secs .. "\nActually the castle " .. Castle.name .. " is owned by " .. Woe.guildName() .. ".\n" .. Woe.breakerName() .. " broke the empe at "..myTable[1].." / "..myTable[2].." / "..myTable[3].." at time "..myTable[4].."."

else

text = "the last woe was won by " .. Woe.guildName() .. ".\n" .. Woe.breakerName() .. " broke the empe at "..myTable[1].." / "..myTable[2].." / "..myTable[3].." at time "..myTable[4].."."

end

 

if words == "/woe" then

if getPlayerAccess(cid) >= config.accessToStar then

if param == "on" then

if Woe.isTime() ~= true then

doBroadcastMessage("War of Emperium will start in next 5 minutes...", config.bcType)

addEvent(doBroadcastMessage, 5*60*1000, "will have a duration of " .. config.timeToEnd .. " Minutes.", config.bcType)

setGlobalStorageValue(stor.WoeTime, 1)

else

doPlayerSendCancel(cid, "WoE is already running.")

end

elseif param == "off" then

if Woe.isTime() == true then

doBroadcastMessage("WoE was canceled...", 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, "WoE is not running.")

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, "not valid param.")

end

elseif getPlayerAccess(cid) < config.accessToStar then

if param == "info" then

doPlayerPopupFYI(cid, text)

end

else

doPlayerSendCancel(cid, "not possible.")

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, "Emergency Recall", TALKTYPE_SAY)

else

doPlayerSendCancel(cid, "you can only use this every " .. config.recallTime / 60 .. " minutes.")

end

else

doPlayerSendCancel(cid, "no members online.")

end

else

doPlayerSendCancel(cid, "only can be used in the castle.")

end

else

doPlayerSendCancel(cid, "you are not the leader.")

end

else

doPlayerSendCancel(cid, "woe is not running.")

end

end

return true

end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...