Ir para conteúdo
  • Cadastre-se
  • 0

Anjos atacando Baium


zzyt2

Pergunta

Olá, bom dia;

image.png.2f20d199e913a3f44d871d74bbb5dbeb.png

Sei exatamente que é normal que o anjo ataque o baium, pois os anjos são guardions de Tower of insolence. ok, mas eu quero que não aconteça isso, quero que os anjos ataquem os playes que estão dentro da sala , da mesma forma que o baium faz. Qual configuração exatamente eu poderia tá alterando pra realizar esse feito?

Link para o comentário
Compartilhar em outros sites

7 respostass a esta questão

Posts recomendados

  • 0

 

Test clase


package ai.individual;

import java.util.ArrayList;
import java.util.List;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
import net.sf.l2j.gameserver.model.L2Attackable;
import net.sf.l2j.gameserver.model.L2Character;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.actor.instance.L2GrandBossInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.quest.Quest;
import net.sf.l2j.gameserver.model.quest.QuestState;
import net.sf.l2j.gameserver.network.serverpackets.Earthquake;
import net.sf.l2j.gameserver.network.serverpackets.NpcSay;
import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
import net.sf.l2j.gameserver.templates.StatsSet;
import net.sf.l2j.gameserver.util.Util;
import net.sf.l2j.util.Rnd;
import net.sf.l2j.gameserver.model.zone.type.L2BossZone;

public class Baium extends Quest
{
    private L2Character _target;
    private L2Skill _skill;
    private static final int STONE_BAIUM = 12535;
    private static final int ANGELIC_VORTEX = 12571;
    private static final int LIVE_BAIUM = 12372;
    private static final int ARCHANGEL = 12373;

    // Baium status tracking
    private static final byte ASLEEP = 0; // Baium is in the stone version, waiting to be woken up. Entry is unlocked
    private static final byte AWAKE = 1; // Baium is awake and fighting. Entry is locked.
    private static final byte DEAD = 2; // Baium has been killed and has not yet spawned. Entry is locked

    // Fixed archangel spawn locations
    private final static int ANGEL_LOCATION[][] =
    {
        { 114239, 17168, 10080, 63544 },
        { 115780, 15564, 10080, 13620 },
        { 114880, 16236, 10080, 5400 },
        { 115168, 17200, 10080, 0 },
        { 115792, 16608, 10080, 0 }
    };

    private long _lastAttackVsBaiumTime = 0;
    private final List<L2Attackable> _angels = new ArrayList<>(5);
    private L2BossZone _zone;

    public static void main(String[] args)
    {
        // Quest class
        new Baium();
    }

    public Baium()
    {
        super(-1, "baium", "ai");
        registerNPC(LIVE_BAIUM);

        // Quest NPC starter initialization
        addStartNpc(STONE_BAIUM);
        addStartNpc(ANGELIC_VORTEX);
        addTalkId(STONE_BAIUM);
        addTalkId(ANGELIC_VORTEX);

        _zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
        StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM);
        int status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM);
        if (status == DEAD)
        {
            long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
            if (temp > 0)
            {
                startQuestTimer("baium_unlock", temp, null, null);
            }
            else
            {
                addSpawn(STONE_BAIUM, 116040, 17442, 10132, 41740, false, 0);
                GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
            }
        }
        else if (status == AWAKE)
        {
            int loc_x = info.getInteger("loc_x");
            int loc_y = info.getInteger("loc_y");
            int loc_z = info.getInteger("loc_z");
            int heading = info.getInteger("heading");
            final int hp = info.getInteger("currentHP");
            final int mp = info.getInteger("currentMP");
            L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
            GrandBossManager.getInstance().addBoss(baium);

            baium.setCurrentHpMp(hp, mp);
            baium.setIsInvul(true);
            baium.setRunning();

            for (int[] element : ANGEL_LOCATION)
            {
                L2NpcInstance angel = addSpawn(ARCHANGEL, element[0], element[1], element[2], element[3], false, 0);
                _angels.add((L2Attackable) angel);
            }

            ThreadPoolManager.getInstance().scheduleGeneral(() -> {
                // Choose a random player as target
                List<L2PcInstance> players = _zone.getPlayers();
                for (L2Attackable angel : _angels)
                {
                    if (!players.isEmpty()) {
                        L2PcInstance target = players.get(Rnd.get(players.size()));
                        angel.getKnownList().getKnownObjects().put(target.getObjectId(), target);
                        angel.setRunning();
                        angel.addDamageHate(target, 0, 99999);
                        angel.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
                    }
                }
                startQuestTimer("skill_range", 500, baium, null, true);
            }, 5000L);
        }
        else
        {
            addSpawn(STONE_BAIUM, 116040, 17442, 10132, 41740, false, 0);
        }
    }

    @Override
    public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player)
    {
        if (event.equalsIgnoreCase("baium_unlock"))
        {
            GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
            addSpawn(STONE_BAIUM, 116040, 17442, 10132, 41740, false, 0);
        }
        else if (event.equalsIgnoreCase("skill_range") && (npc != null))
        {
            callSkillAI(npc);
        }
        else if (event.equalsIgnoreCase("clean_player"))
        {
            _target = getRandomTarget(npc);
        }
        else if (event.equalsIgnoreCase("wakeup_action") && (npc != null))
        {
            npc.broadcastPacket(new SocialAction(npc.getObjectId(), 2));
        }
        else if (event.equalsIgnoreCase("manage_earthquake") && (npc != null))
        {
            npc.broadcastPacket(new Earthquake(npc.getX(), npc.getY(), npc.getZ(), 40, 10));
            startQuestTimer("social_action", 11000, npc, player);
        }
        else if (event.equalsIgnoreCase("social_action") && (npc != null))
        {
            npc.broadcastPacket(new SocialAction(npc.getObjectId(), 3));
            startQuestTimer("player_port", 6000, npc, player);
        }
        else if (event.equalsIgnoreCase("player_port") && (npc != null))
        {
            if ((player != null) && player.isInsideRadius(npc, 16000, true, false))
            {
                startQuestTimer("player_kill", 3000, npc, player);
            }
            else
            {
                startQuestTimer("spawn_archangel", 8000, npc, null);
            }
        }
        else if (event.equalsIgnoreCase("player_kill") && (npc != null))
        {
            if ((player != null) && player.isInsideRadius(npc, 16000, true, false))
            {
                npc.broadcastPacket(new SocialAction(npc.getObjectId(), 1));
                npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), player.getName() + ", How dare you wake me! Now you shall die!"));

                npc.setTarget(player);

                if (player.isInsideRadius(npc, 16000, true, false))
                {
                    npc.doCast(SkillTable.getInstance().getInfo(4136, 1));
                }
            }

            startQuestTimer("spawn_archangel", 8000, npc, null);
        }
        else if (event.equalsIgnoreCase("spawn_archangel") && (npc != null))
        {
            npc.setIsInvul(false);

            // Choose a random player as target
            List<L2PcInstance> players = _zone.getPlayers();
            for (int[] element : ANGEL_LOCATION)
            {
                L2NpcInstance angel = addSpawn(ARCHANGEL, element[0], element[1], element[2], element[3], false, 0);
                _angels.add((L2Attackable) angel);

                if (!players.isEmpty()) {
                    L2PcInstance target = players.get(Rnd.get(players.size()));
                    angel.getKnownList().getKnownObjects().put(target.getObjectId(), target);
                    angel.setRunning();
                    angel.addDamageHate(target, 0, 99999);
                    angel.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
                }
            }
            startQuestTimer("skill_range", 500, npc, null, true);
        }
        else if (event.equalsIgnoreCase("update_angel_targets"))
        {
            // Update angel targets to new players
            List<L2PcInstance> players = _zone.getPlayers();
            for (L2Attackable angel : _angels)
            {
                if (!players.isEmpty())
                {
                    L2PcInstance target = players.get(Rnd.get(players.size()));
                    angel.getKnownList().getKnownObjects().put(target.getObjectId(), target);
                    angel.setRunning();
                    angel.addDamageHate(target, 0, 99999);
                    angel.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
                }
            }
        }

        return super.onAdvEvent(event, npc, player);
    }

    private void callSkillAI(L2NpcInstance npc)
    {
        if (System.currentTimeMillis() - _lastAttackVsBaiumTime > 10000)
        {
            if (npc.getTarget() != null)
            {
                _skill = SkillTable.getInstance().getInfo(4136, 1);
                if (_skill != null)
                {
                    npc.doCast(_skill);
                }
            }
            _lastAttackVsBaiumTime = System.currentTimeMillis();
        }
    }

    private L2PcInstance getRandomTarget(L2NpcInstance npc)
    {
        List<L2PcInstance> players = _zone.getPlayers();
        if (!players.isEmpty())
        {
            return players.get(Rnd.get(players.size()));
        }
        return null;
    }
}


 

 

Link para o comentário
Compartilhar em outros sites


  • 0

anjos e baium sao inimigos e nao aliados, ele só vão parar de atacar quando tiver jogadores no local mas da pra tirar essa regra de eles atacar o baium, fica na class baium.java

Link para o comentário
Compartilhar em outros sites

  • 0

eso viene desde Baium.java
hay una linea mal redactada en lo que es intencion de ataque

aca te dejo la clase actualizada y funcional, en mi server funciona perfectamente, mi pack es L2j Premium

nota: Tambien tengo corregido frintezza y todos los scripts epicos , luego hare algun post seguramente

Saludos , cualquier cosa me escribes!

 

package L2jServer.gameserver.ai.additional.invidual;

import static L2jServer.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;

import javolution.util.FastList;
import L2jServer.Config;
import L2jServer.gameserver.ai.CtrlIntention;
import L2jServer.gameserver.datatables.SkillTable;
import L2jServer.gameserver.geo.GeoData;
import L2jServer.gameserver.managers.GrandBossManager;
import L2jServer.gameserver.model.L2Attackable;
import L2jServer.gameserver.model.L2Character;
import L2jServer.gameserver.model.L2Object;
import L2jServer.gameserver.model.L2Skill;
import L2jServer.gameserver.model.actor.instance.L2GrandBossInstance;
import L2jServer.gameserver.model.actor.instance.L2MonsterInstance;
import L2jServer.gameserver.model.actor.instance.L2NpcInstance;
import L2jServer.gameserver.model.actor.instance.L2PcInstance;
import L2jServer.gameserver.model.actor.instance.L2PetInstance;
import L2jServer.gameserver.model.actor.instance.L2PlayableInstance;
import L2jServer.gameserver.model.quest.Quest;
import L2jServer.gameserver.model.zone.type.L2BossZone;
import L2jServer.gameserver.network.serverpackets.Earthquake;
import L2jServer.gameserver.network.serverpackets.PlaySound;
import L2jServer.gameserver.network.serverpackets.SocialAction;
import L2jServer.gameserver.templates.StatsSet;
import L2jServer.gameserver.thread.ThreadPoolManager;
import L2jServer.gameserver.util.Util;
import L2jServer.log.Log;
import L2jServer.util.random.Rnd;

public class Baium extends Quest implements Runnable
{
    private L2Character _actualVictim;
    private L2PcInstance _waker;
    
    private static final int STONE_BAIUM = 29025;
    private static final int LIVE_BAIUM = 29020;
    private static final int ARCHANGEL = 29021;
    private static final int ANGELIC_VORTEX = 31862;
    
    // Baium status tracking
    private static final byte ASLEEP = 0; // baium is in the stone version, waiting to be woken up. Entry is unlocked.
    private static final byte AWAKE = 1; // baium is awake and fighting. Entry is locked.
    private static final byte DEAD = 2; // baium has been killed and has not yet spawned. Entry is locked.
    
    private final SimpleDateFormat date = new SimpleDateFormat("H:mm:ss yyyy/MM/dd");
    
    // Archangels spawns
    private final static int ANGEL_LOCATION[][] =
    {
        {
            114239,
            17168,
            10080,
            63544
        },
        {
            115780,
            15564,
            10080,
            13620
        },
        {
            114880,
            16236,
            10080,
            5400
        },
        {
            115168,
            17200,
            10080,
            0
        },
        {
            115792,
            16608,
            10080,
            0
        },
    };
    
    protected long _LastAttackVsBaiumTime = 0;
    private final List<L2NpcInstance> _Minions = new ArrayList<>(5);
    protected L2BossZone _Zone;
    
    public Baium(int questId, String name, String descr)
    {
        super(questId, name, descr);
        
        int[] mob =
        {
            LIVE_BAIUM
        };
        this.registerMobs(mob);
        
        // Quest NPC starter initialization
        addStartNpc(STONE_BAIUM);
        addStartNpc(ANGELIC_VORTEX);
        addTalkId(STONE_BAIUM);
        addTalkId(ANGELIC_VORTEX);
        
        _Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
        
        StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM);
        Integer status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM);
        
        if (status == DEAD)
        {
            // load the unlock date and time for baium from DB
            long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
            if (temp > 0)
            {
                // The time has not yet expired. Mark Baium as currently locked (dead).
                startQuestTimer("baium_unlock", temp, null, null, false);
            }
            else
            {
                // The time has expired while the server was offline. Spawn the stone-baium as ASLEEP.
                addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
                GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
            }
        }
        else if (status == AWAKE)
        {
            final int loc_x = info.getInteger("loc_x");
            final int loc_y = info.getInteger("loc_y");
            final int loc_z = info.getInteger("loc_z");
            final int heading = info.getInteger("heading");
            final int hp = info.getInteger("currentHP");
            final int mp = info.getInteger("currentMP");
            
            L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
            GrandBossManager.getInstance().addBoss(baium);
            
            baium.setCurrentHpMp(hp, mp);
            baium.setRunning();
            
            // start monitoring baium's inactivity
            _LastAttackVsBaiumTime = System.currentTimeMillis();
            startQuestTimer("baium_despawn", 60000, baium, null, true);
            startQuestTimer("skill_range", 2000, baium, null, true);
            
            // Spawns angels
            for (int[] element : ANGEL_LOCATION)
            {
                L2NpcInstance angel = addSpawn(ARCHANGEL, element[0], element[1], element[2], element[3], false, 0);
                angel.setRunning();
                // angel.setIsInvul(false);
                _Minions.add(angel);
            }
            
            // Angels AI
            startQuestTimer("angels_aggro_reconsider", 5000, null, null, true);
        }
        else
        {
            addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
        }
    }
    
    @Override
    public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player)
    {
        if ((npc != null) && (npc.getNpcId() == LIVE_BAIUM))
        {
            if (event.equalsIgnoreCase("skill_range"))
            {
                callSkillAI(npc);
            }
            else if (event.equalsIgnoreCase("baium_neck"))
            {
                npc.broadcastPacket(new SocialAction(npc.getObjectId(), 3));
            }
            else if (event.equalsIgnoreCase("sacrifice_waker"))
            {
                if (_waker != null)
                {
                    
                    // 60% to die.
                    if (Rnd.get(100) < 60)
                    {
                        _waker.getStatus().setCurrentHp(0);
                        _waker.doDie(npc);
                    }
                }
            }
            else if (event.equalsIgnoreCase("baium_roar"))
            {
                // Roar animation
                npc.broadcastPacket(new SocialAction(npc.getObjectId(), 1));
                
                // Spawn angels
                for (int[] element : ANGEL_LOCATION)
                {
                    L2NpcInstance angel = addSpawn(ARCHANGEL, element[0], element[1], element[2], element[3], false, 0);
                    angel.setRunning();
                    // angel.setIsInvul(true);
                    _Minions.add(angel);
                }
                
                // Angels AI
                startQuestTimer("angels_aggro_reconsider", 5000, null, null, true);
            }
            // despawn the live baium after 30 minutes of inactivity
            // also check if the players are cheating, having pulled Baium outside his zone...
            else if (event.equalsIgnoreCase("baium_despawn"))
            {
                // just in case the zone reference has been lost (somehow...), restore the reference
                if (_Zone == null)
                {
                    _Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
                }
                
                if (_LastAttackVsBaiumTime + Config.BAIUM_SLEEP * 1000 < System.currentTimeMillis())
                {
                    // despawn the live-baium
                    npc.deleteMe();
                    
                    // Unspawn angels
                    for (L2NpcInstance minion : _Minions)
                    {
                        if (minion != null)
                        {
                            minion.getSpawn().stopRespawn();
                            minion.deleteMe();
                        }
                    }
                    _Minions.clear();
                    
                    addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); // spawn stone-baium
                    GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); // Baium isn't awaken anymore
                    _Zone.oustAllPlayers();
                    cancelQuestTimer("baium_despawn", npc, null);
                }
                else if (((_LastAttackVsBaiumTime + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < ((npc.getMaxHp() * 3) / 4.0)))
                {
                    npc.setTarget(npc);
                    L2Skill skill = SkillTable.getInstance().getInfo(4135, 1);
                    npc.doCast(skill);
                }
                else if (!_Zone.isInsideZone(npc))
                {
                    npc.teleToLocation(116033, 17447, 10104);
                }
            }
        }
        else if (event.equalsIgnoreCase("baium_unlock"))
        {
            GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
            addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
        }
        else if (event.equalsIgnoreCase("angels_aggro_reconsider"))
        {
            boolean updateTarget = false; // Update or no the target
            
            for (L2NpcInstance minion : _Minions)
            {
                L2Attackable angel = ((L2Attackable) minion);
                if (angel == null)
                {
                    continue;
                }
                
                L2Character victim = angel.getMostHated();
                
                if (Rnd.get(100) < 10)
                {
                    updateTarget = true;
                }
                else
                {
                    if (victim != null) // Target is a unarmed player ; clean aggro.
                    {
                        if ((victim instanceof L2PcInstance) && (victim.getActiveWeaponInstance() == null))
                        {
                            angel.stopHating(victim); // Clean the aggro number of previous victim.
                            updateTarget = true;
                        }
                    }
                    else
                    {
                        // No target currently.
                        updateTarget = true;
                    }
                }
                
                if (updateTarget)
                {
                    L2Character newVictim = getRandomTargetArchangel(minion);
                    if ((newVictim != null) && (victim != newVictim))
                    {
                        angel.setIsRunning(true);
                        angel.addDamageHate(newVictim, 0, 999);
                        angel.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, newVictim);
                    }
                }
            }
        }
        return super.onAdvEvent(event, npc, player);
    }
    
    @Override
    public String onTalk(L2NpcInstance npc, L2PcInstance player)
    {
        int npcId = npc.getNpcId();
        String htmltext = null;
        
        if (_Zone == null)
        {
            _Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
            
            if (_Zone == null)
            {
                return "<html><body>Angelic Vortex:<br>You may not enter while admin disabled this zone.</body></html>

 

Link para o comentário
Compartilhar em outros sites

  • 0
56 minutos atrás, D1MITRY-DEV disse:

que vem do Baium.java
tem uma linha mal escrita qual é a intenção do ataque

aqui deixo para vocês a classe atualizada e funcional, no meu servidor funciona perfeitamente, meu pack é L2j Premium

nota: também corrigi a frintezza e todos os roteiros épicos, então com certeza farei um post

Saudações, escreva-me qualquer coisa!

pacote L2jServer.gameserver.ai.additional.invidual;

importar estático L2jServer.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;

importar java.text.DateFormat;
importar java.text.SimpleDateFormat;
importar java.util.ArrayList;
importar java.util.Calendar;
importar java.util.Collection;
importar java.util.Date;
importar java.util.GregorianCalendar;
importar java.util.List;

importar javolution.util.FastList;
importar L2jServer.Config;
importar L2jServer.gameserver.ai.CtrlIntention;
importar L2jServer.gameserver.datatables.SkillTable;
importar L2jServer.gameserver.geo.GeoData ;
importar L2jServer.gameserver.managers.GrandBossManager; importar L2jServer.gameserver.model.L2Attackable
; importar L2jServer.gameserver.model.L2Character; importar
L2jServer.gameserver.model.L2Object; importar L2jServer.gameserver.model.L2Skill;
importar L2jServer.gameserver.model.actor.instance.L2GrandBossInstance; importar L2jServer.gameserver.model.actor.instance.L2MonsterInstance; importar L2jServer.gameserver.model.actor.instance.L2NpcInstance; importar L2jServer.gameserver.model.actor.instance.L2PcInstance; importar L2jServer.gameserver.model.actor.instance.L2PetInstance; importar L2jServer.gameserver.model.actor.instance.L2PlayableInstance; importar L2jServer.gameserver.model.quest.Quest; importar L2jServer.gameserver.model.zone.type.L2BossZone; importar L2jServer.gameserver.network.serverpackets.Earthquake; importar L2jServer.gameserver.network.serverpackets.PlaySound; importar L2jServer.gameserver.network.serverpackets.SocialAction; importar L2jServer.gameserver.templates.StatsSet; importar L2jServer.gameserver.thread.ThreadPoolManager; importar L2jServer.gameserver.util.Util; importar L2jServer.log.Log; importar L2jServer.util.random.Rnd;















 

public class Baium extends Quest implements Runnable
{
    private L2Character _actualVictim;
    private L2PcInstance _waker;
    
    private static final int STONE_BAIUM = 29025;
    private static final int LIVE_BAIUM = 29020;
    private static final int ARCHANGEL = 29021;
    private static final int ANGELIC_VORTEX = 31862;
    
    // Rastreamento de status do Baium
    private static final byte ASLEEP = 0; // baium está na versão stone, esperando para ser acordado. A entrada está desbloqueada.
    private static final byte AWAKE = 1; // baium está acordado e lutando. A entrada está bloqueada.
    private static final byte DEAD = 2; // baium foi morto e ainda não foi gerado. A entrada está bloqueada.
    
    private final SimpleDateFormat date = new SimpleDateFormat("H:mm:ss yyyy/MM/dd");
    
    // Archangels gera
    private final static int ANGEL_LOCATION[][] =
    {
        {
            114239,
            17168,
            10080,
            63544
        },
        {
            115780,
            15564,
            10080,
            13620
        },
        {
            114880,
            16236,
            10080,
            5400
        },
        {
            115168,
            17200,
            10080,
            0
        },
        {
            115792,
            16608,
            10080,
            0
        },
    };
    
    protegido long _LastAttackVsBaiumTime = 0;
    privado final List<L2NpcInstance> _Minions = new ArrayList<>(5);
    protegido L2BossZone _Zone;
    
    public Baium(int questId, String name, String descr)
    {
        super(questId, name, descr);
        
        int[] mob =
        {
            LIVE_BAIUM
        };
        this.registerMobs(mob);
        
        // Inicialização do iniciador do NPC da missão
        addStartNpc(STONE_BAIUM);
        addStartNpc(ANGELIC_VORTEX);
        addTalkId(STONE_BAIUM);
        addTalkId(ANGELIC_VORTEX);
        
        _Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
        
        StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM);
        Inteiro status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM);
        
        if (status == DEAD)
        {
            // carregue a data e hora de desbloqueio do baium do banco de dados
            long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
            if (temp > 0)
            {
                // O tempo ainda não expirou. Marque o Baium como bloqueado no momento (morto).
                startQuestTimer("baium_unlock", temp, null, null, false);
            }
            else
            {
                // O tempo expirou enquanto o servidor estava offline. Crie o stone-baium como ASLEEP.
                addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
                GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
            }
        }
        else if (status == AWAKE)
        {
            final int loc_x = info.getInteger("loc_x");
            final int loc_y = info.getInteger("loc_y");
            final int loc_z = info.getInteger("loc_z");
            final int heading = info.getInteger("heading");
            final int hp = info.getInteger("currentHP");
            final int mp = info.getInteger("currentMP");
            
            L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
            GrandBossManager.getInstance().addBoss(baium);
            
            baium.setCurrentHpMp(hp, mp);
            baium.setRunning();
            
            // iniciar o monitoramento da inatividade do baium
            _LastAttackVsBaiumTime = System.currentTimeMillis();
            startQuestTimer("baium_despawn", 60000, baium, null, true);
            startQuestTimer("skill_range", 2000, baium, null, true);
            
            // Gera anjos
            para (int[] elemento : LOCALIZAÇÃO_DO_ANJO)
            {
                L2NpcInstance anjo = addSpawn(ARCANJO, elemento[0], elemento[1], elemento[2], elemento[3], false, 0);
                angel.setRunning();
                // angel.setIsInvul(false);
                _Minions.add(anjo);
            }
            
            // IA dos anjos
            startQuestTimer("angels_aggro_reconsider", 5000, null, null, true);
        }
        senão
        {
            addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
        }
    }
    
    @Override
    public String onAdvEvent(String evento, L2NpcInstance npc, L2PcInstance jogador)
    {
        if ((npc != nulo) && (npc.getNpcId() == LIVE_BAIUM))
        {
            if (event.equalsIgnoreCase("skill_range"))
            {
                callSkillAI(npc);
            }
            else if (event.equalsIgnoreCase("baium_neck"))
            {
                npc.broadcastPacket(new SocialAction(npc.getObjectId(), 3));
            }
            else if (event.equalsIgnoreCase("sacrifice_waker"))
            {
                if (_waker != null)
                {
                    
                    // 60% para morrer.
                    if (Rnd.get(100) < 60)
                    {
                        _waker.getStatus().setCurrentHp(0);
                        _waker.doDie(npc);
                    }
                }
            }
            else if (event.equalsIgnoreCase("baium_roar"))
            {
                // Animação de rugido
                npc.broadcastPacket(new SocialAction(npc.getObjectId(), 1));
                
                // Gerar anjos
                para (int[] elemento : ANGEL_LOCATION)
                {
                    L2NpcInstance anjo = addSpawn(ARCHANGEL, elemento[0], elemento[1], elemento[2], elemento[3], falso, 0);
                    anjo.setRunning();
                    // anjo.setIsInvul(verdadeiro);
                    _Minions.add(anjo);
                }
                
                // IA dos anjos
                startQuestTimer("angels_aggro_reconsider", 5000, nulo, nulo, verdadeiro);
            }
            // despawn o baium vivo após 30 minutos de inatividade
            // também verifica se os jogadores estão trapaceando, tendo puxado o Baium para fora de sua zona...
            else if (event.equalsIgnoreCase("baium_despawn"))
            {
                // apenas no caso de a referência da zona ter sido perdida (de alguma forma...), restaure a referência
                if (_Zone == null)
                {
                    _Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
                }
                
                if (_LastAttackVsBaiumTime + Config.BAIUM_SLEEP * 1000 < System.currentTimeMillis())
                { // despawn o                     npc.deleteMe()
                    do baium vivo ;                     // Despawn os anjos                     for (L2NpcInstance minion : _Minions)                     {                         if (minion != null)                         {

                    





                            minion.getSpawn().stopRespawn();
                            minion.deleteMe();
                        }
                    }
                    _Minions.clear();
                    
                    addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); // gera stone-baium
                    GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); // Baium não está mais acordado
                    _Zone.oustAllPlayers();
                    cancelQuestTimer("baium_despawn", npc, null);
                }
                else if (((_LastAttackVsBaiumTime + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < ((npc.getMaxHp() * 3) / 4.0)))
                {
                    npc.setTarget(npc);
                    Habilidade L2Skill = SkillTable.getInstance().getInfo(4135, 1);
                    npc.doCast(habilidade);
                }
                senão se (!_Zone.isInsideZone(npc))
                {
                    npc.teleToLocation(116033, 17447, 10104);
                }
            }
        }
        senão se (event.equalsIgnoreCase("baium_unlock"))
        {
            GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
            addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
        }
        senão se (event.equalsIgnoreCase("angels_aggro_reconsider"))
        {
            boolean updateTarget = false; // Atualizar ou não o alvo
            
            para (L2NpcInstance minion : _Minions)
            {
                L2Attackable angel = ((L2Attackable) minion);
                if (angel == null)
                {
                    continue;
                }
                
                L2Character victim = angel.getMostHated();
                
                if (Rnd.get(100) < 10)
                {
                    updateTarget = true;
                }
                else
                {
                    if (victim != null) // O alvo é um jogador desarmado ; limpa aggro.
                    {
                        if ((victim instanceof L2PcInstance) && (victim.getActiveWeaponInstance() == null))
                        {
                            angel.stopHating(victim); // Limpa o número de aggro da vítima anterior.
                            updateTarget = true;
                        }
                    }
                    else
                    {
                        // Nenhum alvo atualmente.
                        updateTarget = true;
                    }
                }
                
                if (updateTarget)
                {
                    L2Character newVictim = getRandomTargetArchangel(minion);
                    if ((newVictim != null) && (victim != newVictim))
                    {
                        angel.setIsRunning(true);
                        angel.addDamageHate(newVictim, 0, 999);
                        angel.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, newVictim);
                    }
                }
            }
        }
        return super.onAdvEvent(event, npc, player);
    }
    
    @Override
    public String onTalk(L2NpcInstance npc, L2PcInstance player)
    {
        int npcId = npc.getNpcId();
        String htmltext = null;
        
        if (_Zone == null)
        {
            _Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
            
            if (_Zone == null)
            {
                return "<html><body>Vórtice Angélico:<br>Você não pode entrar enquanto o administrador desabilitar esta zona.</body></html>

Qual dessas linhas seria a linha exata que faz com que os anjos não ataque o baium?

Link para o comentário
Compartilhar em outros sites

  • 0
hace 7 minutos, zzyt2 dijo:

Qual dessas linhas seria a linha exata que faz com que os anjos não ataque o baium?

que pack estas utilizando ? pasame tu clase 

y te marco el problema 

Link para o comentário
Compartilhar em outros sites

  • 0

L2jlisvus C4

 

 

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package ai.individual;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.geoengine.GeoData;
import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
import net.sf.l2j.gameserver.model.L2Attackable;
import net.sf.l2j.gameserver.model.L2Character;
import net.sf.l2j.gameserver.model.L2Effect;
import net.sf.l2j.gameserver.model.L2Object;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.actor.instance.L2GrandBossInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
import net.sf.l2j.gameserver.model.quest.Quest;
import net.sf.l2j.gameserver.model.quest.QuestState;
import net.sf.l2j.gameserver.model.quest.QuestTimer;
import net.sf.l2j.gameserver.model.zone.type.L2BossZone;
import net.sf.l2j.gameserver.network.serverpackets.Earthquake;
import net.sf.l2j.gameserver.network.serverpackets.MoveToPawn;
import net.sf.l2j.gameserver.network.serverpackets.NpcSay;
import net.sf.l2j.gameserver.network.serverpackets.PlaySound;
import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
import net.sf.l2j.gameserver.templates.StatsSet;
import net.sf.l2j.gameserver.util.Util;
import net.sf.l2j.util.Rnd;

/**
 * Baium AI Note1: if the server gets rebooted while players are still fighting Baium, there is no lock, but players also lose their ability to wake baium up. However, should another person enter the room and wake him up, the players who had stayed inside may join the raid. This can be helpful for
 * players who became victims of a reboot (they only need 1 new player to enter and wake up baium) and is not too exploitable since any player wishing to exploit it would have to suffer 5 days of being parked in an empty room. Note2: Neither version of Baium should be a permanent spawn. This script
 * is fully capable of spawning the statue-version when the lock expires and switching it to the mob version promptly. Additional notes ( source

O conteúdo está oculto, favor efetuar login ou se cadastrar!
😞 * Baium only first respawns five days after his last death. And from those five days he will
 * respawn within 1-8 hours of his last death. So, you have to know his last time of death. * If by some freak chance you are the only one in Baium's chamber and NO ONE comes in [ha, ha] you or someone else will have to wake Baium. There is a good chance that Baium will automatically kill whoever
 * wakes him. There are some people that have been able to wake him and not die, however if you've already gone through the trouble of getting the bloody fabric and camped him out and researched his spawn time, are you willing to take that chance that you'll wake him and not be able to finish your
 * quest? Doubtful. [ this powerful attack vs the player who wakes him up is NOT yet implemented here] * once someone starts attacking Baium no one else can port into the chamber where he is. Unlike with the other raid bosses, you can just show up at any time as long as you are there when they die.
 * Not true with Baium. Once he gets attacked, the port to Baium closes. byebye, see you in 5 days. If nobody attacks baium for 30 minutes, he auto-despawns and unlocks the vortex
 * @author Fulminus version 0.1
 */
public class Baium extends Quest
{
    private L2Character _target;
    private L2Skill _skill;
    private static final int STONE_BAIUM = 12535;
    private static final int ANGELIC_VORTEX = 12571;
    private static final int LIVE_BAIUM = 12372;
    private static final int ARCHANGEL = 12373;

    // Baium status tracking
    private static final byte ASLEEP = 0; // baium is in the stone version, waiting to be woken up. Entry is unlocked
    private static final byte AWAKE = 1; // baium is awake and fighting. Entry is locked.
    private static final byte DEAD = 2; // baium has been killed and has not yet spawned. Entry is locked

    // fixed archangel spawnloc
    private final static int ANGEL_LOCATION[][] =
    {
        {
            114239,
            17168,
            10080,
            63544
        },
        {
            115780,
            15564,
            10080,
            13620
        },
        {
            114880,
            16236,
            10080,
            5400
        },
        {
            115168,
            17200,
            10080,
            0
        },
        {
            115792,
            16608,
            10080,
            0
        }
    };

    private long _lastAttackVsBaiumTime = 0;
    private final List<L2Attackable> _angels = new ArrayList<>(5);
    private L2BossZone _zone;
    
    public static void main(String[] args)
    {
        // Quest class
        new Baium();
    }
    
    public Baium()
    {
        super(-1, "baium", "ai");
        registerNPC(LIVE_BAIUM);

        // Quest NPC starter initialization
        addStartNpc(STONE_BAIUM);
        addStartNpc(ANGELIC_VORTEX);
        addTalkId(STONE_BAIUM);
        addTalkId(ANGELIC_VORTEX);

        _zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
        StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM);
        int status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM);
        if (status == DEAD)
        {
            // load the unlock date and time for baium from DB
            long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
            if (temp > 0)
            {
                // the unlock time has not yet expired. Mark Baium as currently locked (dead). Setup a timer
                // to fire at the correct time (calculate the time between now and the unlock time,
                // setup a timer to fire after that many msec)
                startQuestTimer("baium_unlock", temp, null, null);
            }
            else
            {
                // the time has already expired while the server was offline. Delete the saved time and
                // immediately spawn the stone-baium. Also the state need not be changed from ASLEEP
                addSpawn(STONE_BAIUM, 116040, 17442, 10132, 41740, false, 0);
                GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
            }
        }
        else if (status == AWAKE)
        {
            int loc_x = info.getInteger("loc_x");
            int loc_y = info.getInteger("loc_y");
            int loc_z = info.getInteger("loc_z");
            int heading = info.getInteger("heading");
            final int hp = info.getInteger("currentHP");
            final int mp = info.getInteger("currentMP");
            L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
            GrandBossManager.getInstance().addBoss(baium);
            
            baium.setCurrentHpMp(hp, mp);
            baium.setIsInvul(true);
            baium.setRunning();
            
            for (int[] element : ANGEL_LOCATION)
            {
                L2NpcInstance angel = addSpawn(ARCHANGEL, element[0], element[1], element[2], element[3], false, 0);
                _angels.add((L2Attackable) angel);
            }

            ThreadPoolManager.getInstance().scheduleGeneral(() -> {
                for (L2Attackable angel : _angels)
                {
                    // Add Baium to the angel knownlist
                    angel.getKnownList().getKnownObjects().put(baium.getObjectId(), baium);
                    angel.setRunning();
                    angel.addDamageHate(baium, 0, 99999);
                    angel.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, baium);
                }
                startQuestTimer("skill_range", 500, baium, null, true);
            }, 5000L);
        }
        else
        {
            addSpawn(STONE_BAIUM, 116040, 17442, 10132, 41740, false, 0);
        }
    }

    @Override
    public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player)
    {
        if (event.equalsIgnoreCase("baium_unlock"))
        {
            GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
            addSpawn(STONE_BAIUM, 116040, 17442, 10132, 41740, false, 0);
        }
        else if (event.equalsIgnoreCase("skill_range") && (npc != null))
        {
            callSkillAI(npc);
        }
        else if (event.equalsIgnoreCase("clean_player"))
        {
            _target = getRandomTarget(npc);
        }
        else if (event.equalsIgnoreCase("wakeup_action") && (npc != null))
        {
            npc.broadcastPacket(new SocialAction(npc.getObjectId(), 2));
        }
        else if (event.equalsIgnoreCase("manage_earthquake") && (npc != null))
        {
            npc.broadcastPacket(new Earthquake(npc.getX(), npc.getY(), npc.getZ(), 40, 10));
            startQuestTimer("social_action", 11000, npc, player);
        }
        else if (event.equalsIgnoreCase("social_action") && (npc != null))
        {
            npc.broadcastPacket(new SocialAction(npc.getObjectId(), 3));
            startQuestTimer("player_port", 6000, npc, player);
        }
        else if (event.equalsIgnoreCase("player_port") && (npc != null))
        {
            if ((player != null) && player.isInsideRadius(npc, 16000, true, false))
            {
                startQuestTimer("player_kill", 3000, npc, player);
            }
            else
            {
                // Just in case player somehow escapes
                startQuestTimer("spawn_archangel", 8000, npc, null);
            }
        }
        else if (event.equalsIgnoreCase("player_kill") && (npc != null))
        {
            if ((player != null) && player.isInsideRadius(npc, 16000, true, false))
            {
                npc.broadcastPacket(new SocialAction(npc.getObjectId(), 1));
                npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), player.getName() + ", How dare you wake me! Now you shall die!"));
                
                npc.setTarget(player);
                
                // Baium's Gift skill
                if (player.isInsideRadius(npc, 16000, true, false))
                {
                    npc.doCast(SkillTable.getInstance().getInfo(4136, 1));
                }
            }

            startQuestTimer("spawn_archangel", 8000, npc, null);
        }
        else if (event.equalsIgnoreCase("spawn_archangel") && (npc != null))
        {
            npc.setIsInvul(false);
            
            for (int[] element : ANGEL_LOCATION)
            {
                L2NpcInstance angel = addSpawn(ARCHANGEL, element[0], element[1], element[2], element[3], false, 0);
                _angels.add((L2Attackable) angel);
            }

            ThreadPoolManager.getInstance().scheduleGeneral(() -> {
                for (L2Attackable angel : _angels)
                {
                    // Add Baium to the angel knownlist
                    angel.getKnownList().getKnownObjects().put(npc.getObjectId(), npc);
                    angel.setRunning();
                    angel.addDamageHate(npc, 0, 99999);
                    angel.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
                }
                startQuestTimer("skill_range", 500, npc, null, true);
            }, 5000L);
        }
        else if (event.equalsIgnoreCase("baium_despawn") && (npc != null))
        {
            // despawn the live baium after 30 minutes of inactivity
            // also check if the players are cheating, having pulled Baium outside his zone...
            if (npc.getNpcId() == LIVE_BAIUM)
            {
                // just in case the zone reference has been lost (somehow...), restore the reference
                if (_zone == null)
                {
                    _zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
                }
                if ((_lastAttackVsBaiumTime + 1800000) < System.currentTimeMillis())
                {
                    npc.deleteMe(); // despawn the live-baium

                    for (L2NpcInstance minion : _angels)
                    {
                        if (minion != null)
                        {
                            minion.getSpawn().stopRespawn();
                            minion.deleteMe();
                        }
                    }

                    addSpawn(STONE_BAIUM, 116040, 17442, 10132, 41740, false, 0); // spawn stone-baium
                    GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); // mark that Baium is not awake any more
                    _zone.oustAllPlayers();
                    cancelQuestTimer("baium_despawn", npc, null);
                }
                else if (((_lastAttackVsBaiumTime + 300000) < System.currentTimeMillis()) && (npc.getCurrentHp() < ((npc.getMaxHp() * 3) / 4)))
                {
                    npc.setTarget(npc);
                    npc.doCast(SkillTable.getInstance().getInfo(4135, 1));
                }
                else if (!_zone.isInsideZone(npc))
                {
                    npc.teleToLocation(115213, 16623, 10080);
                }
            }
        }
        return super.onAdvEvent(event, npc, player);
    }

    @Override
    public String onTalk(L2NpcInstance npc, QuestState st)
    {
        int npcId = npc.getNpcId();
        if (_zone == null)
        {
            _zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077);
        }
        if (_zone == null)
        {
            return "<html><body>Angelic Vortex:<br>You may not enter while admin disabled this zone</body></html>

 

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.