Ir para conteúdo
  • Cadastre-se

Normal Problema Defend The King Event


Posts Recomendados

Pessoal, implantei o evento Defend The king no meu server está tudo certo, porém na hora que é destruído o Gate aparece o seguinte erro:

 

blob.png.1e316005278f5ab6a93474430895ff30.png

 

Não tenho nem noção de onde está vindo este erro :/

 

Alguém tem noção?

Link para o post
Compartilhar em outros sites
1 hora atrás, Everson Miranda disse:

@crk provavelmente é em creature script posta ai o seu creature script

death_gate.lua

Spoiler

dofile("config-dtk.lua")

function onDeath(cid, corpse, deathList)
                
for i,v in pairs(getPositionsWithFloor(position_gate,floor))  do
    local fence = getThingFromId(gate_id,v)
    if fence ~= FALSE then
       doRemoveItem(fence.uid) 
    end
end        
doSendMessageForAll(MESSAGE_STATUS_WARNING,"The gate was destroyed!")
return TRUE
end

 

death_king.lua

Spoiler

dofile("config-dtk.lua")
function onKill(cid, target, lastHit)
if getCreatureName(target):lower() == "the king" and getPlayerGroup(cid) == "attacker" then
   doSendMessageForAll(14,"The king was killed by ".. getCreatureName(cid))
   for _,name in pairs(getDefendPlayersAttacker()) do
             doPlayerSendTextMessage(getCreatureByName(name),MESSAGE_STATUS_CONSOLE_ORANGE,"Congratulations Attackers, you are the winner of Defend the King!")
   end
   for _,name in pairs(getDefendPlayersDefender()) do
             doPlayerSendTextMessage(getCreatureByName(name),MESSAGE_STATUS_CONSOLE_ORANGE,"You Lost the event Defend The King!")
   end
   for _,info in pairs(getDefendPlayersInEvent()) do
       if isPlayerOnline(info.name) then
          local pid = getCreatureByName(info.name)
          doTeleportThing(pid,getTownTemplePosition(getPlayerTown(pid)))
          if getPlayerGroup(pid) == "attacker" then
             premio = doPlayerAddItem(pid,premios[math.random(1,#premios)])
             doPlayerSendTextMessage(pid,MESSAGE_EVENT_DEFAULT,"You gain 1 ".. getItemName(premio).."")
          end
       end                
   end
   setGlobalStorageValue(controle_king_death,1)
   doCancelEvent(all_storage,tp_pos,position_gate,position_gate_main,gate_id)
end
return TRUE
end

 

king-combat.lua

Spoiler

dofile("config-dtk.lua")
voices = {"Oh god.","o.O help help help","I'll deeead!","HELP","Heeelp","Heeeeeelp me pleeeease"}

function onCombat(cid, target)
if getCreatureName(target):lower() == "the king" then 
   if getPlayerGroup(cid) == "defender" then 
      if getEscolhido():lower() == getCreatureName(cid):lower() then
         if getGlobalStorageValue(controle_walk_king) == -1 then
            doChangeSpeed(target, -getCreatureSpeed(target))
            setGlobalStorageValue(controle_walk_king,1)
            doCreatureSay(cid, "Stop here my Lord!", 1)
            doCreatureSay(target, "ok", 1)
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,"The king is stop.")
         else
            doChangeSpeed(target,getCreatureBaseSpeed(target))
            setGlobalStorageValue(controle_walk_king,-1)
            doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,"The king is following you.")
            doCreatureSay(cid, "Follow me my Lord!", 1)
            doCreatureSay(target, "All right!", 1)
         end
      end
      return FALSE
   else
      if getGlobalStorageValue(controle_voice) == -1 then
         doCreatureSay(target, voices[math.random(1,#voices)], 1)
         for _,name in pairs(getDefendPlayersDefender()) do
             doPlayerSendTextMessage(getCreatureByName(name),MESSAGE_INFO_DESCR,"Your king is under attack. Defend him.")
         end
         setGlobalStorageValue(controle_voice,1)
         addEvent(reset,6000,controle_voice) 
      end
      return TRUE
   end
else
return TRUE
end
end

function reset(storage_global)
setGlobalStorageValue(storage_global,-1)
end

 

player_death.lua

Spoiler

dofile("config-dtk.lua")
function onPrepareDeath(cid, deathList)
         if getPlayerStorageValue(cid,death_times) == -1 then setPlayerStorageValue(cid,death_times,1) end
         local delay = 0
         local times = 5*getPlayerStorageValue(cid,death_times)
         doCreatureSetNoMove(cid,TRUE)
         setPlayerStorageValue(cid,controle_in_delay,1)
         for i=times,0,-1 do
                addEvent(doMessageWithCheck,delay,cid,MESSAGE_STATUS_CONSOLE_ORANGE,"Respawn to back: "..i)
                delay = 2000 + delay                 
                if i == 0 then
                   addEvent(doMovePlayer,delay+1000,cid)
                end
         end
         
return TRUE
end

function onDeath(cid, deathList)
doConvinceCreature(getGlobalStorageValue(controle_convince_pid),cid)
return TRUE
end

function doMessageWithCheck(cid,type,msg)
if isPlayerOnline(getCreatureName(cid)) and getGlobalStorageValue(controle_atived) ~= -1 then
   doPlayerSendTextMessage(cid,type,msg)
else
    stopEvent(doMessageWithCheck)
end
return TRUE
end

function doMovePlayer(cid)
         if isPlayerOnline(getCreatureName(cid)) and getGlobalStorageValue(controle_atived) ~= -1 then 
               doCreatureSetNoMove(cid, FALSE)
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Go Go GO!")
               setPlayerStorageValue(cid,death_times,getPlayerStorageValue(cid,death_times)+1)
               setPlayerStorageValue(cid,controle_in_delay,-1)
         end
end

 

player-combat.lua

Spoiler

function onCombat(cid, target)
if isPlayer(cid) then
   if getPlayerGroup(cid) ~= getPlayerGroup(target) and getGlobalStorageValue(controle_round) == 1 then
      return TRUE
   else
       return FALSE
   end
end
end

 

sincronia.lua

Spoiler

dofile("config-dtk.lua")
function onThink(pid, interval)
    if isCreature(pid) then
       cid = getCreatureMaster(pid)       -- Player que sumonou
       pos = getCreaturePosition(cid)     -- Posiçao do player que sumonou
       pos_summon = getCreaturePosition(pid)          
       if pos.z ~= pos_summon.z and getGlobalStorageValue(controle_walk_king) == -1 then
          doTeleportThing(pid,pos)
          doSendMagicEffect(pos,2)
          doSendMagicEffect(pos_summon,2)
       end
    end
return TRUE
end

-- 36 animated efeito

 

Link para o post
Compartilhar em outros sites

@crk os scripts estao perfeitos, o problema deve ser dentro da pasta lib.. posta seu arquivo 000-constant

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:
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo