I need help so that when the character is created, start with the Grace Sustantion buff

AnicoDEV

Путник
Пользователь
Сообщения
5
Розыгрыши
0
Репутация
0
Реакции
0
Баллы
1
Неприемлемый язык
Хроники
  1. Master Class
Исходники
Присутствуют
Сборка
Essencial L2JMobius
Este é o
brilho Buff Incial.jpg

Qual a forma ou exemplo de conseguir o add, alguém pode me ajudar por favor?
 
Este é o
brilhoПосмотреть вложение 74866

Qual a forma ou exemplo de conseguir o add, alguém pode me ajudar por favor?
I've recently been working with lineage 2 essence and the first function they gave me was to add this, it's very similar to a toggle buff, but as soon as you create the character it already appears as if it were from the buff bar, no need to click in nothing. Reasoning, I came to the conclusion that it needs to be implemented within some initial file, but I still haven't managed to get to the path.
 
Make it as A2 skill which cannot be deleted and will stay after death. Make abnormal time -1 :D
Make a simple scripts with registering event "OnPlayerLogin" - and make something as SkillData.getInstance().getSkill(skillid, skilllevel).applyEffect(event.getPlayer(), event.getPlayer());
 
Make it as A2 skill which cannot be deleted and will stay after death. Make abnormal time -1 :D
Make a simple scripts with registering event "OnPlayerLogin" - and make something as SkillData.getInstance().getSkill(skillid, skilllevel).applyEffect(event.getPlayer(), event.getPlayer());
1716495534317.png

I edited the skill, but where I add this script I'm getting complicated!
I imported some things, but when I update the event part, errors appear in other parts.
Is the place where I placed the print correct?
 
Or you can put it on EnterWorld.java like this

SkillData.getInstance().getSkill(<SkillId>, <SkillLevel>).applyEffects(activeChar, activeChar);

replace <SkillId> and <SkillLevel> with the buff you want to give to the player that enters the game
 
Or you can put it on EnterWorld.java like this

SkillData.getInstance().getSkill(<SkillId>, <SkillLevel>).applyEffects(activeChar, activeChar);

replace <SkillId> and <SkillLevel> with the buff you want to give to the player that enters the game
In which line do I add this code?

I tried as MrKirill1232 explained but I was not successful either...

I'm new to Java.
 
Java:
package custom;

import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.events.Containers;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.events.listeners.AbstractEventListener;
import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener;
import org.l2jmobius.gameserver.model.quest.Quest;

public class GraceSustention extends Quest
{
    private AbstractEventListener _onPlayerLogin;

    public GraceSustention()
    {
        super(-1);
    }

    private void onPlayerLogin(OnPlayerLogin event)
    {
        SkillData.getInstance().getSkill(skillid, skilllevel).applyEffect(event.getPlayer(), event.getPlayer());
    }

    @Override
    protected void onLoad()
    {
        super.onLoad();
        _onPlayerLogin = Containers.Players().addListener(new ConsumerEventListener(Containers.Players(), EventType.ON_PLAYER_LOGIN, (OnPlayerLogin event) -> onPlayerLogin(event), this));
    }

    @Override
    public void onSave()
    {
        super.onSave();
        if (_onPlayerLogin != null)
        {
            _onPlayerLogin.unregisterMe();
            _onPlayerLogin = null;
        }
    }

    public static void main(String[] args)
    {
       new GraceSustention();
    }
}
 
Java:
package custom;

import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.events.Containers;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.events.listeners.AbstractEventListener;
import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener;
import org.l2jmobius.gameserver.model.quest.Quest;

public class GraceSustention extends Quest
{
    private AbstractEventListener _onPlayerLogin;

    public GraceSustention()
    {
        super(-1);
    }

    private void onPlayerLogin(OnPlayerLogin event)
    {
        SkillData.getInstance().getSkill(skillid, skilllevel).applyEffect(event.getPlayer(), event.getPlayer());
    }

    @Override
    protected void onLoad()
    {
        super.onLoad();
        _onPlayerLogin = Containers.Players().addListener(new ConsumerEventListener(Containers.Players(), EventType.ON_PLAYER_LOGIN, (OnPlayerLogin event) -> onPlayerLogin(event), this));
    }

    @Override
    public void onSave()
    {
        super.onSave();
        if (_onPlayerLogin != null)
        {
            _onPlayerLogin.unregisterMe();
            _onPlayerLogin = null;
        }
    }

    public static void main(String[] args)
    {
       new GraceSustention();
    }
}


A skill worked, but then it's taking the character who is GM.
However, when I create a new character to test, the buff does not appear.
1716578082177.png
When I put it in the Package Custon doesn't recognize it.
 
Решение
Назад
Сверху Снизу