diff --git a/game-server/data/handlers/ai/instance/abyssal_splinter/YamennesAI.java b/game-server/data/handlers/ai/instance/abyssal_splinter/YamennesAI.java index 8a76d9c2e..645c3c31c 100644 --- a/game-server/data/handlers/ai/instance/abyssal_splinter/YamennesAI.java +++ b/game-server/data/handlers/ai/instance/abyssal_splinter/YamennesAI.java @@ -9,8 +9,6 @@ import com.aionemu.gameserver.ai.poll.AIQuestion; import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE; import com.aionemu.gameserver.utils.PacketSendUtility; import com.aionemu.gameserver.utils.ThreadPoolManager; @@ -42,15 +40,14 @@ protected void handleAttack(Creature creature) { } private void startTasks() { - enrageTask = ThreadPoolManager.getInstance() - .schedule(() -> getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(19098, 55, 100))), 600000); + enrageTask = ThreadPoolManager.getInstance().schedule(() -> getOwner().queueSkill(19098, 55), 600000); portalTask = ThreadPoolManager.getInstance().schedule(() -> spawnPortals(false), 60000); } private void onHealingDebuff() { WorldMapInstance instance = getPosition().getWorldMapInstance(); deleteNpcs(instance.getNpcs(282107)); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(19282, 55, 100))); + getOwner().queueSkill(19282, 55); spawn(282107, getOwner().getX() + 10, getOwner().getY() - 10, getOwner().getZ(), (byte) 0); spawn(282107, getOwner().getX() - 10, getOwner().getY() + 10, getOwner().getZ(), (byte) 0); spawn(282107, getOwner().getX() + 10, getOwner().getY() + 10, getOwner().getZ(), (byte) 0); diff --git a/game-server/data/handlers/ai/instance/custom/eternalChallenge/CustomInstanceDominatorAI.java b/game-server/data/handlers/ai/instance/custom/eternalChallenge/CustomInstanceDominatorAI.java index 5d92130c1..fa2b9a93e 100644 --- a/game-server/data/handlers/ai/instance/custom/eternalChallenge/CustomInstanceDominatorAI.java +++ b/game-server/data/handlers/ai/instance/custom/eternalChallenge/CustomInstanceDominatorAI.java @@ -11,8 +11,6 @@ import com.aionemu.gameserver.model.gameobjects.VisibleObject; import com.aionemu.gameserver.model.gameobjects.player.Player; import com.aionemu.gameserver.model.gameobjects.state.CreatureSeeState; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_FORCED_MOVE; import com.aionemu.gameserver.utils.PacketSendUtility; import com.aionemu.gameserver.utils.ThreadPoolManager; @@ -69,42 +67,42 @@ private void debuffTarget() { getOwner().getSkillCoolDowns().clear(); // Make CD rank-dependent, not skill-dependent if (challengerRank >= CustomInstanceRankEnum.ANCIENT.getMinRank()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(3539, 65, 100))); // Ignite Aether + getOwner().queueSkill(3539, 65); // Ignite Aether if (challengerRank >= CustomInstanceRankEnum.CERANIUM.getMinRank()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(618, 65, 100))); // Ankle Snare + getOwner().queueSkill(618, 65); // Ankle Snare else if (challengerRank >= CustomInstanceRankEnum.GOLD.getMinRank()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(1328, 65, 100))); // Restraint (^) + getOwner().queueSkill(1328, 65); // Restraint (^) if (challengerRank >= CustomInstanceRankEnum.ANCIENT_PLUS.getMinRank()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(3775, 65, 100))); // Fear + getOwner().queueSkill(3775, 65); // Fear else if (challengerRank >= CustomInstanceRankEnum.GOLD.getMinRank()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(1417, 65, 100))); // Curse Tree (^) + getOwner().queueSkill(1417, 65); // Curse Tree (^) // SILVER: - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(3581, 65, 100))); // Withering Gloom + getOwner().queueSkill(3581, 65); // Withering Gloom if (challengerRank >= CustomInstanceRankEnum.PLATINUM.getMinRank()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(3574, 65, 100))); // Shackle of Vulnerability + getOwner().queueSkill(3574, 65); // Shackle of Vulnerability else // SILVER: - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(3780, 65, 100))); // Root of Enervation (^) + getOwner().queueSkill(3780, 65); // Root of Enervation (^) if (challengerRank >= CustomInstanceRankEnum.MITHRIL.getMinRank()) if (getOwner().getTarget() != null && getOwner().getTarget() instanceof Player && ((Player) (getOwner().getTarget())).getPlayerClass().isPhysicalClass()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(3571, 65, 100))); // Body Root + getOwner().queueSkill(3571, 65); // Body Root else - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(3572, 65, 100))); // Sigil of Silence + getOwner().queueSkill(3572, 65); // Sigil of Silence if (challengerRank >= CustomInstanceRankEnum.CERANIUM.getMinRank()) if (getOwner().getTarget() != null && getOwner().getTarget() instanceof Player && ((Player) (getOwner().getTarget())).getPlayerClass().isPhysicalClass()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(4135, 65, 100))); // Blinding Light + getOwner().queueSkill(4135, 65); // Blinding Light else - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(1336, 65, 100))); // Curse of Weakness + getOwner().queueSkill(1336, 65); // Curse of Weakness if (challengerRank >= CustomInstanceRankEnum.ANCIENT.getMinRank()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(4490, 65, 100))); // Paralysis Resonation + getOwner().queueSkill(4490, 65); // Paralysis Resonation debuffTask = ThreadPoolManager.getInstance().schedule(this::debuffTarget, 30000 - challengerRank * 1000 / 3); // 30s ... 20s } diff --git a/game-server/data/handlers/ai/instance/custom/pvpveMap/ModifiedIronWallAggressiveAI.java b/game-server/data/handlers/ai/instance/custom/pvpveMap/ModifiedIronWallAggressiveAI.java index 05c176384..da863b7c7 100644 --- a/game-server/data/handlers/ai/instance/custom/pvpveMap/ModifiedIronWallAggressiveAI.java +++ b/game-server/data/handlers/ai/instance/custom/pvpveMap/ModifiedIronWallAggressiveAI.java @@ -11,10 +11,8 @@ import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.player.Player; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; import com.aionemu.gameserver.model.stats.calc.Stat2; import com.aionemu.gameserver.model.stats.container.StatEnum; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_FORCED_MOVE; import com.aionemu.gameserver.skillengine.model.Effect; import com.aionemu.gameserver.skillengine.model.SkillTemplate; @@ -49,7 +47,7 @@ protected void handleAttack(Creature creature) { @Override public void handleHpPhase(int phaseHpPercent) { - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21165, 1, 100, 0, 3000))); + getOwner().queueSkill(21165, 1, 3000); } @Override @@ -127,7 +125,7 @@ public void onEndUseSkill(SkillTemplate skillTemplate, int skillLevel) { World.getInstance().updatePosition(getOwner(), pos.getX(), pos.getY(), pos.getZ(), pos.getHeading()); PacketSendUtility.broadcastPacketAndReceive(getOwner(), new SM_FORCED_MOVE(getOwner(), getOwner())); ThreadPoolManager.getInstance() - .schedule(() -> getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21171, 1, 100, 0, 6000))), 500); + .schedule(() -> getOwner().queueSkill(21171, 1, 6000), 500); }, 500); break; } diff --git a/game-server/data/handlers/ai/instance/danuarReliquary/CursedQueenModorAI.java b/game-server/data/handlers/ai/instance/danuarReliquary/CursedQueenModorAI.java index f19ddafcf..b5a9c344e 100644 --- a/game-server/data/handlers/ai/instance/danuarReliquary/CursedQueenModorAI.java +++ b/game-server/data/handlers/ai/instance/danuarReliquary/CursedQueenModorAI.java @@ -12,8 +12,6 @@ import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.skill.NpcSkillEntry; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_FORCED_MOVE; import com.aionemu.gameserver.network.aion.serverpackets.SM_HEADING_UPDATE; import com.aionemu.gameserver.skillengine.model.Effect; @@ -239,7 +237,7 @@ private void queueSkill(int id, int lvl) { } private void queueSkill(int id, int lvl, int nextSkillTime) { - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(id, lvl, 100, 0, nextSkillTime))); + getOwner().queueSkill(id, lvl, nextSkillTime); } private void updatePosition(final int curStage) { diff --git a/game-server/data/handlers/ai/instance/danuarReliquary/EnragedQueenModorAI.java b/game-server/data/handlers/ai/instance/danuarReliquary/EnragedQueenModorAI.java index 5bedb7e70..1628174b3 100644 --- a/game-server/data/handlers/ai/instance/danuarReliquary/EnragedQueenModorAI.java +++ b/game-server/data/handlers/ai/instance/danuarReliquary/EnragedQueenModorAI.java @@ -13,8 +13,6 @@ import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.skill.NpcSkillEntry; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_FORCED_MOVE; import com.aionemu.gameserver.network.aion.serverpackets.SM_HEADING_UPDATE; import com.aionemu.gameserver.skillengine.model.Effect; @@ -298,7 +296,7 @@ private void queueSkill(int id, int lvl) { } private void queueSkill(int id, int lvl, int nextSkillTime) { - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(id, lvl, 100, 0, nextSkillTime))); + getOwner().queueSkill(id, lvl, nextSkillTime); } private boolean isCrazedModor() { diff --git a/game-server/data/handlers/ai/instance/darkPoeta/CalindiFlamelordAI.java b/game-server/data/handlers/ai/instance/darkPoeta/CalindiFlamelordAI.java index 180c5d1f3..9df278a94 100644 --- a/game-server/data/handlers/ai/instance/darkPoeta/CalindiFlamelordAI.java +++ b/game-server/data/handlers/ai/instance/darkPoeta/CalindiFlamelordAI.java @@ -5,8 +5,6 @@ import com.aionemu.gameserver.ai.AIActions; import com.aionemu.gameserver.ai.AIName; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import com.aionemu.gameserver.utils.PacketSendUtility; @@ -36,7 +34,7 @@ private void scheduleWipe() { PacketSendUtility.broadcastToMap(getOwner(), SM_SYSTEM_MESSAGE.STR_MSG_INSTANCE_A_RANK_BATTLE_TIME()); wipeTask = ThreadPoolManager.getInstance().schedule(() -> { if (!isDead()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(19679, 50, 100, 0, 3000))); + getOwner().queueSkill(19679, 50, 3000); }, 600000); } diff --git a/game-server/data/handlers/ai/instance/darkPoeta/TahabataPyrelordAI.java b/game-server/data/handlers/ai/instance/darkPoeta/TahabataPyrelordAI.java index 175056781..24b574831 100644 --- a/game-server/data/handlers/ai/instance/darkPoeta/TahabataPyrelordAI.java +++ b/game-server/data/handlers/ai/instance/darkPoeta/TahabataPyrelordAI.java @@ -5,8 +5,6 @@ import com.aionemu.gameserver.ai.AIActions; import com.aionemu.gameserver.ai.AIName; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import com.aionemu.gameserver.utils.PacketSendUtility; @@ -36,7 +34,7 @@ private void scheduleWipe() { PacketSendUtility.broadcastToMap(getOwner(), SM_SYSTEM_MESSAGE.STR_MSG_INSTANCE_S_RANK_BATTLE_TIME()); wipeTask = ThreadPoolManager.getInstance().schedule(() -> { if (!isDead()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(19679, 50, 100, 0, 3000))); + getOwner().queueSkill(19679, 50, 3000); }, 300000); } diff --git a/game-server/data/handlers/ai/instance/dragonLordsRefuge/CalindiFlamelordAI.java b/game-server/data/handlers/ai/instance/dragonLordsRefuge/CalindiFlamelordAI.java index 2e32353b5..8998320bb 100644 --- a/game-server/data/handlers/ai/instance/dragonLordsRefuge/CalindiFlamelordAI.java +++ b/game-server/data/handlers/ai/instance/dragonLordsRefuge/CalindiFlamelordAI.java @@ -9,8 +9,6 @@ import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.player.Player; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import com.aionemu.gameserver.utils.PositionUtil; @@ -45,13 +43,13 @@ protected void handleAttack(Creature creature) { public void handleHpPhase(int phaseHpPercent) { switch (phaseHpPercent) { case 75, 50, 25 -> startHallucinatoryVictoryEvent(); - case 12 -> getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(20942, 1, 100))); + case 12 -> getOwner().queueSkill(20942, 1); } } protected void startHallucinatoryVictoryEvent() { if (getPosition().getWorldMapInstance().getNpc(730695) == null && getPosition().getWorldMapInstance().getNpc(730696) == null) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(20911, 1, 100))); + getOwner().queueSkill(20911, 1); } @Override @@ -71,7 +69,7 @@ public void onEndUseSkill(SkillTemplate skillTemplate, int skillLevel) { protected void blazeEngraving() { if (Rnd.chance() < 2 && getPosition().getWorldMapInstance().getNpc(283131) == null) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(20913, 60, 100))); + getOwner().queueSkill(20913, 60); } protected void rndSpawn(int npcId) { diff --git a/game-server/data/handlers/ai/instance/dragonLordsRefuge/GravityCrusherAI.java b/game-server/data/handlers/ai/instance/dragonLordsRefuge/GravityCrusherAI.java index 1248e0563..96df71b4d 100644 --- a/game-server/data/handlers/ai/instance/dragonLordsRefuge/GravityCrusherAI.java +++ b/game-server/data/handlers/ai/instance/dragonLordsRefuge/GravityCrusherAI.java @@ -8,8 +8,6 @@ import com.aionemu.gameserver.model.EmotionType; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.state.CreatureState; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_EMOTION; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import com.aionemu.gameserver.utils.PacketSendUtility; @@ -45,7 +43,7 @@ protected void handleSpawned() { private void transform() { ThreadPoolManager.getInstance().schedule(() -> { if (!isDead()) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(getNpcId() == 283141 ? 20967 : 21900, 1, 100))); + getOwner().queueSkill(getNpcId() == 283141 ? 20967 : 21900, 1); }, 30000); } @@ -64,7 +62,7 @@ public void onEndUseSkill(SkillTemplate skillTemplate, int skillLevel) { @Override public void handleMoveArrived() { super.handleMoveArrived(); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(20987, 1, 100))); + getOwner().queueSkill(20987, 1); } @Override diff --git a/game-server/data/handlers/ai/instance/dragonLordsRefuge/HM_CalindiFlamelordAI.java b/game-server/data/handlers/ai/instance/dragonLordsRefuge/HM_CalindiFlamelordAI.java index c3dbd6436..252a248df 100644 --- a/game-server/data/handlers/ai/instance/dragonLordsRefuge/HM_CalindiFlamelordAI.java +++ b/game-server/data/handlers/ai/instance/dragonLordsRefuge/HM_CalindiFlamelordAI.java @@ -4,8 +4,6 @@ import com.aionemu.gameserver.ai.AIName; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.player.Player; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.skillengine.model.SkillTemplate; /** @@ -21,7 +19,7 @@ public HM_CalindiFlamelordAI(Npc owner) { @Override protected void startHallucinatoryVictoryEvent() { if (getPosition().getWorldMapInstance().getNpc(731629) == null && getPosition().getWorldMapInstance().getNpc(731630) == null) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21887, 1, 100))); + getOwner().queueSkill(21887, 1); } @Override @@ -42,6 +40,6 @@ public void onEndUseSkill(SkillTemplate skillTemplate, int skillLevel) { @Override protected void blazeEngraving() { if (Rnd.chance() < 3 && getPosition().getWorldMapInstance().getNpc(856299) == null) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21888, 60, 100))); + getOwner().queueSkill(21888, 60); } } diff --git a/game-server/data/handlers/ai/instance/dragonLordsRefuge/TiamatDragonAI.java b/game-server/data/handlers/ai/instance/dragonLordsRefuge/TiamatDragonAI.java index 2786f2861..37b7bd620 100644 --- a/game-server/data/handlers/ai/instance/dragonLordsRefuge/TiamatDragonAI.java +++ b/game-server/data/handlers/ai/instance/dragonLordsRefuge/TiamatDragonAI.java @@ -4,8 +4,6 @@ import com.aionemu.gameserver.ai.AIName; import com.aionemu.gameserver.ai.poll.AIQuestion; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import com.aionemu.gameserver.utils.PacketSendUtility; @@ -28,7 +26,7 @@ protected void handleSpawned() { super.handleSpawned(); ThreadPoolManager.getInstance().schedule(() -> AIActions.useSkill(this, 20920), 4000); ThreadPoolManager.getInstance() - .schedule(() -> getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(20984, 1, 100))), 300000); + .schedule(() -> getOwner().queueSkill(20984, 1), 300000); } @Override diff --git a/game-server/data/handlers/ai/instance/dragonLordsRefuge/TiamatWeakenedDragonAI.java b/game-server/data/handlers/ai/instance/dragonLordsRefuge/TiamatWeakenedDragonAI.java index 19998786c..575a9e58f 100644 --- a/game-server/data/handlers/ai/instance/dragonLordsRefuge/TiamatWeakenedDragonAI.java +++ b/game-server/data/handlers/ai/instance/dragonLordsRefuge/TiamatWeakenedDragonAI.java @@ -11,9 +11,7 @@ import com.aionemu.gameserver.ai.poll.AIQuestion; import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; import com.aionemu.gameserver.model.templates.item.ItemAttackType; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.services.RespawnService; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import com.aionemu.gameserver.utils.ThreadPoolManager; @@ -70,8 +68,8 @@ public void handleHpPhase(int phaseHpPercent) { private void offerAtrocityEvent() { if (!isDead() && hasAggro.get()) { if (getLifeStats().getHpPercentage() <= 50) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(20921, 1, 100))); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(calculateAtrocitySkillId(), 1, 100))); + getOwner().queueSkill(20921, 1); + getOwner().queueSkill(calculateAtrocitySkillId(), 1); } } diff --git a/game-server/data/handlers/ai/instance/drakenspire/Lv1HumanBeritraAI.java b/game-server/data/handlers/ai/instance/drakenspire/Lv1HumanBeritraAI.java index a06f685a8..514a7b402 100644 --- a/game-server/data/handlers/ai/instance/drakenspire/Lv1HumanBeritraAI.java +++ b/game-server/data/handlers/ai/instance/drakenspire/Lv1HumanBeritraAI.java @@ -22,8 +22,6 @@ import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.player.Player; import com.aionemu.gameserver.model.skill.NpcSkillEntry; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.model.templates.spawns.SpawnTemplate; import com.aionemu.gameserver.skillengine.SkillEngine; import com.aionemu.gameserver.skillengine.effect.AbnormalState; @@ -195,8 +193,8 @@ protected void handleBuffsRemovedByNpc() { int chainId = getOwner().getGameStats().getLastSkill().getNextChainId(); NpcSkillEntry entry = getOwner().getSkillList().getNpcSkills().stream().filter(nse -> nse.getChainId() == chainId).findAny().orElse(null); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21604, 56, 100, 0, 0))); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21603, 56, 100, 0, 0))); + getOwner().queueSkill(21604, 56); + getOwner().queueSkill(21603, 56); if (entry != null) getOwner().getQueuedSkills().offer(entry); } diff --git a/game-server/data/handlers/ai/instance/drakenspire/Lv3HumanBeritraAI.java b/game-server/data/handlers/ai/instance/drakenspire/Lv3HumanBeritraAI.java index f76a2b6ac..f938aa37c 100644 --- a/game-server/data/handlers/ai/instance/drakenspire/Lv3HumanBeritraAI.java +++ b/game-server/data/handlers/ai/instance/drakenspire/Lv3HumanBeritraAI.java @@ -5,8 +5,6 @@ import com.aionemu.gameserver.ai.HpPhases; import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE; import com.aionemu.gameserver.skillengine.SkillEngine; import com.aionemu.gameserver.skillengine.model.SkillTemplate; @@ -39,7 +37,7 @@ public Lv3HumanBeritraAI(Npc owner) { @Override protected void handleLastSealBlasted() { - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(20842, 56, 100))); + getOwner().queueSkill(20842, 56); } /** diff --git a/game-server/data/handlers/ai/instance/drakenspire/OrissanAI.java b/game-server/data/handlers/ai/instance/drakenspire/OrissanAI.java index b891adc58..930d4e1a2 100644 --- a/game-server/data/handlers/ai/instance/drakenspire/OrissanAI.java +++ b/game-server/data/handlers/ai/instance/drakenspire/OrissanAI.java @@ -9,8 +9,6 @@ import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.VisibleObject; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.skillengine.SkillEngine; import com.aionemu.gameserver.skillengine.effect.AbnormalState; import com.aionemu.gameserver.skillengine.model.SkillTemplate; @@ -47,8 +45,8 @@ protected void handleCreatureAggro(Creature creature) { } private void startSummoningEvent() { - getOwner().getQueuedSkills().clear(); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21646, 1, 100, 0, 10000))); + getOwner().clearQueuedSkills(); + getOwner().queueSkill(21646, 1, 10000); } @Override @@ -71,9 +69,9 @@ public void onEndUseSkill(SkillTemplate st, int skillLevel) { } else { spawnFrigidCrystals(); task = ThreadPoolManager.getInstance().schedule(() -> { - getOwner().getQueuedSkills().clear(); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21632, 1, 100, 0, 0))); // Frigid Blast - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21633, 1, 100, 0, 8000))); // Ice Explosion + getOwner().clearQueuedSkills(); + getOwner().queueSkill(21632, 1); // Frigid Blast + getOwner().queueSkill(21633, 1, 8000); // Ice Explosion }, 10000); } break; diff --git a/game-server/data/handlers/ai/instance/drakenspire/TwinProtectorAI.java b/game-server/data/handlers/ai/instance/drakenspire/TwinProtectorAI.java index 33c29218b..80ef201f0 100644 --- a/game-server/data/handlers/ai/instance/drakenspire/TwinProtectorAI.java +++ b/game-server/data/handlers/ai/instance/drakenspire/TwinProtectorAI.java @@ -8,8 +8,6 @@ import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.player.Player; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.skillengine.SkillEngine; import com.aionemu.gameserver.skillengine.model.SkillTemplate; @@ -38,8 +36,8 @@ protected void handleAttack(Creature creature) { public void handleHpPhase(int phaseHpPercent) { switch (phaseHpPercent) { case 65, 40, 15 -> { - getOwner().getQueuedSkills().clear(); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21644, 1, 100, 0, 10000))); // Raging Hellfire + getOwner().clearQueuedSkills(); + getOwner().queueSkill(21644, 1, 10000); // Raging Hellfire } case 25, 10 -> spawnAdds(getNpcId() % 2 == 0 ? 855622 : 855621, 20); } diff --git a/game-server/data/handlers/ai/instance/illuminaryObelisk/DynatoumAI.java b/game-server/data/handlers/ai/instance/illuminaryObelisk/DynatoumAI.java index d93ecb5a0..6c61c6297 100644 --- a/game-server/data/handlers/ai/instance/illuminaryObelisk/DynatoumAI.java +++ b/game-server/data/handlers/ai/instance/illuminaryObelisk/DynatoumAI.java @@ -6,8 +6,6 @@ import com.aionemu.gameserver.ai.AIName; import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import com.aionemu.gameserver.utils.PacketSendUtility; @@ -60,7 +58,7 @@ protected void scheduleDespawn(int delayInSec) { scheduleDespawn(60); break; case 60: - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21534, 1, 100, 0, 3000))); + getOwner().queueSkill(21534, 1, 3000); break; } } diff --git a/game-server/data/handlers/ai/instance/illuminaryObelisk/DynatoumHealerAI.java b/game-server/data/handlers/ai/instance/illuminaryObelisk/DynatoumHealerAI.java index eeb037129..f6c21d030 100644 --- a/game-server/data/handlers/ai/instance/illuminaryObelisk/DynatoumHealerAI.java +++ b/game-server/data/handlers/ai/instance/illuminaryObelisk/DynatoumHealerAI.java @@ -3,8 +3,6 @@ import com.aionemu.gameserver.ai.AIActions; import com.aionemu.gameserver.ai.AIName; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import ai.GeneralNpcAI; @@ -34,13 +32,13 @@ private void startHealing() { Npc boss = getPosition().getWorldMapInstance().getNpc(getPosition().getMapId() == 301230000 ? 233740 : 234686); if (boss != null) { AIActions.targetCreature(this, boss); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21535, 1, 100, 0, 10000))); + getOwner().queueSkill(21535, 1, 10000); } } @Override public void onEndUseSkill(SkillTemplate skillTemplate, int skillLevel) { if (skillTemplate.getSkillId() == 21535) - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21535, 1, 100, 0, 10000))); + getOwner().queueSkill(21535, 1, 10000); } } diff --git a/game-server/data/handlers/ai/instance/illuminaryObelisk/InfernalDynatoumAI.java b/game-server/data/handlers/ai/instance/illuminaryObelisk/InfernalDynatoumAI.java index e5beb6f01..ac6fa0719 100644 --- a/game-server/data/handlers/ai/instance/illuminaryObelisk/InfernalDynatoumAI.java +++ b/game-server/data/handlers/ai/instance/illuminaryObelisk/InfernalDynatoumAI.java @@ -2,8 +2,6 @@ import com.aionemu.gameserver.ai.AIName; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import com.aionemu.gameserver.utils.PacketSendUtility; @@ -37,7 +35,7 @@ protected void scheduleDespawn(int delayInSec) { scheduleDespawn(60); break; case 60: - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21534, 1, 100, 0, 3000))); + getOwner().queueSkill(21534, 1, 3000); break; } } diff --git a/game-server/data/handlers/ai/instance/infinityShard/HyperionAI.java b/game-server/data/handlers/ai/instance/infinityShard/HyperionAI.java index 543345f87..b54f9c41e 100644 --- a/game-server/data/handlers/ai/instance/infinityShard/HyperionAI.java +++ b/game-server/data/handlers/ai/instance/infinityShard/HyperionAI.java @@ -16,9 +16,7 @@ import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.state.CreatureState; import com.aionemu.gameserver.model.geometry.Point3D; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; import com.aionemu.gameserver.model.templates.item.ItemAttackType; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_EMOTION; import com.aionemu.gameserver.skillengine.model.Effect; import com.aionemu.gameserver.skillengine.model.SkillTemplate; @@ -101,11 +99,11 @@ public void handleHpPhase(int phaseHpPercent) { case 45, 30, 17 -> spawnAncientTyrhund(4); case 65, 50, 25, 20 -> { stage++; - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21253, 56, 100, 0, 0))); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21244, 56, 100, 0, 5000))); + getOwner().queueSkill(21253, 56); + getOwner().queueSkill(21244, 56, 5000); } case 40 -> spawnSummons(++stage); - case 10 -> getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21246, 56, 100))); + case 10 -> getOwner().queueSkill(21246, 56); } } @@ -217,9 +215,9 @@ private Point3D getRndPos(WorldPosition p, float distanceMod) { } private void queuePowerfulEnergyBlast() { - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21241, 56, 100))); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21241, 56, 100))); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21241, 56, 100, 0, 8000))); + getOwner().queueSkill(21241, 56); + getOwner().queueSkill(21241, 56); + getOwner().queueSkill(21241, 56, 8000); } private void cancelSpawnTask() { diff --git a/game-server/data/handlers/ai/instance/rentusBase/BrigadeGeneralVashartiAI.java b/game-server/data/handlers/ai/instance/rentusBase/BrigadeGeneralVashartiAI.java index 6953066bb..efb96daca 100644 --- a/game-server/data/handlers/ai/instance/rentusBase/BrigadeGeneralVashartiAI.java +++ b/game-server/data/handlers/ai/instance/rentusBase/BrigadeGeneralVashartiAI.java @@ -16,8 +16,6 @@ import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.state.CreatureState; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_EMOTION; import com.aionemu.gameserver.skillengine.SkillEngine; import com.aionemu.gameserver.skillengine.model.Effect; @@ -59,20 +57,18 @@ protected void handleAttack(Creature creature) { @Override public void handleHpPhase(int phaseHpPercent) { cancelTasks(flameShieldBuffSchedule); - getOwner().getQueuedSkills().clear(); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(20532, 1, 100, 0, 10000))); // off (skill name) + getOwner().clearQueuedSkills(); + getOwner().queueSkill(20532, 1, 10000); // off (skill name) } private void scheduleFlameShieldBuffEvent(int delay) { - flameShieldBuffSchedule = ThreadPoolManager.getInstance().schedule(() -> { - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(20530 + Rnd.get(0, 1), 60, 100))); - }, delay); + flameShieldBuffSchedule = ThreadPoolManager.getInstance().schedule(() -> getOwner().queueSkill(20530 + Rnd.get(0, 1), 60), delay); } private void handleEnrageEvent() { - getOwner().getQueuedSkills().clear(); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(19962, 1, 100, 0, 15000))); // Purple Flame Weapon - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(19907, 1, 100, 0, 0))); // Chastise + getOwner().clearQueuedSkills(); + getOwner().queueSkill(19962, 1, 15000); // Purple Flame Weapon + getOwner().queueSkill(19907, 1); // Chastise } private void handleSeaOfFireEvent() { @@ -103,7 +99,7 @@ public void onStartUseSkill(SkillTemplate skillTemplate, int skillLevel) { public void onEndUseSkill(SkillTemplate skillTemplate, int skillLevel) { switch (skillTemplate.getSkillId()) { case 19907: // repeat until reset - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(19907, 1, 100, 0, 0))); // Chastise + getOwner().queueSkill(19907, 1); // Chastise break; case 20530: case 20531: @@ -118,7 +114,7 @@ public void onEndUseSkill(SkillTemplate skillTemplate, int skillLevel) { break; case 20532: EmoteManager.emoteStopAttacking(getOwner()); - getOwner().getQueuedSkills().clear(); + getOwner().clearQueuedSkills(); ThreadPoolManager.getInstance().schedule(() -> { WalkManager.startForcedWalking(this, 188.17f, 414.06f, 260.75488f); getOwner().setState(CreatureState.ACTIVE, true); diff --git a/game-server/data/handlers/ai/instance/sauroBase/GuardCaptainAhuradim.java b/game-server/data/handlers/ai/instance/sauroBase/GuardCaptainAhuradim.java index e5a287c8f..f1548e166 100644 --- a/game-server/data/handlers/ai/instance/sauroBase/GuardCaptainAhuradim.java +++ b/game-server/data/handlers/ai/instance/sauroBase/GuardCaptainAhuradim.java @@ -8,10 +8,7 @@ import com.aionemu.gameserver.ai.HpPhases; import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.ConjunctionType; import com.aionemu.gameserver.model.templates.npcskill.NpcSkillTargetAttribute; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.skillengine.SkillEngine; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import com.aionemu.gameserver.utils.PacketSendUtility; @@ -42,11 +39,11 @@ public void handleHpPhase(int phaseHpPercent) { if (phaseHpPercent == 100) { startGeneratorTask(); } else { - queueSkill(21194,1, 0, NpcSkillTargetAttribute.ME); + getOwner().queueSkill(21194,1, 0, NpcSkillTargetAttribute.ME); if (Rnd.nextBoolean()) { - queueSkill(21429, 1, 5000, NpcSkillTargetAttribute.MOST_HATED); + getOwner().queueSkill(21429, 1, 5000); } else { - queueSkill(21190, 1, 5000, NpcSkillTargetAttribute.ME); + getOwner().queueSkill(21190, 1, 5000, NpcSkillTargetAttribute.ME); } } } @@ -77,10 +74,6 @@ public void onStartUseSkill(SkillTemplate skillTemplate, int skillLevel) { } } - private void queueSkill(int id, int lv, int nextSkillTime, NpcSkillTargetAttribute targetAttribute) { - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(id, lv, 100, 0, nextSkillTime, targetAttribute, 0, 0, 0, 0, ConjunctionType.AND, null))); - } - private void cancelTasks() { if (scheduledTask != null) { scheduledTask.cancel(false); diff --git a/game-server/data/handlers/ai/instance/theHexway/AdjutantGalamatAI.java b/game-server/data/handlers/ai/instance/theHexway/AdjutantGalamatAI.java index 224fca40a..66f894761 100644 --- a/game-server/data/handlers/ai/instance/theHexway/AdjutantGalamatAI.java +++ b/game-server/data/handlers/ai/instance/theHexway/AdjutantGalamatAI.java @@ -13,9 +13,7 @@ import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.player.Player; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; import com.aionemu.gameserver.model.templates.ai.Percentage; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.skillengine.model.Effect; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import com.aionemu.gameserver.utils.PositionUtil; @@ -45,8 +43,8 @@ protected void handleIndividualSpawnedSummons(Percentage percent) { switch (percent.getPercent()) { case 60: case 20: - getOwner().getQueuedSkills().clear(); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21799, 65, 100, 0, 25000))); + getOwner().clearQueuedSkills(); + getOwner().queueSkill(21799, 65, 25000); break; } } @@ -125,7 +123,7 @@ public float modifyOwnerDamage(float damage, Creature effected, Effect effect) { public float modifyDamage(Creature attacker, float damage, Effect effect) { if (shieldPhase.get()) { if (getEffectController().findBySkillId(21799) == null) { - getOwner().getQueuedSkills().clear(); + getOwner().clearQueuedSkills(); resetVariablesAndCancelTasks(); } else { damageInShieldPhase.addAndGet((int) damage); diff --git a/game-server/data/handlers/ai/instance/theHexway/CaptainLakharaAI.java b/game-server/data/handlers/ai/instance/theHexway/CaptainLakharaAI.java index 74fa879a0..11fdc167b 100644 --- a/game-server/data/handlers/ai/instance/theHexway/CaptainLakharaAI.java +++ b/game-server/data/handlers/ai/instance/theHexway/CaptainLakharaAI.java @@ -4,10 +4,8 @@ import com.aionemu.gameserver.ai.AIName; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; import com.aionemu.gameserver.model.templates.ai.Percentage; import com.aionemu.gameserver.model.templates.ai.SummonGroup; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.utils.ThreadPoolManager; import ai.SummonerAI; @@ -26,8 +24,8 @@ public CaptainLakharaAI(Npc owner) { @Override protected void handleIndividualSpawnedSummons(Percentage percent) { - getOwner().getQueuedSkills().clear(); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(17497, 65, 100))); + getOwner().clearQueuedSkills(); + getOwner().queueSkill(17497, 65); cancelDespawnTask(); percent.getSummons().forEach(this::summonNpcWithSmoke); despawnTask = ThreadPoolManager.getInstance().schedule(() -> percent.getSummons().forEach(group -> despawnNpc(group.getNpcId())), 25000); diff --git a/game-server/data/handlers/ai/instance/unstableSplinterpath/UnstableYamennesAI.java b/game-server/data/handlers/ai/instance/unstableSplinterpath/UnstableYamennesAI.java index c1bcf2a3e..3b3d71298 100644 --- a/game-server/data/handlers/ai/instance/unstableSplinterpath/UnstableYamennesAI.java +++ b/game-server/data/handlers/ai/instance/unstableSplinterpath/UnstableYamennesAI.java @@ -9,8 +9,6 @@ import com.aionemu.gameserver.ai.poll.AIQuestion; import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE; import com.aionemu.gameserver.utils.PacketSendUtility; import com.aionemu.gameserver.utils.ThreadPoolManager; @@ -43,14 +41,14 @@ protected void handleAttack(Creature creature) { private void startTasks() { enrageTask = ThreadPoolManager.getInstance() - .schedule(() -> getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(19098, 55, 100))), 600000); + .schedule(() -> getOwner().queueSkill(19098, 55), 600000); portalTask = ThreadPoolManager.getInstance().schedule(() -> spawnPortals(false), 60000); } private void onHealingDebuff() { WorldMapInstance instance = getPosition().getWorldMapInstance(); deleteNpcs(instance.getNpcs(219586)); - getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(19282, 55, 100))); + getOwner().queueSkill(19282, 55); spawn(219586, getOwner().getX() + 10, getOwner().getY() - 10, getOwner().getZ(), (byte) 0); spawn(219586, getOwner().getX() - 10, getOwner().getY() + 10, getOwner().getZ(), (byte) 0); spawn(219586, getOwner().getX() + 10, getOwner().getY() + 10, getOwner().getZ(), (byte) 0); diff --git a/game-server/data/handlers/ai/siege/EmpoweredAgent.java b/game-server/data/handlers/ai/siege/EmpoweredAgent.java index 3d9b399ea..45f0f5a97 100644 --- a/game-server/data/handlers/ai/siege/EmpoweredAgent.java +++ b/game-server/data/handlers/ai/siege/EmpoweredAgent.java @@ -24,11 +24,9 @@ import com.aionemu.gameserver.model.geometry.Point3D; import com.aionemu.gameserver.model.siege.SiegeModType; import com.aionemu.gameserver.model.siege.SiegeRace; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; import com.aionemu.gameserver.model.stats.calc.Stat2; import com.aionemu.gameserver.model.stats.container.StatEnum; import com.aionemu.gameserver.model.templates.npcskill.NpcSkillTargetAttribute; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.model.templates.spawns.siegespawns.SiegeSpawnTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_EMOTION; import com.aionemu.gameserver.skillengine.SkillEngine; @@ -97,8 +95,7 @@ protected void handleAttack(Creature creature) { public void handleHpPhase(int phaseHpPercent) { switch (phaseHpPercent) { case 80, 70, 60, 50, 40, 30, 20 -> onGuardSpawnEvent(); - case 25, 5 -> getOwner().getQueuedSkills() - .offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(21778, 1, 100, 0, 3000, NpcSkillTargetAttribute.ME))); + case 25, 5 -> getOwner().queueSkill(21778, 1, 3000, NpcSkillTargetAttribute.ME); } } diff --git a/game-server/data/handlers/ai/worlds/gelkmaros/PadmarashkaAI.java b/game-server/data/handlers/ai/worlds/gelkmaros/PadmarashkaAI.java index c08b167f4..6ed905fed 100644 --- a/game-server/data/handlers/ai/worlds/gelkmaros/PadmarashkaAI.java +++ b/game-server/data/handlers/ai/worlds/gelkmaros/PadmarashkaAI.java @@ -11,8 +11,6 @@ import com.aionemu.gameserver.controllers.observer.ObserverType; import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE; import com.aionemu.gameserver.skillengine.SkillEngine; import com.aionemu.gameserver.skillengine.model.Effect; @@ -58,7 +56,7 @@ protected void handleAttack(Creature creature) { public void handleHpPhase(int phaseHpPercent) { switch (phaseHpPercent) { case 33 -> spawnRockSlides(); - case 5 -> getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(18730, 1, 100, 0, 3000))); // Berserk State + case 5 -> getOwner().queueSkill(18730, 1, 3000); // Berserk State } } diff --git a/game-server/data/handlers/ai/worlds/inggison/SematariuxAI.java b/game-server/data/handlers/ai/worlds/inggison/SematariuxAI.java index 5cc137731..c6ace66c1 100644 --- a/game-server/data/handlers/ai/worlds/inggison/SematariuxAI.java +++ b/game-server/data/handlers/ai/worlds/inggison/SematariuxAI.java @@ -18,8 +18,6 @@ import com.aionemu.gameserver.model.gameobjects.Creature; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.player.Player; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE; import com.aionemu.gameserver.skillengine.SkillEngine; import com.aionemu.gameserver.skillengine.model.Effect; @@ -76,7 +74,7 @@ protected void handleAttack(Creature creature) { public void handleHpPhase(int phaseHpPercent) { switch (phaseHpPercent) { case 90, 70, 50, 30, 20, 10 -> spawnTornado(); - case 5 -> getOwner().getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(18730, 1, 100, 0, 3000))); // Berserk State + case 5 -> getOwner().queueSkill(18730, 1, 3000); // Berserk State } } diff --git a/game-server/data/handlers/ai/worlds/inggison/SematariuxEggAI.java b/game-server/data/handlers/ai/worlds/inggison/SematariuxEggAI.java index 01993e453..a9782d0f8 100644 --- a/game-server/data/handlers/ai/worlds/inggison/SematariuxEggAI.java +++ b/game-server/data/handlers/ai/worlds/inggison/SematariuxEggAI.java @@ -8,8 +8,6 @@ import com.aionemu.gameserver.ai.poll.AIQuestion; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.VisibleObject; -import com.aionemu.gameserver.model.skill.QueuedNpcSkillEntry; -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.utils.ThreadPoolManager; /** @@ -34,9 +32,9 @@ protected void handleSpawned() { @Override protected void handleDied() { for (VisibleObject vo : getKnownList().getKnownObjects().values()) { - if (vo instanceof Npc && ((Npc) vo).getNpcId() == 216520) { - ((Npc) vo).getEffectController().removeEffect(18726); - ((Npc) vo).getQueuedSkills().offer(new QueuedNpcSkillEntry(new QueuedNpcSkillTemplate(19199, 1, 100, 0, 3000))); + if (vo instanceof Npc npc && npc.getNpcId() == 216520) { + npc.getEffectController().removeEffect(18726); + npc.queueSkill(19199, 1, 3000); break; } } diff --git a/game-server/src/com/aionemu/gameserver/ai/handler/ThinkEventHandler.java b/game-server/src/com/aionemu/gameserver/ai/handler/ThinkEventHandler.java index 300aef61a..42c26213b 100644 --- a/game-server/src/com/aionemu/gameserver/ai/handler/ThinkEventHandler.java +++ b/game-server/src/com/aionemu/gameserver/ai/handler/ThinkEventHandler.java @@ -14,9 +14,6 @@ */ public class ThinkEventHandler { - /** - * @param npcAI - */ public static void onThink(NpcAI npcAI) { if (npcAI.isDead()) { AILogger.info(npcAI, "can't think in dead state"); @@ -47,9 +44,6 @@ public static void onThink(NpcAI npcAI) { } } - /** - * @param npcAI - */ private static void thinkInInactiveRegion(NpcAI npcAI) { if (npcAI.isInState(AIState.WALKING)) { WalkManager.stopWalking(npcAI); @@ -73,9 +67,6 @@ private static void thinkInInactiveRegion(NpcAI npcAI) { } - /** - * @param npcAI - */ public static void thinkAttack(NpcAI npcAI) { Npc npc = npcAI.getOwner(); Creature mostHated = npc.getAggroList().getMostHated(); @@ -83,7 +74,7 @@ public static void thinkAttack(NpcAI npcAI) { npcAI.onCreatureEvent(AIEventType.TARGET_CHANGED, mostHated); } else { npcAI.setSubStateIfNot(AISubState.NONE); - npc.getQueuedSkills().clear(); + npc.clearQueuedSkills(); npc.getGameStats().setLastSkill(null); npc.getGameStats().resetFightStats(); npc.getMoveController().recallPreviousStep(); @@ -92,9 +83,6 @@ public static void thinkAttack(NpcAI npcAI) { } } - /** - * @param npcAI - */ public static void thinkIdle(NpcAI npcAI) { if (npcAI.isMoveSupported() && npcAI.getOwner().isWalker()) WalkManager.startWalking(npcAI); diff --git a/game-server/src/com/aionemu/gameserver/model/gameobjects/Npc.java b/game-server/src/com/aionemu/gameserver/model/gameobjects/Npc.java index fb154bf6b..ccc0ecf01 100644 --- a/game-server/src/com/aionemu/gameserver/model/gameobjects/Npc.java +++ b/game-server/src/com/aionemu/gameserver/model/gameobjects/Npc.java @@ -15,10 +15,13 @@ import com.aionemu.gameserver.model.items.NpcEquippedGear; import com.aionemu.gameserver.model.skill.NpcSkillEntry; import com.aionemu.gameserver.model.skill.NpcSkillList; +import com.aionemu.gameserver.model.skill.NpcSkillTemplateEntry; import com.aionemu.gameserver.model.stats.container.NpcGameStats; import com.aionemu.gameserver.model.stats.container.NpcLifeStats; import com.aionemu.gameserver.model.templates.item.ItemAttackType; import com.aionemu.gameserver.model.templates.npc.*; +import com.aionemu.gameserver.model.templates.npcskill.NpcSkillTargetAttribute; +import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; import com.aionemu.gameserver.model.templates.spawns.SpawnTemplate; import com.aionemu.gameserver.network.aion.serverpackets.SM_CUSTOM_SETTINGS; import com.aionemu.gameserver.network.aion.serverpackets.SM_LOOKATOBJECT; @@ -132,6 +135,22 @@ public ConcurrentLinkedQueue getQueuedSkills() { return queuedSkills; } + public void clearQueuedSkills() { + queuedSkills.clear(); + } + + public void queueSkill(int skillId, int level) { + queuedSkills.offer(new NpcSkillTemplateEntry(new QueuedNpcSkillTemplate(skillId, level))); + } + + public void queueSkill(int skillId, int level, int nextSkillTime) { + queuedSkills.offer(new NpcSkillTemplateEntry(new QueuedNpcSkillTemplate(skillId, level, nextSkillTime, NpcSkillTargetAttribute.MOST_HATED))); + } + + public void queueSkill(int skillId, int level, int nextSkillTime, NpcSkillTargetAttribute npcSkillTargetAttribute) { + queuedSkills.offer(new NpcSkillTemplateEntry(new QueuedNpcSkillTemplate(skillId, level, nextSkillTime, npcSkillTargetAttribute))); + } + public boolean isWalker() { return isRandomWalker() || isPathWalker(); } diff --git a/game-server/src/com/aionemu/gameserver/model/skill/QueuedNpcSkillEntry.java b/game-server/src/com/aionemu/gameserver/model/skill/QueuedNpcSkillEntry.java deleted file mode 100644 index 75c41ecbc..000000000 --- a/game-server/src/com/aionemu/gameserver/model/skill/QueuedNpcSkillEntry.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.aionemu.gameserver.model.skill; - -import com.aionemu.gameserver.model.templates.npcskill.QueuedNpcSkillTemplate; - -/** - * @author Yeats - */ -public class QueuedNpcSkillEntry extends NpcSkillTemplateEntry { - - public QueuedNpcSkillEntry(QueuedNpcSkillTemplate template) { - super(template); - } - -} diff --git a/game-server/src/com/aionemu/gameserver/model/templates/npcskill/QueuedNpcSkillTemplate.java b/game-server/src/com/aionemu/gameserver/model/templates/npcskill/QueuedNpcSkillTemplate.java index f4e773742..029bcab7d 100644 --- a/game-server/src/com/aionemu/gameserver/model/templates/npcskill/QueuedNpcSkillTemplate.java +++ b/game-server/src/com/aionemu/gameserver/model/templates/npcskill/QueuedNpcSkillTemplate.java @@ -5,32 +5,15 @@ */ public class QueuedNpcSkillTemplate extends NpcSkillTemplate { - public QueuedNpcSkillTemplate(int id, int lv, int prob) { - this(id, lv, prob, 0, 0); + public QueuedNpcSkillTemplate(int id, int lv) { + this(id, lv, 0, NpcSkillTargetAttribute.MOST_HATED); } - public QueuedNpcSkillTemplate(int id, int lv, int prob, int cd, int nextSkillTime) { - this(id, lv, prob, cd, nextSkillTime, NpcSkillTargetAttribute.MOST_HATED); - } - - public QueuedNpcSkillTemplate(int id, int lv, int prob, int cd, int nextSkillTime, NpcSkillTargetAttribute npcSkillTargetAttribute) { - this(id, lv, prob, cd, nextSkillTime, npcSkillTargetAttribute, 0, 0, 0, 0, ConjunctionType.AND, null); - } - - public QueuedNpcSkillTemplate(int id, int lv, int prob, int cd, int nextSkillTime, NpcSkillTargetAttribute target, int minHp, int maxHp, - int minTime, int maxTime, ConjunctionType conjunction, NpcSkillConditionTemplate conditionTemplate) { + public QueuedNpcSkillTemplate(int id, int lv, int nextSkillTime, NpcSkillTargetAttribute npcSkillTargetAttribute) { this.id = id; this.lv = lv; - this.prob = prob; - this.cd = cd; + this.prob = 100; this.nextSkillTime = nextSkillTime; - this.target = target; - this.minHp = minHp; - this.maxHp = maxHp; - this.minTime = minTime; - this.maxTime = maxTime; - this.conjunction = conjunction; - this.conditionTemplate = conditionTemplate; + this.target = npcSkillTargetAttribute; } - }