Ir para conteúdo
  • Cadastre-se
  • 0

Add buff Noblesse Blessing (nobre) no Npc Adventurers' Guide


sandrozappi

Pergunta

Olá, gostaria de uma ajuda com esse mod...
Queria add o buff Noblesse Blessing no NPC Adventurers' Guide, para dar uma força para os chares newbies...
Seria do Level 6 ao 75, (fiz uns testes, mais o mago pega o buff já os fighters não(eles no final até fazem o "gesto" de quem deu o buff, mais não pega nos fighters.
Sei que é nesse mod, pois essa reve não tem ele no banco de dados, se tivesse seria bem fácil de fazer, pois lá eu manjo e já havia feito para um server anterior.

A ID e level da skill do Buff é:  ==>   1323     Level 1

Desde já, grato pela ajuda.

new 1.txt

Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts recomendados

  • 0

tenta assim.

Spoiler

package handlers.bypasshandlers;

import king.server.gameserver.handler.IBypassHandler;
import king.server.gameserver.model.actor.L2Character;
import king.server.gameserver.model.actor.L2Npc;
import king.server.gameserver.model.actor.instance.L2PcInstance;
import king.server.gameserver.model.base.ClassId;
import king.server.gameserver.model.holders.SkillHolder;

public class SupportMagic implements IBypassHandler
{
    private static final String[] COMMANDS =
    {
        "supportmagicservitor",
        "supportmagic"
    };
    // Buffs
    private static final SkillHolder HASTE_1 = new SkillHolder(4327, 1);
    private static final SkillHolder HASTE_2 = new SkillHolder(5632, 1);
    private static final SkillHolder CUBIC = new SkillHolder(4338, 1);
    private static final SkillHolder[] FIGHTER_BUFFS =
    {
        new SkillHolder(4322, 1), // Wind Walk
        new SkillHolder(4323, 1), // Shield
        new SkillHolder(5637, 1), // Magic Barrier
        new SkillHolder(4324, 1), // Bless the Body
        new SkillHolder(4325, 1), // Vampiric Rage
        new SkillHolder(4326, 1), // Regeneration
        new SkillHolder(1323, 1), // Noblessing
    };
    private static final SkillHolder[] MAGE_BUFFS =
    {
        new SkillHolder(4322, 1), // Wind Walk
        new SkillHolder(4323, 1), // Shield
        new SkillHolder(5637, 1), // Magic Barrier
        new SkillHolder(4328, 1), // Bless the Soul
        new SkillHolder(4329, 1), // Acumen
        new SkillHolder(4330, 1), // Concentration
        new SkillHolder(4331, 1), // Empower
        new SkillHolder(1323, 1), // Noblessing
    };
    private static final SkillHolder[] SUMMON_BUFFS =
    {
        new SkillHolder(4322, 1), // Wind Walk
        new SkillHolder(4323, 1), // Shield
        new SkillHolder(5637, 1), // Magic Barrier
        new SkillHolder(4324, 1), // Bless the Body
        new SkillHolder(4325, 1), // Vampiric Rage
        new SkillHolder(4326, 1), // Regeneration
        new SkillHolder(4328, 1), // Bless the Soul
        new SkillHolder(4329, 1), // Acumen
        new SkillHolder(4330, 1), // Concentration
        new SkillHolder(4331, 1), // Empower
    };
    
    // Levels
    private static final int LOWEST_LEVEL = 6;
    private static final int HIGHEST_LEVEL = 75;
    private static final int CUBIC_LOWEST = 16;
    private static final int CUBIC_HIGHEST = 34;
    private static final int HASTE_LEVEL_2 = 75;
    
    @Override
    public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
    {
        if (!target.isNpc() || activeChar.isCursedWeaponEquipped())
        {
            return false;
        }
        
        if (command.equalsIgnoreCase(COMMANDS[0]))
        {
            makeSupportMagic(activeChar, (L2Npc) target, true);
        }
        else if (command.equalsIgnoreCase(COMMANDS[1]))
        {
            makeSupportMagic(activeChar, (L2Npc) target, false);
        }
        return true;
    }
    
    private static void makeSupportMagic(L2PcInstance player, L2Npc npc, boolean isSummon)
    {
        final int level = player.getLevel();
        if (isSummon && (!player.hasSummon() || !player.getSummon().isServitor()))
        {
            npc.showChatWindow(player, "data/html/default/SupportMagicNoSummon.htm");
            return;
        }
        else if (level > HIGHEST_LEVEL)
        {
            npc.showChatWindow(player, "data/html/default/SupportMagicHighLevel.htm");
            return;
        }
        else if (level < LOWEST_LEVEL)
        {
            npc.showChatWindow(player, "data/html/default/SupportMagicLowLevel.htm");
            return;
        }
        else if (player.getClassId().level() == 3)
        {
            player.sendMessage("Only adventurers who have not completed their 3rd class transfer may receive these buffs."); // Custom message
            return;
        }
        
        if (isSummon)
        {
            npc.setTarget(player.getSummon());
            for (SkillHolder skill : SUMMON_BUFFS)
            {
                npc.doCast(skill.getSkill());
            }
            
            if (level >= HASTE_LEVEL_2)
            {
                npc.doCast(HASTE_2.getSkill());
            }
            else
            {
                npc.doCast(HASTE_1.getSkill());
            }
        }
        else
        {
            npc.setTarget(player);
            if (player.isMageClass() && (player.getClassId() != ClassId.overlord) && (player.getClassId() != ClassId.warcryer))
            {
                for (SkillHolder skill : MAGE_BUFFS)
                {
                    npc.doCast(skill.getSkill());
                }
            }
            else
            {
                for (SkillHolder skill : FIGHTER_BUFFS)
                {
                    npc.doCast(skill.getSkill());
                }
                
                if (level >= HASTE_LEVEL_2)
                {
                    npc.doCast(HASTE_2.getSkill());
                }
                else
                {
                    npc.doCast(HASTE_1.getSkill());
                }
            }
            
            if ((level >= CUBIC_LOWEST) && (level <= CUBIC_HIGHEST))
            {
                player.doSimultaneousCast(CUBIC.getSkill());
            }
        }
    }
    
    @Override
    public String[] getBypassList()
    {
        return COMMANDS;
    }
}
 

 

Link para o comentário
Compartilhar em outros sites


  • 0

\gameserver\data\xml\newbieBuffs.xml

    <buff skillId="1323" skillLevel="1" lowerLevel="1" upperLevel="76" isMagicClass="false"/><!-- Noblesse Blessing -->
    <buff skillId="1323" skillLevel="1" lowerLevel="1" upperLevel="76" isMagicClass="true"/><!-- Noblesse Blessing -->

 

usando a acis

add as linhas em vermelho

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

  • 0
1 hora atrás, Dartz disse:

\gameserver\data\xml\newbieBuffs.xml

    <buff skillId="1323" skillLevel="1" lowerLevel="1" upperLevel="76" isMagicClass="false"/><!-- Noblesse Blessing -->
    <buff skillId="1323" skillLevel="1" lowerLevel="1" upperLevel="76" isMagicClass="true"/><!-- Noblesse Blessing -->

 

usando a acis

add as linhas em vermelho

acho que dele não é acis pelo codigo fonte

Link para o comentário
Compartilhar em outros sites

  • 0
19 horas atrás, Christian-SDM disse:

acho que dele não é acis pelo codigo fonte

Obrigado pela força, mais na reve que uso não tem esse tipo de xmls
(Já havia procurado antes tbm, no outro servidor Freya que usava, tinha essa forma de xml)
Mesmo assim, muito grato em ajudar.

Link para o comentário
Compartilhar em outros sites

  • 0
6 minutos atrás, sandrozappi disse:

Obrigado pela força, mais na reve que uso não tem esse tipo de xmls
(Já havia procurado antes tbm, no outro servidor Freya que usava, tinha essa forma de xml)
Mesmo assim, muito grato em ajudar.

testo o codigo q eu enviei ?

Link para o comentário
Compartilhar em outros sites

  • 0
21 horas atrás, Christian-SDM disse:

tenta assim.

  Mostrar conteúdo oculto

package handlers.bypasshandlers;

import king.server.gameserver.handler.IBypassHandler;
import king.server.gameserver.model.actor.L2Character;
import king.server.gameserver.model.actor.L2Npc;
import king.server.gameserver.model.actor.instance.L2PcInstance;
import king.server.gameserver.model.base.ClassId;
import king.server.gameserver.model.holders.SkillHolder;

public class SupportMagic implements IBypassHandler
{
    private static final String[] COMMANDS =
    {
        "supportmagicservitor",
        "supportmagic"
    };
    // Buffs
    private static final SkillHolder HASTE_1 = new SkillHolder(4327, 1);
    private static final SkillHolder HASTE_2 = new SkillHolder(5632, 1);
    private static final SkillHolder CUBIC = new SkillHolder(4338, 1);
    private static final SkillHolder[] FIGHTER_BUFFS =
    {
        new SkillHolder(4322, 1), // Wind Walk
        new SkillHolder(4323, 1), // Shield
        new SkillHolder(5637, 1), // Magic Barrier
        new SkillHolder(4324, 1), // Bless the Body
        new SkillHolder(4325, 1), // Vampiric Rage
        new SkillHolder(4326, 1), // Regeneration
        new SkillHolder(1323, 1), // Noblessing
    };
    private static final SkillHolder[] MAGE_BUFFS =
    {
        new SkillHolder(4322, 1), // Wind Walk
        new SkillHolder(4323, 1), // Shield
        new SkillHolder(5637, 1), // Magic Barrier
        new SkillHolder(4328, 1), // Bless the Soul
        new SkillHolder(4329, 1), // Acumen
        new SkillHolder(4330, 1), // Concentration
        new SkillHolder(4331, 1), // Empower
        new SkillHolder(1323, 1), // Noblessing
    };
    private static final SkillHolder[] SUMMON_BUFFS =
    {
        new SkillHolder(4322, 1), // Wind Walk
        new SkillHolder(4323, 1), // Shield
        new SkillHolder(5637, 1), // Magic Barrier
        new SkillHolder(4324, 1), // Bless the Body
        new SkillHolder(4325, 1), // Vampiric Rage
        new SkillHolder(4326, 1), // Regeneration
        new SkillHolder(4328, 1), // Bless the Soul
        new SkillHolder(4329, 1), // Acumen
        new SkillHolder(4330, 1), // Concentration
        new SkillHolder(4331, 1), // Empower
    };
    
    // Levels
    private static final int LOWEST_LEVEL = 6;
    private static final int HIGHEST_LEVEL = 75;
    private static final int CUBIC_LOWEST = 16;
    private static final int CUBIC_HIGHEST = 34;
    private static final int HASTE_LEVEL_2 = 75;
    
    @Override
    public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
    {
        if (!target.isNpc() || activeChar.isCursedWeaponEquipped())
        {
            return false;
        }
        
        if (command.equalsIgnoreCase(COMMANDS[0]))
        {
            makeSupportMagic(activeChar, (L2Npc) target, true);
        }
        else if (command.equalsIgnoreCase(COMMANDS[1]))
        {
            makeSupportMagic(activeChar, (L2Npc) target, false);
        }
        return true;
    }
    
    private static void makeSupportMagic(L2PcInstance player, L2Npc npc, boolean isSummon)
    {
        final int level = player.getLevel();
        if (isSummon && (!player.hasSummon() || !player.getSummon().isServitor()))
        {
            npc.showChatWindow(player, "data/html/default/SupportMagicNoSummon.htm");
            return;
        }
        else if (level > HIGHEST_LEVEL)
        {
            npc.showChatWindow(player, "data/html/default/SupportMagicHighLevel.htm");
            return;
        }
        else if (level < LOWEST_LEVEL)
        {
            npc.showChatWindow(player, "data/html/default/SupportMagicLowLevel.htm");
            return;
        }
        else if (player.getClassId().level() == 3)
        {
            player.sendMessage("Only adventurers who have not completed their 3rd class transfer may receive these buffs."); // Custom message
            return;
        }
        
        if (isSummon)
        {
            npc.setTarget(player.getSummon());
            for (SkillHolder skill : SUMMON_BUFFS)
            {
                npc.doCast(skill.getSkill());
            }
            
            if (level >= HASTE_LEVEL_2)
            {
                npc.doCast(HASTE_2.getSkill());
            }
            else
            {
                npc.doCast(HASTE_1.getSkill());
            }
        }
        else
        {
            npc.setTarget(player);
            if (player.isMageClass() && (player.getClassId() != ClassId.overlord) && (player.getClassId() != ClassId.warcryer))
            {
                for (SkillHolder skill : MAGE_BUFFS)
                {
                    npc.doCast(skill.getSkill());
                }
            }
            else
            {
                for (SkillHolder skill : FIGHTER_BUFFS)
                {
                    npc.doCast(skill.getSkill());
                }
                
                if (level >= HASTE_LEVEL_2)
                {
                    npc.doCast(HASTE_2.getSkill());
                }
                else
                {
                    npc.doCast(HASTE_1.getSkill());
                }
            }
            
            if ((level >= CUBIC_LOWEST) && (level <= CUBIC_HIGHEST))
            {
                player.doSimultaneousCast(CUBIC.getSkill());
            }
        }
    }
    
    @Override
    public String[] getBypassList()
    {
        return COMMANDS;
    }
}
 

 

Pelo que puder perceber, já havia tentado assim antes, mais não deu certo não...
vou add e testar pra ver, vai que tenha passado um detalhe que não tenha reparado né... kkk

Agora, Christian-SDM disse:

testo o codigo q eu enviei ?

Vou testar agora...

 

Link para o comentário
Compartilhar em outros sites

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...




×
×
  • 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.