jvcasarin 56 Postado Dezembro 8, 2015 Share Postado Dezembro 8, 2015 Bom galera, direto ao assunto, segui um tópico no OTLand(aqui) para adicionar o evento Zombie Event no meu server. Tudo certo até os players entrarem no mapa do zombie, mas ai começa uns bugs no console: [22:11:19.907] [Error - GlobalEvent Interface] [22:11:19.910] data/globalevents/scripts/zombie/onthink.lua:onThink [22:11:19.911] Description: [22:11:19.912] data/lib/zombie_event.lua:123: attempt to index local 'pir' (a number value) [22:11:19.913] stack traceback: [22:11:19.913] data/lib/zombie_event.lua:123: in function 'spawnNewZombie' [22:11:19.914] data/globalevents/scripts/zombie/onthink.lua:6: in function <data/globalevents/scripts/zombie/onthink.lua:1> [22:11:19.915] [Error - GlobalEvents::think] Couldn't execute event: ZombieGlobalThink Ai vai o meu lib/zombie_event.lua -- CONFIG ZE_DEFAULT_NUMBER_OF_PLAYERS = 5 ZE_ACCESS_TO_IGNORE_ARENA = 3 -- POSITIONS ZE_blockEnterItemPosition = {x= 10166, y=10045, z=5} ZE_enterPosition = {x = 9930, y = 10105, z = 7} ZE_kickPosition = {x=10160, y=10054, z=7} ZE_spawnFromPosition = {x = 9896, y = 10074, z = 7} ZE_spawnToPosition = {x = 9970, y = 10142, z = 7} -- ITEM IDS ZE_blockEnterItemID = 1591 -- STORAGES -- - player ZE_isOnZombieArea = 34370 -- - global ZE_STATUS = 34370 -- =< 0 - off, 1 - waiting for players, 2 - is running ZE_PLAYERS_NUMBER = 34371 ZE_ZOMBIES_TO_SPAWN = 34372 ZE_ZOMBIES_SPAWNED = 34373 -- FUNCTION function setZombiesEventPlayersLimit(value) doSetStorage(ZE_PLAYERS_NUMBER, value) end function getZombiesEventPlayersLimit() return getStorage(ZE_PLAYERS_NUMBER) end function addPlayerToZombiesArea(cid) doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT) doTeleportThing(cid, ZE_enterPosition, true) doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT) if(getPlayerAccess(cid) < ZE_ACCESS_TO_IGNORE_ARENA) then setPlayerZombiesEventStatus(cid, os.time()) end end function kickPlayerFromZombiesArea(cid) doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT) doTeleportThing(cid, ZE_kickPosition, true) doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT) setPlayerZombiesEventStatus(cid, 0) end function getPlayerZombiesEventStatus(cid) return getCreatureStorage(cid, ZE_isOnZombieArea) end function setPlayerZombiesEventStatus(cid, value) doCreatureSetStorage(cid, ZE_isOnZombieArea, value) end function getZombiesEventPlayers() local players = {} for i, cid in pairs(getPlayersOnline()) do if(getPlayerZombiesEventStatus(cid) > 0) then table.insert(players, cid) end end return players end function getZombiesCount() return getStorage(ZE_ZOMBIES_SPAWNED) end function addZombiesCount() doSetStorage(ZE_ZOMBIES_SPAWNED, getStorage(ZE_ZOMBIES_SPAWNED)+1) end function resetZombiesCount() doSetStorage(ZE_ZOMBIES_SPAWNED, 0) end function getZombiesToSpawnCount() return getStorage(ZE_ZOMBIES_TO_SPAWN) end function setZombiesToSpawnCount(count) doSetStorage(ZE_ZOMBIES_TO_SPAWN, count) end function addZombiesEventBlockEnterPosition() if(getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID).uid == 0) then doCreateItem(ZE_blockEnterItemID, 1, ZE_blockEnterItemPosition) end end function removeZombiesEventBlockEnterPosition() local item = getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID) if(item.uid ~= 0) then doRemoveItem(item.uid) end end function spawnNewZombie() local posx = {} local posy = {} local posz = {} local pir = {} for i=1, 5 do local posx_tmp = math.random(ZE_spawnFromPosition.x ,ZE_spawnToPosition.x) local posy_tmp = math.random(ZE_spawnFromPosition.y ,ZE_spawnToPosition.y) local posz_tmp = math.random(ZE_spawnFromPosition.z ,ZE_spawnToPosition.z) local pir_tmp = 0 local spec = getSpectators({x=posx_tmp, y=posy_tmp, z=posz_tmp}, 3, 3, false) if(spec and #spec > 0) then for z, pid in pairs(spec) do if(isPlayer(pid)) then pir_tmp = pir_tmp + 1 end end end posx = posx_tmp posy = posy_tmp posz = posz_tmp pir = pir_tmp end local lowest_i = 1 for i=2, 5 do if(pir < pir[lowest_i]) then lowest_i = i end end local ret = (type(doCreateMonster("Zombie Event", {x=posx[lowest_i], y=posy[lowest_i], z=posz[lowest_i]}, false)) == 'number') if(ret) then addZombiesCount() end return ret end globalevents/scripts/zombie/onthink.lua function onThink(interval, lastExecution, thinkInterval) if(getStorage(ZE_STATUS) == 2) then setZombiesToSpawnCount(getZombiesToSpawnCount()+1) local players = getZombiesEventPlayers() for i=1, getZombiesToSpawnCount() * 2 do if(getZombiesToSpawnCount() > 0 and spawnNewZombie()) then setZombiesToSpawnCount(getZombiesToSpawnCount()-1) end end end return true end POR FAVOR, ME AJUDEM!! Quero muito esse evento, e nenhum outro na internet funcionou comigo... NENHUM! Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/ Compartilhar em outros sites More sharing options...
0 Diretor Yan Liima 578 Postado Dezembro 9, 2015 Diretor Share Postado Dezembro 9, 2015 Tente esse: function loseOnZombieArena(cid) kickPlayerFromZombiesArea(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce perdeu.") local players = getZombiesEventPlayers() if(#players <= 1) then local winner = players[1] if(winner) then doPlayerAddItem(winner, 2157, 5, true) doPlayerAddItem(winner, 6119, 1, true) doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ganhou o Zombie Event.") doBroadcastMessage("Depois de " .. os.time() - getPlayerZombiesEventStatus(winner) .. " segundos, o jogador " .. getCreatureName(winner) .. " ganhou o Zombie Arena Event com " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zumbis!") kickPlayerFromZombiesArea(winner) else doBroadcastMessage("O evento acabou, infelizmente ninguém ganhou!") end doSetStorage(ZE_STATUS, 0) doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS) doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0) doSetStorage(ZE_ZOMBIES_SPAWNED, 0) local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1 local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1 local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z} for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do centerPos.z = z for i, uid in pairs(getSpectators(centerPos, width, height, false)) do if(isMonster(uid)) then doRemoveCreature(uid) end end end end end function onStatsChange(target, cid, changetype, combat, value) if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then doCreatureAddHealth(target, getCreatureMaxHealth(target)) loseOnZombieArena(target) return false end return true end Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1677820 Compartilhar em outros sites More sharing options...
0 Diretor Yan Liima 578 Postado Dezembro 8, 2015 Diretor Share Postado Dezembro 8, 2015 (editado) @ Não vi erro na script. Tente criar um outro arquivo.lua e coloca os codigos neles. Talvez seja um probleminha no arquivo, as vezes acontece. O evento funciona normal? Talvez esteja faltando arquivos do evento em outras pastas. creaturescripts globalevents lib movements talkactions. Editado Dezembro 8, 2015 por nedroesdoksdja Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1677731 Compartilhar em outros sites More sharing options...
0 Caronte 446 Postado Dezembro 8, 2015 Share Postado Dezembro 8, 2015 Mude a última função (spawnNewZombie) sua da linha 98 para baixo. Coloque isto: function spawnNewZombie() local posx = {} local posy = {} local posz = {} local pir = {} for i=1, 5 do local posx_tmp = math.random(ZE_spawnFromPosition.x ,ZE_spawnToPosition.x) local posy_tmp = math.random(ZE_spawnFromPosition.y ,ZE_spawnToPosition.y) local posz_tmp = math.random(ZE_spawnFromPosition.z ,ZE_spawnToPosition.z) local pir_tmp = 0 local spec = getSpectators({x=posx_tmp, y=posy_tmp, z=posz_tmp}, 3, 3, false) if(spec and #spec > 0) then for z, pid in pairs(spec) do if(isPlayer(pid)) then pir_tmp = pir_tmp + 1 end end end posx[i] = posx_tmp posy[i] = posy_tmp posz[i] = posz_tmp pir[i] = pir_tmp end local lowest_i = 1 for i=2, 5 do if(pir[i] < pir[lowest_i]) then lowest_i = i end end local ret = (type(doCreateMonster("Zombie Event", {x=posx[lowest_i], y=posy[lowest_i], z=posz[lowest_i]}, false, false, false)) == 'number') if(ret) then addZombiesCount() end return ret end Não vi erro na script. Tente criar um outro arquivo.lua e coloca os codigos neles. Talvez seja um probleminha no arquivo, as vezes acontece. Já tenho uns 7 anos de tibia, e nunca deu isso em um otserver meu. verifique se você tá colocando o nome certo. Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1677733 Compartilhar em outros sites More sharing options...
0 Spring Trap 2 Postado Dezembro 8, 2015 Share Postado Dezembro 8, 2015 Tava com um problema parecido com esse fiz o que o Yan Lima disse e funcionou Já tenho uns 7 anos de tibia, e nunca deu isso em um otserver meu. verifique se você tá colocando o nome certo. para um pessoa que tem 7 anos de tibia. ta faltando aprender mais coisas. Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1677777 Compartilhar em outros sites More sharing options...
0 Caronte 446 Postado Dezembro 9, 2015 Share Postado Dezembro 9, 2015 (editado) Tava com um problema parecido com esse fiz o que o Yan Lima disse e funcionou para um pessoa que tem 7 anos de tibia. ta faltando aprender mais coisas. É né que coisa.O problema nem tem haver com o TFS 0.4, que dá erro na função... Que os gringos até postaram na página seguinte. Editado Dezembro 9, 2015 por Caronte Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1677802 Compartilhar em outros sites More sharing options...
0 jvcasarin 56 Postado Dezembro 9, 2015 Autor Share Postado Dezembro 9, 2015 Postaram resolução? por que eu fui pegando os scripts UPDATED que postavam la! Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1677805 Compartilhar em outros sites More sharing options...
0 Caronte 446 Postado Dezembro 9, 2015 Share Postado Dezembro 9, 2015 Postaram resolução? por que eu fui pegando os scripts UPDATED que postavam la! Veja a segunda página lá, e siga o meu post, é só alterar a última função... O gringo postou a correção para TFS_0.4 Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1677808 Compartilhar em outros sites More sharing options...
0 jvcasarin 56 Postado Dezembro 9, 2015 Autor Share Postado Dezembro 9, 2015 Substitui a sua parte ali, mas olha: O zombie spawnou, mas quando ele chegou em uma distancia de uns 2 sqm do player, o player morreu, acabou o evento, o outro venceu e apareceram esses erros no distrô: [23:1:39.460] [Error - CreatureScript Interface] [23:1:39.460] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange [23:1:39.460] Description: [23:1:39.460] data/lib/032-position.lua:2: attempt to index global 'position' (a nil value) [23:1:39.460] stack traceback: [23:1:39.460] data/lib/032-position.lua:2: in function 'isInRange' [23:1:39.460] data/creaturescripts/scripts/zombie/onattack.lua:35: in function <data/creaturescripts/scripts/zombie/onattack.lua:34> [23:1:39.460] [C]: in function 'doCreatureAddHealth' [23:1:39.460] data/creaturescripts/scripts/zombie/onattack.lua:36: in function <data/creaturescripts/scripts/zombie/onattack.lua:34> onattack.lua function loseOnZombieArena(cid) kickPlayerFromZombiesArea(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "BOOM! You are dead.") local players = getZombiesEventPlayers() if(#players <= 1) then local winner = players[1] if(winner) then doPlayerAddItem(winner, 2157, 5, true) doPlayerAddItem(winner, 6119, 1, true) doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You won zombies arena event.") doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " seconds of fight " .. getCreatureName(winner) .. " won Zombie Arena Event in game versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zombies!") kickPlayerFromZombiesArea(winner) else doBroadcastMessage("Zombie arena event finished! No one win?!?!?! WTF!") end doSetStorage(ZE_STATUS, 0) doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS) doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0) doSetStorage(ZE_ZOMBIES_SPAWNED, 0) local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1 local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1 local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z} for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do centerPos.z = z for i, uid in pairs(getSpectators(centerPos, width, height, false)) do if(isMonster(uid)) then doRemoveCreature(uid) end end end end end function onStatsChange(target, cid, changetype, combat, value) if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then doCreatureAddHealth(target, getCreatureMaxHealth(target)) loseOnZombieArena(target) return false end return true end 032-position.lua function isInRange(pos, fromPosition, toPosition) return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z) end function getDistanceBetween(firstPosition, secondPosition) local x, y = math.abs(firstPosition.x - secondPosition.x), math.abs(firstPosition.y - secondPosition.y) local diff = math.max(x, y) if(firstPosition.z ~= secondPosition.z) then diff = diff + 9 + 6 end return diff end function getDirectionTo(pos1, pos2) local dir = NORTH if(pos1.x > pos2.x) then dir = WEST if(pos1.y > pos2.y) then dir = NORTHWEST elseif(pos1.y < pos2.y) then dir = SOUTHWEST end elseif(pos1.x < pos2.x) then dir = EAST if(pos1.y > pos2.y) then dir = NORTHEAST elseif(pos1.y < pos2.y) then dir = SOUTHEAST end else if(pos1.y > pos2.y) then dir = NORTH elseif(pos1.y < pos2.y) then dir = SOUTH end end return dir end function getCreatureLookPosition(cid) return getPosByDir(getThingPos(cid), getCreatureLookDirection(cid)) end function getPosByDir(fromPosition, direction, size) local n = size or 1 local pos = fromPosition if(direction == NORTH) then pos.y = pos.y - n elseif(direction == SOUTH) then pos.y = pos.y + n elseif(direction == WEST) then pos.x = pos.x - n elseif(direction == EAST) then pos.x = pos.x + n elseif(direction == NORTHWEST) then pos.y = pos.y - n pos.x = pos.x - n elseif(direction == NORTHEAST) then pos.y = pos.y - n pos.x = pos.x + n elseif(direction == SOUTHWEST) then pos.y = pos.y + n pos.x = pos.x - n elseif(direction == SOUTHEAST) then pos.y = pos.y + n pos.x = pos.x + n end return pos end function doComparePositions(pos, posEx) return pos.x == posEx.x and pos.y == posEx.y and pos.z == posEx.z end function getArea(pos, rangeX, rangeY) local t = {} for i = (pos.x - rangeX), (pos.x + rangeX) do for j = (pos.y - rangeY), (pos.y + rangeY) do table.insert(t, {x = i, y = j, z = pos.z}) end end return t end Ajuda eu? kkkkk Obs.: O post la dos gringos, é referente à: doCreateMonster(name, pos, false, false, false) Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1677811 Compartilhar em outros sites More sharing options...
0 Diretor Yan Liima 578 Postado Dezembro 9, 2015 Diretor Share Postado Dezembro 9, 2015 (editado) vai em creaturescripts\scripts\zombie\onattack e substitua tudo por isso: function loseOnZombieArena(cid) kickPlayerFromZombiesArea(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce perdeu.") local players = getZombiesEventPlayers() if(#players <= 1) then local winner = players[1] if(winner) then doPlayerAddItem(winner, 2157, 5, true) doPlayerAddItem(winner, 6119, 1, true) doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ganhou o Zombie Event.") doBroadcastMessage("Depois de " .. os.time() - getPlayerZombiesEventStatus(winner) .. " segundos, o jogador " .. getCreatureName(winner) .. " ganhou o Zombie Arena Event com " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zumbis!") kickPlayerFromZombiesArea(winner) else doBroadcastMessage("O evento acabou, infelizmente ninguém ganhou!") end doSetStorage(ZE_STATUS, 0) doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS) doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0) doSetStorage(ZE_ZOMBIES_SPAWNED, 0) local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1 local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1 local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z} for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do centerPos.z = z for i, uid in pairs(getSpectators(centerPos, width, height, false)) do if(isMonster(uid)) then doRemoveCreature(uid) end end end end end function onStatsChange(target, cid, changetype, combat, value) if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then doCreatureAddHealth(target, getCreatureMaxHealth(target)) loseOnZombieArena(target) return false end return true end Depois vai em lib\032-position.lua e substitue por: function isInRange(position, fromPosition, toPosition) return (position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z) end function getDistanceBetween(fromPosition, toPosition) local x, y = math.abs(fromPosition.x - toPosition.x), math.abs(fromPosition.y - toPosition.y) local diff = math.max(x, y) if(fromPosition.z ~= toPosition.z) then diff = diff + 9 + 6 end return diff end function getDirectionTo(pos1, pos2) local dir = NORTH if(pos1.x > pos2.x) then dir = WEST if(pos1.y > pos2.y) then dir = NORTHWEST elseif(pos1.y < pos2.y) then dir = SOUTHWEST end elseif(pos1.x < pos2.x) then dir = EAST if(pos1.y > pos2.y) then dir = NORTHEAST elseif(pos1.y < pos2.y) then dir = SOUTHEAST end else if(pos1.y > pos2.y) then dir = NORTH elseif(pos1.y < pos2.y) then dir = SOUTH end end return dir end function getCreatureLookPosition(cid) return getPosByDir(getThingPos(cid), getCreatureLookDirection(cid)) end function getPositionByDirection(position, direction, size) local n = size or 1 if(direction == NORTH) then position.y = position.y - n elseif(direction == SOUTH) then position.y = position.y + n elseif(direction == WEST) then position.x = position.x - n elseif(direction == EAST) then position.x = position.x + n elseif(direction == NORTHWEST) then position.y = position.y - n position.x = position.x - n elseif(direction == NORTHEAST) then position.y = position.y - n position.x = position.x + n elseif(direction == SOUTHWEST) then position.y = position.y + n position.x = position.x - n elseif(direction == SOUTHEAST) then position.y = position.y + n position.x = position.x + n end return position end function doComparePositions(position, positionEx) return position.x == positionEx.x and position.y == positionEx.y and position.z == positionEx.z end function getArea(position, x, y) local t = {} for i = (position.x - x), (position.x + x) do for j = (position.y - y), (position.y + y) do table.insert(t, {x = i, y = j, z = position.z}) end end return t end Editado Dezembro 9, 2015 por nedroesdoksdja Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1677818 Compartilhar em outros sites More sharing options...
0 jvcasarin 56 Postado Dezembro 9, 2015 Autor Share Postado Dezembro 9, 2015 O erro de position sumiu, mas agora, "funciona", mas assim, o player morre, e o outro vence, blz, ai aparece esse erro no distro: [0:16:18.071] ADM Hero has logged in. [0:16:25.849] Akziel has logged in. [0:16:44.058] Sekk has logged in. > ADM Hero broadcasted message: "Zombie Arena Event teleport is opened. We are w aiting for 2 players to start.". [0:17:23.302] ADM Hero has logged out. > Broadcasted message: "Akziel has entered a Zombie Arena. We still need 1 playe rs.". > Broadcasted message: "Zombie Arena Event started.". [0:18:16.858] [Error - CreatureScript Interface] [0:18:16.858] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange [0:18:16.858] Description: [0:18:16.859] (luaDoPlayerAddItem) Item not found [0:18:16.859] [Error - CreatureScript Interface] [0:18:16.860] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange [0:18:16.863] Description: [0:18:16.863] (luaDoPlayerAddItem) Item not found > Broadcasted message: "Depois de 44 segundos, o jogador Sekk ganhou o Zombie Arena Event com 9 zumbis!". [0:18:42.019] Sekk has logged out. [0:18:46.169] Akziel has logged out. [0:18:48.334] ADM Hero has logged in. [0:18:50.050] > Saving server... [0:18:50.508] > SAVE: Complete in 0.457 seconds using relational house storage. [0:18:51.901] ADM Hero has logged out. VERMELHO -- ocorreu apenas quando o player morreu e o outro venceu. Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1677819 Compartilhar em outros sites More sharing options...
0 jvcasarin 56 Postado Dezembro 9, 2015 Autor Share Postado Dezembro 9, 2015 RESOLVIDO! REP+ PARA OS DOIS!!! VLWW Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1677822 Compartilhar em outros sites More sharing options...
0 Lumus 254 Postado Dezembro 21, 2015 Share Postado Dezembro 21, 2015 Tópico Movido Este tópico foi movido de "OTServ → Suporte OTServ → Suporte Scripting" para "OTServ → Suporte OTServ → Suporte Scripting → Pedidos e dúvidas resolvidos - Scripting". Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1678626 Compartilhar em outros sites More sharing options...
0 kleytonhigor 1 Postado Julho 3, 2016 Share Postado Julho 3, 2016 Em 08/12/2015 at 23:20, Yan Liima disse: vai em creaturescripts\scripts\zombie\onattack e substitua tudo por isso: function loseOnZombieArena(cid) kickPlayerFromZombiesArea(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce perdeu.") local players = getZombiesEventPlayers() if(#players <= 1) then local winner = players[1] if(winner) then doPlayerAddItem(winner, 2157, 5, true) doPlayerAddItem(winner, 6119, 1, true) doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ganhou o Zombie Event.") doBroadcastMessage("Depois de " .. os.time() - getPlayerZombiesEventStatus(winner) .. " segundos, o jogador " .. getCreatureName(winner) .. " ganhou o Zombie Arena Event com " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " zumbis!") kickPlayerFromZombiesArea(winner) else doBroadcastMessage("O evento acabou, infelizmente ninguém ganhou!") end doSetStorage(ZE_STATUS, 0) doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS) doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0) doSetStorage(ZE_ZOMBIES_SPAWNED, 0) local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1 local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1 local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z} for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do centerPos.z = z for i, uid in pairs(getSpectators(centerPos, width, height, false)) do if(isMonster(uid)) then doRemoveCreature(uid) end end end endendfunction onStatsChange(target, cid, changetype, combat, value) if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then doCreatureAddHealth(target, getCreatureMaxHealth(target)) loseOnZombieArena(target) return false end return trueend Vlwwww!!!!! Ajudo De ++++++++ Rep++ Link para o comentário https://xtibia.com/forum/topic/238232-problema-com-zombie-event/#findComment-1698480 Compartilhar em outros sites More sharing options...
Pergunta
jvcasarin 56
Bom galera, direto ao assunto, segui um tópico no OTLand(aqui) para adicionar o evento Zombie Event no meu server.
Tudo certo até os players entrarem no mapa do zombie, mas ai começa uns bugs no console:
Ai vai o meu lib/zombie_event.lua
Link para o comentário
https://xtibia.com/forum/topic/238232-problema-com-zombie-event/Compartilhar em outros sites
13 respostass a esta questão
Posts Recomendados