Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Boa tarde, bom eu configurei o zombie event perfeitamente no meu servidor, só que quando o ultimo sobrevivente é kickado da arena ele recebe o premio mas o evento não termina continua nascendo monstros lá na arena e também não aparece a mensagem do vencedor e quanto tempo durou o evento, meu distro é o 0.4 uso o mesmo script em outro servidor com o mesmo distro e funciona normalmente, script onattack:

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
			local reward = {
				[11487] = "War Boots",
				[11481] = "War Shuriken",
			}
			local rand = {}
			for itemid, _ in pairs(reward) do
				table.insert(rand, itemid)
			end
			rand = rand[math.random(#rand)]
			doPlayerAddItem(cid, rand)
			doPlayerAddItem(winner, 11192, 500, 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

Erro na distro quando o ultimo jogador vence e é teleportado para o templo:

tfgYgwC.png

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

x1fCxnI.png

Link para o post
Compartilhar em outros sites

Ele não está reconhecendo a função loseOnZombieArena(target)

Vcta usando algum zombie event do forum? Se sim qual..

se n...

Poste o arquivo lua da pasta lib (do zombie event)

Link para o post
Compartilhar em outros sites
-- CONFIG
ZE_DEFAULT_NUMBER_OF_PLAYERS = 50
ZE_ACCESS_TO_IGNORE_ARENA = 4
-- POSITIONS
ZE_blockEnterItemPosition = {x= 1012, y=890, z=7}
ZE_enterPosition = {x = 1492, y = 1550, z = 7}
ZE_kickPosition = {x=1026, y=910, z=7}
ZE_spawnFromPosition = {x = 1465, y = 1534, z = 7}
ZE_spawnToPosition = {x = 1521, y = 1567, z = 7}
-- ITEM IDS
ZE_blockEnterItemID = 1536
-- 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[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)) == 'number')
if(ret) then
  addZombiesCount()
end
return ret
end

x1fCxnI.png

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:
  • Estatísticas dos Fóruns

    96846
    Tópicos
    519599
    Posts
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo