From 8be467ada162fb3e287aecbe18e9cb9153bc6427 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 11 Feb 2020 22:25:13 +0000 Subject: [PATCH] Addition of proper chat type enum. --- .../game/data/scripts/ai/bosses/Benom.java | 3 +- .../game/data/scripts/ai/bosses/Core.java | 13 +- .../data/scripts/ai/bosses/Frintezza.java | 3 +- .../data/scripts/ai/others/CatsEyeBandit.java | 5 +- .../ai/others/DeluLizardmanSpecialAgent.java | 5 +- .../others/DeluLizardmanSpecialCommander.java | 5 +- .../scripts/ai/others/FeedableBeasts.java | 5 +- .../data/scripts/ai/others/KarulBugbear.java | 5 +- .../data/scripts/ai/others/Monastery.java | 7 +- .../scripts/ai/others/OlMahumGeneral.java | 5 +- .../scripts/ai/others/RetreatOnAttack.java | 3 +- .../data/scripts/ai/others/SummonMinions.java | 3 +- .../scripts/ai/others/TimakOrcOverlord.java | 3 +- .../ai/others/TimakOrcTroopLeader.java | 3 +- .../data/scripts/ai/others/Transform.java | 5 +- .../scripts/ai/others/TurekOrcFootman.java | 5 +- .../scripts/ai/others/TurekOrcSupplier.java | 5 +- .../scripts/ai/others/TurekOrcWarlord.java | 5 +- ...Q024_InhabitantsOfTheForrestOfTheDead.java | 3 +- .../Q025_HidingBehindTheTruth.java | 5 +- .../Q115_TheOtherSideOfTruth.java | 9 +- .../l2jmobius/gameserver/enums/ChatType.java | 75 +++++++ .../gameserver/handler/AutoChatHandler.java | 3 +- .../AdminAnnouncements.java | 4 +- .../admincommandhandlers/AdminGmChat.java | 22 +- .../admincommandhandlers/AdminTownWar.java | 12 +- .../instancemanager/ChristmasManager.java | 3 +- .../instancemanager/PetitionManager.java | 8 +- .../gameserver/model/actor/Attackable.java | 4 +- .../gameserver/model/actor/Creature.java | 10 - .../model/actor/instance/BoatInstance.java | 22 +- .../model/actor/instance/NpcInstance.java | 4 +- .../actor/instance/NpcWalkerInstance.java | 3 +- .../instance/PenaltyMonsterInstance.java | 6 +- .../model/actor/instance/PlayerInstance.java | 31 +-- .../actor/instance/ProtectorInstance.java | 5 +- .../instance/SepulcherMonsterInstance.java | 5 +- .../actor/instance/SepulcherNpcInstance.java | 3 +- .../model/actor/stat/CreatureStat.java | 2 +- .../model/entity/Announcements.java | 12 +- .../gameserver/model/entity/Rebirth.java | 3 +- .../gameserver/model/entity/event/CTF.java | 75 +++---- .../gameserver/model/entity/event/DM.java | 52 ++--- .../model/entity/event/GameEvent.java | 4 +- .../gameserver/model/entity/event/TvT.java | 60 +++--- .../gameserver/model/entity/event/VIP.java | 22 +- .../model/entity/olympiad/OlympiadGame.java | 3 +- .../entity/sevensigns/SevenSignsFestival.java | 7 +- .../clanhalls/BanditStrongholdSiege.java | 5 +- .../siege/clanhalls/WildBeastFarmSiege.java | 5 +- .../network/SystemChatChannelId.java | 74 ------- .../network/clientpackets/EnterWorld.java | 9 +- .../clientpackets/RequestPetitionCancel.java | 3 +- .../RequestPrivateStoreManageBuy.java | 3 +- .../RequestPrivateStoreManageSell.java | 3 +- .../network/clientpackets/Say2.java | 199 ++++++------------ .../network/serverpackets/CreatureSay.java | 13 +- .../serverpackets/PrivateStoreListBuy.java | 3 +- .../serverpackets/PrivateStoreListSell.java | 3 +- .../network/serverpackets/Snoop.java | 14 +- .../java/org/l2jmobius/gameserver/ui/Gui.java | 6 +- .../gameserver/util/BuilderUtil.java | 6 +- .../l2jmobius/telnet/GameStatusThread.java | 6 +- 63 files changed, 432 insertions(+), 485 deletions(-) create mode 100644 L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/enums/ChatType.java delete mode 100644 L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/SystemChatChannelId.java diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Benom.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Benom.java index 7fd34cc6e1..e69ab8244f 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Benom.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Benom.java @@ -21,6 +21,7 @@ import java.util.Collection; import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.datatables.xml.DoorData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.instancemanager.CastleManager; import org.l2jmobius.gameserver.instancemanager.GrandBossManager; import org.l2jmobius.gameserver.model.Location; @@ -282,7 +283,7 @@ public class Benom extends Quest { if (Rnd.get(100) < 40) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, "Benom", TALK[Rnd.get(4)])); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, "Benom", TALK[Rnd.get(4)])); } break; } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Core.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Core.java index a75966e74e..d96755cd88 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Core.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Core.java @@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager; import org.l2jmobius.gameserver.instancemanager.GrandBossManager; import org.l2jmobius.gameserver.model.Location; @@ -203,14 +204,14 @@ public class Core extends Quest { if (Rnd.get(100) == 0) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Removing intruders.")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "Removing intruders.")); } } else { _firstAttacked = true; - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "A non-permitted target has been discovered.")); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Starting intruder removal system.")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "A non-permitted target has been discovered.")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "Starting intruder removal system.")); } } return super.onAttack(npc, attacker, damage, isPet); @@ -224,9 +225,9 @@ public class Core extends Quest if (npcId == CORE) { npc.broadcastPacket(new PlaySound(1, "BS02_D", npc)); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, name, "A fatal error has occurred.")); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, name, "System is being shut down...")); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, name, "......")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, name, "A fatal error has occurred.")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, name, "System is being shut down...")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, name, "......")); _firstAttacked = false; addSpawn(31842, 16502, 110165, -6394, 0, false, 900000); diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Frintezza.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Frintezza.java index 5574a86ee4..db4c6da71d 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Frintezza.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/bosses/Frintezza.java @@ -24,6 +24,7 @@ import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.datatables.SkillTable; import org.l2jmobius.gameserver.datatables.xml.DoorData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.instancemanager.GrandBossManager; import org.l2jmobius.gameserver.model.CommandChannel; import org.l2jmobius.gameserver.model.Party; @@ -1363,7 +1364,7 @@ public class Frintezza extends Quest } else if (event.equals("room_final")) { - _zone.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), "Exceeded his time limit, challenge failed!")); + _zone.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.SHOUT, npc.getName(), "Exceeded his time limit, challenge failed!")); _zone.oustAllPlayers(); cancelQuestTimer("waiting", npc, null); diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/CatsEyeBandit.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/CatsEyeBandit.java index 0a30fedfcf..c0bf59dac8 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/CatsEyeBandit.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/CatsEyeBandit.java @@ -17,6 +17,7 @@ package ai.others; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -46,7 +47,7 @@ public class CatsEyeBandit extends Quest { if (Rnd.get(100) < 40) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "You childish fool, do you think you can catch me?")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "You childish fool, do you think you can catch me?")); } } else @@ -61,7 +62,7 @@ public class CatsEyeBandit extends Quest { if (Rnd.get(100) < 80) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "I must do something about this shameful incident...")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "I must do something about this shameful incident...")); } return super.onKill(npc, killer, isPet); diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialAgent.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialAgent.java index 2295c5aeb2..90d4c04af5 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialAgent.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialAgent.java @@ -17,6 +17,7 @@ package ai.others; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -45,13 +46,13 @@ public class DeluLizardmanSpecialAgent extends Quest { if (Rnd.get(100) < 40) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Hey! We're having a duel here!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "Hey! We're having a duel here!")); } } else { npc.setScriptValue(1); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "How dare you interrupt our fight! Hey guys, help!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "How dare you interrupt our fight! Hey guys, help!")); } return super.onAttack(npc, attacker, damage, isPet); } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialCommander.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialCommander.java index b2037815d2..c9028621dd 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialCommander.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/DeluLizardmanSpecialCommander.java @@ -17,6 +17,7 @@ package ai.others; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -45,13 +46,13 @@ public class DeluLizardmanSpecialCommander extends Quest { if (Rnd.get(100) < 40) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Come on, Ill take you on!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "Come on, Ill take you on!")); } } else { npc.setScriptValue(1); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "How dare you interrupt a sacred duel! You must be taught a lesson!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "How dare you interrupt a sacred duel! You must be taught a lesson!")); } return super.onAttack(npc, attacker, damage, isPet); } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/FeedableBeasts.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/FeedableBeasts.java index 50ec76d62e..abde65a8dc 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/FeedableBeasts.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/FeedableBeasts.java @@ -23,6 +23,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.datatables.sql.NpcTable; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.idfactory.IdFactory; import org.l2jmobius.gameserver.model.Skill; import org.l2jmobius.gameserver.model.actor.Attackable; @@ -416,7 +417,7 @@ public class FeedableBeasts extends Quest final int rand = Rnd.get(20); if (rand < 5) { - npc.broadcastPacket(new CreatureSay(nextNpc.getObjectId(), 0, nextNpc.getName(), SPAWN_CHATS[rand].replace("$s1", player.getName()))); + npc.broadcastPacket(new CreatureSay(nextNpc.getObjectId(), ChatType.GENERAL, nextNpc.getName(), SPAWN_CHATS[rand].replace("$s1", player.getName()))); } } else @@ -523,7 +524,7 @@ public class FeedableBeasts extends Quest // Rare random talk... if (Rnd.get(20) == 0) { - npc.broadcastPacket(new CreatureSay(objectId, 0, npc.getName(), TEXT[growthLevel][Rnd.get(TEXT[growthLevel].length)])); + npc.broadcastPacket(new CreatureSay(objectId, ChatType.GENERAL, npc.getName(), TEXT[growthLevel][Rnd.get(TEXT[growthLevel].length)])); } if ((growthLevel > 0) && (FEED_INFO.getOrDefault(objectId, 0) != caster.getObjectId())) diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/KarulBugbear.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/KarulBugbear.java index 9346748d4d..2b9aca6748 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/KarulBugbear.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/KarulBugbear.java @@ -17,6 +17,7 @@ package ai.others; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -45,7 +46,7 @@ public class KarulBugbear extends Quest { if (Rnd.get(100) < 4) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Your rear is practically unguarded!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "Your rear is practically unguarded!")); } } else @@ -53,7 +54,7 @@ public class KarulBugbear extends Quest npc.setScriptValue(1); if (Rnd.get(100) < 4) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Watch your back!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "Watch your back!")); } } return super.onAttack(npc, attacker, damage, isPet); diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Monastery.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Monastery.java index a03aaf9473..98af9f30d9 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Monastery.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Monastery.java @@ -23,6 +23,7 @@ import java.util.List; import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.datatables.SkillTable; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.Skill; import org.l2jmobius.gameserver.model.Skill.SkillType; import org.l2jmobius.gameserver.model.WorldObject; @@ -75,7 +76,7 @@ public class Monastery extends Quest if ((player.getActiveWeaponInstance() != null) && !player.isSilentMoving()) { npc.setTarget(player); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), TEXT[0])); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), TEXT[0])); switch (npc.getNpcId()) { @@ -132,7 +133,7 @@ public class Monastery extends Quest if ((target.getActiveWeaponInstance() != null) && !npc.isInCombat() && (npc.getTarget() == null)) { npc.setTarget(target); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), TEXT[0])); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), TEXT[0])); switch (npc.getNpcId()) { case 22124: @@ -171,7 +172,7 @@ public class Monastery extends Quest if (Util.contains(MOBS_2, npc.getNpcId()) && (skill.getSkillType() == SkillType.AGGDAMAGE)) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), TEXT[Rnd.get(2) + 1].replace("name", player.getName()))); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), TEXT[Rnd.get(2) + 1].replace("name", player.getName()))); ((Attackable) npc).addDamageHate(player, 0, 999); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player); } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/OlMahumGeneral.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/OlMahumGeneral.java index fe447cafb2..d6f5376a8e 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/OlMahumGeneral.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/OlMahumGeneral.java @@ -17,6 +17,7 @@ package ai.others; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -45,13 +46,13 @@ public class OlMahumGeneral extends Quest { if (Rnd.get(100) < 10) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "We shall see about that!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "We shall see about that!")); } } else { npc.setScriptValue(1); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "I will definitely repay this humiliation!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "I will definitely repay this humiliation!")); } return super.onAttack(npc, attacker, damage, isPet); } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/RetreatOnAttack.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/RetreatOnAttack.java index fce487d826..88d1428bcd 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/RetreatOnAttack.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/RetreatOnAttack.java @@ -18,6 +18,7 @@ package ai.others; import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.ai.CtrlIntention; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; @@ -68,7 +69,7 @@ public class RetreatOnAttack extends Quest { if (npcId == OL_MAHUM_GUARD) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), OL_MAHUM_GUARD_TEXT[Rnd.get(OL_MAHUM_GUARD_TEXT.length)])); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), OL_MAHUM_GUARD_TEXT[Rnd.get(OL_MAHUM_GUARD_TEXT.length)])); } int posX = npc.getX(); int posY = npc.getY(); diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/SummonMinions.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/SummonMinions.java index f6803aed16..b4390d5f78 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/SummonMinions.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/SummonMinions.java @@ -26,6 +26,7 @@ import java.util.concurrent.CopyOnWriteArraySet; import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.ai.CtrlIntention; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -243,7 +244,7 @@ public class SummonMinions extends Quest } if (npcId == 20767) { - npc.broadcastPacket(new CreatureSay(npcObjId, 0, npc.getName(), "Come out, you children of darkness!")); + npc.broadcastPacket(new CreatureSay(npcObjId, ChatType.GENERAL, npc.getName(), "Come out, you children of darkness!")); } } } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcOverlord.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcOverlord.java index 24283d4717..4211df4dca 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcOverlord.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcOverlord.java @@ -17,6 +17,7 @@ package ai.others; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -45,7 +46,7 @@ public class TimakOrcOverlord extends Quest { if (Rnd.get(100) < 50) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Dear ultimate power!!!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "Dear ultimate power!!!")); } } else diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcTroopLeader.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcTroopLeader.java index 36f8e3a3b6..8954cfa896 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcTroopLeader.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TimakOrcTroopLeader.java @@ -17,6 +17,7 @@ package ai.others; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -45,7 +46,7 @@ public class TimakOrcTroopLeader extends Quest { if (Rnd.get(100) < 50) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Destroy the enemy, my brothers!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "Destroy the enemy, my brothers!")); } } else diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Transform.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Transform.java index fa03f205f5..9d63d6e301 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Transform.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/Transform.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import org.l2jmobius.Config; import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.ai.CtrlIntention; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; @@ -146,7 +147,7 @@ public class Transform extends Quest { if (monster.getMessage() != 0) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), Message[Rnd.get(monster.getMessage())])); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), Message[Rnd.get(monster.getMessage())])); } npc.onDecay(); final Attackable newNpc = (Attackable) addSpawn(monster.getIdPoly(), npc); @@ -176,7 +177,7 @@ public class Transform extends Quest { if (monster.getMessage() != 0) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), Message[Rnd.get(monster.getMessage())])); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), Message[Rnd.get(monster.getMessage())])); } final Attackable newNpc = (Attackable) addSpawn(monster.getIdPoly(), npc); final Creature originalAttacker = isPet ? killer.getPet() : killer; diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcFootman.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcFootman.java index 0543a528b3..8d369bfaca 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcFootman.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcFootman.java @@ -17,6 +17,7 @@ package ai.others; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -45,13 +46,13 @@ public class TurekOrcFootman extends Quest { if (Rnd.get(100) < 40) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "There is no reason for you to kill me! I have nothing you need!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "There is no reason for you to kill me! I have nothing you need!")); } } else { npc.setScriptValue(1); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "We shall see about that!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "We shall see about that!")); } return super.onAttack(npc, attacker, damage, isPet); } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcSupplier.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcSupplier.java index f69e10d763..409be318a5 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcSupplier.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcSupplier.java @@ -17,6 +17,7 @@ package ai.others; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -45,13 +46,13 @@ public class TurekOrcSupplier extends Quest { if (Rnd.get(100) < 40) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "You wont take me down easily.")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "You wont take me down easily.")); } } else { npc.setScriptValue(1); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "We shall see about that!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "We shall see about that!")); } return super.onAttack(npc, attacker, damage, isPet); } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcWarlord.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcWarlord.java index 27584cd464..57f9218e3d 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcWarlord.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/ai/others/TurekOrcWarlord.java @@ -17,6 +17,7 @@ package ai.others; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -45,13 +46,13 @@ public class TurekOrcWarlord extends Quest { if (Rnd.get(100) < 40) { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "You wont take me down easily.")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "You wont take me down easily.")); } } else { npc.setScriptValue(1); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "The battle has just begun!")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "The battle has just begun!")); } return super.onAttack(npc, attacker, damage, isPet); } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForrestOfTheDead/Q024_InhabitantsOfTheForrestOfTheDead.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForrestOfTheDead/Q024_InhabitantsOfTheForrestOfTheDead.java index b52e89b33b..92345e7052 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForrestOfTheDead/Q024_InhabitantsOfTheForrestOfTheDead.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q024_InhabitantsOfTheForrestOfTheDead/Q024_InhabitantsOfTheForrestOfTheDead.java @@ -16,6 +16,7 @@ */ package quests.Q024_InhabitantsOfTheForrestOfTheDead; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -275,7 +276,7 @@ public class Q024_InhabitantsOfTheForrestOfTheDead extends Quest for (PlayerInstance nearby : npc.getKnownList().getKnownPlayers().values()) { - nearby.sendPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "That sign!")); + nearby.sendPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "That sign!")); } } } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java index 0c89b83e72..251f9627d1 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q025_HidingBehindTheTruth/Q025_HidingBehindTheTruth.java @@ -17,6 +17,7 @@ package quests.Q025_HidingBehindTheTruth; import org.l2jmobius.gameserver.ai.CtrlIntention; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -123,7 +124,7 @@ public class Q025_HidingBehindTheTruth extends Quest { qs.set("step", "1"); final NpcInstance triol = qs.addSpawn(TRIOL, 59712, -47568, -2712, 300000); - triol.broadcastPacket(new CreatureSay(triol.getObjectId(), 0, triol.getName(), "That box was sealed by my master. Don't touch it!")); + triol.broadcastPacket(new CreatureSay(triol.getObjectId(), ChatType.GENERAL, triol.getName(), "That box was sealed by my master. Don't touch it!")); triol.setRunning(); ((Attackable) triol).addDamageHate(player, 0, 999); triol.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player); @@ -438,7 +439,7 @@ public class Q025_HidingBehindTheTruth extends Quest { qs.playSound("ItemSound.quest_itemget"); qs.set("cond", "8"); - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "You've ended my immortal life! You've protected by the feudal lord, aren't you?")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "You've ended my immortal life! You've protected by the feudal lord, aren't you?")); qs.giveItems(TOTEM_DOLL, 1); qs.set("step", "2"); } diff --git a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q115_TheOtherSideOfTruth/Q115_TheOtherSideOfTruth.java b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q115_TheOtherSideOfTruth/Q115_TheOtherSideOfTruth.java index a56005884a..cdbe2f23fc 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q115_TheOtherSideOfTruth/Q115_TheOtherSideOfTruth.java +++ b/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q115_TheOtherSideOfTruth/Q115_TheOtherSideOfTruth.java @@ -16,6 +16,7 @@ */ package quests.Q115_TheOtherSideOfTruth; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; @@ -141,7 +142,7 @@ public class Q115_TheOtherSideOfTruth extends Quest qs.playSound("ItemSound.quest_middle"); qs.set("cond", "9"); final NpcInstance man = qs.addSpawn(SUSPICIOUS, 104562, -107598, -3688, 0, false, 4000); - man.broadcastPacket(new CreatureSay(man.getObjectId(), 0, man.getName(), "We meet again.")); + man.broadcastPacket(new CreatureSay(man.getObjectId(), ChatType.GENERAL, man.getName(), "We meet again.")); startQuestTimer("2", 3700, man, player); qs.giveItems(REPORT, 1); break; @@ -158,7 +159,7 @@ public class Q115_TheOtherSideOfTruth extends Quest qs.playSound("ItemSound.quest_middle"); qs.set("cond", "8"); final NpcInstance man = qs.addSpawn(SUSPICIOUS, 117890, -126478, -2584, 0, false, 4000); - man.broadcastPacket(new CreatureSay(man.getObjectId(), 0, man.getName(), "This looks like the right place...")); + man.broadcastPacket(new CreatureSay(man.getObjectId(), ChatType.GENERAL, man.getName(), "This looks like the right place...")); startQuestTimer("1", 3700, man, player); htmltext = "Sculpture-04.htm"; if ((qs.getInt("" + SCULPTURE1) == 0) && (qs.getInt("" + SCULPTURE2) == 0)) @@ -174,12 +175,12 @@ public class Q115_TheOtherSideOfTruth extends Quest } case "1": { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "I see someone. Is this fate?")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "I see someone. Is this fate?")); break; } case "2": { - npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, npc.getName(), "Don't bother trying to find out more about me. Follow your own destiny.")); + npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.GENERAL, npc.getName(), "Don't bother trying to find out more about me. Follow your own destiny.")); break; } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/enums/ChatType.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/enums/ChatType.java new file mode 100644 index 0000000000..23d036b0cf --- /dev/null +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/enums/ChatType.java @@ -0,0 +1,75 @@ +/* + * 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 org.l2jmobius.gameserver.enums; + +/** + * @author St3eT + */ +public enum ChatType +{ + GENERAL(0), + SHOUT(1), + WHISPER(2), + PARTY(3), + CLAN(4), + GM(5), + PETITION_PLAYER(6), + PETITION_GM(7), + TRADE(8), + ALLIANCE(9), + ANNOUNCEMENT(10), + BOAT(11), + FRIEND(12), + MSNCHAT(13), + PARTYMATCH_ROOM(14), + PARTYROOM_COMMANDER(15), + PARTYROOM_ALL(16), + HERO_VOICE(17), + CRITICAL_ANNOUNCE(18); + + private final int _clientId; + + private ChatType(int clientId) + { + _clientId = clientId; + } + + /** + * @return the client id. + */ + public int getClientId() + { + return _clientId; + } + + /** + * Finds the {@code ChatType} by its clientId + * @param clientId the clientId + * @return the {@code ChatType} if its found, {@code null} otherwise. + */ + public static ChatType findByClientId(int clientId) + { + for (ChatType ChatType : values()) + { + if (ChatType.getClientId() == clientId) + { + return ChatType; + } + } + return null; + } +} \ No newline at end of file diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/AutoChatHandler.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/AutoChatHandler.java index f1df7e1d05..8153a41276 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/AutoChatHandler.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/AutoChatHandler.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.Rnd; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -787,7 +788,7 @@ public class AutoChatHandler implements SpawnListener return; } - final CreatureSay cs = new CreatureSay(chatNpc.getObjectId(), 0, creatureName, text); + final CreatureSay cs = new CreatureSay(chatNpc.getObjectId(), ChatType.GENERAL, creatureName, text); for (PlayerInstance nearbyPlayer : nearbyPlayers) { nearbyPlayer.sendPacket(cs); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminAnnouncements.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminAnnouncements.java index 4a47af8be3..05399df8f1 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminAnnouncements.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminAnnouncements.java @@ -19,12 +19,12 @@ package org.l2jmobius.gameserver.handler.admincommandhandlers; import java.util.StringTokenizer; import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.handler.AutoAnnouncementHandler; import org.l2jmobius.gameserver.handler.IAdminCommandHandler; import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.entity.Announcements; -import org.l2jmobius.gameserver.network.clientpackets.Say2; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; import org.l2jmobius.gameserver.util.Broadcast; import org.l2jmobius.gameserver.util.BuilderUtil; @@ -156,7 +156,7 @@ public class AdminAnnouncements implements IAdminCommandHandler { text1 = activeChar.getName() + ": " + text1; } - Broadcast.toAllOnlinePlayers(new CreatureSay(activeChar.getObjectId(), Say2.CRITICAL_ANNOUNCE, "", text1)); + Broadcast.toAllOnlinePlayers(new CreatureSay(activeChar.getObjectId(), ChatType.CRITICAL_ANNOUNCE, "", text1)); return true; } case "admin_list_autoannouncements": diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminGmChat.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminGmChat.java index 9da0f9701c..877ca29c39 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminGmChat.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminGmChat.java @@ -16,7 +16,7 @@ */ package org.l2jmobius.gameserver.handler.admincommandhandlers; -import org.l2jmobius.gameserver.datatables.xml.AdminData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.handler.IAdminCommandHandler; import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.WorldObject; @@ -102,21 +102,15 @@ public class AdminGmChat implements IAdminCommandHandler { try { - int offset = 0; - - String text; - - if (command.contains("menu")) + final int offset = command.contains("menu") ? 17 : 13; + final String text = command.substring(offset); + for (PlayerInstance player : World.getInstance().getAllPlayers()) { - offset = 17; + if (player.isGM()) + { + player.sendPacket(new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text)); + } } - else - { - offset = 13; - } - - text = command.substring(offset); - AdminData.broadcastToGMs(new CreatureSay(0, 9, activeChar.getName(), text)); } catch (StringIndexOutOfBoundsException e) { diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTownWar.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTownWar.java index eee1f880b6..12c7a8f5df 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTownWar.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminTownWar.java @@ -104,15 +104,15 @@ public class AdminTownWar implements IAdminCommandHandler // Announce for all towns if (Config.TW_ALL_TOWNS) { - Announcements.getInstance().gameAnnounceToAll("Town War Event!"); - Announcements.getInstance().gameAnnounceToAll("All towns have been set to war zone by " + activeChar.getName() + "."); + Announcements.getInstance().criticalAnnounceToAll("Town War Event!"); + Announcements.getInstance().criticalAnnounceToAll("All towns have been set to war zone by " + activeChar.getName() + "."); } // Announce for one town if (!Config.TW_ALL_TOWNS) { - Announcements.getInstance().gameAnnounceToAll("Town War Event!"); - Announcements.getInstance().gameAnnounceToAll(MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set to war zone by " + activeChar.getName() + "."); + Announcements.getInstance().criticalAnnounceToAll("Town War Event!"); + Announcements.getInstance().criticalAnnounceToAll(MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set to war zone by " + activeChar.getName() + "."); } } @@ -179,13 +179,13 @@ public class AdminTownWar implements IAdminCommandHandler // Announce for all towns if (Config.TW_ALL_TOWNS) { - Announcements.getInstance().gameAnnounceToAll("All towns have been set back to normal by " + activeChar.getName() + "."); + Announcements.getInstance().criticalAnnounceToAll("All towns have been set back to normal by " + activeChar.getName() + "."); } // Announce for one town if (!Config.TW_ALL_TOWNS) { - Announcements.getInstance().gameAnnounceToAll(MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set back to normal by " + activeChar.getName() + "."); + Announcements.getInstance().criticalAnnounceToAll(MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set back to normal by " + activeChar.getName() + "."); } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/ChristmasManager.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/ChristmasManager.java index 8ccb0f65c5..508802ed8c 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/ChristmasManager.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/ChristmasManager.java @@ -26,6 +26,7 @@ import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.gameserver.datatables.ItemTable; import org.l2jmobius.gameserver.datatables.sql.NpcTable; import org.l2jmobius.gameserver.datatables.sql.SpawnTable; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.idfactory.IdFactory; import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.WorldObject; @@ -545,7 +546,7 @@ public class ChristmasManager */ protected CreatureSay getXMasMessage() { - return new CreatureSay(0, 17, getRandomSender(), getRandomXMasMessage()); + return new CreatureSay(0, ChatType.HERO_VOICE, getRandomSender(), getRandomXMasMessage()); } /** diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java index aae9dabbcd..5ea0243138 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/PetitionManager.java @@ -26,10 +26,10 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.gameserver.datatables.xml.AdminData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.idfactory.IdFactory; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.clientpackets.Say2; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; import org.l2jmobius.gameserver.network.serverpackets.GameServerPacket; import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; @@ -507,7 +507,7 @@ public class PetitionManager if ((currPetition.getPetitioner() != null) && (currPetition.getPetitioner().getObjectId() == player.getObjectId())) { - cs = new CreatureSay(player.getObjectId(), Say2.PETITION_PLAYER, player.getName(), messageText); + cs = new CreatureSay(player.getObjectId(), ChatType.PETITION_PLAYER, player.getName(), messageText); currPetition.addLogMessage(cs); currPetition.sendResponderPacket(cs); @@ -518,7 +518,7 @@ public class PetitionManager if ((currPetition.getResponder() != null) && (currPetition.getResponder().getObjectId() == player.getObjectId())) { - cs = new CreatureSay(player.getObjectId(), Say2.PETITION_GM, player.getName(), messageText); + cs = new CreatureSay(player.getObjectId(), ChatType.PETITION_GM, player.getName(), messageText); currPetition.addLogMessage(cs); currPetition.sendResponderPacket(cs); @@ -580,7 +580,7 @@ public class PetitionManager // Notify all GMs that a new petition has been submitted. final String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ")."; - AdminData.broadcastToGMs(new CreatureSay(petitioner.getObjectId(), 17, "Petition System", msgContent)); + AdminData.broadcastToGMs(new CreatureSay(petitioner.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent)); return newPetitionId; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java index ba4323eaa1..9b6f16b8b1 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -33,6 +33,7 @@ import org.l2jmobius.gameserver.ai.FortSiegeGuardAI; import org.l2jmobius.gameserver.ai.SiegeGuardAI; import org.l2jmobius.gameserver.datatables.ItemTable; import org.l2jmobius.gameserver.datatables.xml.ManorSeedData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager; import org.l2jmobius.gameserver.model.CommandChannel; import org.l2jmobius.gameserver.model.DropCategory; @@ -60,7 +61,6 @@ import org.l2jmobius.gameserver.model.quest.EventType; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.skills.Stat; import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.clientpackets.Say2; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; @@ -454,7 +454,7 @@ public class Attackable extends NpcInstance _commandChannelTimer = new CommandChannelTimer(this); _commandChannelLastAttack = System.currentTimeMillis(); ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack - _firstCommandChannelAttacked.broadcastToChannelMembers(new CreatureSay(0, Say2.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg + _firstCommandChannelAttacked.broadcastToChannelMembers(new CreatureSay(0, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg } } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java index c29b9d9720..0b3ed6d14a 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -231,16 +231,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder } } - /** - * This will return true if the player is GM,
- * but if the player is not GM it will return false. - * @return GM status - */ - public boolean charIsGM() - { - return (this instanceof PlayerInstance) && ((PlayerInstance) this).isGM(); - } - /** * Constructor of Creature.
*
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java index 529eefabf8..e10e470323 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/BoatInstance.java @@ -23,6 +23,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.gameserver.GameTimeController; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.knownlist.BoatKnownList; import org.l2jmobius.gameserver.model.actor.templates.CreatureTemplate; @@ -30,7 +31,6 @@ import org.l2jmobius.gameserver.model.holders.BoatPathHolder; import org.l2jmobius.gameserver.model.holders.BoatPathHolder.BoatPoint; import org.l2jmobius.gameserver.model.items.Weapon; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; -import org.l2jmobius.gameserver.network.clientpackets.Say2; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; import org.l2jmobius.gameserver.network.serverpackets.OnVehicleCheckLocation; @@ -263,11 +263,11 @@ public class BoatInstance extends Creature { if (cycle == 1) { - sm = new CreatureSay(0, Say2.SHOUT, pathA.npc, pathA.sysmess10); + sm = new CreatureSay(0, ChatType.SHOUT, pathA.npc, pathA.sysmess10); } else { - sm = new CreatureSay(0, Say2.SHOUT, pathB.npc, pathB.sysmess10); + sm = new CreatureSay(0, ChatType.SHOUT, pathB.npc, pathB.sysmess10); } ps = new PlaySound(0, "itemsound.ship_arrival_departure", this); if ((knownPlayers == null) || knownPlayers.isEmpty()) @@ -287,11 +287,11 @@ public class BoatInstance extends Creature { if (cycle == 1) { - sm = new CreatureSay(0, Say2.SHOUT, pathA.npc, pathA.sysmess5); + sm = new CreatureSay(0, ChatType.SHOUT, pathA.npc, pathA.sysmess5); } else { - sm = new CreatureSay(0, Say2.SHOUT, pathB.npc, pathB.sysmess5); + sm = new CreatureSay(0, ChatType.SHOUT, pathB.npc, pathB.sysmess5); } ps = new PlaySound(0, "itemsound.ship_5min", this); if ((knownPlayers == null) || knownPlayers.isEmpty()) @@ -309,11 +309,11 @@ public class BoatInstance extends Creature { if (cycle == 1) { - sm = new CreatureSay(0, Say2.SHOUT, pathA.npc, pathA.sysmess1); + sm = new CreatureSay(0, ChatType.SHOUT, pathA.npc, pathA.sysmess1); } else { - sm = new CreatureSay(0, Say2.SHOUT, pathB.npc, pathB.sysmess1); + sm = new CreatureSay(0, ChatType.SHOUT, pathB.npc, pathB.sysmess1); } ps = new PlaySound(0, "itemsound.ship_1min", this); if ((knownPlayers == null) || knownPlayers.isEmpty()) @@ -331,11 +331,11 @@ public class BoatInstance extends Creature { if (cycle == 1) { - sm = new CreatureSay(0, Say2.SHOUT, pathA.npc, pathA.sysmess0); + sm = new CreatureSay(0, ChatType.SHOUT, pathA.npc, pathA.sysmess0); } else { - sm = new CreatureSay(0, Say2.SHOUT, pathB.npc, pathB.sysmess0); + sm = new CreatureSay(0, ChatType.SHOUT, pathB.npc, pathB.sysmess0); } if ((knownPlayers == null) || knownPlayers.isEmpty()) { @@ -351,11 +351,11 @@ public class BoatInstance extends Creature { if (cycle == 1) { - sm = new CreatureSay(0, Say2.SHOUT, pathA.npc, pathA.sysmessb); + sm = new CreatureSay(0, ChatType.SHOUT, pathA.npc, pathA.sysmessb); } else { - sm = new CreatureSay(0, Say2.SHOUT, pathB.npc, pathB.sysmessb); + sm = new CreatureSay(0, ChatType.SHOUT, pathB.npc, pathB.sysmessb); } ps = new PlaySound(0, "itemsound.ship_arrival_departure", this); for (PlayerInstance player : knownPlayers) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java index 527e0ca797..4fdb8ba982 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcInstance.java @@ -32,6 +32,7 @@ import org.l2jmobius.gameserver.datatables.sql.ClanTable; import org.l2jmobius.gameserver.datatables.sql.HelperBuffTable; import org.l2jmobius.gameserver.datatables.sql.SpawnTable; import org.l2jmobius.gameserver.datatables.xml.ZoneData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.idfactory.IdFactory; import org.l2jmobius.gameserver.instancemanager.CastleManager; import org.l2jmobius.gameserver.instancemanager.CustomNpcInstanceManager; @@ -79,7 +80,6 @@ import org.l2jmobius.gameserver.model.spawn.Spawn; import org.l2jmobius.gameserver.model.zone.type.TownZone; import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.clientpackets.Say2; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; import org.l2jmobius.gameserver.network.serverpackets.ExShowVariationCancelWindow; @@ -1929,7 +1929,7 @@ public class NpcInstance extends Creature */ public void broadcastNpcSay(String message) { - broadcastPacket(new CreatureSay(getObjectId(), Say2.ALL, getName(), message)); + broadcastPacket(new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), message)); } /** diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcWalkerInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcWalkerInstance.java index 15efbf2315..6e2e675372 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcWalkerInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/NpcWalkerInstance.java @@ -20,6 +20,7 @@ import java.util.Map; import org.l2jmobius.gameserver.ai.CreatureAI; import org.l2jmobius.gameserver.ai.NpcWalkerAI; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; @@ -81,7 +82,7 @@ public class NpcWalkerInstance extends NpcInstance // we send message to known players only! if (!knownPlayers.isEmpty()) { - final CreatureSay cs = new CreatureSay(getObjectId(), 0, getName(), chat); + final CreatureSay cs = new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), chat); // we interact and list players here for (PlayerInstance players : knownPlayers.values()) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PenaltyMonsterInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PenaltyMonsterInstance.java index ef99ffebac..35ec3857de 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PenaltyMonsterInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PenaltyMonsterInstance.java @@ -19,10 +19,10 @@ package org.l2jmobius.gameserver.model.actor.instance; import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.ai.CtrlEvent; import org.l2jmobius.gameserver.datatables.sql.SpawnTable; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate; import org.l2jmobius.gameserver.model.spawn.Spawn; -import org.l2jmobius.gameserver.network.clientpackets.Say2; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; public class PenaltyMonsterInstance extends MonsterInstance @@ -58,7 +58,7 @@ public class PenaltyMonsterInstance extends MonsterInstance { if (Rnd.get(100) <= 80) { - broadcastPacket(new CreatureSay(getObjectId(), Say2.ALL, getName(), "mmm your bait was delicious")); + broadcastPacket(new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), "mmm your bait was delicious")); } _ptk = ptk; addDamageHate(ptk, 10, 10); @@ -76,7 +76,7 @@ public class PenaltyMonsterInstance extends MonsterInstance if (Rnd.get(100) <= 75) { - broadcastPacket(new CreatureSay(getObjectId(), Say2.ALL, getName(), "I will tell fishes not to take your bait")); + broadcastPacket(new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), "I will tell fishes not to take your bait")); } return true; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index c6aa58df49..70cf2dd21c 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -67,6 +67,7 @@ import org.l2jmobius.gameserver.datatables.xml.MapRegionData; import org.l2jmobius.gameserver.datatables.xml.PlayerTemplateData; import org.l2jmobius.gameserver.datatables.xml.RecipeData; import org.l2jmobius.gameserver.datatables.xml.ZoneData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.enums.Race; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.geoengine.GeoEngine; @@ -6353,7 +6354,7 @@ public class PlayerInstance extends Playable CTF.removeFlagFromPlayer(this); broadcastUserInfo(); _haveFlagCTF = false; - Announcements.getInstance().gameAnnounceToAll(CTF.getEventName() + "(CTF): " + _teamNameHaveFlagCTF + "'s flag returned."); + Announcements.getInstance().criticalAnnounceToAll(CTF.getEventName() + "(CTF): " + _teamNameHaveFlagCTF + "'s flag returned."); } /** @@ -6788,7 +6789,7 @@ public class PlayerInstance extends Playable if ((_heroConsecutiveKillCount == Config.KILLS_TO_GET_WAR_LEGEND_AURA) && Config.WAR_LEGEND_AURA) { setHeroAura(true); - Announcements.getInstance().gameAnnounceToAll(getName() + " becames War Legend with " + Config.KILLS_TO_GET_WAR_LEGEND_AURA + " PvP!!"); + Announcements.getInstance().criticalAnnounceToAll(getName() + " becames War Legend with " + Config.KILLS_TO_GET_WAR_LEGEND_AURA + " PvP!!"); } @@ -6827,7 +6828,7 @@ public class PlayerInstance extends Playable { if (Config.ENABLE_ANTI_PVP_FARM_MSG) { - final CreatureSay cs12 = new CreatureSay(0, 15, "", getName() + " 5 consecutive kill! Only Gm."); // 8D + final CreatureSay cs12 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " 5 consecutive kill! Only Gm."); // 8D for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline() && player.isGM()) @@ -6840,7 +6841,7 @@ public class PlayerInstance extends Playable } case 6: { - final CreatureSay cs = new CreatureSay(0, 15, "", getName() + " is Dominating!"); // 8D + final CreatureSay cs = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is Dominating!"); // 8D for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline()) @@ -6852,7 +6853,7 @@ public class PlayerInstance extends Playable } case 9: { - final CreatureSay cs2 = new CreatureSay(0, 15, "", getName() + " is on a Rampage!"); // 8D + final CreatureSay cs2 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Rampage!"); // 8D for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline()) @@ -6864,7 +6865,7 @@ public class PlayerInstance extends Playable } case 14: { - final CreatureSay cs3 = new CreatureSay(0, 15, "", getName() + " is on a Killing Spree!"); // 8D + final CreatureSay cs3 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Killing Spree!"); // 8D for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline()) @@ -6876,7 +6877,7 @@ public class PlayerInstance extends Playable } case 18: { - final CreatureSay cs4 = new CreatureSay(0, 15, "", getName() + " is on a Monster Kill!"); // 8D + final CreatureSay cs4 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Monster Kill!"); // 8D for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline()) @@ -6888,7 +6889,7 @@ public class PlayerInstance extends Playable } case 22: { - final CreatureSay cs5 = new CreatureSay(0, 15, "", getName() + " is Unstoppable!"); // 8D + final CreatureSay cs5 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is Unstoppable!"); // 8D for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline()) @@ -6900,7 +6901,7 @@ public class PlayerInstance extends Playable } case 25: { - final CreatureSay cs6 = new CreatureSay(0, 15, "", getName() + " is on an Ultra Kill!"); // 8D + final CreatureSay cs6 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on an Ultra Kill!"); // 8D for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline()) @@ -6912,7 +6913,7 @@ public class PlayerInstance extends Playable } case 28: { - final CreatureSay cs7 = new CreatureSay(0, 15, "", getName() + " God Blessed!"); // 8D + final CreatureSay cs7 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " God Blessed!"); // 8D for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline()) @@ -6924,7 +6925,7 @@ public class PlayerInstance extends Playable } case 32: { - final CreatureSay cs8 = new CreatureSay(0, 15, "", getName() + " is Wicked Sick!"); // 8D + final CreatureSay cs8 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is Wicked Sick!"); // 8D for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline()) @@ -6936,7 +6937,7 @@ public class PlayerInstance extends Playable } case 35: { - final CreatureSay cs9 = new CreatureSay(0, 15, "", getName() + " is on a Ludricrous Kill!"); // 8D + final CreatureSay cs9 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Ludricrous Kill!"); // 8D for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline()) @@ -6948,7 +6949,7 @@ public class PlayerInstance extends Playable } case 40: { - final CreatureSay cs10 = new CreatureSay(0, 15, "", getName() + " is GodLike!"); // 8D + final CreatureSay cs10 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is GodLike!"); // 8D for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline()) @@ -13873,11 +13874,11 @@ public class PlayerInstance extends Playable } } - public void broadcastSnoop(int type, String name, String text, CreatureSay cs) + public void broadcastSnoop(ChatType _chatType, String name, String text, CreatureSay cs) { if (!_snoopListener.isEmpty()) { - final Snoop sn = new Snoop(this, type, name, text); + final Snoop sn = new Snoop(this, _chatType, name, text); for (PlayerInstance pci : _snoopListener) { if (pci != null) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ProtectorInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ProtectorInstance.java index b567c0b0e5..74de12e020 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ProtectorInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ProtectorInstance.java @@ -21,6 +21,7 @@ import java.util.concurrent.ScheduledFuture; import org.l2jmobius.Config; import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.gameserver.datatables.SkillTable; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.Skill; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Summon; @@ -87,7 +88,7 @@ public class ProtectorInstance extends NpcInstance final int objId = _caster.getObjectId(); skill.getEffects(_caster, player, false, false, false); broadcastPacket(new MagicSkillUse(_caster, player, skillId, skillLevel, Config.PROTECTOR_SKILLTIME, 0)); - broadcastPacket(new CreatureSay(objId, 0, getName(), Config.PROTECTOR_MESSAGE)); + broadcastPacket(new CreatureSay(objId, ChatType.GENERAL, getName(), Config.PROTECTOR_MESSAGE)); return true; } @@ -109,7 +110,7 @@ public class ProtectorInstance extends NpcInstance final int objId = _caster.getObjectId(); skill.getEffects(_caster, player, false, false, false); broadcastPacket(new MagicSkillUse(_caster, player, skillId, skillLevel, Config.PROTECTOR_SKILLTIME, 0)); - broadcastPacket(new CreatureSay(objId, 0, getName(), Config.PROTECTOR_MESSAGE)); + broadcastPacket(new CreatureSay(objId, ChatType.GENERAL, getName(), Config.PROTECTOR_MESSAGE)); return true; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherMonsterInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherMonsterInstance.java index cec86570e5..fdadc4601e 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherMonsterInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherMonsterInstance.java @@ -20,6 +20,7 @@ import java.util.concurrent.Future; import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.gameserver.datatables.SkillTable; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.instancemanager.FourSepulchersManager; import org.l2jmobius.gameserver.model.Skill; import org.l2jmobius.gameserver.model.actor.Creature; @@ -370,7 +371,7 @@ public class SepulcherMonsterInstance extends MonsterInstance return; } - broadcastPacket(new CreatureSay(getObjectId(), 0, getName(), "forgive me!!")); + broadcastPacket(new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), "forgive me!!")); } } @@ -397,7 +398,7 @@ public class SepulcherMonsterInstance extends MonsterInstance } FourSepulchersManager.getInstance().spawnKeyBox(_activeChar); - broadcastPacket(new CreatureSay(getObjectId(), 0, getName(), "Many thanks for rescue me.")); + broadcastPacket(new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), "Many thanks for rescue me.")); } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherNpcInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherNpcInstance.java index fccda1953b..d139d891fa 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherNpcInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherNpcInstance.java @@ -26,6 +26,7 @@ import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.datatables.xml.DoorData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.instancemanager.FourSepulchersManager; import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate; @@ -436,7 +437,7 @@ public class SepulcherNpcInstance extends NpcInstance { return; } - final CreatureSay sm = new CreatureSay(0, 1, getName(), msg); + final CreatureSay sm = new CreatureSay(0, ChatType.SHOUT, getName(), msg); for (PlayerInstance player : knownPlayers) { if (player == null) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java index 7db15829fc..2d37904213 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/stat/CreatureStat.java @@ -901,7 +901,7 @@ public class CreatureStat } val /= _creature.getArmourExpertisePenalty(); - if ((val > Config.MAX_RUN_SPEED) && !_creature.charIsGM()) + if ((val > Config.MAX_RUN_SPEED) && !(_creature.isPlayer() && !_creature.getActingPlayer().isGM())) { val = Config.MAX_RUN_SPEED; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/Announcements.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/Announcements.java index 103499a536..d006de1920 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/Announcements.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/Announcements.java @@ -29,10 +29,10 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.gameserver.cache.HtmCache; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.clientpackets.Say2; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; @@ -73,7 +73,7 @@ public class Announcements { for (String _announcement : _announcements) { - player.sendPacket(new CreatureSay(0, Say2.ANNOUNCEMENT, player.getName(), _announcement.replace("%name%", player.getName()))); + player.sendPacket(new CreatureSay(0, ChatType.ANNOUNCEMENT, player.getName(), _announcement.replace("%name%", player.getName()))); } for (List entry : _eventAnnouncements) @@ -225,18 +225,16 @@ public class Announcements public void announceToAll(String text) { - final CreatureSay cs = new CreatureSay(0, Say2.ANNOUNCEMENT, "", text); + final CreatureSay cs = new CreatureSay(0, ChatType.ANNOUNCEMENT, "", text); for (PlayerInstance player : World.getInstance().getAllPlayers()) { player.sendPacket(cs); } } - // Colored Announcements 8D - // Used for events - public void gameAnnounceToAll(String text) + public void criticalAnnounceToAll(String text) { - final CreatureSay cs = new CreatureSay(0, 18, null, text); + final CreatureSay cs = new CreatureSay(0, ChatType.CRITICAL_ANNOUNCE, null, text); for (PlayerInstance player : World.getInstance().getAllPlayers()) { if ((player != null) && player.isOnline()) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/Rebirth.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/Rebirth.java index 1038b05931..b9bfa5c3c4 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/Rebirth.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/Rebirth.java @@ -27,6 +27,7 @@ import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.datatables.ItemTable; import org.l2jmobius.gameserver.datatables.SkillTable; import org.l2jmobius.gameserver.datatables.xml.ExperienceData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.Skill; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; @@ -321,7 +322,7 @@ public class Rebirth player.addSkill(bonusSkill, false); // If you'd rather make it simple, simply comment this out and replace with a simple player.sendmessage(); - rebirthText = new CreatureSay(0, 18, "Rebirth Manager ", " Granted you [ " + bonusSkill.getName() + " ] level [ " + bonusSkill.getLevel() + " ]!"); + rebirthText = new CreatureSay(0, ChatType.HERO_VOICE, "Rebirth Manager ", " Granted you [ " + bonusSkill.getName() + " ] level [ " + bonusSkill.getLevel() + " ]!"); player.sendPacket(rebirthText); } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/CTF.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/CTF.java index 91dfed2a0b..a91ad2d260 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/CTF.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/CTF.java @@ -31,6 +31,7 @@ import org.l2jmobius.gameserver.datatables.ItemTable; import org.l2jmobius.gameserver.datatables.SkillTable; import org.l2jmobius.gameserver.datatables.sql.NpcTable; import org.l2jmobius.gameserver.datatables.sql.SpawnTable; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.instancemanager.CastleManager; import org.l2jmobius.gameserver.model.Effect; import org.l2jmobius.gameserver.model.Inventory; @@ -744,17 +745,17 @@ public class CTF implements EventTask _inProgress = true; _joining = true; spawnEventNpc(); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Event " + _eventName + "!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Event " + _eventName + "!"); if (Config.CTF_ANNOUNCE_REWARD && (ItemTable.getInstance().getTemplate(_rewardId) != null)) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName()); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName()); } - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "."); if (Config.CTF_COMMAND) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Commands .ctfjoin .ctfleave .ctfinfo!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Commands .ctfjoin .ctfleave .ctfinfo!"); } return true; @@ -781,7 +782,7 @@ public class CTF implements EventTask } else if (Config.CTF_EVEN_TEAMS.equals("SHUFFLE") && !checkMinPlayers(_playersShuffle.size())) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size()); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size()); if (Config.CTF_STATS_LOGGER) { LOGGER.info(_eventName + ":Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size()); @@ -792,7 +793,7 @@ public class CTF implements EventTask } else if (!checkMinPlayers(_players.size())) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _players.size()); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _players.size()); if (Config.CTF_STATS_LOGGER) { LOGGER.info(_eventName + ":Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _players.size()); @@ -801,7 +802,7 @@ public class CTF implements EventTask } _joining = false; - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!"); setUserData(); ThreadPool.schedule(() -> @@ -889,7 +890,7 @@ public class CTF implements EventTask afterStartOperations(); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Started. Go Capture the Flags!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Started. Go Capture the Flags!"); _started = true; return true; @@ -925,7 +926,7 @@ public class CTF implements EventTask _aborted = false; final long delay = _intervalBetweenMatches; - Announcements.getInstance().gameAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!"); waiter(delay); @@ -937,7 +938,7 @@ public class CTF implements EventTask } else { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": next event aborted!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": next event aborted!"); } } catch (Exception e) @@ -972,21 +973,21 @@ public class CTF implements EventTask if (Config.CTF_ANNOUNCE_TEAM_STATS) { - Announcements.getInstance().gameAnnounceToAll(_eventName + " Team Statistics:"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + " Team Statistics:"); for (String team : _teams) { final int _flags_ = teamPointsCount(team); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Team: " + team + " - Flags taken: " + _flags_); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Team: " + team + " - Flags taken: " + _flags_); } } if (_topTeam != null) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Team " + _topTeam + " wins the match, with " + _topScore + " flags taken!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Team " + _topTeam + " wins the match, with " + _topScore + " flags taken!"); } else { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": The event finished with a TIE: " + _topScore + " flags taken by each team!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": The event finished with a TIE: " + _topScore + " flags taken by each team!"); } rewardTeam(_topTeam); @@ -1005,7 +1006,7 @@ public class CTF implements EventTask } else { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": The event finished with a TIE: No team wins the match(nobody took flags)!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": The event finished with a TIE: No team wins the match(nobody took flags)!"); if (Config.CTF_STATS_LOGGER) { @@ -1047,7 +1048,7 @@ public class CTF implements EventTask cleanCTF(); _joining = false; _inProgress = false; - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!"); return; } _joining = false; @@ -1058,7 +1059,7 @@ public class CTF implements EventTask afterFinish(); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!"); teleportFinish(); } @@ -1076,7 +1077,7 @@ public class CTF implements EventTask public static void teleportFinish() { sit(); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!"); ThreadPool.schedule(() -> { @@ -1241,12 +1242,12 @@ public class CTF implements EventTask removeOfflinePlayers(); if (_joining) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!"); } else if (_started) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!"); } break; } @@ -1261,12 +1262,12 @@ public class CTF implements EventTask { if (_joining) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!"); } else if (_started) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!"); } break; } @@ -1283,15 +1284,15 @@ public class CTF implements EventTask { if (_joining) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!"); } else if (_teleport) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!"); } else if (_started) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!"); } break; } @@ -2639,7 +2640,7 @@ public class CTF implements EventTask { if (!_started && !_aborted) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Thank you For Participating At, " + _eventName + " Event."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Thank you For Participating At, " + _eventName + " Event."); } } @@ -2819,13 +2820,13 @@ public class CTF implements EventTask // logged off with a flag in his hands if (!player.isOnline() && player._haveFlagCTF) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player.getName() + " logged off with a CTF flag!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + player.getName() + " logged off with a CTF flag!"); player._haveFlagCTF = false; if ((_teams.indexOf(player._teamNameHaveFlagCTF) >= 0) && _flagsTaken.get(_teams.indexOf(player._teamNameHaveFlagCTF))) { _flagsTaken.set(_teams.indexOf(player._teamNameHaveFlagCTF), false); spawnFlag(player._teamNameHaveFlagCTF); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player._teamNameHaveFlagCTF + " flag now returned to place."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + player._teamNameHaveFlagCTF + " flag now returned to place."); } removeFlagFromPlayer(player); player._teamNameHaveFlagCTF = null; @@ -2851,7 +2852,7 @@ public class CTF implements EventTask { _flagsTaken.set(index, false); spawnFlag(team); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + team + " flag returned due to player error."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + team + " flag returned due to player error."); } } // Check if a player ran away from the event holding a flag: @@ -2861,13 +2862,13 @@ public class CTF implements EventTask { if ((player != null) && player._haveFlagCTF && isOutsideCTFArea(player)) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player.getName() + " escaped from the event holding a flag!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + player.getName() + " escaped from the event holding a flag!"); player._haveFlagCTF = false; if ((_teams.indexOf(player._teamNameHaveFlagCTF) >= 0) && _flagsTaken.get(_teams.indexOf(player._teamNameHaveFlagCTF))) { _flagsTaken.set(_teams.indexOf(player._teamNameHaveFlagCTF), false); spawnFlag(player._teamNameHaveFlagCTF); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player._teamNameHaveFlagCTF + " flag now returned to place."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + player._teamNameHaveFlagCTF + " flag now returned to place."); } removeFlagFromPlayer(player); player._teamNameHaveFlagCTF = null; @@ -2915,7 +2916,7 @@ public class CTF implements EventTask player.broadcastPacket(new SocialAction(player.getObjectId(), 16)); // Amazing glow player._haveFlagCTF = true; player.broadcastUserInfo(); - player.sendPacket(new CreatureSay(player.getObjectId(), 15, ":", "You got it! Run back! ::")); + player.sendPacket(new CreatureSay(player.getObjectId(), ChatType.PARTYROOM_COMMANDER, ":", "You got it! Run back! ::")); } /** @@ -3149,7 +3150,7 @@ public class CTF implements EventTask player.broadcastUserInfo(); removeFlagFromPlayer(player); _teamPointsCount.set(indexOwn, teamPointsCount(team) + 1); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player.getName() + " scores for " + player._teamNameCTF + "."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + player.getName() + " scores for " + player._teamNameCTF + "."); } } else @@ -3164,7 +3165,7 @@ public class CTF implements EventTask addFlagToPlayer(player); player.broadcastUserInfo(); player._haveFlagCTF = true; - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + team + " flag taken by " + player.getName() + "..."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + team + " flag taken by " + player.getName() + "..."); pointTeamTo(player, team); break; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/DM.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/DM.java index 247b4bdac1..728e1e0529 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/DM.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/DM.java @@ -704,20 +704,20 @@ public class DM implements EventTask _inProgress = true; _joining = true; spawnEventNpc(); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Event " + _eventName + "!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Event " + _eventName + "!"); if (Config.DM_ANNOUNCE_REWARD && (ItemTable.getInstance().getTemplate(_rewardId) != null)) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName()); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName()); } - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName); if (Config.DM_COMMAND) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Commands .dmjoin .dmleave .dminfo"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Commands .dmjoin .dmleave .dminfo"); } - Announcements.getInstance().gameAnnounceToAll(_eventName + ": FULL BUFF Event: be ready with your buffs, they won't be deleted!!!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": FULL BUFF Event: be ready with your buffs, they won't be deleted!!!"); return true; } @@ -742,7 +742,7 @@ public class DM implements EventTask final int size = _players.size(); if (!checkMinPlayers(size)) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + size); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + size); if (Config.DM_STATS_LOGGER) { LOGGER.info(_eventName + ":Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + size); @@ -754,7 +754,7 @@ public class DM implements EventTask } _joining = false; - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!"); setUserData(); ThreadPool.schedule(() -> @@ -830,7 +830,7 @@ public class DM implements EventTask afterStartOperations(); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Started. Go to kill your enemies!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Started. Go to kill your enemies!"); _started = true; return true; @@ -873,7 +873,7 @@ public class DM implements EventTask _aborted = false; final long delay = _intervalBetweenMatches; - Announcements.getInstance().gameAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!"); waiter(delay); @@ -885,7 +885,7 @@ public class DM implements EventTask } else { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": next event aborted!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": next event aborted!"); } } catch (Exception e) @@ -925,7 +925,7 @@ public class DM implements EventTask { winners = winners + " " + winner.getName(); } - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + winners + " win the match! " + _topKills + " kills."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + winners + " win the match! " + _topKills + " kills."); rewardPlayer(); if (Config.DM_STATS_LOGGER) @@ -936,7 +936,7 @@ public class DM implements EventTask } else { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": No players win the match(nobody killed)."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": No players win the match(nobody killed)."); if (Config.DM_STATS_LOGGER) { LOGGER.info(_eventName + ": No players win the match(nobody killed)."); @@ -970,7 +970,7 @@ public class DM implements EventTask cleanDM(); _joining = false; _inProgress = false; - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!"); return; } _joining = false; @@ -981,7 +981,7 @@ public class DM implements EventTask afterFinish(); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!"); teleportFinish(); } @@ -999,7 +999,7 @@ public class DM implements EventTask { sit(); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!"); removeUserData(); ThreadPool.schedule(() -> @@ -1155,12 +1155,12 @@ public class DM implements EventTask removeOfflinePlayers(); if (_joining) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!"); } else if (_started) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!"); } break; } @@ -1175,12 +1175,12 @@ public class DM implements EventTask { if (_joining) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!"); } else if (_started) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!"); } break; } @@ -1197,15 +1197,15 @@ public class DM implements EventTask { if (_joining) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!"); } else if (_teleport) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!"); } else if (_started) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!"); } break; } @@ -2034,7 +2034,7 @@ public class DM implements EventTask { if (!_started && !_aborted) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Thank you For participating!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Thank you For participating!"); } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/GameEvent.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/GameEvent.java index 868d73088f..ad4354417e 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/GameEvent.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/GameEvent.java @@ -30,11 +30,11 @@ import java.util.logging.Logger; import org.l2jmobius.gameserver.datatables.sql.NpcTable; import org.l2jmobius.gameserver.datatables.sql.SpawnTable; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.World; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate; import org.l2jmobius.gameserver.model.spawn.Spawn; -import org.l2jmobius.gameserver.network.clientpackets.Say2; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse; import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; @@ -281,7 +281,7 @@ public class GameEvent public static void announceAllPlayers(String text) { - final CreatureSay cs = new CreatureSay(0, Say2.ANNOUNCEMENT, "", text); + final CreatureSay cs = new CreatureSay(0, ChatType.ANNOUNCEMENT, "", text); for (PlayerInstance player : World.getInstance().getAllPlayers()) { player.sendPacket(cs); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/TvT.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/TvT.java index 87c0c5de99..97e3e7ad5a 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/TvT.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/TvT.java @@ -709,17 +709,17 @@ public class TvT implements EventTask _inProgress = true; _joining = true; spawnEventNpc(); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Event " + _eventName + "!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Event " + _eventName + "!"); if (Config.TVT_ANNOUNCE_REWARD && (ItemTable.getInstance().getTemplate(_rewardId) != null)) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName()); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName()); } - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "."); if (Config.TVT_COMMAND) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Commands .tvtjoin .tvtleave .tvtinfo"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Commands .tvtjoin .tvtleave .tvtinfo"); } return true; @@ -744,7 +744,7 @@ public class TvT implements EventTask } else if (Config.TVT_EVEN_TEAMS.equals("SHUFFLE") && !checkMinPlayers(_playersShuffle.size())) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size()); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size()); if (Config.CTF_STATS_LOGGER) { LOGGER.info(_eventName + ":Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size()); @@ -754,7 +754,7 @@ public class TvT implements EventTask } _joining = false; - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!"); setUserData(); ThreadPool.schedule(() -> @@ -826,7 +826,7 @@ public class TvT implements EventTask closeAdenColosseumDoors(); } - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Started. Go to kill your enemies!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Started. Go to kill your enemies!"); _started = true; return true; @@ -844,7 +844,7 @@ public class TvT implements EventTask _aborted = false; final long delay = _intervalBetweenMatches; - Announcements.getInstance().gameAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!"); waiter(delay); @@ -856,7 +856,7 @@ public class TvT implements EventTask } else { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": next event aborted!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": next event aborted!"); } } catch (Exception e) @@ -895,30 +895,30 @@ public class TvT implements EventTask if (Config.TVT_ANNOUNCE_TEAM_STATS) { - Announcements.getInstance().gameAnnounceToAll(_eventName + " Team Statistics:"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + " Team Statistics:"); for (String team : _teams) { final int _kills = teamKillsCount(team); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Team: " + team + " - Kills: " + _kills); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Team: " + team + " - Kills: " + _kills); } if (bestKiller != null) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Top killer: " + bestKiller.getName() + " - Kills: " + bestKiller._countTvTkills); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Top killer: " + bestKiller.getName() + " - Kills: " + bestKiller._countTvTkills); } if ((looser != null) && (!looser.equals(bestKiller))) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Top looser: " + looser.getName() + " - Dies: " + looser._countTvTdies); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Top looser: " + looser.getName() + " - Dies: " + looser._countTvTdies); } } if (_topTeam != null) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + _topTeam + "'s win the match! " + _topKills + " kills."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + _topTeam + "'s win the match! " + _topKills + " kills."); } else { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": The event finished with a TIE: " + _topKills + " kills by each team!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": The event finished with a TIE: " + _topKills + " kills by each team!"); } rewardTeam(_topTeam, bestKiller, looser); @@ -946,7 +946,7 @@ public class TvT implements EventTask } else { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": The event finished with a TIE: No team wins the match(nobody killed)!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": The event finished with a TIE: No team wins the match(nobody killed)!"); if (Config.TVT_STATS_LOGGER) { @@ -997,7 +997,7 @@ public class TvT implements EventTask cleanTvT(); _joining = false; _inProgress = false; - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!"); return; } _joining = false; @@ -1005,7 +1005,7 @@ public class TvT implements EventTask _started = false; _aborted = true; unspawnEventNpc(); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!"); teleportFinish(); } @@ -1015,7 +1015,7 @@ public class TvT implements EventTask public static void teleportFinish() { sit(); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!"); ThreadPool.schedule(() -> { @@ -1179,12 +1179,12 @@ public class TvT implements EventTask removeOfflinePlayers(); if (_joining) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!"); } else if (_started) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!"); } break; } @@ -1199,12 +1199,12 @@ public class TvT implements EventTask { if (_joining) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!"); } else if (_started) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!"); } break; } @@ -1221,15 +1221,15 @@ public class TvT implements EventTask { if (_joining) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!"); } else if (_teleport) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!"); } else if (_started) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!"); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!"); } break; } @@ -2524,7 +2524,7 @@ public class TvT implements EventTask { if (!_started && !_aborted) { - Announcements.getInstance().gameAnnounceToAll(_eventName + ": Thank you For Participating At, " + _eventName + " Event."); + Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Thank you For Participating At, " + _eventName + " Event."); } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/VIP.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/VIP.java index c50d7abd19..a40db996da 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/VIP.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/event/VIP.java @@ -348,7 +348,7 @@ public class VIP _inProgress = true; _joining = true; - Announcements.getInstance().gameAnnounceToAll("Vip event has started.Use .vipjoin to join or .vipleave to leave."); + Announcements.getInstance().criticalAnnounceToAll("Vip event has started.Use .vipjoin to join or .vipleave to leave."); spawnJoinNPC(); ThreadPool.schedule(() -> @@ -361,22 +361,22 @@ public class VIP public static void startEvent() { - Announcements.getInstance().gameAnnounceToAll("Registration for the VIP event involving " + _teamName + " has ended."); - Announcements.getInstance().gameAnnounceToAll("Players will be teleported to their locations in 20 seconds."); + Announcements.getInstance().criticalAnnounceToAll("Registration for the VIP event involving " + _teamName + " has ended."); + Announcements.getInstance().criticalAnnounceToAll("Players will be teleported to their locations in 20 seconds."); ThreadPool.schedule(() -> { teleportPlayers(); chooseVIP(); setUserData(); - Announcements.getInstance().gameAnnounceToAll("Players have been teleported for the VIP event."); - Announcements.getInstance().gameAnnounceToAll("VIP event will start in 20 seconds."); + Announcements.getInstance().criticalAnnounceToAll("Players have been teleported for the VIP event."); + Announcements.getInstance().criticalAnnounceToAll("VIP event will start in 20 seconds."); spawnEndNPC(); ThreadPool.schedule(() -> { - Announcements.getInstance().gameAnnounceToAll("VIP event has started. " + _teamName + "'s VIP must get to the starter city and talk with " + getNPCName(_endNPC, null) + ". The opposing team must kill the VIP. All players except the VIP will respawn at their current locations."); - Announcements.getInstance().gameAnnounceToAll("VIP event will end if the " + _teamName + " team makes it to their town or when " + (_time / 1000 / 60) + " mins have elapsed."); + Announcements.getInstance().criticalAnnounceToAll("VIP event has started. " + _teamName + "'s VIP must get to the starter city and talk with " + getNPCName(_endNPC, null) + ". The opposing team must kill the VIP. All players except the VIP will respawn at their current locations."); + Announcements.getInstance().criticalAnnounceToAll("VIP event will end if the " + _teamName + " team makes it to their town or when " + (_time / 1000 / 60) + " mins have elapsed."); VIP.sit(); ThreadPool.schedule(VIP::endEventTime, _time); @@ -394,7 +394,7 @@ public class VIP _started = false; unspawnEventNpcs(); - Announcements.getInstance().gameAnnounceToAll("The VIP has died. The opposing team has won."); + Announcements.getInstance().criticalAnnounceToAll("The VIP has died. The opposing team has won."); rewardNotVIP(); teleportFinish(); } @@ -409,7 +409,7 @@ public class VIP _started = false; unspawnEventNpcs(); - Announcements.getInstance().gameAnnounceToAll("The time has run out and the " + _teamName + "'s have not made it to their goal. Everybody on the opposing team wins."); + Announcements.getInstance().criticalAnnounceToAll("The time has run out and the " + _teamName + "'s have not made it to their goal. Everybody on the opposing team wins."); rewardNotVIP(); teleportFinish(); } @@ -478,7 +478,7 @@ public class VIP _started = false; unspawnEventNpcs(); - Announcements.getInstance().gameAnnounceToAll("The VIP has made it to the goal. " + _teamName + " has won. Everybody on that team wins."); + Announcements.getInstance().criticalAnnounceToAll("The VIP has made it to the goal. " + _teamName + " has won. Everybody on that team wins."); rewardVIP(); teleportFinish(); } @@ -631,7 +631,7 @@ public class VIP public static void teleportFinish() { - Announcements.getInstance().gameAnnounceToAll("Teleporting VIP players back to the Registration area in 20 seconds."); + Announcements.getInstance().criticalAnnounceToAll("Teleporting VIP players back to the Registration area in 20 seconds."); ThreadPool.schedule(() -> { diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/olympiad/OlympiadGame.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/olympiad/OlympiadGame.java index 35d151cbfc..3eab0f600e 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/olympiad/OlympiadGame.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/olympiad/OlympiadGame.java @@ -25,6 +25,7 @@ import org.l2jmobius.Config; import org.l2jmobius.gameserver.ai.CtrlIntention; import org.l2jmobius.gameserver.datatables.HeroSkillTable; import org.l2jmobius.gameserver.datatables.SkillTable; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.Party; import org.l2jmobius.gameserver.model.Skill; import org.l2jmobius.gameserver.model.StatSet; @@ -1016,7 +1017,7 @@ class OlympiadGame { final int objId = manager.getLastSpawn().getObjectId(); final String npcName = manager.getLastSpawn().getName(); - manager.getLastSpawn().broadcastPacket(new CreatureSay(objId, 1, npcName, "Olympiad is going to begin in Arena " + (_stadiumID + 1) + " in a moment.")); + manager.getLastSpawn().broadcastPacket(new CreatureSay(objId, ChatType.SHOUT, npcName, "Olympiad is going to begin in Arena " + (_stadiumID + 1) + " in a moment.")); } } } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java index c606593c3a..5f88420186 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/sevensigns/SevenSignsFestival.java @@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.datatables.sql.ClanTable; import org.l2jmobius.gameserver.datatables.sql.NpcTable; import org.l2jmobius.gameserver.datatables.sql.SpawnTable; import org.l2jmobius.gameserver.datatables.xml.ExperienceData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.model.Location; import org.l2jmobius.gameserver.model.Party; @@ -4168,10 +4169,10 @@ public class SevenSignsFestival implements SpawnListener return; } - CreatureSay cs = new CreatureSay(_dawnChatGuide.getObjectId(), 1, senderName, message); + CreatureSay cs = new CreatureSay(_dawnChatGuide.getObjectId(), ChatType.SHOUT, senderName, message); _dawnChatGuide.broadcastPacket(cs); - cs = new CreatureSay(_duskChatGuide.getObjectId(), 1, senderName, message); + cs = new CreatureSay(_duskChatGuide.getObjectId(), ChatType.SHOUT, senderName, message); _duskChatGuide.broadcastPacket(cs); } @@ -4747,7 +4748,7 @@ public class SevenSignsFestival implements SpawnListener { if (!_participants.isEmpty()) { - final CreatureSay cs = new CreatureSay(_witchInst.getObjectId(), 0, "Festival Witch", message); + final CreatureSay cs = new CreatureSay(_witchInst.getObjectId(), ChatType.GENERAL, "Festival Witch", message); for (PlayerInstance participant : _participants) { try diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/siege/clanhalls/BanditStrongholdSiege.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/siege/clanhalls/BanditStrongholdSiege.java index f8bcc72ac7..8a931f3327 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/siege/clanhalls/BanditStrongholdSiege.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/siege/clanhalls/BanditStrongholdSiege.java @@ -28,6 +28,7 @@ import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.gameserver.datatables.sql.ClanTable; import org.l2jmobius.gameserver.datatables.sql.NpcTable; import org.l2jmobius.gameserver.datatables.xml.DoorData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.idfactory.IdFactory; import org.l2jmobius.gameserver.instancemanager.ClanHallManager; import org.l2jmobius.gameserver.model.World; @@ -552,7 +553,7 @@ public class BanditStrongholdSiege extends ClanHallSiege { if (type == 1) { - final CreatureSay cs = new CreatureSay(0, 1, "Journal", text); + final CreatureSay cs = new CreatureSay(0, ChatType.SHOUT, "Journal", text); for (String clanName : getRegisteredClans()) { final Clan clan = ClanTable.getInstance().getClanByName(clanName); @@ -568,7 +569,7 @@ public class BanditStrongholdSiege extends ClanHallSiege } else { - final CreatureSay cs = new CreatureSay(0, 1, "Journal", text); + final CreatureSay cs = new CreatureSay(0, ChatType.SHOUT, "Journal", text); for (PlayerInstance player : World.getInstance().getAllPlayers()) { if (player.getInstanceId() == 0) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/siege/clanhalls/WildBeastFarmSiege.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/siege/clanhalls/WildBeastFarmSiege.java index c086e174bb..28f89c9112 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/siege/clanhalls/WildBeastFarmSiege.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/entity/siege/clanhalls/WildBeastFarmSiege.java @@ -28,6 +28,7 @@ import org.l2jmobius.commons.concurrent.ThreadPool; import org.l2jmobius.gameserver.datatables.sql.ClanTable; import org.l2jmobius.gameserver.datatables.sql.NpcTable; import org.l2jmobius.gameserver.datatables.xml.DoorData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.idfactory.IdFactory; import org.l2jmobius.gameserver.instancemanager.ClanHallManager; import org.l2jmobius.gameserver.model.World; @@ -540,7 +541,7 @@ public class WildBeastFarmSiege extends ClanHallSiege { if (type == 1) { - final CreatureSay cs = new CreatureSay(0, 1, "Journal", text); + final CreatureSay cs = new CreatureSay(0, ChatType.SHOUT, "Journal", text); for (String clanName : getRegisteredClans()) { final Clan clan = ClanTable.getInstance().getClanByName(clanName); @@ -556,7 +557,7 @@ public class WildBeastFarmSiege extends ClanHallSiege } else { - final CreatureSay cs = new CreatureSay(0, 1, "Journal", text); + final CreatureSay cs = new CreatureSay(0, ChatType.SHOUT, "Journal", text); for (PlayerInstance player : World.getInstance().getAllPlayers()) { if (player.getInstanceId() == 0) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/SystemChatChannelId.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/SystemChatChannelId.java deleted file mode 100644 index 1a6ad489fe..0000000000 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/SystemChatChannelId.java +++ /dev/null @@ -1,74 +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 org.l2jmobius.gameserver.network; - -/** - * @author Beetle - */ -public enum SystemChatChannelId -{ - CHAT_NORMAL("ALL"), // id = 0 , white - CHAT_SHOUT("SHOUT"), // ! id = 1 , dark orange - CHAT_TELL("WHISPER"), // " id = 2, purple - CHAT_PARTY("PARTY"), // # id = 3, green - CHAT_CLAN("CLAN"), // @ id = 4, blue/purple - CHAT_SYSTEM("EMOTE"), // ( id = 5 - CHAT_USER_PET("USERPET"), // * id = 6 - CHAT_GM_PET("GMPET"), // * id = 7 - CHAT_MARKET("TRADE"), // + id = 8 pink - CHAT_ALLIANCE("ALLIANCE"), // $ id = 9 light green - CHAT_ANNOUNCE("ANNOUNCE"), // id = 10 light cyan - CHAT_CUSTOM("CRASH"), // id = 11 --> Crashes client - CHAT_L2FRIEND("L2FRIEND"), // id = 12 - CHAT_MSN("MSN"), // id = 13 - CHAT_PARTY_ROOM("PARTYROOM"), // id = 14 - CHAT_COMMANDER("COMMANDER"), // id = 15 - CHAT_INNER_PARTYMASTER("INNERPARTYMASTER"), // id = 16 - CHAT_HERO("HERO"), // % id = 17 blue - CHAT_CRITICAL_ANNOUNCE("CRITANNOUNCE"), // id = 18 dark cyan - CHAT_UNKNOWN("UNKNOWN"), // id = 19 - CHAT_BATTLEFIELD("BATTLEFIELD"), // ^ id = 20 - CHAT_NONE("NONE"); - private String _channelName; - - private SystemChatChannelId(String channelName) - { - _channelName = channelName; - } - - public int getId() - { - return ordinal(); - } - - public String getName() - { - return _channelName; - } - - public static SystemChatChannelId getChatType(int channelId) - { - for (SystemChatChannelId channel : SystemChatChannelId.values()) - { - if (channel.getId() == channelId) - { - return channel; - } - } - return SystemChatChannelId.CHAT_NONE; - } -} diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index a84d53a382..70c6983668 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -33,6 +33,7 @@ import org.l2jmobius.gameserver.GameTimeController; import org.l2jmobius.gameserver.communitybbs.Manager.MailBBSManager; import org.l2jmobius.gameserver.datatables.SkillTable; import org.l2jmobius.gameserver.datatables.xml.AdminData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.enums.TeleportWhereType; import org.l2jmobius.gameserver.instancemanager.CastleManager; import org.l2jmobius.gameserver.instancemanager.ClanHallManager; @@ -153,7 +154,7 @@ public class EnterWorld extends GameClientPacket notifyPartner(player); } - EnterGM(player); + enterGM(player); Quest.playerEnter(player); player.sendPacket(new QuestList(player)); @@ -561,7 +562,7 @@ public class EnterWorld extends GameClientPacket return result; } - private void EnterGM(PlayerInstance player) + private void enterGM(PlayerInstance player) { if (player.isGM()) { @@ -659,8 +660,8 @@ public class EnterWorld extends GameClientPacket if (Config.PM_MESSAGE_ON_START) { - player.sendPacket(new CreatureSay(2, Say2.HERO_VOICE, Config.PM_TEXT1, Config.PM_SERVER_NAME)); - player.sendPacket(new CreatureSay(15, Say2.PARTYROOM_COMMANDER, player.getName(), Config.PM_TEXT2)); + player.sendPacket(new CreatureSay(2, ChatType.HERO_VOICE, Config.PM_TEXT1, Config.PM_SERVER_NAME)); + player.sendPacket(new CreatureSay(15, ChatType.PARTYROOM_COMMANDER, player.getName(), Config.PM_TEXT2)); } if (Config.SERVER_TIME_ON_START) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionCancel.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionCancel.java index b5cb796bf7..60a95d715e 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionCancel.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPetitionCancel.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets; import org.l2jmobius.Config; import org.l2jmobius.gameserver.datatables.xml.AdminData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.instancemanager.PetitionManager; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.network.SystemMessageId; @@ -70,7 +71,7 @@ public class RequestPetitionCancel extends GameClientPacket // Notify all GMs that the player's pending petition has been cancelled. final String msgContent = player.getName() + " has canceled a pending petition."; - AdminData.broadcastToGMs(new CreatureSay(player.getObjectId(), 17, "Petition System", msgContent)); + AdminData.broadcastToGMs(new CreatureSay(player.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent)); } else { diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreManageBuy.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreManageBuy.java index ad137af31c..c110d93353 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreManageBuy.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreManageBuy.java @@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.clientpackets; import java.util.logging.Logger; import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; @@ -110,7 +111,7 @@ public class RequestPrivateStoreManageBuy extends GameClientPacket if (Config.SELL_BY_ITEM) { - player.sendPacket(new CreatureSay(0, 15, "", "ATTENTION: Store System is not based on Adena, be careful!")); + player.sendPacket(new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", "ATTENTION: Store System is not based on Adena, be careful!")); } player.setPrivateStoreType(PlayerInstance.STORE_PRIVATE_BUY + 1); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreManageSell.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreManageSell.java index fa660bcb0a..f3b2383808 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreManageSell.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestPrivateStoreManageSell.java @@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.clientpackets; import java.util.logging.Logger; import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; @@ -110,7 +111,7 @@ public class RequestPrivateStoreManageSell extends GameClientPacket if (Config.SELL_BY_ITEM) { - player.sendPacket(new CreatureSay(0, 15, "", "ATTENTION: Store System is not based on Adena, be careful!")); + player.sendPacket(new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", "ATTENTION: Store System is not based on Adena, be careful!")); } player.setPrivateStoreType(PlayerInstance.STORE_PRIVATE_SELL + 1); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/Say2.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/Say2.java index 451e17e9e2..901a7539ba 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/Say2.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/Say2.java @@ -16,15 +16,13 @@ */ package org.l2jmobius.gameserver.network.clientpackets; -import java.nio.BufferUnderflowException; import java.util.Collection; import java.util.StringTokenizer; -import java.util.logging.Level; -import java.util.logging.LogRecord; import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.gameserver.datatables.xml.MapRegionData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.handler.IVoicedCommandHandler; import org.l2jmobius.gameserver.handler.VoicedCommandHandler; import org.l2jmobius.gameserver.instancemanager.PetitionManager; @@ -33,7 +31,6 @@ import org.l2jmobius.gameserver.model.WorldObject; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance.PunishLevel; -import org.l2jmobius.gameserver.network.SystemChatChannelId; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; import org.l2jmobius.gameserver.network.serverpackets.SystemMessage; @@ -41,101 +38,84 @@ import org.l2jmobius.gameserver.util.Util; public class Say2 extends GameClientPacket { - private static final Logger LOGGER = Logger.getLogger(Say2.class.getName()); - private static Logger _logChat = Logger.getLogger("chat"); + private static final Logger LOGGER_CHAT = Logger.getLogger("chat"); - public static final int ALL = 0; - public static final int SHOUT = 1; // ! - public static final int TELL = 2; - public static final int PARTY = 3; // # - public static final int CLAN = 4; // @ - public static final int GM = 5; // //gmchat - public static final int PETITION_PLAYER = 6; // used for petition - public static final int PETITION_GM = 7; // * used for petition - public static final int TRADE = 8; // + - public static final int ALLIANCE = 9; // $ - public static final int ANNOUNCEMENT = 10; // //announce - public static final int PARTYROOM_ALL = 16; // (Red) - public static final int PARTYROOM_COMMANDER = 15; // (Yellow) - public static final int HERO_VOICE = 17; // % - public static final int CRITICAL_ANNOUNCE = 18; - - private static final String[] CHAT_NAMES = + private static final String[] WALKER_COMMAND_LIST = { - "ALL ", - "SHOUT", - "TELL ", - "PARTY", - "CLAN ", - "GM ", - "PETITION_PLAYER", - "PETITION_GM", - "TRADE", - "ALLIANCE", - "ANNOUNCEMENT", // 10 - "WILLCRASHCLIENT:)", - "FAKEALL?", - "FAKEALL?", - "FAKEALL?", - "PARTYROOM_ALL", - "PARTYROOM_COMMANDER", - "CRITICAL_ANNOUNCE", - "HERO_VOICE" + "USESKILL", + "USEITEM", + "BUYITEM", + "SELLITEM", + "SAVEITEM", + "LOADITEM", + "MSG", + "SET", + "DELAY", + "LABEL", + "JMP", + "CALL", + "RETURN", + "MOVETO", + "NPCSEL", + "NPCDLG", + "DLGSEL", + "CHARSTATUS", + "POSOUTRANGE", + "POSINRANGE", + "GOHOME", + "SAY", + "EXIT", + "PAUSE", + "STRINDLG", + "STRNOTINDLG", + "CHANGEWAITTYPE", + "FORCEATTACK", + "ISMEMBER", + "REQUESTJOINPARTY", + "REQUESTOUTPARTY", + "QUITPARTY", + "MEMBERSTATUS", + "CHARBUFFS", + "ITEMCOUNT", + "FOLLOWTELEPORT" }; private String _text; private int _type; - private SystemChatChannelId _type2Check; private String _target; @Override protected void readImpl() { _text = readS(); - try - { - _type = readD(); - _type2Check = SystemChatChannelId.getChatType(_type); - } - catch (BufferUnderflowException e) - { - _type = CHAT_NAMES.length; - _type2Check = SystemChatChannelId.CHAT_NONE; - } - _target = _type == TELL ? readS() : null; + _type = readD(); + _target = _type == ChatType.WHISPER.getClientId() ? readS() : null; } @Override protected void runImpl() { - if ((_type < 0) || (_type >= CHAT_NAMES.length)) - { - LOGGER.warning("Say2: Invalid type: " + _type); - return; - } - final PlayerInstance player = getClient().getPlayer(); - - // Anti-PHX Announce - if ((_type2Check == SystemChatChannelId.CHAT_NONE) || (_type2Check == SystemChatChannelId.CHAT_ANNOUNCE) || (_type2Check == SystemChatChannelId.CHAT_CRITICAL_ANNOUNCE) || (_type2Check == SystemChatChannelId.CHAT_SYSTEM) || (_type2Check == SystemChatChannelId.CHAT_CUSTOM) || ((_type2Check == SystemChatChannelId.CHAT_GM_PET) && !player.isGM())) - { - LOGGER.warning("[Anti-PHX Announce] Illegal Chat ( " + _type2Check + " ) channel was used by character: [" + player.getName() + "]"); - return; - } - if (player == null) { LOGGER.warning("[Say2.java] Active Character is null."); return; } - if (player.isChatBanned() && !player.isGM() && (_type != CLAN) && (_type != ALLIANCE) && (_type != PARTY)) + ChatType chatType = ChatType.findByClientId(_type); + if (chatType == null) + { + LOGGER.warning("Say2: Invalid type: " + _type + " Player : " + player.getName() + " text: " + _text); + return; + } + + if (player.isChatBanned() && !player.isGM() && (chatType != ChatType.CLAN) && (chatType != ChatType.ALLIANCE) && (chatType != ChatType.PARTY)) { player.sendMessage("You may not chat while a chat ban is in effect."); return; } - if (player.isInJail() && Config.JAIL_DISABLE_CHAT && ((_type == TELL) || (_type == SHOUT) || (_type == TRADE) || (_type == HERO_VOICE))) + if (player.isInJail() && Config.JAIL_DISABLE_CHAT && ((chatType == ChatType.WHISPER) || (chatType == ChatType.SHOUT) || (chatType == ChatType.TRADE) || (chatType == ChatType.HERO_VOICE))) { player.sendMessage("You can not chat with players outside of the jail."); return; @@ -147,15 +127,15 @@ public class Say2 extends GameClientPacket return; } - if (player.isCursedWeaponEquiped() && ((_type == TRADE) || (_type == SHOUT))) + if (player.isCursedWeaponEquiped() && ((chatType == ChatType.TRADE) || (chatType == ChatType.SHOUT))) { player.sendMessage("Shout and trade chatting cannot be used while possessing a cursed weapon."); return; } - if ((_type == PETITION_PLAYER) && player.isGM()) + if ((chatType == ChatType.PETITION_PLAYER) && player.isGM()) { - _type = PETITION_GM; + chatType = ChatType.PETITION_GM; } if (_text.length() > Config.MAX_CHAT_LENGTH) @@ -166,30 +146,17 @@ public class Say2 extends GameClientPacket if (Config.LOG_CHAT) { - final LogRecord record = new LogRecord(Level.INFO, _text); - record.setLoggerName("chat"); - - if (_type == TELL) + if (chatType == ChatType.WHISPER) { - record.setParameters(new Object[] - { - CHAT_NAMES[_type], - "[" + player.getName() + " to " + _target + "]" - }); + LOGGER_CHAT.info(chatType.name() + " [" + player + " to " + _target + "] " + _text); } else { - record.setParameters(new Object[] - { - CHAT_NAMES[_type], - "[" + player.getName() + "]" - }); + LOGGER_CHAT.info(chatType.name() + " [" + player + "] " + _text); } - - _logChat.log(record); } - if (Config.L2WALKER_PROTECTION && (_type == TELL) && checkBot(_text)) + if (Config.L2WALKER_PROTECTION && (chatType == ChatType.WHISPER) && checkBot(_text)) { Util.handleIllegalPlayerAction(player, "Client Emulator Detect: Player " + player.getName() + " using l2walker.", Config.DEFAULT_PUNISH); return; @@ -210,7 +177,7 @@ public class Say2 extends GameClientPacket _type = 0; final Collection list = saymode.getKnownList().getKnownObjects().values(); - final CreatureSay cs = new CreatureSay(actor, _type, name, _text); + final CreatureSay cs = new CreatureSay(actor, chatType, name, _text); for (WorldObject obj : list) { if (!(obj instanceof Creature)) @@ -223,10 +190,10 @@ public class Say2 extends GameClientPacket return; } - final CreatureSay cs = new CreatureSay(player.getObjectId(), _type, player.getName(), _text); - switch (_type) + final CreatureSay cs = new CreatureSay(player.getObjectId(), chatType, player.getName(), _text); + switch (chatType) { - case TELL: + case WHISPER: { final PlayerInstance receiver = World.getInstance().getPlayer(_target); if (receiver == null) @@ -256,7 +223,7 @@ public class Say2 extends GameClientPacket if (!receiver.isInRefusalMode()) { receiver.sendPacket(cs); - player.sendPacket(new CreatureSay(player.getObjectId(), _type, "->" + receiver.getName(), _text)); + player.sendPacket(new CreatureSay(player.getObjectId(), chatType, "->" + receiver.getName(), _text)); } else { @@ -440,7 +407,7 @@ public class Say2 extends GameClientPacket } break; } - case ALL: + case GENERAL: { if (_text.startsWith(".")) { @@ -568,46 +535,6 @@ public class Say2 extends GameClientPacket } } - private static final String[] WALKER_COMMAND_LIST = - { - "USESKILL", - "USEITEM", - "BUYITEM", - "SELLITEM", - "SAVEITEM", - "LOADITEM", - "MSG", - "SET", - "DELAY", - "LABEL", - "JMP", - "CALL", - "RETURN", - "MOVETO", - "NPCSEL", - "NPCDLG", - "DLGSEL", - "CHARSTATUS", - "POSOUTRANGE", - "POSINRANGE", - "GOHOME", - "SAY", - "EXIT", - "PAUSE", - "STRINDLG", - "STRNOTINDLG", - "CHANGEWAITTYPE", - "FORCEATTACK", - "ISMEMBER", - "REQUESTJOINPARTY", - "REQUESTOUTPARTY", - "QUITPARTY", - "MEMBERSTATUS", - "CHARBUFFS", - "ITEMCOUNT", - "FOLLOWTELEPORT" - }; - private boolean checkBot(String text) { for (String botCommand : WALKER_COMMAND_LIST) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CreatureSay.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CreatureSay.java index 9e71983028..66c4dddcf0 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CreatureSay.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CreatureSay.java @@ -16,6 +16,7 @@ */ package org.l2jmobius.gameserver.network.serverpackets; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; /** @@ -24,20 +25,20 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; public class CreatureSay extends GameServerPacket { private final int _objectId; - private final int _textType; + private final ChatType _chatType; private final String _charName; private final String _text; /** * @param objectId - * @param messageType + * @param chatType * @param charName * @param text */ - public CreatureSay(int objectId, int messageType, String charName, String text) + public CreatureSay(int objectId, ChatType chatType, String charName, String text) { _objectId = objectId; - _textType = messageType; + _chatType = chatType; _charName = charName; _text = text; } @@ -47,14 +48,14 @@ public class CreatureSay extends GameServerPacket { writeC(0x4a); writeD(_objectId); - writeD(_textType); + writeD(_chatType.getClientId()); writeS(_charName); writeS(_text); final PlayerInstance player = getClient().getPlayer(); if (player != null) { - player.broadcastSnoop(_textType, _charName, _text, this); + player.broadcastSnoop(_chatType, _charName, _text, this); } } } \ No newline at end of file diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/PrivateStoreListBuy.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/PrivateStoreListBuy.java index bcf8c8e7ee..6e7fba003f 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/PrivateStoreListBuy.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/PrivateStoreListBuy.java @@ -17,6 +17,7 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.TradeList; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -37,7 +38,7 @@ public class PrivateStoreListBuy extends GameServerPacket if (Config.SELL_BY_ITEM) { - _player.sendPacket(new CreatureSay(0, 15, "", "ATTENTION: Store System is not based on Adena, be careful!")); + _player.sendPacket(new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", "ATTENTION: Store System is not based on Adena, be careful!")); _playerAdena = _player.getItemCount(Config.SELL_ITEM, -1); } else diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/PrivateStoreListSell.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/PrivateStoreListSell.java index c9974ba13f..8340ab5208 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/PrivateStoreListSell.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/PrivateStoreListSell.java @@ -17,6 +17,7 @@ package org.l2jmobius.gameserver.network.serverpackets; import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.TradeList; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; @@ -39,7 +40,7 @@ public class PrivateStoreListSell extends GameServerPacket if (Config.SELL_BY_ITEM) { - _player.sendPacket(new CreatureSay(0, 15, "", "ATTENTION: Store System is not based on Adena, be careful!")); + _player.sendPacket(new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", "ATTENTION: Store System is not based on Adena, be careful!")); _playerAdena = _player.getItemCount(Config.SELL_ITEM, -1); } else diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/Snoop.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/Snoop.java index b0fa65c8d1..ec23ecdc11 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/Snoop.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/Snoop.java @@ -16,31 +16,27 @@ */ package org.l2jmobius.gameserver.network.serverpackets; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; /** * CDSDDSS -> (0xd5)(objId)(name)(0x00)(type)(speaker)(name) */ - public class Snoop extends GameServerPacket { private final PlayerInstance _snooped; - private final int _type; + private final ChatType _type; private final String _speaker; private final String _msg; - public Snoop(PlayerInstance snooped, int type, String speaker, String msg) + public Snoop(PlayerInstance snooped, ChatType _chatType, String speaker, String msg) { _snooped = snooped; - _type = type; + _type = _chatType; _speaker = speaker; _msg = msg; } - /* - * (non-Javadoc) - * @see net.sf.l2j.gameserver.serverpackets.ServerBasePacket#writeImpl() - */ @Override protected void writeImpl() { @@ -48,7 +44,7 @@ public class Snoop extends GameServerPacket writeD(_snooped.getObjectId()); writeS(_snooped.getName()); writeD(0); // ?? - writeD(_type); + writeD(_type.getClientId()); writeS(_speaker); writeS(_msg); } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ui/Gui.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ui/Gui.java index abe2005dd3..92e68eae6e 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ui/Gui.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/ui/Gui.java @@ -48,8 +48,8 @@ import org.l2jmobius.commons.util.LimitLinesDocumentListener; import org.l2jmobius.commons.util.SplashScreen; import org.l2jmobius.gameserver.Shutdown; import org.l2jmobius.gameserver.cache.HtmCache; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.multisell.Multisell; -import org.l2jmobius.gameserver.network.clientpackets.Say2; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; import org.l2jmobius.gameserver.util.Broadcast; import org.l2jmobius.gameserver.util.Util; @@ -209,7 +209,7 @@ public class Gui final String message = ((String) input).trim(); if (!message.isEmpty()) { - Broadcast.toAllOnlinePlayers(new CreatureSay(-1, Say2.ANNOUNCEMENT, "", message)); + Broadcast.toAllOnlinePlayers(new CreatureSay(-1, ChatType.ANNOUNCEMENT, "", message)); } } }); @@ -225,7 +225,7 @@ public class Gui final String message = ((String) input).trim(); if (!message.isEmpty()) { - Broadcast.toAllOnlinePlayers(new CreatureSay(-1, Say2.CRITICAL_ANNOUNCE, "", message)); + Broadcast.toAllOnlinePlayers(new CreatureSay(-1, ChatType.CRITICAL_ANNOUNCE, "", message)); } } }); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/util/BuilderUtil.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/util/BuilderUtil.java index 93c630e29c..1787585527 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/util/BuilderUtil.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/util/BuilderUtil.java @@ -17,8 +17,8 @@ package org.l2jmobius.gameserver.util; import org.l2jmobius.Config; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; -import org.l2jmobius.gameserver.network.clientpackets.Say2; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; /** @@ -40,7 +40,7 @@ public class BuilderUtil { if (Config.GM_STARTUP_BUILDER_HIDE) { - player.sendPacket(new CreatureSay(0, Say2.ALL, "SYS", message)); + player.sendPacket(new CreatureSay(0, ChatType.GENERAL, "SYS", message)); } else { @@ -55,7 +55,7 @@ public class BuilderUtil */ public static void sendHtmlMessage(PlayerInstance player, String message) { - player.sendPacket(new CreatureSay(0, Say2.ALL, "HTML", message)); + player.sendPacket(new CreatureSay(0, ChatType.GENERAL, "HTML", message)); } /** diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/telnet/GameStatusThread.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/telnet/GameStatusThread.java index 17c4b48874..f24ae5db24 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/telnet/GameStatusThread.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/telnet/GameStatusThread.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.datatables.sql.SpawnTable; import org.l2jmobius.gameserver.datatables.sql.TeleportLocationTable; import org.l2jmobius.gameserver.datatables.xml.AdminData; import org.l2jmobius.gameserver.datatables.xml.ZoneData; +import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.instancemanager.DayNightSpawnManager; import org.l2jmobius.gameserver.instancemanager.QuestManager; import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager; @@ -75,7 +76,6 @@ import org.l2jmobius.gameserver.model.entity.Announcements; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.multisell.Multisell; import org.l2jmobius.gameserver.network.SystemMessageId; -import org.l2jmobius.gameserver.network.clientpackets.Say2; import org.l2jmobius.gameserver.network.serverpackets.CharInfo; import org.l2jmobius.gameserver.network.serverpackets.CreatureSay; import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; @@ -335,7 +335,7 @@ public class GameStatusThread extends Thread final String name = st.nextToken(); final String message = val.substring(name.length() + 1); final PlayerInstance reciever = World.getInstance().getPlayer(name); - final CreatureSay cs = new CreatureSay(0, Say2.TELL, "Telnet Priv", message); + final CreatureSay cs = new CreatureSay(0, ChatType.WHISPER, "Telnet Priv", message); if (reciever != null) { reciever.sendPacket(cs); @@ -357,7 +357,7 @@ public class GameStatusThread extends Thread try { usrCommand = usrCommand.substring(7); - final CreatureSay cs = new CreatureSay(0, Say2.ALLIANCE, "Telnet GM Broadcast from " + _cSocket.getInetAddress().getHostAddress(), usrCommand); + final CreatureSay cs = new CreatureSay(0, ChatType.ALLIANCE, "Telnet GM Broadcast from " + _cSocket.getInetAddress().getHostAddress(), usrCommand); AdminData.broadcastToGMs(cs); _print.println("Your Message Has Been Sent To " + getOnlineGMs() + " GM(s)."); }