Ir para conteúdo
  • Cadastre-se
  • 0

VENENOS DE HOTSPRINGES


TeacherOfJava

Pergunta

Citar

Ola pessoal, Gostaria de sabe o seguinte.

Como que tira aquele efeito do personagem quando estar utilizando malaria?? aquele gritinho de puto e aquele veneno escorrendo no corpo do personagem, poderiam me dizer como remover esse efeito? Obrigado. Estou utilizando l2jacis 370.

Se for na system onde? nunca fiz isso antes por isso pergunto..

Se for no java ai esta o arquivo todo..

package net.sf.l2j.gameserver.scripting.scripts.ai.group;

import net.sf.l2j.commons.random.Rnd;

import net.sf.l2j.gameserver.data.SkillTable;
import net.sf.l2j.gameserver.model.L2Effect;
import net.sf.l2j.gameserver.model.actor.Npc;
import net.sf.l2j.gameserver.model.actor.instance.Player;
import net.sf.l2j.gameserver.scripting.scripts.ai.L2AttackableAIScript;

public class HotSpringDisease extends L2AttackableAIScript
{
    // Diseases
    private static final int MALARIA = 4554;
    
    // Chance
    private static final int DISEASE_CHANCE = 100;
    
    // Monsters
    private static final int[][] MONSTERS_DISEASES =
    {
        {
            21314,
            21316,
            21317,
            21319,
            21321,
            21322
        },
        {
            4551,
            4552,
            4553,
            4552,
            4551,
            4553
        }
    };
    
    public HotSpringDisease()
    {
        super("ai/group");
    }
    
    @Override
    protected void registerNpcs()
    {
        addAttackActId(MONSTERS_DISEASES[0]);
    }
    
    @Override
    public String onAttackAct(Npc npc, Player victim)
    {
        for (int i = 0; i < 6; i++)
        {
            if (MONSTERS_DISEASES[0] != npc.getNpcId())
                continue;
            
            tryToApplyEffect(npc, victim, MALARIA);
            tryToApplyEffect(npc, victim, MONSTERS_DISEASES[1]);
        }
        return super.onAttackAct(npc, victim);
    }
    
    private static void tryToApplyEffect(Npc npc, Player victim, int skillId)
    {
        if (Rnd.get(100) < DISEASE_CHANCE)
        {
            int level = 1;
            
            L2Effect[] effects = victim.getAllEffects();
            if (effects.length != 0)
            {
                for (L2Effect e : effects)
                {
                    if (e.getSkill().getId() != skillId)
                        continue;
                    
                    level += e.getSkill().getLevel();
                    e.exit();
                }
            }
            
            if (level > 4)
                level = 4;
            
            SkillTable.getInstance().getInfo(skillId, level).getEffects(npc, victim);
        }
    }
}

 

Editado por powergames
Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts recomendados


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Processando...
  • Registre-se

    Faça parte da maior e  mais antigas comunidades sobre Lineage2 da América Latina.





×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.