Ir para conteúdo

Featured Replies

Postado

Nao sei tbm =(

Ajudei? da um Rep+, não custa nada. ;D:P

 

Servidor de PokeTibia ja online.

Pagina: https://www.facebook.com/PokemonxStore?ref=bookmarks

Grupo: https://www.facebook.com/groups/257989224406246/

Site: http://pokexstore.wix.com/pokexstore

  • Respostas 60
  • Visualizações 4.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • funcionando 100% em tfs 0.4 muito bom recomendo!

  • Estava como "UNSI" salvei como "UTF-8", baixa ai.   http://www.mediafire.com/view/4bq19prdn4qcrqk/eventoarena.xml

  • Que isso, qual quer outro erro poste-o. Caso eu demorar pra responder espere pois estou fora do fórum.

Postado

<?xml version="1.0" encoding="UTF-8"?>


<mod name="Arena" version="1.0" author="Murilo" contact="Tibiaking" enabled="yes">
<config name="arena_config"><![CDATA[
  config = {
   delay = 1,
   posicaoPlayer = {x = 966,y = 924,z = 13},
   posicaoArena = {{x = 957,y = 915,z = 13},{x = 977,y = 935,z = 13}},
   premio = {
   {2160,100},
   },
   storage = 15444, -- não mecha..
   posicaoTp = {x = 1041, y = 1076, z = 6}, -- posição que o teleport aparecera
   acesso = 5, -- acesso  minimo para ser ignorado pelo evento, e o mesmo acesso para poder inicializa-lo
  }
  leveis = {
  [1] = {{"Ancient Alakazam",60},{"Elder Electabuzz",60}},
  [2] = {{"Elder Gengar",70},{"Elder Jynx",70}},
  [3] = {{"Elder Tangela",80},{"Enigmatic Girafarig",80}},
  [4] = {{"Evil Cloyster",90},{"Gordo Snorlax",90}},
  [5] = {{"Magnet Electabuzz",100},{"Bixo Papao",1}},
  }
 
   function abrirTeleport(n)
        doItemSetAttribute(doCreateItem(1387, config.posicaoTp), "aid", 2941)
        doBroadcastMessage("[unicos Sobrevivente] Foi aberto faltam ".. n .. " players para o evento começar.")
        doSetStorage(config.storage, n)
   end
 
   function fecharTPeAguardarEvento()
        doRemoveItem(getTileItemById(config.posicaoTp, 1387).uid,100)
        doBroadcastMessage("[unicos Sobrevivente] Já concluio " .. #getPlayersInArena() .. " players e começará em " .. config.delay .. " minutos!")
        addEvent(evento,config.delay*60*1000,1)
   end
 
 
   function HaveCreatureArena(area, remove, clean)
                        for x = area[1].x - 1, area[2].x + 1 do
                                for y = area[1].y - 1, area[2].y + 1 do
                                        local pos = {x=x, y=y, z=area[1].z}
                                        local m = getTopCreature(pos).uid
                                        if remove ~= false and m ~= 0 and isMonster(m) then doRemoveCreature(m) end
                                        if clean ~= false then doCleanTile(pos, false) end
                                end
   end
   end
   function resetEvento()
        doSetStorage(config.storage, -1)
   end
 
   function criarMonstros(lv)
        local monstro = leveis[lv]
        local area = {config.posicaoArena[1],config.posicaoArena[2]}
        for i = 1,#monstro do
         for k=1,monstro[2]do
                pos = {x=math.random(area[1].x,area[2].x), y=math.random(area[1].y,area[2].y), z=area[1].z}
          monstrinho = doCreateMonster(monstro[1], pos)
         end
        end
   end
 
   function evento(i)
        if #getPlayersInArena() == 0 then
         doBroadcastMessage("[unicos Sobrevivente] Ninguém sobreviveu, Evento finalizado.")
         HaveCreatureArena({config.posicaoArena[1],config.posicaoArena[2]}, true, true)
         resetEvento()
         return true
        end
 
        if i == (#leveis +1) then
        HaveCreatureArena({config.posicaoArena[1],config.posicaoArena[2]}, true, true)
          doBroadcastMessage("[unicos Sobrevivente] Apenas " .. #getPlayersInArena() .. " ficaram vivos no evento. ")
         for _, pid in ipairs(getPlayersInArena()) do
          doPlayerSendTextMessage(pid,22,"[unicos Sobrevivente] Parabéns você ficou vivo.")
          addItens(pid)
          doTeleportThing(pid,getTownTemplePosition(getPlayerTown(pid)))
         end
          resetEvento()
          return true
        end
         for _, pid  in ipairs(getPlayersInArena()) do
        doBroadcastMessage("[unicos Sobrevivente] Está na " .. i .. " wave está começando ficar mais dificil.")
         end
        criarMonstros(i)
        addEvent(evento,config.delay*60*1000,i+1)
   end
   function addItens(pid)
        for i=1,#config.premio do
         doPlayerAddItem(pid,config.premio[1],config.premio[2])
        end
        doPlayerSendTextMessage(pid,22,"[unicos Sobrevivente], Parabéns você ganhou e recebeu seu premio.")
   end
 
   function getPlayersInArena()
   local t = {}
        for _, pid in pairs(getPlayersOnline()) do
         if getPlayerAccess(pid) < config.acesso then
         if isInRange(getCreaturePosition(pid), config.posicaoArena[1], config.posicaoArena[2]) then
                                                table.insert(t, pid)
         end
         end
        end
   return t
   end
 
]]></config>
<talkaction words="/eventoarena" event="buffer"><![CDATA[
  domodlib('arena_config')
  if getPlayerAccess(cid) < config.acesso then
   return doPlayerSendCancel(cid,"Apenas admistradores tem acesso ao evento.")
  end
  if tonumber(param) ~= nil then
   if tonumber(param) > 0 then
        doSetStorage(config.storage, param)
        abrirTeleport(param)
   end
  else
  doPlayerSendTextMessage(cid,19,"Digite /eventoarena e um numero, Dependendo do numero será jogador se falar /eventoarena 5 apenas 5 jogadores poderão participar.")
  end

]]></talkaction>
<movevent type="StepIn" actionid="2941" event="script"><![CDATA[
                domodlib('arena_config')
                        
        if getPlayerAccess(cid) > config.acesso then
        doTeleportThing(cid, config.posicaoPlayer)
        return false
        end
        doSetStorage(config.storage,getStorage(config.storage) - 1)
        doTeleportThing(cid, config.posicaoPlayer)
        registerCreatureEvent(cid, "naoAtacarPlayer")
        registerCreatureEvent(cid, "morrerNaArena")
        if getStorage(config.storage) <= 0 then
        fecharTPeAguardarEvento()
        end
        return true
     
]]></movevent>
<event type="login" name="VerSeTaNaArenaEExpulsa" event="script"><![CDATA[
domodlib('arena_config')
if isInRange(getCreaturePosition(cid), config.posicaoArena[1], config.posicaoArena[2]) then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end
return true

]]></event>
<event type="combat" name="naoAtacarPlayer" event="script"><![CDATA[
                                 domodlib('arena_config')
                                 if isPlayer(cid) and isPlayer(target) then
                                           if isInRange(getPlayerPosition(cid), config.posicaoArena[1], config.posicaoArena[2]) and isInRange(getPlayerPosition(target), config.posicaoArena[1], config.posicaoArena[2]) then
                                                                doPlayerSendCancel(cid, "Você não pode atacar seus amigos.")
                                                                return false
                                                end
                                end
                                return true

]]></event>
<event type="statschange" name="morrerNaArena" event="script"><![CDATA[
                                 domodlib('arena_config')
         if isInRange(getPlayerPosition(cid), config.posicaoArena[1], config.posicaoArena[2]) then
         if type == STATSCHANGE_HEALTHLOSS then
          if isPlayer(cid) then
                                                                if value >= getCreatureHealth(cid) then
                 doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)))
                 doPlayerSendTextMessage(pid,22,"[unico Sobrevivente] Você morreu no evento.")
                 doCreatureAddHealth(cid,getCreatureMaxHealth(cid) - getCreatureHealth(cid))
                return false
                end
                                                end
          end
                                end
                                return true
]]></event>
</mod>

Ajudei? da um Rep+, não custa nada. ;D:P

 

Servidor de PokeTibia ja online.

Pagina: https://www.facebook.com/PokemonxStore?ref=bookmarks

Grupo: https://www.facebook.com/groups/257989224406246/

Site: http://pokexstore.wix.com/pokexstore

Postado

Ainda esta dando o erro

[03/05/2015 22:22:26] Podemosss has logged in.

[03/05/2015 22:22:26] [Error - CreatureScript Interface]
[03/05/2015 22:22:26] buffer:onLogin
[03/05/2015 22:22:26] Description:
[03/05/2015 22:22:26] [string "loadBuffer"]:15: bad argument #1 to 'ipairs' (table expected, got nil)
[03/05/2015 22:22:26] stack traceback:
[03/05/2015 22:22:26]  [C]: in function 'ipairs'
[03/05/2015 22:22:26]  [string "loadBuffer"]:15: in function <[string "loadBuffer"]:3>
[03/05/2015 22:22:26] Podemosss has logged out.

Ajudei? da um Rep+, não custa nada. ;D:P

 

Servidor de PokeTibia ja online.

Pagina: https://www.facebook.com/PokemonxStore?ref=bookmarks

Grupo: https://www.facebook.com/groups/257989224406246/

Site: http://pokexstore.wix.com/pokexstore

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo