Ir para conteúdo

Featured Replies

Postado

Estou tendo um problema no meu script do zombie event... 

Os zumbis são sumonados, porem com um ataque eles "matam" os jogadores...

 

O código do Zumbi

<monster name="Zombie Event" nameDescription="an event zombie" race="undead" experience="480" speed="170" manacost="0">

	<health now="20000" max="20000"/>

	<look type="311" corpse="9875"/>

	<targetchange interval="5000" chance="50"/>

	<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="1000" min="-700" max="-1350"/>

	</attacks>

	<defenses armor="0" defense="0"/>

<immunities>

  <immunity paralyze="1"/>

  <immunity invisible="1"/>

  <immunity fire="1"/>

  <immunity energy="1"/>

  <immunity poison="1"/>

</immunities>

	<voices interval="4000" chance="10">

		<voice sentence="You wont last long!"/>

		<voice sentence="Mmmmh.. braains!"/>

	</voices>

<script>

  <event name="ZombieThink"/>

  <event name="ZombieDeath"/>

</script>

	<loot>


	</loot>

</monster>

E segue o onattack.lua

function loseOnZombieArena(cid)
    kickPlayerFromZombiesArea(cid)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Ixi! Voce ja era.")
    local players = getZombiesEventPlayers()
    if(#players <= 1) then
        local winner = players[1]
        if(winner) then
		 doPlayerAddItem(winner, 6119, 2, true)
		 doPlayerAddItem(winner, 6119, 1, true)
		  doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ganhou o evento zumbi.")
            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

 

Obrigado!!!

Postado

Esta é uma mensagem automática! Este tópico foi movido para a área correta.
Pedimos que você leia as regras do fórum.

Spoiler

This is an automated message! This topic has been moved to the correct area.
Please read the forum rules.

 

@Mirkaan mais o certo é esse, você mata o zombie com 1 único hit, e o zombie te mata com 1 único hit, é só aumentar o hp do zombie na xml dele, e então ele irá demorar para morrer.

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

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