Postado Fevereiro 10, 2017 8 anos Fala pessoal, não sei se é simples mas vamos la: Usei esse tópico do Zombie System automático: Funcionou certinho, porém acontece o seguinte: Após os 2min que abre o portal, fecha o portal, mas fica dando esse erro: Mostrar conteúdo oculto [21:3:44.399] [Error - GlobalEvent Interface] [21:3:44.403] In a timer event called from: [21:3:44.405] data/globalevents/scripts/zombieevent.lua:onTime [21:3:44.408] Description: [21:3:44.410] (LuaInterface::luaGetThingFromPos) Tile not found Ai no fim, quando sobra só 1 pessoa na arena, todos são teleportados, o vencedor ganha o item normal, tudo okay, só preciso corrigir aquele erro mesmo. Obs.: Ja mudei o 'onTimer' do fechazombie para 'onTime' @Vodkart @xWhiteWolf @Fir3element please Editado Fevereiro 10, 2017 8 anos por Sekk (veja o histórico de edições) GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
Postado Fevereiro 11, 2017 8 anos local teleportPos = {x = 652, y = 1020, z = 7} -- Posição em que se abre o teleport function removeZombieTp() local t = getTileItemById(teleportPos, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(teleportPos, CONST_ME_POFF) end function onTimer() removeZombieTp() return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Fevereiro 11, 2017 8 anos Autor Em 11/02/2017 em 02:27, Vodkart disse: local teleportPos = {x = 652, y = 1020, z = 7} -- Posição em que se abre o teleport function removeZombieTp() local t = getTileItemById(teleportPos, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(teleportPos, CONST_ME_POFF) end function onTimer() removeZombieTp() return true end Vi que vc modificou o arquivo fechazombie responsável por deletar o teleport, certo? Alterei o código dele para esse, mas o erro continua depois q o teleport é deletado. Exatamente o mesmo erro, mas ele aponta para o arquivo zombieevent.lua e não fechazombie... Aqui vai ele: Mostrar conteúdo oculto local config = { semana_mes = "semana", days = {1,2,3,4,5,6,7}, -- Dia das semanas que irá acontecer o evento goblet = 5805, -- Troféu que vai pro vencedor do evento rewards = {7440}, -- Recompensas. moneyReward = {9971, 10, 1},-- {moneyId, quantidade, usar}1 pra usar 0 pra não usar} playerCount = 2001, -- Storage dos players que entram e sai do evento zombieCount = 2002, -- Storage do zombie do event teleportActionId = 2008, -- Action ID do teleport teleportPosition = {x = 10160, y = 10054, z = 7, stackpos = 1}, -- Onde o teleport é criado teleportToPosition = {x = 9930, y = 10105, z = 7}, -- Pra onde será teleportado teleportId = 1387, -- ID do teleporte timeToStartEvent = 2, -- Minutos que o portal irá ficar aberto até os player entrarem timeBetweenSpawns = 20, -- Segundos dps do evento ser startado começarem a aparecer os zombie zombieName = "Zombie Event", -- Nome do zombie sumonado playersNeededToStartEvent = 2, -- Players necessários pro evento ser iniciado -- Area que o zumbi vai spawnar fromPosition = {x = 9896, y = 10074, z = 7}, -- top de fromPosition até toPosition = {x = 9970, y = 10142, z = 7} -- -- em baixo toPostion } function onTime() local time = os.date("*t") if (config.semana_mes == "semana" and isInArray(config.days,time.wday)) or (config.semana_mes == "mes" and isInArray(config.days,time.day)) or config.semana_mes == "" then local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doItemSetAttribute(tp, "aid", config.teleportActionId) doBroadcastMessage("Zombie event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) setGlobalStorageValue(config.playerCount, 0) setGlobalStorageValue(config.zombieCount, 0) addEvent(startEvent, config.timeToStartEvent * 1000 * 60) end return TRUE end function startEvent() local fromp, top = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("Good luck in the zombie event people! The teleport has closed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doPlayerSendTextMessage(getPlayers.uid, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. config.timeBetweenSpawns .. " seconds! Good luck!") pvgaylord() end end end end else doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. config.playersNeededToStartEvent .. " players is needed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doTeleportThing(getPlayers.uid, getTownTemplePosition(getPlayerTown(getPlayers.uid)), false) doSendMagicEffect(getPlayerPosition(getPlayers.uid), CONST_ME_TELEPORT) end end end end end end function spawnZombie() if getGlobalStorageValue(config.playerCount) >= 2 then pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)} doSummonCreature(config.zombieName, pos) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1) doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) else local fromp, top = config.fromPosition, config.toPosition for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} cid = getThingfromPos(areapos).uid if isPlayer(cid) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) doBroadcastMessage(getCreatureName(cid)..' has survived at zombie event!') for _,items in ipairs(config.rewards) do doPlayerAddItem(cid, items, 1) doPlayerAddItem(cid, 8306, 4) end if config.moneyReward[3] == 1 then doPlayerAddItem(cid, config.moneyReward[1], config.moneyReward[2]) end doBroadcastMessage(getPlayerName(cid) .. " won the Zombie event! Congratulations!", MESSAGE_STATUS_WARNING) local goblet = doPlayerAddItem(cid, config.goblet, 1) doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(cid) .. " for winning the Zombie event.") elseif isMonster(cid) then doRemoveCreature(cid) end end end end end end function pvgaylord() local fromp, top, p, m = config.fromPosition, config.toPosition, 0, 0 for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do local areapos = {x = x, y = y, z = z, stackpos = 253} local cid = getThingfromPos(areapos).uid if isPlayer(cid) then p = p+1 elseif isMonster(cid) then m = m+1 end end end end if p ~= getGlobalStorageValue(config.playerCount) then setGlobalStorageValue(config.playerCount, p) end if p < 2 then return true end addEvent(pvgaylord,100,nil) end Creio que o erro seja aqui: function onTime() local time = os.date("*t") if (config.semana_mes == "semana" and isInArray(config.days,time.wday)) or (config.semana_mes == "mes" and isInArray(config.days,time.day)) or config.semana_mes == "" then local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doItemSetAttribute(tp, "aid", config.teleportActionId) doBroadcastMessage("Zombie event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) setGlobalStorageValue(config.playerCount, 0) setGlobalStorageValue(config.zombieCount, 0) addEvent(startEvent, config.timeToStartEvent * 1000 * 60) end return TRUE end Obs.: O erro não aparece apenas uma vez, enquanto o evento não acaba, ele aparece muitas vezes no console, muitas mesmo e muito rápido Editado Fevereiro 11, 2017 8 anos por Sekk (veja o histórico de edições) GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
Postado Fevereiro 11, 2017 8 anos pode ser local config = { semana_mes = "semana", days = {1,2,3,4,5,6,7}, -- Dia das semanas que irá acontecer o evento goblet = 5805, -- Troféu que vai pro vencedor do evento rewards = {2195, 2152, 2160}, -- Recompensas. moneyReward = {2160, 10, 1},-- {moneyId, quantidade, usar}1 pra usar 0 pra não usar} playerCount = 2001, -- Storage dos players que entram e sai do evento zombieCount = 2002, -- Storage do zombie do event teleportActionId = 2008, -- Action ID do teleport teleportPosition = {x = 652, y = 1020, z = 7, stackpos = 1}, -- Onde o teleport é criado teleportToPosition = {x = 559, y = 589, z = 7}, -- Pra onde será teleportado teleportId = 1387, -- ID do teleporte timeToStartEvent = 2, -- Minutos que o portal irá ficar aberto até os player entrarem timeBetweenSpawns = 20, -- Segundos dps do evento ser startado começarem a aparecer os zombie zombieName = "event zombie", -- Nome do zombie sumonado playersNeededToStartEvent = 3, -- Players necessários pro evento ser iniciado fromPosition = {x = 543, y = 578, z = 7}, -- top de fromPosition até toPosition = {x = 577, y = 600, z = 7} -- -- em baixo toPostion } function onTime() local time = os.date("*t") if (config.semana_mes == "semana" and isInArray(config.days,time.wday)) or (config.semana_mes == "mes" and isInArray(config.days,time.day)) or config.semana_mes == "" then local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doItemSetAttribute(tp, "aid", config.teleportActionId) doBroadcastMessage("Zombie event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) setGlobalStorageValue(config.playerCount, 0) setGlobalStorageValue(config.zombieCount, 0) addEvent(startEvent, config.timeToStartEvent * 1000 * 60) end return TRUE end function startEvent() local fromp, top = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("Good luck in the zombie event people! The teleport has closed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z} local m = getTopCreature(areapos).uid if isPlayer(m) then doPlayerSendTextMessage(m, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. config.timeBetweenSpawns .. " seconds! Good luck!") pvgaylord() end end end end else doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. config.playersNeededToStartEvent .. " players is needed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z} local m = getTopCreature(areapos).uid if isPlayer(m) then doTeleportThing(m, getTownTemplePosition(getPlayerTown(m)), false) doSendMagicEffect(getPlayerPosition(m), CONST_ME_TELEPORT) end end end end end end function spawnZombie() if getGlobalStorageValue(config.playerCount) >= 2 then pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)} doSummonCreature(config.zombieName, pos) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1) doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) else local fromp, top = config.fromPosition, config.toPosition for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z} local cid = getTopCreature(areapos).uid if isPlayer(cid) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) doBroadcastMessage(getCreatureName(cid)..' has survived at zombie event!') for _,items in ipairs(config.rewards) do doPlayerAddItem(cid, items, 1) end if config.moneyReward[3] == 1 then doPlayerAddItem(cid, config.moneyReward[1], config.moneyReward[2]) end doBroadcastMessage(getPlayerName(cid) .. " won the Zombie event! Congratulations!", MESSAGE_STATUS_WARNING) local goblet = doPlayerAddItem(cid, config.goblet, 1) doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(cid) .. " for winning the Zombie event.") elseif isMonster(cid) then doRemoveCreature(cid) end end end end end end function pvgaylord() local fromp, top, p, m = config.fromPosition, config.toPosition, 0, 0 for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z} local m = getTopCreature(areapos).uid if isPlayer(m) then p = p+1 elseif isMonster(m) then m = m+1 end end end end if p ~= getGlobalStorageValue(config.playerCount) then setGlobalStorageValue(config.playerCount, p) end if p < 2 then return true end addEvent(pvgaylord,100,nil) end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Fevereiro 11, 2017 8 anos Autor @Vodkart Agora não aparece mais o erro do portal, agora a cada 20segundos, que é o tempo pra iniciar o spawn de zombie, eu recebo esse erro: Mostrar conteúdo oculto [15:4:00.505] [Error - GlobalEvent Interface] [15:4:00.508] In a timer event called from: [15:4:00.510] data/globalevents/scripts/zombieevent.lua:onTime [15:4:00.514] Description: [15:4:00.517] (LuaInterface::luaDoCreateMonster) Cannot create monster: Zombie Event > Broadcasted message: "A zombie has spawned! There is currently 3 zombies in th e zombie event!". Recebo o broadcast mas o zombie não é spawnado... Aqui ta meu zombieevent.lua Mostrar conteúdo oculto local config = { semana_mes = "semana", days = {1,2,3,4,5,6,7}, -- Dia das semanas que irá acontecer o evento goblet = 5805, -- Troféu que vai pro vencedor do evento rewards = {7440}, -- Recompensas. moneyReward = {9971, 10, 1},-- {moneyId, quantidade, usar}1 pra usar 0 pra não usar} playerCount = 2001, -- Storage dos players que entram e sai do evento zombieCount = 2002, -- Storage do zombie do event teleportActionId = 2008, -- Action ID do teleport teleportPosition = {x = 10160, y = 10054, z = 7, stackpos = 1}, -- Onde o teleport é criado teleportToPosition = {x = 9930, y = 10105, z = 7}, -- Pra onde será teleportado teleportId = 1387, -- ID do teleporte timeToStartEvent = 2, -- Minutos que o portal irá ficar aberto até os player entrarem timeBetweenSpawns = 20, -- Segundos dps do evento ser startado começarem a aparecer os zombie zombieName = "Zombie Event", -- Nome do zombie sumonado playersNeededToStartEvent = 2, -- Players necessários pro evento ser iniciado fromPosition = {x = 9896, y = 10074, z = 7}, -- top de fromPosition até toPosition = {x = 9970, y = 10142, z = 7} -- -- em baixo toPostion } function onTime() local time = os.date("*t") if (config.semana_mes == "semana" and isInArray(config.days,time.wday)) or (config.semana_mes == "mes" and isInArray(config.days,time.day)) or config.semana_mes == "" then local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doItemSetAttribute(tp, "aid", config.teleportActionId) doBroadcastMessage("Zombie event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) setGlobalStorageValue(config.playerCount, 0) setGlobalStorageValue(config.zombieCount, 0) addEvent(startEvent, config.timeToStartEvent * 1000 * 60) end return TRUE end function startEvent() local fromp, top = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("Good luck in the zombie event people! The teleport has closed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z} local m = getTopCreature(areapos).uid if isPlayer(m) then doPlayerSendTextMessage(m, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. config.timeBetweenSpawns .. " seconds! Good luck!") pvgaylord() end end end end else doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. config.playersNeededToStartEvent .. " players is needed!", MESSAGE_STATUS_WARNING) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z} local m = getTopCreature(areapos).uid if isPlayer(m) then doTeleportThing(m, getTownTemplePosition(getPlayerTown(m)), false) doSendMagicEffect(getPlayerPosition(m), CONST_ME_TELEPORT) end end end end end end function spawnZombie() if getGlobalStorageValue(config.playerCount) >= 2 then pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)} doSummonCreature(config.zombieName, pos) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1) doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) else local fromp, top = config.fromPosition, config.toPosition for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z} local cid = getTopCreature(areapos).uid if isPlayer(cid) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) doBroadcastMessage(getCreatureName(cid)..' has survived at zombie event!') for _,items in ipairs(config.rewards) do doPlayerAddItem(cid, items, 1) doPlayerAddItem(cid, 8306, 4) end if config.moneyReward[3] == 1 then doPlayerAddItem(cid, config.moneyReward[1], config.moneyReward[2]) end doBroadcastMessage(getPlayerName(cid) .. " won the Zombie event! Congratulations!", MESSAGE_STATUS_WARNING) local goblet = doPlayerAddItem(cid, config.goblet, 1) doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(cid) .. " for winning the Zombie event.") elseif isMonster(cid) then doRemoveCreature(cid) end end end end end end function pvgaylord() local fromp, top, p, m = config.fromPosition, config.toPosition, 0, 0 for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z} local m = getTopCreature(areapos).uid if isPlayer(m) then p = p+1 elseif isMonster(m) then m = m+1 end end end end if p ~= getGlobalStorageValue(config.playerCount) then setGlobalStorageValue(config.playerCount, p) end if p < 2 then return true end addEvent(pvgaylord,100,nil) end Edit: O zombie era spawnado sim, mas aparecia o erro a cada spawn dele. Troquei o doSummonCreature para doCreateMonster pra ver se o erro saia... Por fim, o erro apareceu apenas uma vez e os zombies foram spawnados... MAS ESSE ERRO NÃO SAI... como isso mds? Mostrar conteúdo oculto [15:19:20.368] [Error - GlobalEvent Interface] [15:19:20.371] In a timer event called from: [15:19:20.373] data/globalevents/scripts/zombieevent.lua:onTime [15:19:20.380] Description: [15:19:20.382] (LuaInterface::luaDoCreateMonster) Cannot create monster: ZombieEvent Esse erro apareceu apenas uma vez com essa função doCreateMonster(config.zombieName, pos) Editado Fevereiro 11, 2017 8 anos por Sekk (veja o histórico de edições) GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
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.