Ir para conteúdo
  • Cadastre-se

Normal [PEDIDO] Zombie Event TFS 1.0 Erro no distro


Posts Recomendados

alguem ai tem algum zombie event para tfs 1.0 10.41
 
Consegui um zombie event porem da um erro no distro...
 

Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/zombie_think.lua:onThink
data/globalevents/scripts/zombie_think.lua:4: attempt to compare nil with number
stack traceback:
        [C]: in function '__lt'
        data/globalevents/scripts/zombie_think.lua:4: in function <data/globalevents/scripts/zombie_think.lua:3>
[Error - GlobalEvents::think] Failed to execute event: zombie

Zombie Event


\data\globalevents\scripts\zombie_think.lua
dofile('data/zombie_system.lua')

function onThink(interval, lastExecution, thinkInterval)
    if Game.getStorageValue(zeStartedGlobalStorage) < 1 then
        local teleport = Game.createItem(1387, 1, zeCreateTeleportPosition)
        if teleport then
            teleport:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 7000)
        end
        Game.setStorageValue(zeStartedGlobalStorage, 1)
        print('Zombie Event has started & waiting for players to join! Min: '.. zeMinPlayers ..'/'.. zeMaxPlayers ..'.')
        Game.broadcastMessage('The Zombie Event has started! You have '.. zeWaitMinutes ..' minutes to join!', MESSAGE_STATUS_WARNING)
        addEvent(startZombie, zeWaitMinutes * 60 * 1000)
    end
    return true
end

\data\creaturescripts\scripts\zombie_death.lua



dofile('data/zombie_system.lua')

function onDeath(cid, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    local monster = Monster(cid)
    monster:say("I WILL BE BACK!", TALKTYPE_MONSTER_YELL)
    monster:getPosition():sendMagicEffect(CONST_ME_MORTAREA)
    doSummonZombie()
    Game.setStorageValue(zeZombieCountGlobalStorage, Game.getStorageValue(zeZombieCountGlobalStorage) - 1)
end

function onPrepareDeath(cid, killer)
    local player = Player(cid)
    local winner = 0
    if player:getStorageValue(zeJoinStorage) == 1 then
        Game.setStorageValue(zeJoinedCountGlobalStorage, Game.getStorageValue(zeJoinedCountGlobalStorage) - 1)
        player:teleportTo(player:getTown():getTemplePosition())
        player:setStorageValue(zeJoinStorage, 0)
        player:addHealth(player:getMaxHealth())
        if Game.getStorageValue(zeJoinedCountGlobalStorage) <= 1 then --Event ended, someone won!
            local players = Game.getPlayers()
            for _, tmpPlayer in ipairs(players) do
                local stor = tmpPlayer:getStorageValue(zeJoinStorage)
                if stor == 1 then
                    winner = tmpPlayer:getId()
                    break
                end
            end
            winner = Player(winner)
            if winner then
                winner:teleportTo(winner:getTown():getTemplePosition())
                local trophy = winner:addItem(zeTrophy, 1)
                if trophy then
                    trophy:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, '['.. winner:getName() ..'] has won the Zombie Event.')
                end
                 Game.broadcastMessage(string.format('%s is the winner of Zombie Event Versus %s Zombies.', winner:getName(), Game.getStorageValue(zeZombieCountGlobalStorage)), MESSAGE_STATUS_WARNING)
            end
            doClearZombieArena()
            resetVariables()
        end
        return false
    end
    return true
end

\data\monster\Zombie_Event.xml



<?xml version="1.0" encoding="UTF-8"?>
<monster name="Zombie" nameDescription="a zombie" race="undead" experience="0" speed="100" manacost="0">
    <health now="500" max="500"/>
    <look type="311" corpse="0"/>
    <targetchange interval="4000" chance="10"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="0"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="90"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" skill="9999999" attack="9999999"/>
    </attacks>
    <defenses armor="15" defense="15"/>
    <elements>
        <element firePercent="50"/>
    </elements>
    <immunities>
        <immunity death="1"/>
        <immunity energy="1"/>
        <immunity ice="1"/>
        <immunity earth="1"/>
        <immunity drown="1"/>
        <immunity drunk="1"/>
        <immunity lifedrain="1"/>
        <immunity paralyze="1"/>
    </immunities>
    <voices interval="5000" chance="10">
        <voice sentence="Mst.... klll...."/>
        <voice sentence="Whrrrr... ssss.... mmm.... grrrrl"/>
        <voice sentence="Dnnnt... cmmm... clsrrr...."/>
        <voice sentence="Httt.... hmnnsss..."/>
    </voices>
    <script>
            <event name="ZE_Mon_Death"/>
        </script>
</monster>

\data\zombie_system.lua



-- Zombie Variables
zeZombieName = 'Zombie Event' --Zombie Name
zombieSpawnInterval = 5 --how many seconds until a new zombie spawns
zeMaxZombies = 50 --max zombies in the arena?
zeJoinedCountGlobalStorage = 200 --Player joined event count

-- Players Variables
zeJoinStorage = 1000 --player join storage
zeMinPlayers = 1 --min players needed when time runout
zeMaxPlayers = 30 --max players to join
zeTrophy = 7369 --trophy itemid
zeZombieCountGlobalStorage = 201 --Zombie spawned Count

-- Other Variables
zeWaitMinutes = 5 --when event has opened, how long until it starts?
zeWaitingRoomPos = Position(32365, 29021, 7) --middle of waiting room
zeZombieArena = Position(16907, 11817, 8) --when even start where should player be teleported in the zombie arena?
zeArenaFromPosition = Position(16883, 11799, 8) --pos of top left corner
zeArenaToPosition = Position(16931, 11835, 8) --pos of bottom right corner
zeMiddleZombieArena = Position(16907, 11817, 8) --Middle pos of the arena
zeWaitingRoomRadiusX = 20 --depends how big the waiting room is 20sqm to x
zeWaitingRoomRadiusY = 20 --depends how big the waiting room is 20sqm to y
zeZombieArenaRadiusX = 50 --Depends how big the zombie arena is 50sqm to x
zeZombieArenaRadiusY = 50 --Depends how big the zombie arena is 50sqm to y
zeStartedGlobalStorage = 202 -- Value: 0 == false, 1 == true, 2 == started --State of the event
zeCreateTeleportPosition = Position(32360, 32239, 7) --Where should the teleport be created?

function startZombie()
    local specs = Game.getSpectators(zeWaitingRoomPos, false, true, 0, zeWaitingRoomRadiusX, 0, zeWaitingRoomRadiusY)
        if Game.getStorageValue(zeJoinedCountGlobalStorage) < zeMinPlayers then
            for i = 1, #specs do
                    specs[i]:teleportTo(specs[i]:getTown():getTemplePosition(), false)
                    specs[i]:setStorageValue(zeJoinStorage, 0)
            end
            resetVariables()
            Game.broadcastMessage('Zombie Event failed to start, because of to little players joined the event!', MESSAGE_STATUS_WARNING)
            return true
        end
 
        for i = 1, #specs do
            specs[i]:teleportTo(zeZombieArena)
        end
        Game.broadcastMessage("Zombie Event has started, good luck to all participant.", MESSAGE_STATUS_WARNING)
        Game.setStorageValue(zeStartedGlobalStorage, 2)
        doStartZombieEvasion()
end

function doSummonZombie()
        if Game.getStorageValue(zeZombieCountGlobalStorage) > zeMaxZombies then
            return false
        end
 
        local zombie = Game.createMonster(zeZombieName, {x = math.random(zeArenaFromPosition.x, zeArenaToPosition.x), y = math.random(zeArenaFromPosition.y, zeArenaToPosition.y), z = math.random(zeArenaFromPosition.z, zeArenaToPosition.z)})
        if zombie then
            Game.createMonster(zeZombieName, {x = math.random(zeArenaFromPosition.x, zeArenaToPosition.x), y = math.random(zeArenaFromPosition.y, zeArenaToPosition.y), z = math.random(zeArenaFromPosition.z, zeArenaToPosition.z)})
        end
        Game.setStorageValue(zeZombieCountGlobalStorage, Game.getStorageValue(zeZombieCountGlobalStorage) + 1)
end

function doStartZombieEvasion()
        if Game.getStorageValue(zeStartedGlobalStorage) == 2 then
               doSummonZombie()
            addEvent(doStartZombieEvasion, 5 * 1000)
        end
end

function resetVariables()
        Game.setStorageValue(zeJoinedCountGlobalStorage, 0)
        Game.setStorageValue(zeZombieCountGlobalStorage, 0)
        Game.setStorageValue(zeStartedGlobalStorage, 0)
end

function doClearZombieArena()
        local specs = Game.getSpectators(zeMiddleZombieArena, false, false, 0, zeZombieArenaRadiusX, 0, zeZombieArenaRadiusY)
        for i = 1, #specs do
            if specs[i]:getName() == zeZombieName then
                    specs[i]:remove()
            end
        end
end

globalevents



<globalevent name="zombie" interval="300000000" script="zombie_think.lua"/>

creaturescripts



<event type="preparedeath" name="ZE_Death" script="zombie_death.lua"/>
<event type="death" name="ZE_Mon_Death" script="zombie_death.lua"/>

monsters



<monster name="Zombie" file="Zombie_Event.xml"/>


se alguem puder dar uma mãozinha eu agradeço!!!

Editado por lrickes (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Tbm to querendo, pq tbm fusei pelo fórum aq e achei esse mesmo zombie.. e dá o mesmo error.. kkk' :/

 

Se alguém tiver, dá um help aew.. ? .-.

Link para o post
Compartilhar em outros sites

Vou arriscar. \data\zombie_system.lua, tente trocar:

zeJoinedCountGlobalStorage = 200 --Player joined event count

por:

zeZombieCountGlobalStorage = 200 --Player joined event count
Editado por Larissa Azhaurn (veja o histórico de edições)
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