From 2555bab9e77ebdccd1d4b27ac93a8faf16b57db5 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 28 Oct 2016 08:59:28 +0000 Subject: [PATCH] Partial sync latest Test changes to HighFive. --- .../scripts/ai/fantasy_isle/TalentShow.java | 20 +-- .../scripts/ai/group_template/GiantsCave.java | 8 +- .../ai/group_template/LairOfAntharas.java | 6 +- .../ai/group_template/MinionSpawnManager.java | 2 +- .../ai/group_template/MonasteryOfSilence.java | 8 +- .../ai/group_template/PlainsOfDion.java | 6 +- .../ai/group_template/PrimevalIsle.java | 2 +- .../ai/group_template/PrisonGuards.java | 4 +- .../ai/group_template/SelMahumDrill.java | 4 +- .../ai/group_template/SelMahumSquad.java | 4 +- .../ai/group_template/SilentValley.java | 2 +- .../scripts/ai/group_template/TurekOrcs.java | 2 +- .../group_template/WarriorFishingBlock.java | 6 +- .../scripts/ai/individual/Baium/Baium.java | 2 +- .../ai/individual/CrimsonHatuOtis.java | 2 +- .../data/scripts/ai/individual/DrChaos.java | 8 +- .../ai/individual/FrightenedRagnaOrc.java | 12 +- .../scripts/ai/individual/QueenShyeed.java | 2 +- .../scripts/ai/individual/Venom/Venom.java | 6 +- .../data/scripts/ai/npc/AbstractNpcAI.java | 58 -------- .../game/data/scripts/ai/npc/Alarm/Alarm.java | 10 +- .../data/scripts/ai/npc/Dorian/Dorian.java | 2 +- .../scripts/ai/npc/ForgeOfTheGods/Rooney.java | 10 +- .../data/scripts/ai/npc/Katenar/Katenar.java | 4 +- .../MercenaryCaptain/MercenaryCaptain.java | 6 +- .../scripts/ai/npc/Minigame/Minigame.java | 16 +-- .../ai/npc/NpcBuffers/impl/CabaleBuffer.java | 4 +- .../TeleportToFantasy/TeleportToFantasy.java | 2 +- .../TeleportToRaceTrack.java | 2 +- .../DevastatedCastle/DevastatedCastle.java | 6 +- .../FortressOfTheDead/FortressOfTheDead.java | 10 +- .../game/data/scripts/gracia/AI/Lindvior.java | 6 +- .../data/scripts/gracia/AI/NPC/Seyo/Seyo.java | 18 +-- .../data/scripts/hellbound/AI/Amaskari.java | 16 +-- .../data/scripts/hellbound/AI/Keltas.java | 4 +- .../hellbound/AI/NPC/Natives/Natives.java | 4 +- .../hellbound/AI/NPC/Quarry/Quarry.java | 4 +- .../game/data/scripts/hellbound/AI/Ranku.java | 2 +- .../data/scripts/hellbound/AI/Slaves.java | 2 +- .../AI/Zones/AnomicFoundry/AnomicFoundry.java | 4 +- .../AI/Zones/TowerOfNaia/TowerOfNaia.java | 4 +- .../AI/Zones/TullyWorkshop/TullyWorkshop.java | 24 ++-- .../Instances/UrbanArea/UrbanArea.java | 12 +- .../IceQueensCastle/IceQueensCastle.java | 4 +- .../IceQueensCastleNormalBattle.java | 8 +- .../LibraryOfSages/LibraryOfSages.java | 2 +- .../instances/MithrilMine/MithrilMine.java | 4 +- .../MonasteryOfSilence1.java | 4 +- .../PailakaSongOfIceAndFire.java | 2 +- .../SanctumOftheLordsOfDawn.java | 6 +- .../instancemanager/WalkingManager.java | 6 +- .../gameserver/model/actor/L2Npc.java | 57 ++++++++ .../model/olympiad/OlympiadAnnouncer.java | 9 +- .../l2jmobius/gameserver/script/IntList.java | 68 --------- .../gameserver/script/ScriptPackage.java | 130 ------------------ .../gameserver/script/ShortList.java | 56 -------- 56 files changed, 212 insertions(+), 480 deletions(-) delete mode 100644 L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/IntList.java delete mode 100644 L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/ScriptPackage.java delete mode 100644 L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/ShortList.java diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/fantasy_isle/TalentShow.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/fantasy_isle/TalentShow.java index cd8b7add5f..34fd300636 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/fantasy_isle/TalentShow.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/fantasy_isle/TalentShow.java @@ -27,7 +27,6 @@ import com.l2jmobius.gameserver.model.Location; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.network.NpcStringId; -import com.l2jmobius.gameserver.network.serverpackets.NpcSay; import com.l2jmobius.gameserver.network.serverpackets.PlaySound; import ai.npc.AbstractNpcAI; @@ -308,11 +307,6 @@ public final class TalentShow extends AbstractNpcAI startQuestTimer("Start", diff, null, null); // first start } - private void autoChat(L2Npc npc, NpcStringId npcString, ChatType type) - { - npc.broadcastPacket(new NpcSay(npc.getObjectId(), type, npc.getId(), npcString)); - } - @Override public String onSpawn(L2Npc npc) { @@ -322,7 +316,7 @@ public final class TalentShow extends AbstractNpcAI { case 32433: { - autoChat(npc, MESSAGES[0], ChatType.NPC_SHOUT); + npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[0]); startQuestTimer("1", 30000, npc, null); break; } @@ -384,7 +378,7 @@ public final class TalentShow extends AbstractNpcAI // TODO switch on event if (event.equalsIgnoreCase("6")) { - autoChat(npc, MESSAGES[6], ChatType.NPC_SHOUT); + npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[6]); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-56511, -56647, -2008, 36863)); npc.broadcastPacket(new PlaySound(1, "NS22_F", 0, 0, 0, 0, 0)); addSpawn(SINGERS[0], -56344, -56328, -2008, 32768, false, 224000); @@ -402,7 +396,7 @@ public final class TalentShow extends AbstractNpcAI { case 32433: { - autoChat(npc, MESSAGES[7], ChatType.NPC_SHOUT); + npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[7]); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-56698, -56430, -2008, 32768)); startQuestTimer("8", 12000, npc, null); break; @@ -436,7 +430,7 @@ public final class TalentShow extends AbstractNpcAI { case 32433: { - autoChat(npc, MESSAGES[11], ChatType.NPC_SHOUT); + npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[11]); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-56698, -56430, -2008, 32768)); startQuestTimer("12", 5000, npc, null); break; @@ -455,7 +449,7 @@ public final class TalentShow extends AbstractNpcAI } else if (event.equalsIgnoreCase("17")) { - autoChat(npc, MESSAGES[16], ChatType.NPC_SHOUT); + npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[16]); startQuestTimer("social1", 2000, addSpawn(INDIVIDUALS[1], -56700, -56340, -2008, 32768, false, 32000), null); startQuestTimer("18", 9000, npc, null); } @@ -476,7 +470,7 @@ public final class TalentShow extends AbstractNpcAI } else if (event.equalsIgnoreCase("28")) { - autoChat(npc, MESSAGES[23], ChatType.NPC_GENERAL); + npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[23]); startQuestTimer("social1", 1, npc, null); } else if (event.equalsIgnoreCase("29")) @@ -499,7 +493,7 @@ public final class TalentShow extends AbstractNpcAI final ShoutInfo si = TALKS.get(event); if (si != null) { - autoChat(npc, si.getNpcStringId(), ChatType.NPC_SHOUT); + npc.broadcastSay(ChatType.NPC_SHOUT, si.getNpcStringId()); startQuestTimer(si.getNextEvent(), si.getTime(), npc, null); } } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/GiantsCave.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/GiantsCave.java index 61b89a1e74..b3e44ff1f7 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/GiantsCave.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/GiantsCave.java @@ -51,11 +51,11 @@ public final class GiantsCave extends AbstractNpcAI { if (npc.getId() == SCOUTS[0]) // Gamlin { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.INTRUDER_DETECTED); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.INTRUDER_DETECTED); } else { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.OH_GIANTS_AN_INTRUDER_HAS_BEEN_DISCOVERED); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.OH_GIANTS_AN_INTRUDER_HAS_BEEN_DISCOVERED); } for (L2Character characters : npc.getKnownList().getKnownCharactersInRadius(450)) @@ -93,11 +93,11 @@ public final class GiantsCave extends AbstractNpcAI npc.setScriptValue(1); if (getRandomBoolean()) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_GUYS_ARE_DETECTED); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_GUYS_ARE_DETECTED); } else { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WHAT_KIND_OF_CREATURES_ARE_YOU); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHAT_KIND_OF_CREATURES_ARE_YOU); } startQuestTimer("ATTACK", 6000, npc, player); startQuestTimer("CLEAR", 120000, npc, null); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/LairOfAntharas.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/LairOfAntharas.java index f4e0d5d7a0..264e4eb30c 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/LairOfAntharas.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/LairOfAntharas.java @@ -80,7 +80,7 @@ public final class LairOfAntharas extends AbstractNpcAI { npc.setScriptValue(1); } - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.WHO_S_THERE_IF_YOU_DISTURB_THE_TEMPER_OF_THE_GREAT_LAND_DRAGON_ANTHARAS_I_WILL_NEVER_FORGIVE_YOU); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.WHO_S_THERE_IF_YOU_DISTURB_THE_TEMPER_OF_THE_GREAT_LAND_DRAGON_ANTHARAS_I_WILL_NEVER_FORGIVE_YOU); } return super.onAggroRangeEnter(npc, player, isSummon); } @@ -96,7 +96,7 @@ public final class LairOfAntharas extends AbstractNpcAI { final L2Npc newKnight = addSpawn(DRAGON_KNIGHT2, npc, false, 0, true); npc.deleteMe(); - broadcastNpcSay(newKnight, ChatType.NPC_SHOUT, NpcStringId.THOSE_WHO_SET_FOOT_IN_THIS_PLACE_SHALL_NOT_LEAVE_ALIVE); + newKnight.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.THOSE_WHO_SET_FOOT_IN_THIS_PLACE_SHALL_NOT_LEAVE_ALIVE); addAttackDesire(newKnight, killer); } break; @@ -107,7 +107,7 @@ public final class LairOfAntharas extends AbstractNpcAI { final L2Npc eliteKnight = addSpawn(ELITE_DRAGON_KNIGHT, npc, false, 0, true); npc.deleteMe(); - broadcastNpcSay(eliteKnight, ChatType.NPC_SHOUT, NpcStringId.IF_YOU_WISH_TO_SEE_HELL_I_WILL_GRANT_YOU_YOUR_WISH); + eliteKnight.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.IF_YOU_WISH_TO_SEE_HELL_I_WILL_GRANT_YOU_YOUR_WISH); addAttackDesire(eliteKnight, killer); } break; diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/MinionSpawnManager.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/MinionSpawnManager.java index 797e89ab32..61e61dea24 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/MinionSpawnManager.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/MinionSpawnManager.java @@ -440,7 +440,7 @@ public final class MinionSpawnManager extends AbstractNpcAI { addMinion((L2MonsterInstance) npc, is.getId()); } - broadcastNpcSay(npc, ChatType.NPC_GENERAL, ON_ATTACK_MSG[getRandom(ON_ATTACK_MSG.length)]); + npc.broadcastSay(ChatType.NPC_GENERAL, ON_ATTACK_MSG[getRandom(ON_ATTACK_MSG.length)]); } } } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/MonasteryOfSilence.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/MonasteryOfSilence.java index 375d43f1b7..8711ae5b5c 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/MonasteryOfSilence.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/MonasteryOfSilence.java @@ -95,7 +95,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI if ((character.getId() == CAPTAIN) && (getRandom(100) < 10) && npc.isScriptValue(0)) { final L2Npc captain = (L2Npc) character; - broadcastNpcSay(captain, ChatType.NPC_GENERAL, SOLINA_KNIGHTS_MSG[getRandom(SOLINA_KNIGHTS_MSG.length)]); + captain.broadcastSay(ChatType.NPC_GENERAL, SOLINA_KNIGHTS_MSG[getRandom(SOLINA_KNIGHTS_MSG.length)]); captain.setScriptValue(1); startQuestTimer("TIMER", 10000, captain, null); } @@ -160,7 +160,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI npc.doCast(KNIGHT_BLESS.getSkill()); } npc.setScriptValue(1); - broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.FOR_THE_GLORY_OF_SOLINA); + npc.broadcastSay(ChatType.GENERAL, NpcStringId.FOR_THE_GLORY_OF_SOLINA); addAttackDesire(addSpawn(KNIGHT, npc), player); } break; @@ -252,7 +252,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI if (!npc.isInCombat()) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_CANNOT_CARRY_A_WEAPON_WITHOUT_AUTHORIZATION); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CANNOT_CARRY_A_WEAPON_WITHOUT_AUTHORIZATION); } addAttackDesire(npc, player); @@ -269,7 +269,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI { if (obj.equals(npc)) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, DIVINITY_MSG[getRandom(DIVINITY_MSG.length)], caster.getName()); + npc.broadcastSay(ChatType.NPC_GENERAL, DIVINITY_MSG[getRandom(DIVINITY_MSG.length)], caster.getName()); addAttackDesire(npc, caster); break; } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PlainsOfDion.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PlainsOfDion.java index c0046072a9..24f5876d5f 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PlainsOfDion.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PlainsOfDion.java @@ -69,11 +69,11 @@ public final class PlainsOfDion extends AbstractNpcAI final int i = getRandom(5); if (i < 2) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, MONSTERS_MSG[i], player.getName()); + npc.broadcastSay(ChatType.NPC_GENERAL, MONSTERS_MSG[i], player.getName()); } else { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, MONSTERS_MSG[i]); + npc.broadcastSay(ChatType.NPC_GENERAL, MONSTERS_MSG[i]); } for (L2Character obj : npc.getKnownList().getKnownCharactersInRadius(npc.getTemplate().getClanHelpRange())) @@ -82,7 +82,7 @@ public final class PlainsOfDion extends AbstractNpcAI { final L2Npc monster = (L2Npc) obj; addAttackDesire(monster, player); - broadcastNpcSay(monster, ChatType.NPC_GENERAL, MONSTERS_ASSIST_MSG[getRandom(3)]); + monster.broadcastSay(ChatType.NPC_GENERAL, MONSTERS_ASSIST_MSG[getRandom(3)]); } } npc.setScriptValue(1); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PrimevalIsle.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PrimevalIsle.java index 1d4f333fbc..e51d6859ab 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PrimevalIsle.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PrimevalIsle.java @@ -309,7 +309,7 @@ public final class PrimevalIsle extends AbstractNpcAI if (npc.isScriptValue(0)) { npc.setScriptValue(1); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, "?"); + npc.broadcastSay(ChatType.NPC_GENERAL, "?"); ((L2Attackable) npc).clearAggroList(); startQuestTimer("TREX_ATTACK", 6000, npc, player); } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PrisonGuards.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PrisonGuards.java index 48493d2119..2ab5763c49 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PrisonGuards.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/PrisonGuards.java @@ -92,7 +92,7 @@ public final class PrisonGuards extends AbstractNpcAI { npc.setTarget(player); npc.doCast(STONE.getSkill()); - broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.IT_S_NOT_EASY_TO_OBTAIN); + npc.broadcastSay(ChatType.GENERAL, NpcStringId.IT_S_NOT_EASY_TO_OBTAIN); } } else @@ -101,7 +101,7 @@ public final class PrisonGuards extends AbstractNpcAI { npc.setTarget(player); npc.doCast(STONE.getSkill()); - broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE); + npc.broadcastSay(ChatType.GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE); } } return super.onAttack(npc, player, damage, isSummon); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SelMahumDrill.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SelMahumDrill.java index fe310129ab..84e4d12c3f 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SelMahumDrill.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SelMahumDrill.java @@ -242,7 +242,7 @@ public final class SelMahumDrill extends AbstractNpcAI { if (getRandom(4) < 1) { - broadcastNpcSay(receiver, ChatType.NPC_GENERAL, SOLDIER_FSTRINGS[getRandom(2)]); + receiver.broadcastSay(ChatType.NPC_GENERAL, SOLDIER_FSTRINGS[getRandom(2)]); } if (receiver.canBeAttacked()) { @@ -260,7 +260,7 @@ public final class SelMahumDrill extends AbstractNpcAI { if (Util.contains(MAHUM_CHIEFS, receiver.getId())) { - broadcastNpcSay(receiver, ChatType.NPC_GENERAL, CHIEF_FSTRINGS[getRandom(2)]); + receiver.broadcastSay(ChatType.NPC_GENERAL, CHIEF_FSTRINGS[getRandom(2)]); } break; } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SelMahumSquad.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SelMahumSquad.java index b427d66980..7920b0c591 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SelMahumSquad.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SelMahumSquad.java @@ -228,7 +228,7 @@ public final class SelMahumSquad extends AbstractNpcAI final L2Npc stove = addSpawn(STOVE, receiver.getX(), receiver.getY(), receiver.getZ() + 100, 0, false, 0); stove.setSummoner(receiver); startQuestTimer("notify_dinner", 2000, receiver, null); // @SCE_DINNER_EAT - broadcastNpcSay(sender, ChatType.NPC_GENERAL, CHEF_FSTRINGS[getRandom(2)], 1250); + sender.broadcastSay(ChatType.NPC_GENERAL, CHEF_FSTRINGS[getRandom(2)], 1250); } break; } @@ -273,7 +273,7 @@ public final class SelMahumSquad extends AbstractNpcAI receiver.setIsNoRndWalk(true); // Moving to fire - i_ai0 = 1 receiver.getVariables().set("BUSY_STATE", 1); // Eating - i_ai3 = 1 receiver.setIsRunning(true); - broadcastNpcSay(receiver, ChatType.NPC_GENERAL, (getRandom(3) < 1) ? NpcStringId.LOOKS_DELICIOUS : NpcStringId.LET_S_GO_EAT); + receiver.broadcastSay(ChatType.NPC_GENERAL, (getRandom(3) < 1) ? NpcStringId.LOOKS_DELICIOUS : NpcStringId.LET_S_GO_EAT); final Location loc = sender.getPointInRange(100, 200); loc.setHeading(receiver.getHeading()); receiver.stopMove(null); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SilentValley.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SilentValley.java index 6b00058d45..6ac5c00ef1 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SilentValley.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/SilentValley.java @@ -102,7 +102,7 @@ public final class SilentValley extends AbstractNpcAI if (!isSummon && npc.isScriptValue(0)) { npc.setScriptValue(1); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_WILL_BE_CURSED_FOR_SEEKING_THE_TREASURE); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_WILL_BE_CURSED_FOR_SEEKING_THE_TREASURE); npc.setTarget(player); npc.doCast(BETRAYAL.getSkill()); } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/TurekOrcs.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/TurekOrcs.java index afa0188473..898a7c16fe 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/TurekOrcs.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/TurekOrcs.java @@ -82,7 +82,7 @@ public final class TurekOrcs extends AbstractNpcAI else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.5)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.3)) && (attacker.getCurrentHp() > (attacker.getMaxHp() * 0.25)) && npc.hasAIValue("fleeX") && npc.hasAIValue("fleeY") && npc.hasAIValue("fleeZ") && (npc.getVariables().getInt("state") == 0) && (getRandom(100) < 10)) { // Say and flee - broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.getNpcStringId(getRandom(1000007, 1000027))); + npc.broadcastSay(ChatType.GENERAL, NpcStringId.getNpcStringId(getRandom(1000007, 1000027))); npc.disableCoreAI(true); // to avoid attacking behaviour, while flee npc.setIsRunning(true); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(npc.getAIValue("fleeX"), npc.getAIValue("fleeY"), npc.getAIValue("fleeZ"))); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/WarriorFishingBlock.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/WarriorFishingBlock.java index 6593763701..6ba27af094 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/WarriorFishingBlock.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/group_template/WarriorFishingBlock.java @@ -90,7 +90,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI else { final L2PcInstance target = obj.getActingPlayer(); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPC_STRINGS_ON_SPAWN[getRandom(NPC_STRINGS_ON_SPAWN.length)], target.getName()); + npc.broadcastSay(ChatType.NPC_GENERAL, NPC_STRINGS_ON_SPAWN[getRandom(NPC_STRINGS_ON_SPAWN.length)], target.getName()); ((L2Attackable) npc).addDamageHate(target, 0, 2000); npc.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, target); npc.addAttackerToAttackByList(target); @@ -113,7 +113,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI { if (getRandom(100) < CHANCE_TO_SHOUT_ON_ATTACK) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPC_STRINGS_ON_ATTACK[getRandom(NPC_STRINGS_ON_ATTACK.length)]); + npc.broadcastSay(ChatType.NPC_GENERAL, NPC_STRINGS_ON_ATTACK[getRandom(NPC_STRINGS_ON_ATTACK.length)]); } return super.onAttack(npc, attacker, damage, isSummon); } @@ -121,7 +121,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI @Override public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPC_STRINGS_ON_KILL[getRandom(NPC_STRINGS_ON_KILL.length)]); + npc.broadcastSay(ChatType.NPC_GENERAL, NPC_STRINGS_ON_KILL[getRandom(NPC_STRINGS_ON_KILL.length)]); cancelQuestTimer("DESPAWN", npc, killer); return super.onKill(npc, killer, isSummon); } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/Baium/Baium.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/Baium/Baium.java index 4d38a800da..21a1500f09 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/Baium/Baium.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/Baium/Baium.java @@ -270,7 +270,7 @@ public final class Baium extends AbstractNpcAI if ((player != null) && player.isInsideRadius(npc, 16000, true, false)) { zone.broadcastPacket(new SocialAction(npc.getObjectId(), 1)); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HOW_DARE_YOU_WAKE_ME_NOW_YOU_SHALL_DIE, player.getName()); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_DARE_YOU_WAKE_ME_NOW_YOU_SHALL_DIE, player.getName()); npc.setTarget(player); npc.doCast(BAIUM_PRESENT.getSkill()); } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/CrimsonHatuOtis.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/CrimsonHatuOtis.java index b4e3499fc0..be20285492 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/CrimsonHatuOtis.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/CrimsonHatuOtis.java @@ -83,7 +83,7 @@ public final class CrimsonHatuOtis extends AbstractNpcAI } else if (npc.isScriptValue(1) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.3))) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.I_VE_HAD_IT_UP_TO_HERE_WITH_YOU_I_LL_TAKE_CARE_OF_YOU); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_VE_HAD_IT_UP_TO_HERE_WITH_YOU_I_LL_TAKE_CARE_OF_YOU); npc.setScriptValue(2); startQuestTimer("BUFF", 1000, npc, null); } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/DrChaos.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/DrChaos.java index e4b5894ffd..21cae3083f 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/DrChaos.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/DrChaos.java @@ -188,7 +188,7 @@ public class DrChaos extends AbstractNpcAI // Make him speak. if (_pissedOffTimer == 15) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, "How dare you trespass into my territory! Have you no fear?"); + npc.broadcastSay(ChatType.NPC_GENERAL, "How dare you trespass into my territory! Have you no fear?"); } // That was "too much" for that time. @@ -249,7 +249,7 @@ public class DrChaos extends AbstractNpcAI public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) { cancelQuestTimer("golem_despawn", npc, null); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, "Urggh! You will pay dearly for this insult."); + npc.broadcastSay(ChatType.NPC_GENERAL, "Urggh! You will pay dearly for this insult."); // "lock" Dr. Chaos for regular RB time (36H fixed +- 24H random) final long respawnTime = (36 + Rnd.get(-24, 24)) * 3600000; @@ -288,7 +288,7 @@ public class DrChaos extends AbstractNpcAI } // Make him speak. - broadcastNpcSay(npc, ChatType.NPC_GENERAL, message); + npc.broadcastSay(ChatType.NPC_GENERAL, message); } return null; } @@ -309,7 +309,7 @@ public class DrChaos extends AbstractNpcAI // Makes the NPC moves near the Strange Box speaking. npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(96323, -110914, -3328, 0)); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, "Fools! Why haven't you fled yet? Prepare to learn a lesson!"); + npc.broadcastSay(ChatType.NPC_GENERAL, "Fools! Why haven't you fled yet? Prepare to learn a lesson!"); // Delayed animation timers. startQuestTimer("1", 2000, npc, null, false); // 2 secs, time to launch dr.C anim 2. Cam 1 on. diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/FrightenedRagnaOrc.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/FrightenedRagnaOrc.java index 0adfa7299b..c1bed5144d 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/FrightenedRagnaOrc.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/FrightenedRagnaOrc.java @@ -62,7 +62,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.2)) && npc.isScriptValue(1)) { startQuestTimer("reward", 10000, npc, attacker); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WAIT_WAIT_STOP_SAVE_ME_AND_I_LL_GIVE_YOU_10_000_000_ADENA); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAIT_WAIT_STOP_SAVE_ME_AND_I_LL_GIVE_YOU_10_000_000_ADENA); npc.setScriptValue(2); } return super.onAttack(npc, attacker, damage, isSummon); @@ -72,7 +72,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon) { final NpcStringId msg = getRandomBoolean() ? NpcStringId.UGH_A_CURSE_UPON_YOU : NpcStringId.I_REALLY_DIDN_T_WANT_TO_FIGHT; - broadcastNpcSay(npc, ChatType.NPC_GENERAL, msg); + npc.broadcastSay(ChatType.NPC_GENERAL, msg); cancelQuestTimer("say", npc, null); cancelQuestTimer("reward", npc, player); return super.onKill(npc, player, isSummon); @@ -91,7 +91,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI return null; } final NpcStringId msg = getRandomBoolean() ? NpcStringId.I_DON_T_WANT_TO_FIGHT : NpcStringId.IS_THIS_REALLY_NECESSARY; - broadcastNpcSay(npc, ChatType.NPC_GENERAL, msg); + npc.broadcastSay(ChatType.NPC_GENERAL, msg); break; } case "reward": @@ -101,7 +101,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI if (getRandom(100000) < CHANCE2) { final NpcStringId msg = getRandomBoolean() ? NpcStringId.TH_THANKS_I_COULD_HAVE_BECOME_GOOD_FRIENDS_WITH_YOU : NpcStringId.I_LL_GIVE_YOU_10_000_000_ADENA_LIKE_I_PROMISED_I_MIGHT_BE_AN_ORC_WHO_KEEPS_MY_PROMISES; - broadcastNpcSay(npc, ChatType.NPC_GENERAL, msg); + npc.broadcastSay(ChatType.NPC_GENERAL, msg); npc.setScriptValue(3); npc.doCast(SKILL.getSkill()); for (int i = 0; i < 10; i++) @@ -112,7 +112,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI else if (getRandom(100000) < CHANCE) { final NpcStringId msg = getRandomBoolean() ? NpcStringId.TH_THANKS_I_COULD_HAVE_BECOME_GOOD_FRIENDS_WITH_YOU : NpcStringId.SORRY_BUT_THIS_IS_ALL_I_HAVE_GIVE_ME_A_BREAK; - broadcastNpcSay(npc, ChatType.NPC_GENERAL, msg); + npc.broadcastSay(ChatType.NPC_GENERAL, msg); npc.setScriptValue(3); npc.doCast(SKILL.getSkill()); for (int i = 0; i < 10; i++) @@ -122,7 +122,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI } else { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.THANKS_BUT_THAT_THING_ABOUT_10_000_000_ADENA_WAS_A_LIE_SEE_YA : NpcStringId.YOU_RE_PRETTY_DUMB_TO_BELIEVE_ME); + npc.broadcastSay(ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.THANKS_BUT_THAT_THING_ABOUT_10_000_000_ADENA_WAS_A_LIE_SEE_YA : NpcStringId.YOU_RE_PRETTY_DUMB_TO_BELIEVE_ME); } startQuestTimer("despawn", 1000, npc, null); } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/QueenShyeed.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/QueenShyeed.java index 758a7b0e88..fa617dd9e6 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/QueenShyeed.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/QueenShyeed.java @@ -71,7 +71,7 @@ public final class QueenShyeed extends AbstractNpcAI @Override public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.SHYEED_S_CRY_IS_STEADILY_DYING_DOWN); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SHYEED_S_CRY_IS_STEADILY_DYING_DOWN); startRespawn(); PC_BUFF_ZONE.setEnabled(true); return super.onKill(npc, killer, isSummon); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/Venom/Venom.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/Venom/Venom.java index f5e3a23a3f..6de892d5f5 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/Venom/Venom.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/individual/Venom/Venom.java @@ -155,7 +155,7 @@ public final class Venom extends AbstractNpcAI if (CastleManager.getInstance().getCastleById(CASTLE).getSiege().getControlTowerCount() <= 1) { changeLocation(MoveTo.THRONE); - broadcastNpcSay(_massymore, ChatType.NPC_SHOUT, NpcStringId.OH_NO_THE_DEFENSES_HAVE_FAILED_IT_IS_TOO_DANGEROUS_TO_REMAIN_INSIDE_THE_CASTLE_FLEE_EVERY_MAN_FOR_HIMSELF); + _massymore.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.OH_NO_THE_DEFENSES_HAVE_FAILED_IT_IS_TOO_DANGEROUS_TO_REMAIN_INSIDE_THE_CASTLE_FLEE_EVERY_MAN_FOR_HIMSELF); cancelQuestTimer("tower_check", npc, null); startQuestTimer("raid_check", 10000, npc, null, true); } @@ -284,7 +284,7 @@ public final class Venom extends AbstractNpcAI _venom.disableSkill(VENOM_TELEPORT.getSkill(), -1); _venom.disableSkill(RANGE_TELEPORT.getSkill(), -1); _venom.doRevive(); - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.WHO_DARES_TO_COVET_THE_THRONE_OF_OUR_CASTLE_LEAVE_IMMEDIATELY_OR_YOU_WILL_PAY_THE_PRICE_OF_YOUR_AUDACITY_WITH_YOUR_VERY_OWN_BLOOD); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.WHO_DARES_TO_COVET_THE_THRONE_OF_OUR_CASTLE_LEAVE_IMMEDIATELY_OR_YOU_WILL_PAY_THE_PRICE_OF_YOUR_AUDACITY_WITH_YOUR_VERY_OWN_BLOOD); ((L2Attackable) _venom).setCanReturnToSpawnPoint(false); if (checkStatus() == DEAD) { @@ -335,7 +335,7 @@ public final class Venom extends AbstractNpcAI public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) { updateStatus(DEAD); - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.IT_S_NOT_OVER_YET_IT_WON_T_BE_OVER_LIKE_THIS_NEVER); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.IT_S_NOT_OVER_YET_IT_WON_T_BE_OVER_LIKE_THIS_NEVER); if (!CastleManager.getInstance().getCastleById(CASTLE).getSiege().isInProgress()) { final L2Npc cube = addSpawn(TELEPORT_CUBE, CUBE, false, 0); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/AbstractNpcAI.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/AbstractNpcAI.java index 21edc8bb6f..f933d01b35 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/AbstractNpcAI.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/AbstractNpcAI.java @@ -16,15 +16,11 @@ */ package ai.npc; -import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.holders.MinionHolder; import com.l2jmobius.gameserver.model.quest.Quest; -import com.l2jmobius.gameserver.network.NpcStringId; -import com.l2jmobius.gameserver.network.serverpackets.NpcSay; -import com.l2jmobius.gameserver.util.Broadcast; /** * Abstract NPC AI class for datapack based AIs. @@ -70,60 +66,6 @@ public abstract class AbstractNpcAI extends Quest addFactionCallId(mobs); } - /** - * Broadcasts NpcSay packet to all known players with custom string. - * @param npc - * @param type - * @param text - */ - protected void broadcastNpcSay(L2Npc npc, ChatType type, String text) - { - Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), text)); - } - - /** - * Broadcasts NpcSay packet to all known players with npc string id. - * @param npc - * @param type - * @param stringId - */ - protected void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId stringId) - { - Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId)); - } - - /** - * Broadcasts NpcSay packet to all known players with npc string id. - * @param npc - * @param type - * @param stringId - * @param parameters - */ - protected void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId stringId, String... parameters) - { - final NpcSay say = new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId); - if (parameters != null) - { - for (String parameter : parameters) - { - say.addStringParameter(parameter); - } - } - Broadcast.toKnownPlayers(npc, say); - } - - /** - * Broadcasts NpcSay packet to all known players with npc string id in specific radius. - * @param npc - * @param type - * @param stringId - * @param radius - */ - protected void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId stringId, int radius) - { - Broadcast.toKnownPlayersInRadius(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId), radius); - } - public void spawnMinions(L2Npc npc, String spawnName) { for (MinionHolder is : npc.getTemplate().getParameters().getMinionList(spawnName)) diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Alarm/Alarm.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Alarm/Alarm.java index 0f1196856e..c0884eba84 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Alarm/Alarm.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Alarm/Alarm.java @@ -59,19 +59,19 @@ public final class Alarm extends AbstractNpcAI case "SELF_DESTRUCT_IN_60": { startQuestTimer("SELF_DESTRUCT_IN_30", 30000, npc, null); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_60_SECONDS_ENTER_PASSCODE_TO_OVERRIDE); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_60_SECONDS_ENTER_PASSCODE_TO_OVERRIDE); break; } case "SELF_DESTRUCT_IN_30": { startQuestTimer("SELF_DESTRUCT_IN_10", 20000, npc, null); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_30_SECONDS_ENTER_PASSCODE_TO_OVERRIDE); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_30_SECONDS_ENTER_PASSCODE_TO_OVERRIDE); break; } case "SELF_DESTRUCT_IN_10": { startQuestTimer("RECORDER_CRUSHED", 10000, npc, null); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_10_SECONDS_ENTER_PASSCODE_TO_OVERRIDE); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_10_SECONDS_ENTER_PASSCODE_TO_OVERRIDE); break; } case "RECORDER_CRUSHED": @@ -81,7 +81,7 @@ public final class Alarm extends AbstractNpcAI npc0.getVariables().set("SPAWNED", false); if (player0 != null) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.RECORDER_CRUSHED); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.RECORDER_CRUSHED); if (verifyMemoState(player0, ART_OF_PERSUASION_ID, -1)) { setMemoState(player0, ART_OF_PERSUASION_ID, 5); @@ -225,7 +225,7 @@ public final class Alarm extends AbstractNpcAI public String onSpawn(L2Npc npc) { startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES); final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class); if (player != null) { diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Dorian/Dorian.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Dorian/Dorian.java index 7e058c9707..b993adeb0b 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Dorian/Dorian.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Dorian/Dorian.java @@ -56,7 +56,7 @@ public final class Dorian extends AbstractNpcAI takeItems(pl, SILVER_CROSS, -1); giveItems(pl, BROKEN_SILVER_CROSS, 1); qs.setCond(4, true); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THAT_SIGN); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THAT_SIGN); } } return super.onSeeCreature(npc, creature, isSummon); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/ForgeOfTheGods/Rooney.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/ForgeOfTheGods/Rooney.java index fefefec534..5653765bc5 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/ForgeOfTheGods/Rooney.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/ForgeOfTheGods/Rooney.java @@ -94,22 +94,22 @@ public final class Rooney extends AbstractNpcAI { case 1: { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HURRY_HURRY); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HURRY_HURRY); break; } case 2: { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.I_AM_NOT_THAT_TYPE_OF_PERSON_WHO_STAYS_IN_ONE_PLACE_FOR_A_LONG_TIME); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_AM_NOT_THAT_TYPE_OF_PERSON_WHO_STAYS_IN_ONE_PLACE_FOR_A_LONG_TIME); break; } case 3: { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.IT_S_HARD_FOR_ME_TO_KEEP_STANDING_LIKE_THIS); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IT_S_HARD_FOR_ME_TO_KEEP_STANDING_LIKE_THIS); break; } case 4: { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WHY_DON_T_I_GO_THAT_WAY_THIS_TIME); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHY_DON_T_I_GO_THAT_WAY_THIS_TIME); break; } default: @@ -130,7 +130,7 @@ public final class Rooney extends AbstractNpcAI { if (creature.isPlayer() && npc.isScriptValue(0)) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WELCOME); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELCOME); startQuestTimer("teleport", 60000, npc, null); npc.setScriptValue(1); } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Katenar/Katenar.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Katenar/Katenar.java index 7264969711..bfb8218f5b 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Katenar/Katenar.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Katenar/Katenar.java @@ -75,7 +75,7 @@ public final class Katenar extends AbstractNpcAI if (!npc.getVariables().getBoolean("SPAWNED", false)) { npc0.getVariables().set("SPAWNED", false); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.GOOD_LUCK); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.GOOD_LUCK); } } npc.deleteMe(); @@ -130,7 +130,7 @@ public final class Katenar extends AbstractNpcAI final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class); if (player != null) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.I_AM_LATE); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_AM_LATE); } return super.onSpawn(npc); } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/MercenaryCaptain/MercenaryCaptain.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/MercenaryCaptain/MercenaryCaptain.java index 3d6860966a..30b7fa9e15 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/MercenaryCaptain/MercenaryCaptain.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/MercenaryCaptain/MercenaryCaptain.java @@ -191,15 +191,15 @@ public final class MercenaryCaptain extends AbstractNpcAI { if (TerritoryWarManager.getInstance().isTWInProgress()) { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.CHARGE_CHARGE_CHARGE); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.CHARGE_CHARGE_CHARGE); } else if (getRandom(2) == 0) { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.COURAGE_AMBITION_PASSION_MERCENARIES_WHO_WANT_TO_REALIZE_THEIR_DREAM_OF_FIGHTING_IN_THE_TERRITORY_WAR_COME_TO_ME_FORTUNE_AND_GLORY_ARE_WAITING_FOR_YOU); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.COURAGE_AMBITION_PASSION_MERCENARIES_WHO_WANT_TO_REALIZE_THEIR_DREAM_OF_FIGHTING_IN_THE_TERRITORY_WAR_COME_TO_ME_FORTUNE_AND_GLORY_ARE_WAITING_FOR_YOU); } else { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.DO_YOU_WISH_TO_FIGHT_ARE_YOU_AFRAID_NO_MATTER_HOW_HARD_YOU_TRY_YOU_HAVE_NOWHERE_TO_RUN_BUT_IF_YOU_FACE_IT_HEAD_ON_OUR_MERCENARY_TROOP_WILL_HELP_YOU_OUT); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.DO_YOU_WISH_TO_FIGHT_ARE_YOU_AFRAID_NO_MATTER_HOW_HARD_YOU_TRY_YOU_HAVE_NOWHERE_TO_RUN_BUT_IF_YOU_FACE_IT_HEAD_ON_OUR_MERCENARY_TROOP_WILL_HELP_YOU_OUT); } } return htmltext; diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Minigame/Minigame.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Minigame/Minigame.java index 038fe3ba99..65c443b34e 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Minigame/Minigame.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Minigame/Minigame.java @@ -88,7 +88,7 @@ public final class Minigame extends AbstractNpcAI takeItems(player, UNLIT_TORCHLIGHT, 1); giveItems(player, TORCHLIGHT, 1); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_FURNACE_WILL_GO_OUT_WATCH_AND_SEE); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_FURNACE_WILL_GO_OUT_WATCH_AND_SEE); room.getManager().setTarget(player); room.setParticipant(player); @@ -153,7 +153,7 @@ public final class Minigame extends AbstractNpcAI } else { - broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.NOW_LIGHT_THE_FURNACE_S_FIRE); + room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NOW_LIGHT_THE_FURNACE_S_FIRE); room.burnThemAll(); startQuestTimer("off", 2000, npc, null); final ConsumerEventListener listener = new ConsumerEventListener(room.getParticipant(), EventType.ON_CREATURE_SKILL_USE, (OnCreatureSkillUse listenerEvent) -> onSkillUse(listenerEvent), room); @@ -164,19 +164,19 @@ public final class Minigame extends AbstractNpcAI } case "hurry_up": { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THERE_S_ABOUT_1_MINUTE_LEFT); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THERE_S_ABOUT_1_MINUTE_LEFT); startQuestTimer("hurry_up2", 60000, npc, null); break; } case "hurry_up2": { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THERE_S_JUST_10_SECONDS_LEFT); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THERE_S_JUST_10_SECONDS_LEFT); startQuestTimer("expire", 10000, npc, null); break; } case "expire": { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.TIME_IS_UP_AND_YOU_HAVE_FAILED_ANY_MORE_WILL_BE_DIFFICULT); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TIME_IS_UP_AND_YOU_HAVE_FAILED_ANY_MORE_WILL_BE_DIFFICULT); } case "end": { @@ -284,7 +284,7 @@ public final class Minigame extends AbstractNpcAI else { addSpawn(TREASURE_BOX, room.getParticipant().getLocation(), true, 0); - broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.OH_YOU_VE_SUCCEEDED); + room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_VE_SUCCEEDED); room.setCurrentPot(0); room.burnThemAll(); startQuestTimer("off", 2000, room.getManager(), null); @@ -293,7 +293,7 @@ public final class Minigame extends AbstractNpcAI } else if (room.getAttemptNumber() == MAX_ATTEMPTS) { - broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.AH_I_VE_FAILED_GOING_FURTHER_WILL_BE_DIFFICULT); + room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.AH_I_VE_FAILED_GOING_FURTHER_WILL_BE_DIFFICULT); room.burnThemAll(); startQuestTimer("off", 2000, room.getManager(), null); room.getParticipant().removeListenerIf(EventType.ON_CREATURE_SKILL_USE, listener -> listener.getOwner() == room); @@ -301,7 +301,7 @@ public final class Minigame extends AbstractNpcAI } else if (room.getAttemptNumber() < MAX_ATTEMPTS) { - broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.AH_IS_THIS_FAILURE_BUT_IT_LOOKS_LIKE_I_CAN_KEEP_GOING); + room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.AH_IS_THIS_FAILURE_BUT_IT_LOOKS_LIKE_I_CAN_KEEP_GOING); room.burnThemAll(); startQuestTimer("off", 2000, room.getManager(), null); room.setAttemptNumber(room.getAttemptNumber() + 1); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/impl/CabaleBuffer.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/impl/CabaleBuffer.java index 6b0d71dc39..e2fd347f35 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/impl/CabaleBuffer.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/NpcBuffers/impl/CabaleBuffer.java @@ -280,11 +280,11 @@ public final class CabaleBuffer extends AbstractNpcAI { if (chance == -1) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, message); + npc.broadcastSay(ChatType.NPC_GENERAL, message); } else if (getRandom(10000) < chance) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, message, param); + npc.broadcastSay(ChatType.NPC_GENERAL, message, param); } } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Teleports/TeleportToFantasy/TeleportToFantasy.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Teleports/TeleportToFantasy/TeleportToFantasy.java index c38a18def5..13e85dec84 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Teleports/TeleportToFantasy/TeleportToFantasy.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Teleports/TeleportToFantasy/TeleportToFantasy.java @@ -101,7 +101,7 @@ public final class TeleportToFantasy extends AbstractNpcAI } else { - broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_RUNE_TOWNSHIP_WHICH_IS_THE_NEAREST_TOWN); + npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_RUNE_TOWNSHIP_WHICH_IS_THE_NEAREST_TOWN); player.teleToLocation(RUNE_TOWNSHIP); } } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Teleports/TeleportToRaceTrack/TeleportToRaceTrack.java b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Teleports/TeleportToRaceTrack/TeleportToRaceTrack.java index 51cc681456..66feb49d9b 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Teleports/TeleportToRaceTrack/TeleportToRaceTrack.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/ai/npc/Teleports/TeleportToRaceTrack/TeleportToRaceTrack.java @@ -95,7 +95,7 @@ public final class TeleportToRaceTrack extends AbstractNpcAI } else { - broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_RUNE_TOWNSHIP_WHICH_IS_THE_NEAREST_TOWN); + npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_RUNE_TOWNSHIP_WHICH_IS_THE_NEAREST_TOWN); player.teleToLocation(DION_CASTLE_TOWN); } } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/conquerablehalls/DevastatedCastle/DevastatedCastle.java b/L2J_Mobius_HighFive/dist/game/data/scripts/conquerablehalls/DevastatedCastle/DevastatedCastle.java index 1d668867f2..fa115e6571 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/conquerablehalls/DevastatedCastle/DevastatedCastle.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/conquerablehalls/DevastatedCastle/DevastatedCastle.java @@ -58,11 +58,11 @@ public final class DevastatedCastle extends ClanHallSiegeEngine { if (npc.getId() == MIKHAIL) { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.GLORY_TO_ADEN_THE_KINGDOM_OF_THE_LION_GLORY_TO_SIR_GUSTAV_OUR_IMMORTAL_LORD); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.GLORY_TO_ADEN_THE_KINGDOM_OF_THE_LION_GLORY_TO_SIR_GUSTAV_OUR_IMMORTAL_LORD); } else if (npc.getId() == DIETRICH) { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.SOLDIERS_OF_GUSTAV_GO_FORTH_AND_DESTROY_THE_INVADERS); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.SOLDIERS_OF_GUSTAV_GO_FORTH_AND_DESTROY_THE_INVADERS); } return null; } @@ -96,7 +96,7 @@ public final class DevastatedCastle extends ClanHallSiegeEngine if ((npc.getCurrentHp() < GUSTAV_TRIGGER_HP) && (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST)) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THIS_IS_UNBELIEVABLE_HAVE_I_REALLY_BEEN_DEFEATED_I_SHALL_RETURN_AND_TAKE_YOUR_HEAD); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_IS_UNBELIEVABLE_HAVE_I_REALLY_BEEN_DEFEATED_I_SHALL_RETURN_AND_TAKE_YOUR_HEAD); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, SkillData.getInstance().getSkill(4235, 1), npc); } } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/conquerablehalls/FortressOfTheDead/FortressOfTheDead.java b/L2J_Mobius_HighFive/dist/game/data/scripts/conquerablehalls/FortressOfTheDead/FortressOfTheDead.java index 577c932ead..22d1ae5cb9 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/conquerablehalls/FortressOfTheDead/FortressOfTheDead.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/conquerablehalls/FortressOfTheDead/FortressOfTheDead.java @@ -61,15 +61,15 @@ public final class FortressOfTheDead extends ClanHallSiegeEngine { if (npc.getId() == LIDIA) { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.HMM_THOSE_WHO_ARE_NOT_OF_THE_BLOODLINE_ARE_COMING_THIS_WAY_TO_TAKE_OVER_THE_CASTLE_HUMPH_THE_BITTER_GRUDGES_OF_THE_DEAD_YOU_MUST_NOT_MAKE_LIGHT_OF_THEIR_POWER); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.HMM_THOSE_WHO_ARE_NOT_OF_THE_BLOODLINE_ARE_COMING_THIS_WAY_TO_TAKE_OVER_THE_CASTLE_HUMPH_THE_BITTER_GRUDGES_OF_THE_DEAD_YOU_MUST_NOT_MAKE_LIGHT_OF_THEIR_POWER); } else if (npc.getId() == ALFRED) { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.HEH_HEH_I_SEE_THAT_THE_FEAST_HAS_BEGUN_BE_WARY_THE_CURSE_OF_THE_HELLMANN_FAMILY_HAS_POISONED_THIS_LAND); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.HEH_HEH_I_SEE_THAT_THE_FEAST_HAS_BEGUN_BE_WARY_THE_CURSE_OF_THE_HELLMANN_FAMILY_HAS_POISONED_THIS_LAND); } else if (npc.getId() == GISELLE) { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.ARISE_MY_FAITHFUL_SERVANTS_YOU_MY_PEOPLE_WHO_HAVE_INHERITED_THE_BLOOD_IT_IS_THE_CALLING_OF_MY_DAUGHTER_THE_FEAST_OF_BLOOD_WILL_NOW_BEGIN); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.ARISE_MY_FAITHFUL_SERVANTS_YOU_MY_PEOPLE_WHO_HAVE_INHERITED_THE_BLOOD_IT_IS_THE_CALLING_OF_MY_DAUGHTER_THE_FEAST_OF_BLOOD_WILL_NOW_BEGIN); } return null; } @@ -116,11 +116,11 @@ public final class FortressOfTheDead extends ClanHallSiegeEngine if ((npcId == ALFRED) || (npcId == GISELLE)) { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.AARGH_IF_I_DIE_THEN_THE_MAGIC_FORCE_FIELD_OF_BLOOD_WILL); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.AARGH_IF_I_DIE_THEN_THE_MAGIC_FORCE_FIELD_OF_BLOOD_WILL); } if (npcId == LIDIA) { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.GRARR_FOR_THE_NEXT_2_MINUTES_OR_SO_THE_GAME_ARENA_ARE_WILL_BE_CLEANED_THROW_ANY_ITEMS_YOU_DON_T_NEED_TO_THE_FLOOR_NOW); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.GRARR_FOR_THE_NEXT_2_MINUTES_OR_SO_THE_GAME_ARENA_ARE_WILL_BE_CLEANED_THROW_ANY_ITEMS_YOU_DON_T_NEED_TO_THE_FLOOR_NOW); _missionAccomplished = true; synchronized (this) { diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/gracia/AI/Lindvior.java b/L2J_Mobius_HighFive/dist/game/data/scripts/gracia/AI/Lindvior.java index faa35dadac..dae3cf5283 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/gracia/AI/Lindvior.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/gracia/AI/Lindvior.java @@ -63,13 +63,13 @@ public class Lindvior extends AbstractNpcAI switch (event) { case "tomaris_shout1": - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.HUH_THE_SKY_LOOKS_FUNNY_WHAT_S_THAT); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.HUH_THE_SKY_LOOKS_FUNNY_WHAT_S_THAT); break; case "artius_shout": - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.A_POWERFUL_SUBORDINATE_IS_BEING_HELD_BY_THE_BARRIER_ORB_THIS_REACTION_MEANS); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.A_POWERFUL_SUBORDINATE_IS_BEING_HELD_BY_THE_BARRIER_ORB_THIS_REACTION_MEANS); break; case "tomaris_shout2": - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.BE_CAREFUL_SOMETHING_S_COMING); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.BE_CAREFUL_SOMETHING_S_COMING); break; case "lindvior_scene": if (npc != null) diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/gracia/AI/NPC/Seyo/Seyo.java b/L2J_Mobius_HighFive/dist/game/data/scripts/gracia/AI/NPC/Seyo/Seyo.java index fb5510edbe..9134c1bc9e 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/gracia/AI/NPC/Seyo/Seyo.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/gracia/AI/NPC/Seyo/Seyo.java @@ -66,7 +66,7 @@ public final class Seyo extends AbstractNpcAI if (npc.isScriptValue(1)) { npc.setScriptValue(0); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, TEXT[getRandom(TEXT.length)]); + npc.broadcastSay(ChatType.NPC_GENERAL, TEXT[getRandom(TEXT.length)]); } break; } @@ -87,11 +87,11 @@ public final class Seyo extends AbstractNpcAI if (getRandom(100) == 0) { giveItems(player, STONE_FRAGMENT, 100); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.AMAZING_S1_TOOK_100_OF_THESE_SOUL_STONE_FRAGMENTS_WHAT_A_COMPLETE_SWINDLER, player.getName()); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.AMAZING_S1_TOOK_100_OF_THESE_SOUL_STONE_FRAGMENTS_WHAT_A_COMPLETE_SWINDLER, player.getName()); } else { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HMM_HEY_DID_YOU_GIVE_S1_SOMETHING_BUT_IT_WAS_JUST_1_HAHA, player.getName()); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_HEY_DID_YOU_GIVE_S1_SOMETHING_BUT_IT_WAS_JUST_1_HAHA, player.getName()); } startQuestTimer("TRICKERY_TIMER", 5000, npc, null); } @@ -114,18 +114,18 @@ public final class Seyo extends AbstractNpcAI final int chance = getRandom(100); if (chance < 20) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.AHEM_S1_HAS_NO_LUCK_AT_ALL_TRY_PRAYING, player.getName()); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.AHEM_S1_HAS_NO_LUCK_AT_ALL_TRY_PRAYING, player.getName()); } else if (chance < 80) { giveItems(player, STONE_FRAGMENT, 1); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.IT_S_BETTER_THAN_LOSING_IT_ALL_RIGHT_OR_DOES_THIS_FEEL_WORSE); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IT_S_BETTER_THAN_LOSING_IT_ALL_RIGHT_OR_DOES_THIS_FEEL_WORSE); } else { final int itemCount = getRandom(10, 16); giveItems(player, STONE_FRAGMENT, itemCount); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.S1_PULLED_ONE_WITH_S2_DIGITS_LUCKY_NOT_BAD, player.getName(), String.valueOf(itemCount)); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.S1_PULLED_ONE_WITH_S2_DIGITS_LUCKY_NOT_BAD, player.getName(), String.valueOf(itemCount)); } startQuestTimer("TRICKERY_TIMER", 5000, npc, null); } @@ -149,17 +149,17 @@ public final class Seyo extends AbstractNpcAI if (chance == 0) { giveItems(player, STONE_FRAGMENT, 10000); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.AH_IT_S_OVER_WHAT_KIND_OF_GUY_IS_THAT_DAMN_FINE_YOU_S1_TAKE_IT_AND_GET_OUTTA_HERE, player.getName()); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.AH_IT_S_OVER_WHAT_KIND_OF_GUY_IS_THAT_DAMN_FINE_YOU_S1_TAKE_IT_AND_GET_OUTTA_HERE, player.getName()); } else if (chance < 10) { giveItems(player, STONE_FRAGMENT, 1); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_DON_T_FEEL_BAD_RIGHT_ARE_YOU_SAD_BUT_DON_T_CRY); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DON_T_FEEL_BAD_RIGHT_ARE_YOU_SAD_BUT_DON_T_CRY); } else { giveItems(player, STONE_FRAGMENT, getRandom(1, 100)); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.A_BIG_PIECE_IS_MADE_UP_OF_LITTLE_PIECES_SO_HERE_S_A_LITTLE_PIECE); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.A_BIG_PIECE_IS_MADE_UP_OF_LITTLE_PIECES_SO_HERE_S_A_LITTLE_PIECE); } startQuestTimer("TRICKERY_TIMER", 5000, npc, null); } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Amaskari.java b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Amaskari.java index 286a39d496..8090018533 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Amaskari.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Amaskari.java @@ -76,7 +76,7 @@ public final class Amaskari extends AbstractNpcAI { if (event.equalsIgnoreCase("stop_toggle")) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[2]); + npc.broadcastSay(ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[2]); ((L2MonsterInstance) npc).clearAggroList(); ((L2MonsterInstance) npc).getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); npc.setIsInvul(false); @@ -86,11 +86,11 @@ public final class Amaskari extends AbstractNpcAI { if (getRandom(100) > 20) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[2]); + npc.broadcastSay(ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[2]); } else if (getRandom(100) > 40) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[3]); + npc.broadcastSay(ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[3]); } startQuestTimer("onspawn_msg", (getRandom(8) + 1) * 30000, npc, null); } @@ -102,12 +102,12 @@ public final class Amaskari extends AbstractNpcAI { if ((npc.getId() == AMASKARI) && (getRandom(1000) < 25)) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[0]); + npc.broadcastSay(ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[0]); for (L2MonsterInstance minion : ((L2MonsterInstance) npc).getMinionList().getSpawnedMinions()) { if ((minion != null) && !minion.isDead() && (getRandom(10) == 0)) { - broadcastNpcSay(minion, ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[0]); + minion.broadcastSay(ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[0]); minion.setCurrentHp(minion.getCurrentHp() - (minion.getCurrentHp() / 5)); } } @@ -123,7 +123,7 @@ public final class Amaskari extends AbstractNpcAI final L2MonsterInstance master = ((L2MonsterInstance) npc).getLeader(); if ((master != null) && !master.isDead()) { - broadcastNpcSay(master, ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[1]); + master.broadcastSay(ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[1]); final BuffInfo info = master.getEffectList().getBuffInfoBySkillId(BUFF_ID); if ((info != null) && (info.getSkill().getAbnormalLvl() == 3) && master.isInvul()) { @@ -143,7 +143,7 @@ public final class Amaskari extends AbstractNpcAI } else { - broadcastNpcSay(master, ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[3]); + master.broadcastSay(ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[3]); // master.doCast(INVINCIBILITY.getSkill()) master.setIsInvul(true); startQuestTimer("stop_toggle", 10000, master, null); @@ -159,7 +159,7 @@ public final class Amaskari extends AbstractNpcAI { if (getRandom(1000) > 300) { - broadcastNpcSay(minion, ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[1]); + minion.broadcastSay(ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[1]); } HellboundEngine.getInstance().updateTrust(30, true); minion.deleteMe(); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Keltas.java b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Keltas.java index 50dcc995a5..45687a50bb 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Keltas.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Keltas.java @@ -159,7 +159,7 @@ public final class Keltas extends AbstractNpcAI final L2Npc keltas = _spawnedKeltas; if ((keltas != null) && !keltas.isDead()) { - broadcastNpcSay(keltas, ChatType.NPC_SHOUT, NpcStringId.THAT_IS_IT_FOR_TODAY_LET_S_RETREAT_EVERYONE_PULL_BACK); + keltas.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.THAT_IS_IT_FOR_TODAY_LET_S_RETREAT_EVERYONE_PULL_BACK); keltas.deleteMe(); keltas.getSpawn().decreaseCount(keltas); despawnMinions(); @@ -180,7 +180,7 @@ public final class Keltas extends AbstractNpcAI public final String onSpawn(L2Npc npc) { _spawnedKeltas = (L2MonsterInstance) npc; - broadcastNpcSay(_spawnedKeltas, ChatType.NPC_SHOUT, NpcStringId.GUYS_SHOW_THEM_OUR_POWER); + _spawnedKeltas.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.GUYS_SHOW_THEM_OUR_POWER); spawnMinions(); startQuestTimer("despawn", 1800000, null, null); return super.onSpawn(npc); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/NPC/Natives/Natives.java b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/NPC/Natives/Natives.java index 970fd212cd..429f471337 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/NPC/Natives/Natives.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/NPC/Natives/Natives.java @@ -108,7 +108,7 @@ public final class Natives extends AbstractNpcAI if (getQuestItemsCount(player, MARK_OF_BETRAYAL) >= 10) { takeItems(player, MARK_OF_BETRAYAL, 10); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.ALRIGHT_NOW_LEODAS_IS_YOURS); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ALRIGHT_NOW_LEODAS_IS_YOURS); HellboundEngine.getInstance().updateTrust(-50, true); for (int doorId : DOORS) @@ -146,7 +146,7 @@ public final class Natives extends AbstractNpcAI } else if ((npc.getId() == NATIVE) && event.equalsIgnoreCase("hungry_death")) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HUN_HUNGRY); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HUN_HUNGRY); npc.doDie(null); } else if (npc.getId() == INCASTLE) diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/NPC/Quarry/Quarry.java b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/NPC/Quarry/Quarry.java index 8b217a4a76..00f3356994 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/NPC/Quarry/Quarry.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/NPC/Quarry/Quarry.java @@ -101,7 +101,7 @@ public final class Quarry extends AbstractNpcAI return null; } } - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HUN_HUNGRY); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HUN_HUNGRY); npc.doDie(npc); break; } @@ -174,7 +174,7 @@ public final class Quarry extends AbstractNpcAI startQuestTimer("DECAY", 1000, npc, null); try { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THANK_YOU_FOR_THE_RESCUE_IT_S_A_SMALL_GIFT); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THANK_YOU_FOR_THE_RESCUE_IT_S_A_SMALL_GIFT); } catch (Exception e) { diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Ranku.java b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Ranku.java index 6cfd3f4a9b..62c858018b 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Ranku.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Ranku.java @@ -77,7 +77,7 @@ public final class Ranku extends AbstractNpcAI { if ((minion != null) && !minion.isDead() && !MY_TRACKING_SET.contains(minion.getObjectId())) { - broadcastNpcSay(minion, ChatType.NPC_GENERAL, NpcStringId.DON_T_KILL_ME_PLEASE_SOMETHING_S_STRANGLING_ME); + minion.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_KILL_ME_PLEASE_SOMETHING_S_STRANGLING_ME); startQuestTimer("checkup", 1000, npc, null); MY_TRACKING_SET.add(minion.getObjectId()); } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Slaves.java b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Slaves.java index 0788367909..6fddc9cda5 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Slaves.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Slaves.java @@ -79,7 +79,7 @@ public final class Slaves extends AbstractNpcAI slave.clearAggroList(); slave.abortAttack(); slave.abortCast(); - broadcastNpcSay(slave, ChatType.NPC_GENERAL, NpcStringId.THANK_YOU_FOR_SAVING_ME_FROM_THE_CLUTCHES_OF_EVIL); + slave.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THANK_YOU_FOR_SAVING_ME_FROM_THE_CLUTCHES_OF_EVIL); if ((HellboundEngine.getInstance().getLevel() >= 1) && (HellboundEngine.getInstance().getLevel() <= 2)) { diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/AnomicFoundry/AnomicFoundry.java b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/AnomicFoundry/AnomicFoundry.java index 48b800b765..93853f156a 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/AnomicFoundry/AnomicFoundry.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/AnomicFoundry/AnomicFoundry.java @@ -139,7 +139,7 @@ public final class AnomicFoundry extends AbstractNpcAI int atkIndex = _atkIndex.containsKey(npc.getObjectId()) ? _atkIndex.get(npc.getObjectId()) : 0; if (atkIndex == 0) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.ENEMY_INVASION_HURRY_UP); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ENEMY_INVASION_HURRY_UP); cancelQuestTimer("return_laborer", npc, null); startQuestTimer("return_laborer", 60000, npc, null); @@ -180,7 +180,7 @@ public final class AnomicFoundry extends AbstractNpcAI { if (getRandom(10000) < 8000) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.PROCESS_SHOULDN_T_BE_DELAYED_BECAUSE_OF_ME); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.PROCESS_SHOULDN_T_BE_DELAYED_BECAUSE_OF_ME); if (respawnTime < respawnMax) { respawnTime += 10000; diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TowerOfNaia/TowerOfNaia.java b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TowerOfNaia/TowerOfNaia.java index 706c81b2d7..6fc92fbadf 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TowerOfNaia/TowerOfNaia.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TowerOfNaia/TowerOfNaia.java @@ -586,7 +586,7 @@ public final class TowerOfNaia extends AbstractNpcAI MinionList.spawnMinion(_lock, 18493); MinionList.spawnMinion(_lock, 18493); } - broadcastNpcSay(_controller, ChatType.NPC_GENERAL, NpcStringId.EMERGENCY_EMERGENCY_THE_OUTER_WALL_IS_WEAKENING_RAPIDLY); + _controller.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EMERGENCY_EMERGENCY_THE_OUTER_WALL_IS_WEAKENING_RAPIDLY); _counter -= 10; } } @@ -690,7 +690,7 @@ public final class TowerOfNaia extends AbstractNpcAI { if ((spore != null) && !spore.isDead() && (spore.getId() == npcId)) { - broadcastNpcSay(spore, ChatType.NPC_GENERAL, SPORES_NPCSTRING_ID[getRandom(4)], el); + spore.broadcastSay(ChatType.NPC_GENERAL, SPORES_NPCSTRING_ID[getRandom(4)], el); } } } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TullyWorkshop/TullyWorkshop.java b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TullyWorkshop/TullyWorkshop.java index f417aef1cd..cb56b651d2 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TullyWorkshop/TullyWorkshop.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/AI/Zones/TullyWorkshop/TullyWorkshop.java @@ -570,7 +570,7 @@ public final class TullyWorkshop extends AbstractNpcAI { if (postMortemSpawn.indexOf(npc) == 11) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HA_HA_YOU_WERE_SO_AFRAID_OF_DEATH_LET_ME_SEE_IF_YOU_FIND_ME_IN_TIME_MAYBE_YOU_CAN_FIND_A_WAY); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HA_HA_YOU_WERE_SO_AFRAID_OF_DEATH_LET_ME_SEE_IF_YOU_FIND_ME_IN_TIME_MAYBE_YOU_CAN_FIND_A_WAY); npc.deleteMe(); return null; } @@ -744,7 +744,7 @@ public final class TullyWorkshop extends AbstractNpcAI if (event.equalsIgnoreCase("repair_device")) { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.DE_ACTIVATE_THE_ALARM); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.DE_ACTIVATE_THE_ALARM); brokenContraptions.remove(npc.getObjectId()); } else if (event.equalsIgnoreCase("despawn_servant") && !npc.isDead()) @@ -1221,7 +1221,7 @@ public final class TullyWorkshop extends AbstractNpcAI { if ((_npc != null) && (_npc.getId() == INGENIOUS_CONTRAPTION)) { - broadcastNpcSay(_npc, ChatType.NPC_SHOUT, NpcStringId.S1_MINUTE_S_ARE_REMAINING, Integer.toString((countdownTime / 60000))); + _npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.S1_MINUTE_S_ARE_REMAINING, Integer.toString((countdownTime / 60000))); } } } @@ -1255,35 +1255,35 @@ public final class TullyWorkshop extends AbstractNpcAI { if ((_npc != null) && (_npc.getId() == INGENIOUS_CONTRAPTION)) { - broadcastNpcSay(_npc, ChatType.NPC_SHOUT, NpcStringId.S1_SECOND_S_REMAINING, Integer.toString((countdownTime / 1000))); + _npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.S1_SECOND_S_REMAINING, Integer.toString((countdownTime / 1000))); } } }, 60000, 10000); - broadcastNpcSay(postMortemSpawn.get(0), ChatType.NPC_SHOUT, NpcStringId.DETONATOR_INITIALIZATION_TIME_SET_FOR_S1_MINUTE_S_FROM_NOW, Integer.toString((countdownTime / 60000))); + postMortemSpawn.get(0).broadcastSay(ChatType.NPC_SHOUT, NpcStringId.DETONATOR_INITIALIZATION_TIME_SET_FOR_S1_MINUTE_S_FROM_NOW, Integer.toString((countdownTime / 60000))); } else if ((npcId == TIMETWISTER_GOLEM) && (_countdown != null)) { if (getRandom(1000) >= 700) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.A_FATAL_ERROR_HAS_OCCURRED); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.A_FATAL_ERROR_HAS_OCCURRED); if (countdownTime > 180000) { countdownTime = Math.max(countdownTime - 180000, 60000); if ((postMortemSpawn != null) && (postMortemSpawn.size() > 0) && (postMortemSpawn.get(0) != null) && (postMortemSpawn.get(0).getId() == INGENIOUS_CONTRAPTION)) { - broadcastNpcSay(postMortemSpawn.get(0), ChatType.NPC_SHOUT, NpcStringId.ZZZZ_CITY_INTERFERENCE_ERROR_FORWARD_EFFECT_CREATED); + postMortemSpawn.get(0).broadcastSay(ChatType.NPC_SHOUT, NpcStringId.ZZZZ_CITY_INTERFERENCE_ERROR_FORWARD_EFFECT_CREATED); } } } else { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.TIME_RIFT_DEVICE_ACTIVATION_SUCCESSFUL); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TIME_RIFT_DEVICE_ACTIVATION_SUCCESSFUL); if ((countdownTime > 0) && (countdownTime <= 420000)) { countdownTime += 180000; if ((postMortemSpawn != null) && (postMortemSpawn.size() > 0) && (postMortemSpawn.get(0) != null) && (postMortemSpawn.get(0).getId() == INGENIOUS_CONTRAPTION)) { - broadcastNpcSay(postMortemSpawn.get(0), ChatType.NPC_SHOUT, NpcStringId.ZZZZ_CITY_INTERFERENCE_ERROR_RECURRENCE_EFFECT_CREATED); + postMortemSpawn.get(0).broadcastSay(ChatType.NPC_SHOUT, NpcStringId.ZZZZ_CITY_INTERFERENCE_ERROR_RECURRENCE_EFFECT_CREATED); } } } @@ -1365,11 +1365,11 @@ public final class TullyWorkshop extends AbstractNpcAI if (((npc.getId() - 22404) == 3) || ((npc.getId() - 22404) == 6)) { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.I_FAILED_PLEASE_FORGIVE_ME_DARION); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.I_FAILED_PLEASE_FORGIVE_ME_DARION); } else { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.S1_I_LL_BE_BACK_DON_T_GET_COMFORTABLE, killer.getName()); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.S1_I_LL_BE_BACK_DON_T_GET_COMFORTABLE, killer.getName()); } } else if (((npcId == TEMENIR) || (npcId == DRAXIUS) || (npcId == KIRETCENAH)) && spawnedFollowers.contains(npc)) @@ -1444,7 +1444,7 @@ public final class TullyWorkshop extends AbstractNpcAI } else if ((npcId >= SERVANT_FIRST) && (npcId <= SERVANT_LAST) && (skillId == 5392)) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.S1_THANK_YOU_FOR_GIVING_ME_YOUR_LIFE, player.getName()); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.S1_THANK_YOU_FOR_GIVING_ME_YOUR_LIFE, player.getName()); final int dmg = (int) (player.getCurrentHp() / (npc.getId() - 22404)); player.reduceCurrentHp(dmg, null, null); npc.setCurrentHp((npc.getCurrentHp() + 10) - (npc.getId() - 22404)); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/Instances/UrbanArea/UrbanArea.java b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/Instances/UrbanArea/UrbanArea.java index 6711b39715..5a1022b223 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/Instances/UrbanArea/UrbanArea.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/hellbound/Instances/UrbanArea/UrbanArea.java @@ -198,8 +198,8 @@ public final class UrbanArea extends AbstractInstance { if (!npc.isAffectedBySkill(STONE.getSkillId()) || world.isAmaskariDead) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[0]); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[2]); + npc.broadcastSay(ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[0]); + npc.broadcastSay(ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[2]); } else { @@ -209,8 +209,8 @@ public final class UrbanArea extends AbstractInstance npc.stopSkillEffects(false, STONE.getSkillId()); } - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[0]); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[1]); + npc.broadcastSay(ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[0]); + npc.broadcastSay(ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[1]); HellboundEngine.getInstance().updateTrust(10, true); npc.scheduleDespawn(3000); // Try to call Amaskari @@ -258,7 +258,7 @@ public final class UrbanArea extends AbstractInstance if (!npc.isBusy()) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPCSTRING_ID[0]); + npc.broadcastSay(ChatType.NPC_GENERAL, NPCSTRING_ID[0]); npc.setBusy(true); if ((world.spawnedAmaskari != null) && !world.spawnedAmaskari.isDead() && (getRandom(1000) < 25) && Util.checkIfInRange(1000, npc, world.spawnedAmaskari, false)) @@ -302,7 +302,7 @@ public final class UrbanArea extends AbstractInstance } if (msgId >= 0) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPCSTRING_ID[msgId], range); + npc.broadcastSay(ChatType.NPC_GENERAL, NPCSTRING_ID[msgId], range); } npc.setBusy(true); npc.setBusyMessage("atk"); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/IceQueensCastle/IceQueensCastle.java b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/IceQueensCastle/IceQueensCastle.java index 1742a5f672..af469a79ef 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/IceQueensCastle/IceQueensCastle.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/IceQueensCastle/IceQueensCastle.java @@ -102,7 +102,7 @@ public final class IceQueensCastle extends AbstractInstance } case "TIMER_BLIZZARD": { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.I_CAN_NO_LONGER_STAND_BY); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_NO_LONGER_STAND_BY); npc.stopMove(null); npc.setTarget(player); npc.doCast(ETHERNAL_BLIZZARD.getSkill()); @@ -152,7 +152,7 @@ public final class IceQueensCastle extends AbstractInstance startQuestTimer("ATTACK_KNIGHT", 5000, npc, null); } } - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.S1_MAY_THE_PROTECTION_OF_THE_GODS_BE_UPON_YOU, creature.getName()); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.S1_MAY_THE_PROTECTION_OF_THE_GODS_BE_UPON_YOU, creature.getName()); } return super.onSeeCreature(npc, creature, isSummon); } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/IceQueensCastleNormalBattle/IceQueensCastleNormalBattle.java b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/IceQueensCastleNormalBattle/IceQueensCastleNormalBattle.java index e9b1c00c4c..9c752c8bef 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/IceQueensCastleNormalBattle/IceQueensCastleNormalBattle.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/IceQueensCastleNormalBattle/IceQueensCastleNormalBattle.java @@ -688,22 +688,22 @@ public final class IceQueensCastleNormalBattle extends AbstractInstance { case 0: { - broadcastNpcSay(npc, ChatType.SHOUT, NpcStringId.ARCHER_GIVE_YOUR_BREATH_FOR_THE_INTRUDER); + npc.broadcastSay(ChatType.SHOUT, NpcStringId.ARCHER_GIVE_YOUR_BREATH_FOR_THE_INTRUDER); break; } case 1: { - broadcastNpcSay(npc, ChatType.SHOUT, NpcStringId.MY_KNIGHTS_SHOW_YOUR_LOYALTY); + npc.broadcastSay(ChatType.SHOUT, NpcStringId.MY_KNIGHTS_SHOW_YOUR_LOYALTY); break; } case 2: { - broadcastNpcSay(npc, ChatType.SHOUT, NpcStringId.I_CAN_TAKE_IT_NO_LONGER); + npc.broadcastSay(ChatType.SHOUT, NpcStringId.I_CAN_TAKE_IT_NO_LONGER); break; } case 3: { - broadcastNpcSay(npc, ChatType.SHOUT, NpcStringId.ARCHER_HEED_MY_CALL); + npc.broadcastSay(ChatType.SHOUT, NpcStringId.ARCHER_HEED_MY_CALL); for (int i = 0; i < 3; i++) { final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), true, 0, false, world.getInstanceId()); diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/LibraryOfSages/LibraryOfSages.java b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/LibraryOfSages/LibraryOfSages.java index f27d1db3a3..37d0f983e1 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/LibraryOfSages/LibraryOfSages.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/LibraryOfSages/LibraryOfSages.java @@ -96,7 +96,7 @@ public final class LibraryOfSages extends AbstractInstance { npc.setIsRunning(true); npc.getAI().startFollow(player); - broadcastNpcSay(npc, ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]); + npc.broadcastSay(ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]); startQuestTimer("FOLLOW", 10000, npc, player); break; } diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/MithrilMine/MithrilMine.java b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/MithrilMine/MithrilMine.java index 8005905e19..530cef85fa 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/MithrilMine/MithrilMine.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/MithrilMine/MithrilMine.java @@ -118,7 +118,7 @@ public final class MithrilMine extends AbstractInstance kegor.setWalking(); kegor.setTarget(player); kegor.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); - broadcastNpcSay(kegor, ChatType.NPC_GENERAL, NpcStringId.I_CAN_FINALLY_TAKE_A_BREATHER_BY_THE_WAY_WHO_ARE_YOU_HMM_I_THINK_I_KNOW_WHO_SENT_YOU); + kegor.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_FINALLY_TAKE_A_BREATHER_BY_THE_WAY_WHO_ARE_YOU_HMM_I_THINK_I_KNOW_WHO_SENT_YOU); } } InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(3000); @@ -161,7 +161,7 @@ public final class MithrilMine extends AbstractInstance if (npc.getId() == KEGOR) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HOW_COULD_I_FALL_IN_A_PLACE_LIKE_THIS); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_COULD_I_FALL_IN_A_PLACE_LIKE_THIS); InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(1000); } else diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/MonasteryOfSilence1/MonasteryOfSilence1.java b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/MonasteryOfSilence1/MonasteryOfSilence1.java index a88a0da8f1..76dde9d65a 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/MonasteryOfSilence1/MonasteryOfSilence1.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/MonasteryOfSilence1/MonasteryOfSilence1.java @@ -169,13 +169,13 @@ public final class MonasteryOfSilence1 extends AbstractInstance npc.getAI().startFollow(player); if (player.isInCombat()) { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOUR_WORK_HERE_IS_DONE_SO_RETURN_TO_THE_CENTRAL_GUARDIAN); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOUR_WORK_HERE_IS_DONE_SO_RETURN_TO_THE_CENTRAL_GUARDIAN); npc.setTarget(player); npc.doCast(BUFFS[getRandom(BUFFS.length)].getSkill()); } else { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]); + npc.broadcastSay(ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]); } startQuestTimer("FOLLOW", 10000, npc, player); break; diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/PailakaSongOfIceAndFire/PailakaSongOfIceAndFire.java b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/PailakaSongOfIceAndFire/PailakaSongOfIceAndFire.java index 115adcb035..d00205ef79 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/PailakaSongOfIceAndFire/PailakaSongOfIceAndFire.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/PailakaSongOfIceAndFire/PailakaSongOfIceAndFire.java @@ -85,7 +85,7 @@ public final class PailakaSongOfIceAndFire extends AbstractInstance } case "GARGOS_LAUGH": { - broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.OHH_OH_OH); + npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.OHH_OH_OH); break; } case "TELEPORT": diff --git a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/SanctumOftheLordsOfDawn/SanctumOftheLordsOfDawn.java b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/SanctumOftheLordsOfDawn/SanctumOftheLordsOfDawn.java index ba890d32ed..94e9d8f14f 100644 --- a/L2J_Mobius_HighFive/dist/game/data/scripts/instances/SanctumOftheLordsOfDawn/SanctumOftheLordsOfDawn.java +++ b/L2J_Mobius_HighFive/dist/game/data/scripts/instances/SanctumOftheLordsOfDawn/SanctumOftheLordsOfDawn.java @@ -113,17 +113,17 @@ public final class SanctumOftheLordsOfDawn extends AbstractInstance { case GUARDS_OF_THE_DAWN: { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.INTRUDER_PROTECT_THE_PRIESTS_OF_DAWN); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_PROTECT_THE_PRIESTS_OF_DAWN); break; } case GUARDS_OF_THE_DAWN_2: { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HOW_DARE_YOU_INTRUDE_WITH_THAT_TRANSFORMATION_GET_LOST); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_DARE_YOU_INTRUDE_WITH_THAT_TRANSFORMATION_GET_LOST); break; } case GUARDS_OF_THE_DAWN_3: { - broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WHO_ARE_YOU_A_NEW_FACE_LIKE_YOU_CAN_T_APPROACH_THIS_PLACE); + npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHO_ARE_YOU_A_NEW_FACE_LIKE_YOU_CAN_T_APPROACH_THIS_PLACE); break; } } diff --git a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java b/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java index 026a7f1bea..a209373e1d 100644 --- a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java +++ b/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/instancemanager/WalkingManager.java @@ -40,8 +40,6 @@ import com.l2jmobius.gameserver.model.events.EventDispatcher; import com.l2jmobius.gameserver.model.events.impl.character.npc.OnNpcMoveNodeArrived; import com.l2jmobius.gameserver.model.holders.NpcRoutesHolder; import com.l2jmobius.gameserver.network.NpcStringId; -import com.l2jmobius.gameserver.network.serverpackets.NpcSay; -import com.l2jmobius.gameserver.util.Broadcast; import com.l2jmobius.util.data.xml.IXmlReader; /** @@ -413,11 +411,11 @@ public final class WalkingManager implements IXmlReader if (node.getNpcString() != null) { - Broadcast.toKnownPlayers(npc, new NpcSay(npc, ChatType.NPC_GENERAL, node.getNpcString())); + npc.broadcastSay(ChatType.NPC_GENERAL, node.getNpcString()); } else if (!node.getChatText().isEmpty()) { - Broadcast.toKnownPlayers(npc, new NpcSay(npc, ChatType.NPC_GENERAL, node.getChatText())); + npc.broadcastSay(ChatType.NPC_GENERAL, node.getChatText()); } if (npc.isDebug()) diff --git a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java b/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java index 6b971118cf..a9e2d4ce79 100644 --- a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java +++ b/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java @@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.datatables.ItemTable; import com.l2jmobius.gameserver.datatables.NpcPersonalAIData; import com.l2jmobius.gameserver.enums.AISkillScope; import com.l2jmobius.gameserver.enums.AIType; +import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.enums.InstanceType; import com.l2jmobius.gameserver.enums.PrivateStoreType; import com.l2jmobius.gameserver.enums.Race; @@ -84,12 +85,14 @@ import com.l2jmobius.gameserver.model.olympiad.Olympiad; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.variables.NpcVariables; import com.l2jmobius.gameserver.model.zone.type.L2TownZone; +import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.AbstractNpcInfo; import com.l2jmobius.gameserver.network.serverpackets.ActionFailed; import com.l2jmobius.gameserver.network.serverpackets.ExChangeNpcState; import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse; import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; +import com.l2jmobius.gameserver.network.serverpackets.NpcSay; import com.l2jmobius.gameserver.network.serverpackets.ServerObjectInfo; import com.l2jmobius.gameserver.network.serverpackets.SocialAction; import com.l2jmobius.gameserver.taskmanager.DecayTaskManager; @@ -1946,6 +1949,60 @@ public class L2Npc extends L2Character } } + /** + * Broadcasts NpcSay packet to all known players. + * @param chatType the chat type + * @param text the text + */ + public void broadcastSay(ChatType chatType, String text) + { + Broadcast.toKnownPlayers(this, new NpcSay(this, chatType, text)); + } + + /** + * Broadcasts NpcSay packet to all known players with NPC string id. + * @param chatType the chat type + * @param npcStringId the NPC string id + * @param parameters the NPC string id parameters + */ + public void broadcastSay(ChatType chatType, NpcStringId npcStringId, String... parameters) + { + final NpcSay npcSay = new NpcSay(this, chatType, npcStringId); + if (parameters != null) + { + for (String parameter : parameters) + { + if (parameter != null) + { + npcSay.addStringParameter(parameter); + } + } + } + Broadcast.toKnownPlayers(this, npcSay); + } + + /** + * Broadcasts NpcSay packet to all known players with custom string in specific radius. + * @param chatType the chat type + * @param text the text + * @param radius the radius + */ + public void broadcastSay(ChatType chatType, String text, int radius) + { + Broadcast.toKnownPlayersInRadius(this, new NpcSay(this, chatType, text), radius); + } + + /** + * Broadcasts NpcSay packet to all known players with NPC string id in specific radius. + * @param chatType the chat type + * @param npcStringId the NPC string id + * @param radius the radius + */ + public void broadcastSay(ChatType chatType, NpcStringId npcStringId, int radius) + { + Broadcast.toKnownPlayersInRadius(this, new NpcSay(this, chatType, npcStringId), radius); + } + @Override public int getMinShopDistance() { diff --git a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadAnnouncer.java b/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadAnnouncer.java index c578502669..863bc39501 100644 --- a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadAnnouncer.java +++ b/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/model/olympiad/OlympiadAnnouncer.java @@ -23,7 +23,6 @@ import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.model.L2Spawn; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.network.NpcStringId; -import com.l2jmobius.gameserver.network.serverpackets.NpcSay; /** * @author DS @@ -78,16 +77,12 @@ public final class OlympiadAnnouncer implements Runnable } } - L2Npc manager; - NpcSay packet; for (L2Spawn spawn : _managers) { - manager = spawn.getLastSpawn(); + final L2Npc manager = spawn.getLastSpawn(); if (manager != null) { - packet = new NpcSay(manager.getObjectId(), ChatType.NPC_SHOUT, manager.getId(), npcString); - packet.addStringParameter(arenaId); - manager.broadcastPacket(packet); + manager.broadcastSay(ChatType.NPC_SHOUT, npcString, arenaId); } } break; diff --git a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/IntList.java b/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/IntList.java deleted file mode 100644 index 317648b775..0000000000 --- a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/IntList.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * 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 . - */ -package com.l2jmobius.gameserver.script; - -/** - * @author Luis Arias - */ -public class IntList -{ - public static int[] parse(String range) - { - if (range.contains("-")) - { - return getIntegerRange(range.split("-")); - } - else if (range.contains(",")) - { - return getIntegerList(range.split(",")); - } - - final int[] list = - { - getInt(range) - }; - return list; - } - - private static int getInt(String number) - { - return Integer.parseInt(number); - } - - private static int[] getIntegerList(String[] numbers) - { - final int[] list = new int[numbers.length]; - for (int i = 0; i < list.length; i++) - { - list[i] = getInt(numbers[i]); - } - return list; - } - - private static int[] getIntegerRange(String[] numbers) - { - final int min = getInt(numbers[0]); - final int max = getInt(numbers[1]); - final int[] list = new int[(max - min) + 1]; - for (int i = 0; i < list.length; i++) - { - list[i] = min + i; - } - return list; - } -} diff --git a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/ScriptPackage.java b/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/ScriptPackage.java deleted file mode 100644 index 2ce617e743..0000000000 --- a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/ScriptPackage.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * 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 . - */ -package com.l2jmobius.gameserver.script; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.List; -import java.util.logging.Logger; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -import com.l2jmobius.Config; - -/** - * @author Luis Arias - */ -public class ScriptPackage -{ - private static final Logger _log = Logger.getLogger(ScriptPackage.class.getName()); - - private final List _scriptFiles = new ArrayList<>(); - private final List _otherFiles = new ArrayList<>(); - private final String _name; - - public ScriptPackage(ZipFile pack) - { - _name = pack.getName(); - addFiles(pack); - } - - /** - * @return Returns the otherFiles. - */ - public List getOtherFiles() - { - return _otherFiles; - } - - /** - * @return Returns the scriptFiles. - */ - public List getScriptFiles() - { - return _scriptFiles; - } - - /** - * @param pack - */ - private void addFiles(ZipFile pack) - { - for (Enumeration e = pack.entries(); e.hasMoreElements();) - { - final ZipEntry entry = e.nextElement(); - if (entry.getName().endsWith(".xml")) - { - try - { - _scriptFiles.add(new ScriptDocument(entry.getName(), pack.getInputStream(entry))); - } - catch (IOException io) - { - _log.warning(getClass().getSimpleName() + ": " + io.getMessage()); - } - } - else if (!entry.isDirectory()) - { - _otherFiles.add(entry.getName()); - } - } - } - - /** - * @return Returns the name. - */ - public String getName() - { - return _name; - } - - @Override - public String toString() - { - if (getScriptFiles().isEmpty() && getOtherFiles().isEmpty()) - { - return "Empty Package."; - } - - final StringBuilder out = new StringBuilder(); - out.append("Package Name: "); - out.append(getName()); - out.append(Config.EOL); - - if (!getScriptFiles().isEmpty()) - { - out.append("Xml Script Files..." + Config.EOL); - for (ScriptDocument script : getScriptFiles()) - { - out.append(script.getName()); - out.append(Config.EOL); - } - } - - if (!getOtherFiles().isEmpty()) - { - out.append("Other Files..." + Config.EOL); - for (String fileName : getOtherFiles()) - { - out.append(fileName); - out.append(Config.EOL); - } - } - return out.toString(); - } -} diff --git a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/ShortList.java b/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/ShortList.java deleted file mode 100644 index 8e7d2c27f8..0000000000 --- a/L2J_Mobius_HighFive/java/com/l2jmobius/gameserver/script/ShortList.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * 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 . - */ -package com.l2jmobius.gameserver.script; - -/** - * @author -Nemesiss- - */ -public class ShortList -{ - public static short[] parse(String range) - { - if (range.contains("-")) - { - return getShortList(range.split("-")); - } - else if (range.contains(",")) - { - return getShortList(range.split(",")); - } - - final short[] list = - { - getShort(range) - }; - return list; - } - - private static short getShort(String number) - { - return Short.parseShort(number); - } - - private static short[] getShortList(String[] numbers) - { - final short[] list = new short[numbers.length]; - for (int i = 0; i < list.length; i++) - { - list[i] = getShort(numbers[i]); - } - return list; - } -}