Prevent Summons From Entering Olympiad Already Summoned?

rammstein

Heir
Customer
Hello everyone, how are you? I have a question.
Is there any configuration that prevents a summon from entering the Olympiad already summoned?
For example: a Hell Knight can summon the panther before registering and, when he is teleported to the arena, it appears with him.
Is there any way to force the player to summon the servitor again inside the arena, and not enter with it already active?
Thanks in advance for the help!
 
Can I ask what this is for?
Because it was originally designed to make it easier to summon a pet for a Necromancer, for example.
Or are you planning on using Gremlins for them at the Olympics?
Nothing terrible or unbalanced is happening, really. All pets are flying in there without any buffs.
 
Hey Fort, how are you doing, fellow Lineage 2 player?
I'm asking because of an idea.
Let's suppose it's a PvP server but they want to keep Olly closer to retail.
If someone creates a summon/skill with more powerful stats for the summoner in PvP, even if they limit the skill so it can't be used in Olly, they can use the summon beforehand and teleport to the coliseum with that custom summon.
I'm a beginner, maybe there's another way to prevent this from happening, at least with custom summons =D
 
Hey Fort, how are you doing, fellow Lineage 2 player?
I'm asking because of an idea.
Let's suppose it's a PvP server but they want to keep Olly closer to retail.
If someone creates a summon/skill with more powerful stats for the summoner in PvP, even if they limit the skill so it can't be used in Olly, they can use the summon beforehand and teleport to the coliseum with that custom summon.
I'm a beginner, maybe there's another way to prevent this from happening, at least with custom summons =D
so what you say is this:
1) an admin can create another "custom" pet/summon for example: for Elemental Summoner class. <- you can create new custom pets in lucera!
2) this "custom" pet/summon is to be made stronger than the existing PETS for this Elemental Summoner class....
3)so this will result to a bad/unballance in olympiad for this Elemental Summoner class....because the custom pet is now STRONGER....hmmmm

there must be something, i dont have it in mind right now, but lucera datapack offers many ways to ban/configure skills and stats on different events
 
That's exactly it, my friend!The skill is banned from use in Olly, okay.But if you summon the pet of that skill that was banned in Olly before teleporting to the stadium, it enters with you, just like the others.
 
Is there a way I can do this myself, or is there someone who sells this service?
In your extender make a class that implements OnTeleportListener, then in the onTeleport function try to check the player oly conditions, for example:
player.isOlyParticipant() (not sure if this flag is set to true before teleporting you or after, you need to try)
 
In your extender make a class that implements OnTeleportListener, then in the onTeleport function try to check the player oly conditions, for example:
player.isOlyParticipant() (not sure if this flag is set to true before teleporting you or after, you need to try)
Do you do this job, friend Nothing?
 
try this, and put the npc ids of the summons you want to unsummon in the list at the beginning (the purpose of it is to avoid unsummoning necro summons or they have no way to resummon them in oly)
Keep in mind that there are probably better ways to implement what you're trying to do, maybe even in the xml of the summon there could be a parameter to set if it's allowed in oly or not
public class OlyTeleportUnsummon implements ScriptFile, OnTeleportListener
{
private static final List<Integer> _forbiddenSummons = List.of(1111,2222,3333); // PUT HERE THE NPC ID OF THE SUMMONS TO UNSUMMON

@Override
public void onTeleport(Player player, int x, int y, int z, Reflection reflection)
{
if (player.isOlyParticipant())
{
final Summon pet = player.getPet();
if ((pet != null) && _forbiddenSummons.contains(pet.getNpcId()))
{
pet.unSummon();
}
}
}

@Override
public void onLoad()
{
CharListenerList.addGlobal(this);
}

@Override
public void onReload()
{

}

@Override
public void onShutdown()
{

}
}
 
try this, and put the npc ids of the summons you want to unsummon in the list at the beginning (the purpose of it is to avoid unsummoning necro summons or they have no way to resummon them in oly)
Keep in mind that there are probably better ways to implement what you're trying to do, maybe even in the xml of the summon there could be a parameter to set if it's allowed in oly or not
I sent you a private message. Nothing, thanks for sharing. Really!
 
Hello everyone, how are you? I have a question.
Is there any configuration that prevents a summon from entering the Olympiad already summoned?
For example: a Hell Knight can summon the panther before registering and, when he is teleported to the arena, it appears with him.
Is there any way to force the player to summon the servitor again inside the arena, and not enter with it already active?
Thanks in advance for the help!
Add please ticket, I will implement it.
 
Hello, idk if is works, but you can try..

JavaScript:
oly_anti_summon_remover:

JavaScript:
package services;

import l2.commons.threading.RunnableImpl;
import l2.gameserver.ThreadPoolManager;
import l2.gameserver.listener.actor.player.OnPlayerEnterListener;
import l2.gameserver.model.Player;
import l2.gameserver.model.World;
import l2.gameserver.model.actor.listener.CharListenerList;
import l2.gameserver.model.entity.oly.ParticipantPool;
import l2.gameserver.network.l2.components.SystemMsg;
import l2.gameserver.network.l2.s2c.SystemMessage;
import l2.gameserver.scripts.ScriptFile;

import java.util.concurrent.ScheduledFuture;

public class OlympiadPetRemover implements ScriptFile, OnPlayerEnterListener {

    private static class Config {
        public static final boolean ENABLED = true;
        public static final long CHECK_INTERVAL = 2000L;
        public static final String MESSAGE_PET = "You cannot register for Olympiad with a pet/summon summoned. Unsummon your pet/summon first.";
        public static final String MESSAGE_MOUNT = "You cannot register for Olympiad while mounted. Dismount first.";
    }

    private static ScheduledFuture<?> _checkTask;

    public static boolean canRegisterForOlympiad(Player player) {
        if (player == null || !Config.ENABLED) {
            return true;
        }

        if (player.getPet() != null) {
            player.sendPacket((l2.gameserver.network.l2.components.IStaticPacket)
                new SystemMessage(SystemMsg.S1).addString(Config.MESSAGE_PET));
            return false;
        }

        if (player.isMounted()) {
            player.sendPacket((l2.gameserver.network.l2.components.IStaticPacket)
                new SystemMessage(SystemMsg.S1).addString(Config.MESSAGE_MOUNT));
            return false;
        }

        return true;
    }

    private static void checkRegisteredPlayers() {
        if (!Config.ENABLED) {
            return;
        }

        for (Player player : World.getPlayers()) {
            if (player == null || !player.isOnline()) {
                continue;
            }

            if (!ParticipantPool.getInstance().isRegistred(player)) {
                continue;
            }

            if (player.isOlyParticipant()) {
                continue;
            }

            if (player.getPet() != null) {
                ParticipantPool.getInstance().remove(player);
                player.sendPacket((l2.gameserver.network.l2.components.IStaticPacket)
                    new SystemMessage(SystemMsg.S1).addString(Config.MESSAGE_PET));
            }

            if (player.isMounted()) {
                ParticipantPool.getInstance().remove(player);
                player.sendPacket((l2.gameserver.network.l2.components.IStaticPacket)
                    new SystemMessage(SystemMsg.S1).addString(Config.MESSAGE_MOUNT));
            }
        }
    }

    @Override
    public void onPlayerEnter(Player player) {
        if (!Config.ENABLED) {
            return;
        }

        ThreadPoolManager.getInstance().schedule(new RunnableImpl() {
            @Override
            public void runImpl() throws Exception {
                if (player == null || !player.isOnline()) {
                    return;
                }

                if (!ParticipantPool.getInstance().isRegistred(player) || player.isOlyParticipant()) {
                    return;
                }

                if (player.getPet() != null || player.isMounted()) {
                    ParticipantPool.getInstance().remove(player);
                   
                    if (player.getPet() != null) {
                        player.sendPacket((l2.gameserver.network.l2.components.IStaticPacket)
                            new SystemMessage(SystemMsg.S1).addString(Config.MESSAGE_PET));
                    } else if (player.isMounted()) {
                        player.sendPacket((l2.gameserver.network.l2.components.IStaticPacket)
                            new SystemMessage(SystemMsg.S1).addString(Config.MESSAGE_MOUNT));
                    }
                }
            }
        }, 1000L);
    }

    @Override
    public void onLoad() {
        if (Config.ENABLED) {
            CharListenerList.addGlobal(this);

            _checkTask = ThreadPoolManager.getInstance().scheduleAtFixedRate(new RunnableImpl() {
                @Override
                public void runImpl() throws Exception {
                    checkRegisteredPlayers();
                }
            }, Config.CHECK_INTERVAL, Config.CHECK_INTERVAL);
        }
    }

    @Override
    public void onReload() {
        onShutdown();
        onLoad();
    }

    @Override
    public void onShutdown() {
        if (Config.ENABLED) {
            CharListenerList.removeGlobal(this);

            if (_checkTask != null) {
                _checkTask.cancel(true);
                _checkTask = null;
            }
        }
    }
}
 
vou testar todos esses códigos agora desse pessoal incrivel!
Para reiniciar o olly é então trocar os horários aqui?

CompetiçãoCustomStartTime = 2200
ConcorrênciaCustomEndTime = 24
 
vou testar todos esses códigos agora desse pessoal incrivel!
Para reiniciar o olly é então trocar os horários aqui?

CompetiçãoCustomStartTime = 2200
ConcorrênciaCustomEndTime = 24
put a big window so you have all the time you want to test, 1000 (first value) and 2300 (second value)
then you can start them manually from in-game admin control panel
 
Back
Top