Ir para conteúdo
  • Cadastre-se

(Resolvido)Monster nao se curam mesmo com script


Ir para solução Resolvido por bpm91,

Posts Recomendados

meus monstros nao estão se curando, e nao sei por qual motivo
segue script da hydra como exemplo


<?xml version="1.0" encoding="UTF-8"?>
<monster name="Hydra" nameDescription="a hydra" race="blood" experience="2100" speed="260" manacost="0">
    <health now="2350" max="2350"/>
    <look type="121" corpse="6048"/>
    <targetchange interval="5000" chance="8"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="1"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="90"/>
        <flag runonhealth="300"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" skill="80" attack="60"/>
        <attack name="speed" interval="1000" chance="17" range="7" radius="4" target="1" speedchange="-600" duration="15000">
            <attribute key="shootEffect" value="poison"/>
            <attribute key="areaEffect" value="greenbubble"/>
        </attack>
        <attack name="physical" interval="3000" chance="17" length="8" spread="3" min="-150" max="-250">
            <attribute key="areaEffect" value="bluebubble"/>
        </attack>
        <attack name="poison" interval="2000" chance="20" length="8" spread="3" min="-60" max="-280">
            <attribute key="areaEffect" value="poison"/>
        </attack>
    </attacks>
    <defenses armor="25" defense="35">
        <defense name="healing" interval="1000" chance="25" min="200" max="400">
            <attribute key="areaEffect" value="blueshimmer"/>
        </defense>
    </defenses>
    <immunities>
    <immunity physical="0"/>
    <immunity energy="0"/>
    <immunity fire="0"/>
    <immunity poison="1"/>
    <immunity lifedrain="1"/>
    <immunity paralyze="1"/>
    <immunity outfit="1"/>
    <immunity drunk="1"/>
    <immunity invisible="1"/>
    </immunities>
    <script>
    <event name="noattack"/>
    </script>
    <voices interval="5000" chance="10">
        <voice sentence="FCHHHHH"/>
        <voice sentence="HISSSS"/>
    </voices>
    <loot>
        <item id="2148" countmax="90" chance="24000"/><!-- gold coin -->
        <item id="2148" countmax="80" chance="24000"/><!-- gold coin -->
        <item id="2148" countmax="80" chance="24000"/><!-- gold coin -->
        <item id="2666" countmax="4" chance="37500"/><!-- meat -->
        <item id="2671" countmax="4" chance="25000"/><!-- ham -->
        <item id="2177" chance="500"/><!-- life crystal -->
        <item id="2197" chance="900"/><!-- stone skin amulet -->
        <item id="2146" chance="5000"/><!-- small sapphire -->
        <item id="1987" chance="100000"><!-- bag -->
            <inside>
        <item id="4850" chance="600"/><!-- hydra egg -->
        <item id="2214" chance="1050"/><!-- ring of healing -->
        <item id="2475" chance="1000"/><!-- warrior helmet -->
        <item id="2476" chance="1200"/><!-- knight armor -->
        <item id="2536" chance="500"/><!-- medusa shield -->
        <item id="2498" chance="200"/><!-- royal helmet -->
        <item id="2195" chance="120"/><!-- boots of haste -->
            </inside>
        </item>
    </loot>
</monster>
 

eu descobri q o script noattackbixo nao deixa q o monstro se cure
<script>
    <event name="noattack"/>
    </script>

 

function onStatsChange(cid, attacker, type, combat, value)
    -- This should block all damage monster cause on eachother expect player summons
    if isMonster(cid) and isMonster(attacker) then
        local master = getCreatureMaster(cid)
        if not master or not isPlayer(master) then
            return false
        end
    end

    return true
end


porém se eu n usar esse script os monstros apanham de outros monstros. alguem poderia me ajudar resolver esse problema?

se eu remover o script isso acontece.
os bog raider se batem. nao só isso, as hydras conseguem tirar dano delas, e todos os monstros que tem o script nao se curam, e os sumons de player nao tiram dano.
alguem pode me dar um help?
 

Screenshot_4.jpg

Screenshot_5.jpg

Link para o post
Compartilhar em outros sites

Essa função:

function onStatsChange(cid, attacker, type, combat, value)
    -- This should block all damage monster cause on eachother expect player summons
    if isMonster(cid) and isMonster(attacker) then
        local master = getCreatureMaster(cid)
        if not master or not isPlayer(master) then
            return false
        end
    end

    return true
end

Foi você que criou? ou faz parte do script da hydra?Se sim,em qual arquivo ela se encontra?

Contribuições:
 

=> Distribuições/Servidores

  1. [8.60] The Forgotten Server 1.3 (COMPILADO WIN x64)

 

=> Scripts/Códigos/Tutoriais

  1. Pokemon pescado aparece em volta do seu pokemon
  2. [Gesior]Dobrar pontos PagSeguro a partir de x valor doado

 

 Gostou de alguma contribuição? Rep +?

Link para o post
Compartilhar em outros sites
  • Solução

@Rayo pra ela funcionar nao pode estar registrada no login.lua, pois deve ser válida apenas para monstros.
então eu editei o script assim e agora ela apanha de sumon, nao se mata entre outros monstros e funciona 100%

function onStatsChange(cid, attacker, type, combat, value)
    if isMonster(attacker) then
       
        if type == STATSCHANGE_HEALTHLOSS then
            
            if not isPlayer(getCreatureMaster(attacker)) then
               
                return false
            end
        end
    end
   
    return true
end

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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo