CreatureSay cleanup and improvements.

This commit is contained in:
MobiusDevelopment
2020-01-04 05:11:01 +00:00
parent 1cdcd2f8b0
commit f8acdcace7
581 changed files with 1810 additions and 2528 deletions

View File

@@ -95,8 +95,7 @@ public class PolymorphingOnAttack extends AbstractNpcAI
if (tmp.get(3) >= 0) if (tmp.get(3) >= 0)
{ {
final NpcStringId npcString = MOBTEXTS[tmp.get(3)][getRandom(MOBTEXTS[tmp.get(3)].length)]; final NpcStringId npcString = MOBTEXTS[tmp.get(3)][getRandom(MOBTEXTS[tmp.get(3)].length)];
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), npcString)); npc.broadcastPacket(new CreatureSay(npc, ChatType.NPC_GENERAL, npcString));
} }
npc.deleteMe(); npc.deleteMe();
final Attackable newNpc = (Attackable) addSpawn(tmp.get(0), npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true); final Attackable newNpc = (Attackable) addSpawn(tmp.get(0), npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true);

View File

@@ -380,7 +380,7 @@ public class Race extends Event
private void sendMessage(PlayerInstance player, String text) private void sendMessage(PlayerInstance player, String text)
{ {
player.sendPacket(new CreatureSay(_npc.getObjectId(), ChatType.MPCC_ROOM, _npc.getName(), text)); player.sendPacket(new CreatureSay(_npc, ChatType.MPCC_ROOM, _npc.getName(), text));
} }
private void showMenu(PlayerInstance player) private void showMenu(PlayerInstance player)

View File

@@ -123,7 +123,7 @@ public class FreyaCelebration extends LongTimeEvent
{ {
if (getRandom(100) < 5) if (getRandom(100) < 5)
{ {
final CreatureSay cs = new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), NpcStringId.DEAR_S1_THINK_OF_THIS_AS_MY_APPRECIATION_FOR_THE_GIFT_TAKE_THIS_WITH_YOU_THERE_S_NOTHING_STRANGE_ABOUT_IT_IT_S_JUST_A_BIT_OF_MY_CAPRICIOUSNESS); final CreatureSay cs = new CreatureSay(npc, ChatType.NPC_GENERAL, NpcStringId.DEAR_S1_THINK_OF_THIS_AS_MY_APPRECIATION_FOR_THE_GIFT_TAKE_THIS_WITH_YOU_THERE_S_NOTHING_STRANGE_ABOUT_IT_IT_S_JUST_A_BIT_OF_MY_CAPRICIOUSNESS);
cs.addStringParameter(caster.getName()); cs.addStringParameter(caster.getName());
npc.broadcastPacket(cs); npc.broadcastPacket(cs);
@@ -132,7 +132,7 @@ public class FreyaCelebration extends LongTimeEvent
} }
else if (getRandom(10) < 2) else if (getRandom(10) < 2)
{ {
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), getRandomEntry(FREYA_TEXT))); npc.broadcastPacket(new CreatureSay(npc, ChatType.NPC_GENERAL, getRandomEntry(FREYA_TEXT)));
} }
} }
return super.onSkillSee(npc, caster, skill, targets, isSummon); return super.onSkillSee(npc, caster, skill, targets, isSummon);

View File

@@ -296,7 +296,7 @@ public class AdminAdmin implements IAdminCommandHandler
sb.append(" "); sb.append(" ");
} }
final CreatureSay cs = new CreatureSay(activeChar, ChatType.WORLD, sb.toString()); final CreatureSay cs = new CreatureSay(activeChar, ChatType.WORLD, activeChar.getName(), sb.toString());
World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo); World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
break; break;
} }

View File

@@ -113,7 +113,7 @@ public class AdminGmChat implements IAdminCommandHandler
offset = 13; offset = 13;
} }
text = command.substring(offset); text = command.substring(offset);
final CreatureSay cs = new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(null, ChatType.ALLIANCE, activeChar.getName(), text);
AdminData.getInstance().broadcastToGMs(cs); AdminData.getInstance().broadcastToGMs(cs);
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)

View File

@@ -53,7 +53,7 @@ public class AdminTargetSay implements IAdminCommandHandler
final String message = command.substring(16); final String message = command.substring(16);
final Creature target = (Creature) obj; final Creature target = (Creature) obj;
target.broadcastPacket(new CreatureSay(target.getObjectId(), target.isPlayer() ? ChatType.GENERAL : ChatType.NPC_GENERAL, target.getName(), message)); target.broadcastPacket(new CreatureSay(target, target.isPlayer() ? ChatType.GENERAL : ChatType.NPC_GENERAL, target.getName(), message));
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {

View File

@@ -124,7 +124,7 @@ public class FindPvP implements IBypassHandler
if (biggestAllyId == allyId) if (biggestAllyId == allyId)
{ {
player.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, your clan/ally is outnumbering the place already so you can't move there.")); player.sendPacket(new CreatureSay(null, ChatType.WHISPER, target.getName(), "Sorry, your clan/ally is outnumbering the place already so you can't move there."));
return true; return true;
} }
} }
@@ -139,7 +139,7 @@ public class FindPvP implements IBypassHandler
} }
else else
{ {
player.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, I can't find anyone in flag status right now.")); player.sendPacket(new CreatureSay(null, ChatType.WHISPER, target.getName(), "Sorry, I can't find anyone in flag status right now."));
} }
return false; return false;
} }

View File

@@ -53,7 +53,7 @@ public class ChatAlliance implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getClan().broadcastToOnlineAllyMembers(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text)); activeChar.getClan().broadcastToOnlineAllyMembers(new CreatureSay(activeChar, type, activeChar.getName(), text));
} }
@Override @Override

View File

@@ -54,7 +54,7 @@ public class ChatClan implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getClan().broadcastCSToOnlineMembers(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getClan().broadcastCSToOnlineMembers(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
@Override @Override

View File

@@ -87,8 +87,8 @@ public class ChatGeneral implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getAppearance().getVisibleName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getAppearance().getVisibleName(), text);
final CreatureSay csRandom = new CreatureSay(activeChar.getObjectId(), type, activeChar.getAppearance().getVisibleName(), ChatRandomizer.randomize(text)); final CreatureSay csRandom = new CreatureSay(activeChar, type, activeChar.getAppearance().getVisibleName(), ChatRandomizer.randomize(text));
World.getInstance().forEachVisibleObjectInRange(activeChar, PlayerInstance.class, 1250, player -> World.getInstance().forEachVisibleObjectInRange(activeChar, PlayerInstance.class, 1250, player ->
{ {
if ((player != null) && !BlockList.isBlocked(player, activeChar)) if ((player != null) && !BlockList.isBlocked(player, activeChar))

View File

@@ -62,7 +62,7 @@ public class ChatHeroVoice implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
for (PlayerInstance player : World.getInstance().getPlayers()) for (PlayerInstance player : World.getInstance().getPlayers())
{ {
if ((player != null) && !BlockList.isBlocked(player, activeChar)) if ((player != null) && !BlockList.isBlocked(player, activeChar))

View File

@@ -54,7 +54,7 @@ public class ChatParty implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getParty().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getParty().broadcastCreatureSay(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
@Override @Override

View File

@@ -53,7 +53,7 @@ public class ChatPartyMatchRoom implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
for (PlayerInstance _member : room.getMembers()) for (PlayerInstance _member : room.getMembers())
{ {
if (Config.FACTION_SYSTEM_ENABLED) if (Config.FACTION_SYSTEM_ENABLED)

View File

@@ -50,7 +50,7 @@ public class ChatPartyRoomAll implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
} }

View File

@@ -50,7 +50,7 @@ public class ChatPartyRoomCommander implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
} }

View File

@@ -58,7 +58,7 @@ public class ChatShout implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS))) if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS)))
{ {
final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar); final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar);

View File

@@ -58,7 +58,7 @@ public class ChatTrade implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS))) if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS)))
{ {
final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar); final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar);

View File

@@ -93,7 +93,7 @@ public class ChatWorld implements IChatHandler
} }
} }
final CreatureSay cs = new CreatureSay(activeChar, type, text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_SPECIFIC_CHAT) if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_SPECIFIC_CHAT)
{ {
if (activeChar.isGood()) if (activeChar.isGood())

View File

@@ -52,7 +52,7 @@ public class GMChat implements ITelnetCommand
{ {
sb.append(str + " "); sb.append(str + " ");
} }
AdminData.getInstance().broadcastToGMs(new CreatureSay(0, ChatType.ALLIANCE, "Telnet GM Broadcast", sb.toString())); AdminData.getInstance().broadcastToGMs(new CreatureSay(null, ChatType.ALLIANCE, "Telnet GM Broadcast", sb.toString()));
return "GMChat sent!"; return "GMChat sent!";
} }
} }

View File

@@ -56,7 +56,7 @@ public class Msg implements ITelnetCommand
{ {
sb.append(args[i] + " "); sb.append(args[i] + " ");
} }
player.sendPacket(new CreatureSay(0, ChatType.WHISPER, "Telnet Priv", sb.toString())); player.sendPacket(new CreatureSay(null, ChatType.WHISPER, "Telnet Priv", sb.toString()));
return "Announcement sent!"; return "Announcement sent!";
} }
return "Couldn't find player with such name."; return "Couldn't find player with such name.";

View File

@@ -145,7 +145,7 @@ public class Q00457_LostAndFound extends Quest
startQuestTimer("STOP", 1000, npc, player); startQuestTimer("STOP", 1000, npc, player);
startQuestTimer("BYE", 3000, npc, player); startQuestTimer("BYE", 3000, npc, player);
cancelQuestTimer("CHECK", npc, player); cancelQuestTimer("CHECK", npc, player);
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), NpcStringId.AH_FRESH_AIR)); npc.broadcastPacket(new CreatureSay(npc, ChatType.NPC_GENERAL, NpcStringId.AH_FRESH_AIR));
broadcastNpcSay(npc, player, NpcStringId.AH_FRESH_AIR, false); broadcastNpcSay(npc, player, NpcStringId.AH_FRESH_AIR, false);
giveItems(player, PACKAGED_BOOK, 1); giveItems(player, PACKAGED_BOOK, 1);
qs.exitQuest(QuestType.DAILY, true); qs.exitQuest(QuestType.DAILY, true);

View File

@@ -138,29 +138,29 @@ public class BoatGludinRune implements Runnable
{ {
_boat = boat; _boat = boat;
ARRIVED_AT_GLUDIN = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_GLUDIN_HARBOR); ARRIVED_AT_GLUDIN = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_GLUDIN_HARBOR);
ARRIVED_AT_GLUDIN_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_AFTER_ANCHORING_FOR_TEN_MINUTES); ARRIVED_AT_GLUDIN_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_AFTER_ANCHORING_FOR_TEN_MINUTES);
LEAVE_GLUDIN5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES); LEAVE_GLUDIN5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES);
LEAVE_GLUDIN1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE); LEAVE_GLUDIN1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE);
LEAVE_GLUDIN0 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY_2); LEAVE_GLUDIN0 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY_2);
LEAVING_GLUDIN = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE); LEAVING_GLUDIN = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE);
ARRIVED_AT_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR); ARRIVED_AT_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR);
ARRIVED_AT_RUNE_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_GLUDIN_HARBOR_AFTER_ANCHORING_FOR_TEN_MINUTES); ARRIVED_AT_RUNE_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_GLUDIN_HARBOR_AFTER_ANCHORING_FOR_TEN_MINUTES);
LEAVE_RUNE5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES); LEAVE_RUNE5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES);
LEAVE_RUNE1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE); LEAVE_RUNE1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE);
LEAVE_RUNE0 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY); LEAVE_RUNE0 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY);
LEAVING_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE); LEAVING_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE);
BUSY_GLUDIN = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_TO_GLUDIN_HARBOR_HAS_BEEN_DELAYED); BUSY_GLUDIN = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_TO_GLUDIN_HARBOR_HAS_BEEN_DELAYED);
BUSY_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_TO_RUNE_HARBOR_HAS_BEEN_DELAYED); BUSY_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_TO_RUNE_HARBOR_HAS_BEEN_DELAYED);
ARRIVAL_RUNE15 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_15_MINUTES); ARRIVAL_RUNE15 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_15_MINUTES);
ARRIVAL_RUNE10 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_10_MINUTES); ARRIVAL_RUNE10 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_10_MINUTES);
ARRIVAL_RUNE5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_5_MINUTES); ARRIVAL_RUNE5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_5_MINUTES);
ARRIVAL_RUNE1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_1_MINUTE); ARRIVAL_RUNE1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_1_MINUTE);
ARRIVAL_GLUDIN15 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_15_MINUTES); ARRIVAL_GLUDIN15 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_15_MINUTES);
ARRIVAL_GLUDIN10 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_10_MINUTES); ARRIVAL_GLUDIN10 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_10_MINUTES);
ARRIVAL_GLUDIN5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_5_MINUTES); ARRIVAL_GLUDIN5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_5_MINUTES);
ARRIVAL_GLUDIN1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_1_MINUTE); ARRIVAL_GLUDIN1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_1_MINUTE);
GLUDIN_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), GLUDIN_DOCK[0].getX(), GLUDIN_DOCK[0].getY(), GLUDIN_DOCK[0].getZ()); GLUDIN_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), GLUDIN_DOCK[0].getX(), GLUDIN_DOCK[0].getY(), GLUDIN_DOCK[0].getZ());
RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ()); RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ());

View File

@@ -94,17 +94,17 @@ public class BoatInnadrilTour implements Runnable
{ {
_boat = boat; _boat = boat;
ARRIVED_AT_INNADRIL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_HAS_ARRIVED_IT_WILL_ANCHOR_FOR_TEN_MINUTES); ARRIVED_AT_INNADRIL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_HAS_ARRIVED_IT_WILL_ANCHOR_FOR_TEN_MINUTES);
LEAVE_INNADRIL5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_FIVE_MINUTES); LEAVE_INNADRIL5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_FIVE_MINUTES);
LEAVE_INNADRIL1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_ONE_MINUTE); LEAVE_INNADRIL1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_ONE_MINUTE);
LEAVE_INNADRIL0 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_BE_LEAVING_SOON); LEAVE_INNADRIL0 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_BE_LEAVING_SOON);
LEAVING_INNADRIL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_IS_LEAVING); LEAVING_INNADRIL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_IS_LEAVING);
ARRIVAL20 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_20_MINUTES); ARRIVAL20 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_20_MINUTES);
ARRIVAL15 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_15_MINUTES); ARRIVAL15 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_15_MINUTES);
ARRIVAL10 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_10_MINUTES); ARRIVAL10 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_10_MINUTES);
ARRIVAL5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_5_MINUTES); ARRIVAL5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_5_MINUTES);
ARRIVAL1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_1_MINUTE); ARRIVAL1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_1_MINUTE);
INNADRIL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), DOCK.getX(), DOCK.getY(), DOCK.getZ()); INNADRIL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), DOCK.getX(), DOCK.getY(), DOCK.getZ());
} }

View File

@@ -90,13 +90,13 @@ public class BoatRunePrimeval implements Runnable
{ {
_boat = boat; _boat = boat;
ARRIVED_AT_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR); ARRIVED_AT_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR);
ARRIVED_AT_RUNE_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_PRIMEVAL_ISLE_AFTER_ANCHORING_FOR_THREE_MINUTES); ARRIVED_AT_RUNE_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_PRIMEVAL_ISLE_AFTER_ANCHORING_FOR_THREE_MINUTES);
LEAVING_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_RUNE_HARBOR_FOR_PRIMEVAL_ISLE); LEAVING_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_RUNE_HARBOR_FOR_PRIMEVAL_ISLE);
ARRIVED_AT_PRIMEVAL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_PRIMEVAL_ISLE); ARRIVED_AT_PRIMEVAL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_PRIMEVAL_ISLE);
ARRIVED_AT_PRIMEVAL_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_RUNE_HARBOR_AFTER_ANCHORING_FOR_THREE_MINUTES); ARRIVED_AT_PRIMEVAL_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_RUNE_HARBOR_AFTER_ANCHORING_FOR_THREE_MINUTES);
LEAVING_PRIMEVAL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_PRIMEVAL_ISLE_FOR_RUNE_HARBOR); LEAVING_PRIMEVAL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_PRIMEVAL_ISLE_FOR_RUNE_HARBOR);
BUSY_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_PRIMEVAL_ISLE_TO_RUNE_HARBOR_HAS_BEEN_DELAYED); BUSY_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_PRIMEVAL_ISLE_TO_RUNE_HARBOR_HAS_BEEN_DELAYED);
RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ()); RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ());
PRIMEVAL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), PRIMEVAL_DOCK.getX(), PRIMEVAL_DOCK.getY(), PRIMEVAL_DOCK.getZ()); PRIMEVAL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), PRIMEVAL_DOCK.getX(), PRIMEVAL_DOCK.getY(), PRIMEVAL_DOCK.getZ());

View File

@@ -110,9 +110,7 @@ public class AnnouncementsTable
{ {
if (announce.isValid() && (announce.getType() == type)) if (announce.isValid() && (announce.getType() == type))
{ {
player.sendPacket(new CreatureSay(0, // player.sendPacket(new CreatureSay(null, type == AnnouncementType.CRITICAL ? ChatType.CRITICAL_ANNOUNCE : ChatType.ANNOUNCEMENT, player.getName(), announce.getContent()));
type == AnnouncementType.CRITICAL ? ChatType.CRITICAL_ANNOUNCE : ChatType.ANNOUNCEMENT, //
player.getName(), announce.getContent()));
} }
} }
} }

View File

@@ -179,7 +179,7 @@ public class FakePlayerChatManager implements IXmlReader
final Npc npc = spawn.getLastSpawn(); final Npc npc = spawn.getLastSpawn();
if (npc != null) if (npc != null)
{ {
player.sendPacket(new CreatureSay(npc, fpcName, ChatType.WHISPER, message)); player.sendPacket(new CreatureSay(npc, ChatType.WHISPER, fpcName, message));
} }
} }
} }

View File

@@ -339,7 +339,7 @@ public class PetitionManager
if ((currPetition.getPetitioner() != null) && (currPetition.getPetitioner().getObjectId() == player.getObjectId())) if ((currPetition.getPetitioner() != null) && (currPetition.getPetitioner().getObjectId() == player.getObjectId()))
{ {
cs = new CreatureSay(player.getObjectId(), ChatType.PETITION_PLAYER, player.getName(), messageText); cs = new CreatureSay(player, ChatType.PETITION_PLAYER, player.getName(), messageText);
currPetition.addLogMessage(cs); currPetition.addLogMessage(cs);
currPetition.sendResponderPacket(cs); currPetition.sendResponderPacket(cs);
@@ -349,7 +349,7 @@ public class PetitionManager
if ((currPetition.getResponder() != null) && (currPetition.getResponder().getObjectId() == player.getObjectId())) if ((currPetition.getResponder() != null) && (currPetition.getResponder().getObjectId() == player.getObjectId()))
{ {
cs = new CreatureSay(player.getObjectId(), ChatType.PETITION_GM, player.getName(), messageText); cs = new CreatureSay(player, ChatType.PETITION_GM, player.getName(), messageText);
currPetition.addLogMessage(cs); currPetition.addLogMessage(cs);
currPetition.sendResponderPacket(cs); currPetition.sendResponderPacket(cs);
@@ -423,7 +423,7 @@ public class PetitionManager
// Notify all GMs that a new petition has been submitted. // Notify all GMs that a new petition has been submitted.
final String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ")."; final String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ").";
AdminData.getInstance().broadcastToGMs(new CreatureSay(petitioner.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent)); AdminData.getInstance().broadcastToGMs(new CreatureSay(petitioner, ChatType.HERO_VOICE, "Petition System", msgContent));
return newPetitionId; return newPetitionId;
} }

View File

@@ -226,7 +226,7 @@ public class Attackable extends Npc
_commandChannelTimer = new CommandChannelTimer(this); _commandChannelTimer = new CommandChannelTimer(this);
_commandChannelLastAttack = System.currentTimeMillis(); _commandChannelLastAttack = System.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(0, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg _firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
} }
} }
} }

View File

@@ -185,7 +185,7 @@ public abstract class VoteSystem implements Runnable
private void announce(String msg) private void announce(String msg)
{ {
final CreatureSay cs = new CreatureSay(0, ChatType.CRITICAL_ANNOUNCE, "", msg); final CreatureSay cs = new CreatureSay(null, ChatType.CRITICAL_ANNOUNCE, "", msg);
Broadcast.toAllOnlinePlayers(cs); Broadcast.toAllOnlinePlayers(cs);
} }

View File

@@ -476,7 +476,7 @@ public class EnterWorld implements IClientIncomingPacket
if ((Config.SERVER_RESTART_SCHEDULE_ENABLED) && (Config.SERVER_RESTART_SCHEDULE_MESSAGE)) if ((Config.SERVER_RESTART_SCHEDULE_ENABLED) && (Config.SERVER_RESTART_SCHEDULE_MESSAGE))
{ {
player.sendPacket(new CreatureSay(2, ChatType.BATTLEFIELD, "[SERVER]", "Next restart is scheduled at " + ServerRestartManager.getInstance().getNextRestartTime() + ".")); player.sendPacket(new CreatureSay(null, ChatType.BATTLEFIELD, "[SERVER]", "Next restart is scheduled at " + ServerRestartManager.getInstance().getNextRestartTime() + "."));
} }
if (showClanNotice) if (showClanNotice)

View File

@@ -80,7 +80,7 @@ public class RequestPetitionCancel implements IClientIncomingPacket
// Notify all GMs that the player's pending petition has been cancelled. // Notify all GMs that the player's pending petition has been cancelled.
final String msgContent = player.getName() + " has canceled a pending petition."; final String msgContent = player.getName() + " has canceled a pending petition.";
AdminData.getInstance().broadcastToGMs(new CreatureSay(player.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent)); AdminData.getInstance().broadcastToGMs(new CreatureSay(player, ChatType.HERO_VOICE, "Petition System", msgContent));
} }
else else
{ {

View File

@@ -22,7 +22,7 @@ import java.util.List;
import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.MentorManager; import org.l2jmobius.gameserver.instancemanager.MentorManager;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId; import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -30,30 +30,29 @@ import org.l2jmobius.gameserver.network.SystemMessageId;
public class CreatureSay implements IClientOutgoingPacket public class CreatureSay implements IClientOutgoingPacket
{ {
private final int _objectId; private final Creature _sender;
private final ChatType _textType; private final ChatType _chatType;
private String _charName = null; private String _senderName = null;
private int _charId = 0;
private String _text = null; private String _text = null;
private int _npcString = -1; private int _charId = 0;
private int _messageId = -1;
private int _mask; private int _mask;
private int _charLevel = -1;
private List<String> _parameters; private List<String> _parameters;
/** /**
* @param sender * @param sender
* @param receiver * @param receiver
* @param name * @param name
* @param messageType * @param chatType
* @param text * @param text
*/ */
public CreatureSay(PlayerInstance sender, PlayerInstance receiver, String name, ChatType messageType, String text) public CreatureSay(PlayerInstance sender, PlayerInstance receiver, String name, ChatType chatType, String text)
{ {
_objectId = sender.getObjectId(); _sender = sender;
_charName = name; _senderName = name;
_charLevel = sender.getLevel(); _chatType = chatType;
_textType = messageType;
_text = text; _text = text;
if (receiver != null) if (receiver != null)
{ {
if (receiver.getFriendList().contains(sender.getObjectId())) if (receiver.getFriendList().contains(sender.getObjectId()))
@@ -81,66 +80,27 @@ public class CreatureSay implements IClientOutgoingPacket
} }
} }
/** public CreatureSay(Creature sender, ChatType chatType, String senderName, String text)
* Used by fake players.
* @param sender
* @param name
* @param messageType
* @param text
*/
public CreatureSay(Npc sender, String name, ChatType messageType, String text)
{ {
_objectId = sender.getObjectId(); _sender = sender;
_charName = name; _chatType = chatType;
_charLevel = sender.getLevel(); _senderName = senderName;
_textType = messageType;
_text = text; _text = text;
} }
/** public CreatureSay(Creature sender, ChatType chatType, NpcStringId npcStringId)
* @param objectId
* @param messageType
* @param charName
* @param text
*/
public CreatureSay(int objectId, ChatType messageType, String charName, String text)
{ {
_objectId = objectId; _sender = sender;
_textType = messageType; _chatType = chatType;
_charName = charName; _messageId = npcStringId.getId();
_text = text;
} }
public CreatureSay(PlayerInstance player, ChatType messageType, String text) public CreatureSay(ChatType chatType, int charId, SystemMessageId systemMessageId)
{ {
_objectId = player.getObjectId(); _sender = null;
_textType = messageType; _chatType = chatType;
_charName = player.getAppearance().getVisibleName();
_text = text;
}
public CreatureSay(int objectId, ChatType messageType, int charId, NpcStringId npcString)
{
_objectId = objectId;
_textType = messageType;
_charId = charId; _charId = charId;
_npcString = npcString.getId(); _messageId = systemMessageId.getId();
}
public CreatureSay(int objectId, ChatType messageType, String charName, NpcStringId npcString)
{
_objectId = objectId;
_textType = messageType;
_charName = charName;
_npcString = npcString.getId();
}
public CreatureSay(int objectId, ChatType messageType, int charId, SystemMessageId sysString)
{
_objectId = objectId;
_textType = messageType;
_charId = charId;
_npcString = sysString.getId();
} }
/** /**
@@ -161,26 +121,26 @@ public class CreatureSay implements IClientOutgoingPacket
{ {
OutgoingPackets.SAY2.writeId(packet); OutgoingPackets.SAY2.writeId(packet);
packet.writeD(_objectId); packet.writeD(_sender == null ? 0 : _sender.getObjectId());
packet.writeD(_textType.getClientId()); packet.writeD(_chatType.getClientId());
if (_charName != null) if (_senderName != null)
{ {
packet.writeS(_charName); packet.writeS(_senderName);
} }
else else
{ {
packet.writeD(_charId); packet.writeD(_charId);
} }
packet.writeD(_npcString); // High Five NPCString ID packet.writeD(_messageId); // High Five NPCString ID
if (_text != null) if (_text != null)
{ {
packet.writeS(_text); packet.writeS(_text);
if ((_charLevel > 0) && (_textType == ChatType.WHISPER)) if ((_sender != null) && (_sender.isPlayer() || _sender.isFakePlayer()) && (_chatType == ChatType.WHISPER))
{ {
packet.writeC(_mask); packet.writeC(_mask);
if ((_mask & 0x10) == 0) if ((_mask & 0x10) == 0)
{ {
packet.writeC(_charLevel); packet.writeC(_sender.getLevel());
} }
} }
} }
@@ -199,7 +159,7 @@ public class CreatureSay implements IClientOutgoingPacket
{ {
if (player != null) if (player != null)
{ {
player.broadcastSnoop(_textType, _charName, _text); player.broadcastSnoop(_chatType, _senderName, _text);
} }
} }
} }

View File

@@ -184,7 +184,7 @@ public class Broadcast
public static void toAllOnlinePlayers(String text, boolean isCritical) public static void toAllOnlinePlayers(String text, boolean isCritical)
{ {
toAllOnlinePlayers(new CreatureSay(0, isCritical ? ChatType.CRITICAL_ANNOUNCE : ChatType.ANNOUNCEMENT, "", text)); toAllOnlinePlayers(new CreatureSay(null, isCritical ? ChatType.CRITICAL_ANNOUNCE : ChatType.ANNOUNCEMENT, "", text));
} }
public static void toAllOnlinePlayersOnScreen(String text) public static void toAllOnlinePlayersOnScreen(String text)

View File

@@ -41,7 +41,7 @@ public class BuilderUtil
{ {
if (Config.GM_STARTUP_BUILDER_HIDE) if (Config.GM_STARTUP_BUILDER_HIDE)
{ {
player.sendPacket(new CreatureSay(0, ChatType.GENERAL, "SYS", message)); player.sendPacket(new CreatureSay(null, ChatType.GENERAL, "SYS", message));
} }
else else
{ {
@@ -56,7 +56,7 @@ public class BuilderUtil
*/ */
public static void sendHtmlMessage(PlayerInstance player, String message) public static void sendHtmlMessage(PlayerInstance player, String message)
{ {
player.sendPacket(new CreatureSay(0, ChatType.GENERAL, "HTML", message)); player.sendPacket(new CreatureSay(null, ChatType.GENERAL, "HTML", message));
} }
/** /**

View File

@@ -95,8 +95,7 @@ public class PolymorphingOnAttack extends AbstractNpcAI
if (tmp.get(3) >= 0) if (tmp.get(3) >= 0)
{ {
final NpcStringId npcString = MOBTEXTS[tmp.get(3)][getRandom(MOBTEXTS[tmp.get(3)].length)]; final NpcStringId npcString = MOBTEXTS[tmp.get(3)][getRandom(MOBTEXTS[tmp.get(3)].length)];
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), npcString)); npc.broadcastPacket(new CreatureSay(npc, ChatType.NPC_GENERAL, npcString));
} }
npc.deleteMe(); npc.deleteMe();
final Attackable newNpc = (Attackable) addSpawn(tmp.get(0), npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true); final Attackable newNpc = (Attackable) addSpawn(tmp.get(0), npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true);

View File

@@ -380,7 +380,7 @@ public class Race extends Event
private void sendMessage(PlayerInstance player, String text) private void sendMessage(PlayerInstance player, String text)
{ {
player.sendPacket(new CreatureSay(_npc.getObjectId(), ChatType.MPCC_ROOM, _npc.getName(), text)); player.sendPacket(new CreatureSay(_npc, ChatType.MPCC_ROOM, _npc.getName(), text));
} }
private void showMenu(PlayerInstance player) private void showMenu(PlayerInstance player)

View File

@@ -123,7 +123,7 @@ public class FreyaCelebration extends LongTimeEvent
{ {
if (getRandom(100) < 5) if (getRandom(100) < 5)
{ {
final CreatureSay cs = new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), NpcStringId.DEAR_S1_THINK_OF_THIS_AS_MY_APPRECIATION_FOR_THE_GIFT_TAKE_THIS_WITH_YOU_THERE_S_NOTHING_STRANGE_ABOUT_IT_IT_S_JUST_A_BIT_OF_MY_CAPRICIOUSNESS); final CreatureSay cs = new CreatureSay(npc, ChatType.NPC_GENERAL, NpcStringId.DEAR_S1_THINK_OF_THIS_AS_MY_APPRECIATION_FOR_THE_GIFT_TAKE_THIS_WITH_YOU_THERE_S_NOTHING_STRANGE_ABOUT_IT_IT_S_JUST_A_BIT_OF_MY_CAPRICIOUSNESS);
cs.addStringParameter(caster.getName()); cs.addStringParameter(caster.getName());
npc.broadcastPacket(cs); npc.broadcastPacket(cs);
@@ -132,7 +132,7 @@ public class FreyaCelebration extends LongTimeEvent
} }
else if (getRandom(10) < 2) else if (getRandom(10) < 2)
{ {
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), getRandomEntry(FREYA_TEXT))); npc.broadcastPacket(new CreatureSay(npc, ChatType.NPC_GENERAL, getRandomEntry(FREYA_TEXT)));
} }
} }
return super.onSkillSee(npc, caster, skill, targets, isSummon); return super.onSkillSee(npc, caster, skill, targets, isSummon);

View File

@@ -296,7 +296,7 @@ public class AdminAdmin implements IAdminCommandHandler
sb.append(" "); sb.append(" ");
} }
final CreatureSay cs = new CreatureSay(activeChar, ChatType.WORLD, sb.toString()); final CreatureSay cs = new CreatureSay(activeChar, ChatType.WORLD, activeChar.getName(), sb.toString());
World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo); World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
break; break;
} }

View File

@@ -113,7 +113,7 @@ public class AdminGmChat implements IAdminCommandHandler
offset = 13; offset = 13;
} }
text = command.substring(offset); text = command.substring(offset);
final CreatureSay cs = new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(null, ChatType.ALLIANCE, activeChar.getName(), text);
AdminData.getInstance().broadcastToGMs(cs); AdminData.getInstance().broadcastToGMs(cs);
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)

View File

@@ -53,7 +53,7 @@ public class AdminTargetSay implements IAdminCommandHandler
final String message = command.substring(16); final String message = command.substring(16);
final Creature target = (Creature) obj; final Creature target = (Creature) obj;
target.broadcastPacket(new CreatureSay(target.getObjectId(), target.isPlayer() ? ChatType.GENERAL : ChatType.NPC_GENERAL, target.getName(), message)); target.broadcastPacket(new CreatureSay(target, target.isPlayer() ? ChatType.GENERAL : ChatType.NPC_GENERAL, target.getName(), message));
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {

View File

@@ -124,7 +124,7 @@ public class FindPvP implements IBypassHandler
if (biggestAllyId == allyId) if (biggestAllyId == allyId)
{ {
player.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, your clan/ally is outnumbering the place already so you can't move there.")); player.sendPacket(new CreatureSay(null, ChatType.WHISPER, target.getName(), "Sorry, your clan/ally is outnumbering the place already so you can't move there."));
return true; return true;
} }
} }
@@ -139,7 +139,7 @@ public class FindPvP implements IBypassHandler
} }
else else
{ {
player.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, I can't find anyone in flag status right now.")); player.sendPacket(new CreatureSay(null, ChatType.WHISPER, target.getName(), "Sorry, I can't find anyone in flag status right now."));
} }
return false; return false;
} }

View File

@@ -53,7 +53,7 @@ public class ChatAlliance implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getClan().broadcastToOnlineAllyMembers(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text)); activeChar.getClan().broadcastToOnlineAllyMembers(new CreatureSay(activeChar, type, activeChar.getName(), text));
} }
@Override @Override

View File

@@ -54,7 +54,7 @@ public class ChatClan implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getClan().broadcastCSToOnlineMembers(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getClan().broadcastCSToOnlineMembers(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
@Override @Override

View File

@@ -87,8 +87,8 @@ public class ChatGeneral implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getAppearance().getVisibleName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getAppearance().getVisibleName(), text);
final CreatureSay csRandom = new CreatureSay(activeChar.getObjectId(), type, activeChar.getAppearance().getVisibleName(), ChatRandomizer.randomize(text)); final CreatureSay csRandom = new CreatureSay(activeChar, type, activeChar.getAppearance().getVisibleName(), ChatRandomizer.randomize(text));
World.getInstance().forEachVisibleObjectInRange(activeChar, PlayerInstance.class, 1250, player -> World.getInstance().forEachVisibleObjectInRange(activeChar, PlayerInstance.class, 1250, player ->
{ {
if ((player != null) && !BlockList.isBlocked(player, activeChar)) if ((player != null) && !BlockList.isBlocked(player, activeChar))

View File

@@ -62,7 +62,7 @@ public class ChatHeroVoice implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
for (PlayerInstance player : World.getInstance().getPlayers()) for (PlayerInstance player : World.getInstance().getPlayers())
{ {
if ((player != null) && !BlockList.isBlocked(player, activeChar)) if ((player != null) && !BlockList.isBlocked(player, activeChar))

View File

@@ -54,7 +54,7 @@ public class ChatParty implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getParty().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getParty().broadcastCreatureSay(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
@Override @Override

View File

@@ -53,7 +53,7 @@ public class ChatPartyMatchRoom implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
for (PlayerInstance _member : room.getMembers()) for (PlayerInstance _member : room.getMembers())
{ {
if (Config.FACTION_SYSTEM_ENABLED) if (Config.FACTION_SYSTEM_ENABLED)

View File

@@ -50,7 +50,7 @@ public class ChatPartyRoomAll implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
} }

View File

@@ -50,7 +50,7 @@ public class ChatPartyRoomCommander implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
} }

View File

@@ -58,7 +58,7 @@ public class ChatShout implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS))) if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS)))
{ {
final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar); final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar);

View File

@@ -58,7 +58,7 @@ public class ChatTrade implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS))) if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS)))
{ {
final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar); final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar);

View File

@@ -93,7 +93,7 @@ public class ChatWorld implements IChatHandler
} }
} }
final CreatureSay cs = new CreatureSay(activeChar, type, text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_SPECIFIC_CHAT) if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_SPECIFIC_CHAT)
{ {
if (activeChar.isGood()) if (activeChar.isGood())

View File

@@ -52,7 +52,7 @@ public class GMChat implements ITelnetCommand
{ {
sb.append(str + " "); sb.append(str + " ");
} }
AdminData.getInstance().broadcastToGMs(new CreatureSay(0, ChatType.ALLIANCE, "Telnet GM Broadcast", sb.toString())); AdminData.getInstance().broadcastToGMs(new CreatureSay(null, ChatType.ALLIANCE, "Telnet GM Broadcast", sb.toString()));
return "GMChat sent!"; return "GMChat sent!";
} }
} }

View File

@@ -56,7 +56,7 @@ public class Msg implements ITelnetCommand
{ {
sb.append(args[i] + " "); sb.append(args[i] + " ");
} }
player.sendPacket(new CreatureSay(0, ChatType.WHISPER, "Telnet Priv", sb.toString())); player.sendPacket(new CreatureSay(null, ChatType.WHISPER, "Telnet Priv", sb.toString()));
return "Announcement sent!"; return "Announcement sent!";
} }
return "Couldn't find player with such name."; return "Couldn't find player with such name.";

View File

@@ -145,7 +145,7 @@ public class Q00457_LostAndFound extends Quest
startQuestTimer("STOP", 1000, npc, player); startQuestTimer("STOP", 1000, npc, player);
startQuestTimer("BYE", 3000, npc, player); startQuestTimer("BYE", 3000, npc, player);
cancelQuestTimer("CHECK", npc, player); cancelQuestTimer("CHECK", npc, player);
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), NpcStringId.AH_FRESH_AIR)); npc.broadcastPacket(new CreatureSay(npc, ChatType.NPC_GENERAL, NpcStringId.AH_FRESH_AIR));
broadcastNpcSay(npc, player, NpcStringId.AH_FRESH_AIR, false); broadcastNpcSay(npc, player, NpcStringId.AH_FRESH_AIR, false);
giveItems(player, PACKAGED_BOOK, 1); giveItems(player, PACKAGED_BOOK, 1);
qs.exitQuest(QuestType.DAILY, true); qs.exitQuest(QuestType.DAILY, true);

View File

@@ -138,29 +138,29 @@ public class BoatGludinRune implements Runnable
{ {
_boat = boat; _boat = boat;
ARRIVED_AT_GLUDIN = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_GLUDIN_HARBOR); ARRIVED_AT_GLUDIN = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_GLUDIN_HARBOR);
ARRIVED_AT_GLUDIN_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_AFTER_ANCHORING_FOR_TEN_MINUTES); ARRIVED_AT_GLUDIN_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_AFTER_ANCHORING_FOR_TEN_MINUTES);
LEAVE_GLUDIN5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES); LEAVE_GLUDIN5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES);
LEAVE_GLUDIN1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE); LEAVE_GLUDIN1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE);
LEAVE_GLUDIN0 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY_2); LEAVE_GLUDIN0 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY_2);
LEAVING_GLUDIN = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE); LEAVING_GLUDIN = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE);
ARRIVED_AT_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR); ARRIVED_AT_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR);
ARRIVED_AT_RUNE_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_GLUDIN_HARBOR_AFTER_ANCHORING_FOR_TEN_MINUTES); ARRIVED_AT_RUNE_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_GLUDIN_HARBOR_AFTER_ANCHORING_FOR_TEN_MINUTES);
LEAVE_RUNE5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES); LEAVE_RUNE5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES);
LEAVE_RUNE1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE); LEAVE_RUNE1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE);
LEAVE_RUNE0 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY); LEAVE_RUNE0 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY);
LEAVING_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE); LEAVING_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE);
BUSY_GLUDIN = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_TO_GLUDIN_HARBOR_HAS_BEEN_DELAYED); BUSY_GLUDIN = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_TO_GLUDIN_HARBOR_HAS_BEEN_DELAYED);
BUSY_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_TO_RUNE_HARBOR_HAS_BEEN_DELAYED); BUSY_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_TO_RUNE_HARBOR_HAS_BEEN_DELAYED);
ARRIVAL_RUNE15 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_15_MINUTES); ARRIVAL_RUNE15 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_15_MINUTES);
ARRIVAL_RUNE10 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_10_MINUTES); ARRIVAL_RUNE10 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_10_MINUTES);
ARRIVAL_RUNE5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_5_MINUTES); ARRIVAL_RUNE5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_5_MINUTES);
ARRIVAL_RUNE1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_1_MINUTE); ARRIVAL_RUNE1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_1_MINUTE);
ARRIVAL_GLUDIN15 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_15_MINUTES); ARRIVAL_GLUDIN15 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_15_MINUTES);
ARRIVAL_GLUDIN10 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_10_MINUTES); ARRIVAL_GLUDIN10 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_10_MINUTES);
ARRIVAL_GLUDIN5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_5_MINUTES); ARRIVAL_GLUDIN5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_5_MINUTES);
ARRIVAL_GLUDIN1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_1_MINUTE); ARRIVAL_GLUDIN1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_1_MINUTE);
GLUDIN_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), GLUDIN_DOCK[0].getX(), GLUDIN_DOCK[0].getY(), GLUDIN_DOCK[0].getZ()); GLUDIN_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), GLUDIN_DOCK[0].getX(), GLUDIN_DOCK[0].getY(), GLUDIN_DOCK[0].getZ());
RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ()); RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ());

View File

@@ -94,17 +94,17 @@ public class BoatInnadrilTour implements Runnable
{ {
_boat = boat; _boat = boat;
ARRIVED_AT_INNADRIL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_HAS_ARRIVED_IT_WILL_ANCHOR_FOR_TEN_MINUTES); ARRIVED_AT_INNADRIL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_HAS_ARRIVED_IT_WILL_ANCHOR_FOR_TEN_MINUTES);
LEAVE_INNADRIL5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_FIVE_MINUTES); LEAVE_INNADRIL5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_FIVE_MINUTES);
LEAVE_INNADRIL1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_ONE_MINUTE); LEAVE_INNADRIL1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_ONE_MINUTE);
LEAVE_INNADRIL0 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_BE_LEAVING_SOON); LEAVE_INNADRIL0 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_BE_LEAVING_SOON);
LEAVING_INNADRIL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_IS_LEAVING); LEAVING_INNADRIL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_IS_LEAVING);
ARRIVAL20 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_20_MINUTES); ARRIVAL20 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_20_MINUTES);
ARRIVAL15 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_15_MINUTES); ARRIVAL15 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_15_MINUTES);
ARRIVAL10 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_10_MINUTES); ARRIVAL10 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_10_MINUTES);
ARRIVAL5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_5_MINUTES); ARRIVAL5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_5_MINUTES);
ARRIVAL1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_1_MINUTE); ARRIVAL1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_1_MINUTE);
INNADRIL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), DOCK.getX(), DOCK.getY(), DOCK.getZ()); INNADRIL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), DOCK.getX(), DOCK.getY(), DOCK.getZ());
} }

View File

@@ -90,13 +90,13 @@ public class BoatRunePrimeval implements Runnable
{ {
_boat = boat; _boat = boat;
ARRIVED_AT_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR); ARRIVED_AT_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR);
ARRIVED_AT_RUNE_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_PRIMEVAL_ISLE_AFTER_ANCHORING_FOR_THREE_MINUTES); ARRIVED_AT_RUNE_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_PRIMEVAL_ISLE_AFTER_ANCHORING_FOR_THREE_MINUTES);
LEAVING_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_RUNE_HARBOR_FOR_PRIMEVAL_ISLE); LEAVING_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_RUNE_HARBOR_FOR_PRIMEVAL_ISLE);
ARRIVED_AT_PRIMEVAL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_PRIMEVAL_ISLE); ARRIVED_AT_PRIMEVAL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_PRIMEVAL_ISLE);
ARRIVED_AT_PRIMEVAL_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_RUNE_HARBOR_AFTER_ANCHORING_FOR_THREE_MINUTES); ARRIVED_AT_PRIMEVAL_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_RUNE_HARBOR_AFTER_ANCHORING_FOR_THREE_MINUTES);
LEAVING_PRIMEVAL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_PRIMEVAL_ISLE_FOR_RUNE_HARBOR); LEAVING_PRIMEVAL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_PRIMEVAL_ISLE_FOR_RUNE_HARBOR);
BUSY_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_PRIMEVAL_ISLE_TO_RUNE_HARBOR_HAS_BEEN_DELAYED); BUSY_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_PRIMEVAL_ISLE_TO_RUNE_HARBOR_HAS_BEEN_DELAYED);
RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ()); RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ());
PRIMEVAL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), PRIMEVAL_DOCK.getX(), PRIMEVAL_DOCK.getY(), PRIMEVAL_DOCK.getZ()); PRIMEVAL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), PRIMEVAL_DOCK.getX(), PRIMEVAL_DOCK.getY(), PRIMEVAL_DOCK.getZ());

View File

@@ -110,9 +110,7 @@ public class AnnouncementsTable
{ {
if (announce.isValid() && (announce.getType() == type)) if (announce.isValid() && (announce.getType() == type))
{ {
player.sendPacket(new CreatureSay(0, // player.sendPacket(new CreatureSay(null, type == AnnouncementType.CRITICAL ? ChatType.CRITICAL_ANNOUNCE : ChatType.ANNOUNCEMENT, player.getName(), announce.getContent()));
type == AnnouncementType.CRITICAL ? ChatType.CRITICAL_ANNOUNCE : ChatType.ANNOUNCEMENT, //
player.getName(), announce.getContent()));
} }
} }
} }

View File

@@ -179,7 +179,7 @@ public class FakePlayerChatManager implements IXmlReader
final Npc npc = spawn.getLastSpawn(); final Npc npc = spawn.getLastSpawn();
if (npc != null) if (npc != null)
{ {
player.sendPacket(new CreatureSay(npc, fpcName, ChatType.WHISPER, message)); player.sendPacket(new CreatureSay(npc, ChatType.WHISPER, fpcName, message));
} }
} }
} }

View File

@@ -339,7 +339,7 @@ public class PetitionManager
if ((currPetition.getPetitioner() != null) && (currPetition.getPetitioner().getObjectId() == player.getObjectId())) if ((currPetition.getPetitioner() != null) && (currPetition.getPetitioner().getObjectId() == player.getObjectId()))
{ {
cs = new CreatureSay(player.getObjectId(), ChatType.PETITION_PLAYER, player.getName(), messageText); cs = new CreatureSay(player, ChatType.PETITION_PLAYER, player.getName(), messageText);
currPetition.addLogMessage(cs); currPetition.addLogMessage(cs);
currPetition.sendResponderPacket(cs); currPetition.sendResponderPacket(cs);
@@ -349,7 +349,7 @@ public class PetitionManager
if ((currPetition.getResponder() != null) && (currPetition.getResponder().getObjectId() == player.getObjectId())) if ((currPetition.getResponder() != null) && (currPetition.getResponder().getObjectId() == player.getObjectId()))
{ {
cs = new CreatureSay(player.getObjectId(), ChatType.PETITION_GM, player.getName(), messageText); cs = new CreatureSay(player, ChatType.PETITION_GM, player.getName(), messageText);
currPetition.addLogMessage(cs); currPetition.addLogMessage(cs);
currPetition.sendResponderPacket(cs); currPetition.sendResponderPacket(cs);
@@ -423,7 +423,7 @@ public class PetitionManager
// Notify all GMs that a new petition has been submitted. // Notify all GMs that a new petition has been submitted.
final String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ")."; final String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ").";
AdminData.getInstance().broadcastToGMs(new CreatureSay(petitioner.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent)); AdminData.getInstance().broadcastToGMs(new CreatureSay(petitioner, ChatType.HERO_VOICE, "Petition System", msgContent));
return newPetitionId; return newPetitionId;
} }

View File

@@ -222,7 +222,7 @@ public class Attackable extends Npc
_commandChannelTimer = new CommandChannelTimer(this); _commandChannelTimer = new CommandChannelTimer(this);
_commandChannelLastAttack = System.currentTimeMillis(); _commandChannelLastAttack = System.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(0, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg _firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
} }
} }
} }

View File

@@ -185,7 +185,7 @@ public abstract class VoteSystem implements Runnable
private void announce(String msg) private void announce(String msg)
{ {
final CreatureSay cs = new CreatureSay(0, ChatType.CRITICAL_ANNOUNCE, "", msg); final CreatureSay cs = new CreatureSay(null, ChatType.CRITICAL_ANNOUNCE, "", msg);
Broadcast.toAllOnlinePlayers(cs); Broadcast.toAllOnlinePlayers(cs);
} }

View File

@@ -481,7 +481,7 @@ public class EnterWorld implements IClientIncomingPacket
if ((Config.SERVER_RESTART_SCHEDULE_ENABLED) && (Config.SERVER_RESTART_SCHEDULE_MESSAGE)) if ((Config.SERVER_RESTART_SCHEDULE_ENABLED) && (Config.SERVER_RESTART_SCHEDULE_MESSAGE))
{ {
player.sendPacket(new CreatureSay(2, ChatType.BATTLEFIELD, "[SERVER]", "Next restart is scheduled at " + ServerRestartManager.getInstance().getNextRestartTime() + ".")); player.sendPacket(new CreatureSay(null, ChatType.BATTLEFIELD, "[SERVER]", "Next restart is scheduled at " + ServerRestartManager.getInstance().getNextRestartTime() + "."));
} }
if (showClanNotice) if (showClanNotice)

View File

@@ -80,7 +80,7 @@ public class RequestPetitionCancel implements IClientIncomingPacket
// Notify all GMs that the player's pending petition has been cancelled. // Notify all GMs that the player's pending petition has been cancelled.
final String msgContent = player.getName() + " has canceled a pending petition."; final String msgContent = player.getName() + " has canceled a pending petition.";
AdminData.getInstance().broadcastToGMs(new CreatureSay(player.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent)); AdminData.getInstance().broadcastToGMs(new CreatureSay(player, ChatType.HERO_VOICE, "Petition System", msgContent));
} }
else else
{ {

View File

@@ -22,7 +22,7 @@ import java.util.List;
import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.MentorManager; import org.l2jmobius.gameserver.instancemanager.MentorManager;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId; import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -30,30 +30,29 @@ import org.l2jmobius.gameserver.network.SystemMessageId;
public class CreatureSay implements IClientOutgoingPacket public class CreatureSay implements IClientOutgoingPacket
{ {
private final int _objectId; private final Creature _sender;
private final ChatType _textType; private final ChatType _chatType;
private String _charName = null; private String _senderName = null;
private int _charId = 0;
private String _text = null; private String _text = null;
private int _npcString = -1; private int _charId = 0;
private int _messageId = -1;
private int _mask; private int _mask;
private int _charLevel = -1;
private List<String> _parameters; private List<String> _parameters;
/** /**
* @param sender * @param sender
* @param receiver * @param receiver
* @param name * @param name
* @param messageType * @param chatType
* @param text * @param text
*/ */
public CreatureSay(PlayerInstance sender, PlayerInstance receiver, String name, ChatType messageType, String text) public CreatureSay(PlayerInstance sender, PlayerInstance receiver, String name, ChatType chatType, String text)
{ {
_objectId = sender.getObjectId(); _sender = sender;
_charName = name; _senderName = name;
_charLevel = sender.getLevel(); _chatType = chatType;
_textType = messageType;
_text = text; _text = text;
if (receiver != null) if (receiver != null)
{ {
if (receiver.getFriendList().contains(sender.getObjectId())) if (receiver.getFriendList().contains(sender.getObjectId()))
@@ -81,66 +80,27 @@ public class CreatureSay implements IClientOutgoingPacket
} }
} }
/** public CreatureSay(Creature sender, ChatType chatType, String senderName, String text)
* Used by fake players.
* @param sender
* @param name
* @param messageType
* @param text
*/
public CreatureSay(Npc sender, String name, ChatType messageType, String text)
{ {
_objectId = sender.getObjectId(); _sender = sender;
_charName = name; _chatType = chatType;
_charLevel = sender.getLevel(); _senderName = senderName;
_textType = messageType;
_text = text; _text = text;
} }
/** public CreatureSay(Creature sender, ChatType chatType, NpcStringId npcStringId)
* @param objectId
* @param messageType
* @param charName
* @param text
*/
public CreatureSay(int objectId, ChatType messageType, String charName, String text)
{ {
_objectId = objectId; _sender = sender;
_textType = messageType; _chatType = chatType;
_charName = charName; _messageId = npcStringId.getId();
_text = text;
} }
public CreatureSay(PlayerInstance player, ChatType messageType, String text) public CreatureSay(ChatType chatType, int charId, SystemMessageId systemMessageId)
{ {
_objectId = player.getObjectId(); _sender = null;
_textType = messageType; _chatType = chatType;
_charName = player.getAppearance().getVisibleName();
_text = text;
}
public CreatureSay(int objectId, ChatType messageType, int charId, NpcStringId npcString)
{
_objectId = objectId;
_textType = messageType;
_charId = charId; _charId = charId;
_npcString = npcString.getId(); _messageId = systemMessageId.getId();
}
public CreatureSay(int objectId, ChatType messageType, String charName, NpcStringId npcString)
{
_objectId = objectId;
_textType = messageType;
_charName = charName;
_npcString = npcString.getId();
}
public CreatureSay(int objectId, ChatType messageType, int charId, SystemMessageId sysString)
{
_objectId = objectId;
_textType = messageType;
_charId = charId;
_npcString = sysString.getId();
} }
/** /**
@@ -161,26 +121,26 @@ public class CreatureSay implements IClientOutgoingPacket
{ {
OutgoingPackets.SAY2.writeId(packet); OutgoingPackets.SAY2.writeId(packet);
packet.writeD(_objectId); packet.writeD(_sender == null ? 0 : _sender.getObjectId());
packet.writeD(_textType.getClientId()); packet.writeD(_chatType.getClientId());
if (_charName != null) if (_senderName != null)
{ {
packet.writeS(_charName); packet.writeS(_senderName);
} }
else else
{ {
packet.writeD(_charId); packet.writeD(_charId);
} }
packet.writeD(_npcString); // High Five NPCString ID packet.writeD(_messageId); // High Five NPCString ID
if (_text != null) if (_text != null)
{ {
packet.writeS(_text); packet.writeS(_text);
if ((_charLevel > 0) && (_textType == ChatType.WHISPER)) if ((_sender != null) && (_sender.isPlayer() || _sender.isFakePlayer()) && (_chatType == ChatType.WHISPER))
{ {
packet.writeC(_mask); packet.writeC(_mask);
if ((_mask & 0x10) == 0) if ((_mask & 0x10) == 0)
{ {
packet.writeC(_charLevel); packet.writeC(_sender.getLevel());
} }
} }
} }
@@ -199,7 +159,7 @@ public class CreatureSay implements IClientOutgoingPacket
{ {
if (player != null) if (player != null)
{ {
player.broadcastSnoop(_textType, _charName, _text); player.broadcastSnoop(_chatType, _senderName, _text);
} }
} }
} }

View File

@@ -184,7 +184,7 @@ public class Broadcast
public static void toAllOnlinePlayers(String text, boolean isCritical) public static void toAllOnlinePlayers(String text, boolean isCritical)
{ {
toAllOnlinePlayers(new CreatureSay(0, isCritical ? ChatType.CRITICAL_ANNOUNCE : ChatType.ANNOUNCEMENT, "", text)); toAllOnlinePlayers(new CreatureSay(null, isCritical ? ChatType.CRITICAL_ANNOUNCE : ChatType.ANNOUNCEMENT, "", text));
} }
public static void toAllOnlinePlayersOnScreen(String text) public static void toAllOnlinePlayersOnScreen(String text)

View File

@@ -41,7 +41,7 @@ public class BuilderUtil
{ {
if (Config.GM_STARTUP_BUILDER_HIDE) if (Config.GM_STARTUP_BUILDER_HIDE)
{ {
player.sendPacket(new CreatureSay(0, ChatType.GENERAL, "SYS", message)); player.sendPacket(new CreatureSay(null, ChatType.GENERAL, "SYS", message));
} }
else else
{ {
@@ -56,7 +56,7 @@ public class BuilderUtil
*/ */
public static void sendHtmlMessage(PlayerInstance player, String message) public static void sendHtmlMessage(PlayerInstance player, String message)
{ {
player.sendPacket(new CreatureSay(0, ChatType.GENERAL, "HTML", message)); player.sendPacket(new CreatureSay(null, ChatType.GENERAL, "HTML", message));
} }
/** /**

View File

@@ -95,8 +95,7 @@ public class PolymorphingOnAttack extends AbstractNpcAI
if (tmp.get(3) >= 0) if (tmp.get(3) >= 0)
{ {
final NpcStringId npcString = MOBTEXTS[tmp.get(3)][getRandom(MOBTEXTS[tmp.get(3)].length)]; final NpcStringId npcString = MOBTEXTS[tmp.get(3)][getRandom(MOBTEXTS[tmp.get(3)].length)];
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), npcString)); npc.broadcastPacket(new CreatureSay(npc, ChatType.NPC_GENERAL, npcString));
} }
npc.deleteMe(); npc.deleteMe();
final Attackable newNpc = (Attackable) addSpawn(tmp.get(0), npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true); final Attackable newNpc = (Attackable) addSpawn(tmp.get(0), npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true);

View File

@@ -380,7 +380,7 @@ public class Race extends Event
private void sendMessage(PlayerInstance player, String text) private void sendMessage(PlayerInstance player, String text)
{ {
player.sendPacket(new CreatureSay(_npc.getObjectId(), ChatType.MPCC_ROOM, _npc.getName(), text)); player.sendPacket(new CreatureSay(_npc, ChatType.MPCC_ROOM, _npc.getName(), text));
} }
private void showMenu(PlayerInstance player) private void showMenu(PlayerInstance player)

View File

@@ -123,7 +123,7 @@ public class FreyaCelebration extends LongTimeEvent
{ {
if (getRandom(100) < 5) if (getRandom(100) < 5)
{ {
final CreatureSay cs = new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), NpcStringId.DEAR_S1_THINK_OF_THIS_AS_MY_APPRECIATION_FOR_THE_GIFT_TAKE_THIS_WITH_YOU_THERE_S_NOTHING_STRANGE_ABOUT_IT_IT_S_JUST_A_BIT_OF_MY_CAPRICIOUSNESS); final CreatureSay cs = new CreatureSay(npc, ChatType.NPC_GENERAL, NpcStringId.DEAR_S1_THINK_OF_THIS_AS_MY_APPRECIATION_FOR_THE_GIFT_TAKE_THIS_WITH_YOU_THERE_S_NOTHING_STRANGE_ABOUT_IT_IT_S_JUST_A_BIT_OF_MY_CAPRICIOUSNESS);
cs.addStringParameter(caster.getName()); cs.addStringParameter(caster.getName());
npc.broadcastPacket(cs); npc.broadcastPacket(cs);
@@ -132,7 +132,7 @@ public class FreyaCelebration extends LongTimeEvent
} }
else if (getRandom(10) < 2) else if (getRandom(10) < 2)
{ {
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), getRandomEntry(FREYA_TEXT))); npc.broadcastPacket(new CreatureSay(npc, ChatType.NPC_GENERAL, getRandomEntry(FREYA_TEXT)));
} }
} }
return super.onSkillSee(npc, caster, skill, targets, isSummon); return super.onSkillSee(npc, caster, skill, targets, isSummon);

View File

@@ -296,7 +296,7 @@ public class AdminAdmin implements IAdminCommandHandler
sb.append(" "); sb.append(" ");
} }
final CreatureSay cs = new CreatureSay(activeChar, ChatType.WORLD, sb.toString()); final CreatureSay cs = new CreatureSay(activeChar, ChatType.WORLD, activeChar.getName(), sb.toString());
World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo); World.getInstance().getPlayers().stream().filter(activeChar::isNotBlocked).forEach(cs::sendTo);
break; break;
} }

View File

@@ -113,7 +113,7 @@ public class AdminGmChat implements IAdminCommandHandler
offset = 13; offset = 13;
} }
text = command.substring(offset); text = command.substring(offset);
final CreatureSay cs = new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(null, ChatType.ALLIANCE, activeChar.getName(), text);
AdminData.getInstance().broadcastToGMs(cs); AdminData.getInstance().broadcastToGMs(cs);
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)

View File

@@ -53,7 +53,7 @@ public class AdminTargetSay implements IAdminCommandHandler
final String message = command.substring(16); final String message = command.substring(16);
final Creature target = (Creature) obj; final Creature target = (Creature) obj;
target.broadcastPacket(new CreatureSay(target.getObjectId(), target.isPlayer() ? ChatType.GENERAL : ChatType.NPC_GENERAL, target.getName(), message)); target.broadcastPacket(new CreatureSay(target, target.isPlayer() ? ChatType.GENERAL : ChatType.NPC_GENERAL, target.getName(), message));
} }
catch (StringIndexOutOfBoundsException e) catch (StringIndexOutOfBoundsException e)
{ {

View File

@@ -124,7 +124,7 @@ public class FindPvP implements IBypassHandler
if (biggestAllyId == allyId) if (biggestAllyId == allyId)
{ {
player.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, your clan/ally is outnumbering the place already so you can't move there.")); player.sendPacket(new CreatureSay(null, ChatType.WHISPER, target.getName(), "Sorry, your clan/ally is outnumbering the place already so you can't move there."));
return true; return true;
} }
} }
@@ -139,7 +139,7 @@ public class FindPvP implements IBypassHandler
} }
else else
{ {
player.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, I can't find anyone in flag status right now.")); player.sendPacket(new CreatureSay(null, ChatType.WHISPER, target.getName(), "Sorry, I can't find anyone in flag status right now."));
} }
return false; return false;
} }

View File

@@ -53,7 +53,7 @@ public class ChatAlliance implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getClan().broadcastToOnlineAllyMembers(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text)); activeChar.getClan().broadcastToOnlineAllyMembers(new CreatureSay(activeChar, type, activeChar.getName(), text));
} }
@Override @Override

View File

@@ -54,7 +54,7 @@ public class ChatClan implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getClan().broadcastCSToOnlineMembers(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getClan().broadcastCSToOnlineMembers(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
@Override @Override

View File

@@ -87,8 +87,8 @@ public class ChatGeneral implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getAppearance().getVisibleName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getAppearance().getVisibleName(), text);
final CreatureSay csRandom = new CreatureSay(activeChar.getObjectId(), type, activeChar.getAppearance().getVisibleName(), ChatRandomizer.randomize(text)); final CreatureSay csRandom = new CreatureSay(activeChar, type, activeChar.getAppearance().getVisibleName(), ChatRandomizer.randomize(text));
World.getInstance().forEachVisibleObjectInRange(activeChar, PlayerInstance.class, 1250, player -> World.getInstance().forEachVisibleObjectInRange(activeChar, PlayerInstance.class, 1250, player ->
{ {
if ((player != null) && !BlockList.isBlocked(player, activeChar)) if ((player != null) && !BlockList.isBlocked(player, activeChar))

View File

@@ -62,7 +62,7 @@ public class ChatHeroVoice implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
for (PlayerInstance player : World.getInstance().getPlayers()) for (PlayerInstance player : World.getInstance().getPlayers())
{ {
if ((player != null) && !BlockList.isBlocked(player, activeChar)) if ((player != null) && !BlockList.isBlocked(player, activeChar))

View File

@@ -54,7 +54,7 @@ public class ChatParty implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getParty().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getParty().broadcastCreatureSay(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
@Override @Override

View File

@@ -53,7 +53,7 @@ public class ChatPartyMatchRoom implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
for (PlayerInstance _member : room.getMembers()) for (PlayerInstance _member : room.getMembers())
{ {
if (Config.FACTION_SYSTEM_ENABLED) if (Config.FACTION_SYSTEM_ENABLED)

View File

@@ -50,7 +50,7 @@ public class ChatPartyRoomAll implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
} }

View File

@@ -50,7 +50,7 @@ public class ChatPartyRoomCommander implements IChatHandler
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED); activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED);
return; return;
} }
activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text), activeChar); activeChar.getParty().getCommandChannel().broadcastCreatureSay(new CreatureSay(activeChar, type, activeChar.getName(), text), activeChar);
} }
} }

View File

@@ -58,7 +58,7 @@ public class ChatShout implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS))) if (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_GLOBAL_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS)))
{ {
final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar); final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar);

View File

@@ -58,7 +58,7 @@ public class ChatTrade implements IChatHandler
return; return;
} }
final CreatureSay cs = new CreatureSay(activeChar.getObjectId(), type, activeChar.getName(), text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS))) if (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("on") || (Config.DEFAULT_TRADE_CHAT.equalsIgnoreCase("gm") && activeChar.canOverrideCond(PlayerCondOverride.CHAT_CONDITIONS)))
{ {
final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar); final int region = MapRegionManager.getInstance().getMapRegionLocId(activeChar);

View File

@@ -93,7 +93,7 @@ public class ChatWorld implements IChatHandler
} }
} }
final CreatureSay cs = new CreatureSay(activeChar, type, text); final CreatureSay cs = new CreatureSay(activeChar, type, activeChar.getName(), text);
if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_SPECIFIC_CHAT) if (Config.FACTION_SYSTEM_ENABLED && Config.FACTION_SPECIFIC_CHAT)
{ {
if (activeChar.isGood()) if (activeChar.isGood())

View File

@@ -52,7 +52,7 @@ public class GMChat implements ITelnetCommand
{ {
sb.append(str + " "); sb.append(str + " ");
} }
AdminData.getInstance().broadcastToGMs(new CreatureSay(0, ChatType.ALLIANCE, "Telnet GM Broadcast", sb.toString())); AdminData.getInstance().broadcastToGMs(new CreatureSay(null, ChatType.ALLIANCE, "Telnet GM Broadcast", sb.toString()));
return "GMChat sent!"; return "GMChat sent!";
} }
} }

View File

@@ -56,7 +56,7 @@ public class Msg implements ITelnetCommand
{ {
sb.append(args[i] + " "); sb.append(args[i] + " ");
} }
player.sendPacket(new CreatureSay(0, ChatType.WHISPER, "Telnet Priv", sb.toString())); player.sendPacket(new CreatureSay(null, ChatType.WHISPER, "Telnet Priv", sb.toString()));
return "Announcement sent!"; return "Announcement sent!";
} }
return "Couldn't find player with such name."; return "Couldn't find player with such name.";

View File

@@ -145,7 +145,7 @@ public class Q00457_LostAndFound extends Quest
startQuestTimer("STOP", 1000, npc, player); startQuestTimer("STOP", 1000, npc, player);
startQuestTimer("BYE", 3000, npc, player); startQuestTimer("BYE", 3000, npc, player);
cancelQuestTimer("CHECK", npc, player); cancelQuestTimer("CHECK", npc, player);
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), NpcStringId.AH_FRESH_AIR)); npc.broadcastPacket(new CreatureSay(npc, ChatType.NPC_GENERAL, NpcStringId.AH_FRESH_AIR));
broadcastNpcSay(npc, player, NpcStringId.AH_FRESH_AIR, false); broadcastNpcSay(npc, player, NpcStringId.AH_FRESH_AIR, false);
giveItems(player, PACKAGED_BOOK, 1); giveItems(player, PACKAGED_BOOK, 1);
qs.exitQuest(QuestType.DAILY, true); qs.exitQuest(QuestType.DAILY, true);

View File

@@ -138,29 +138,29 @@ public class BoatGludinRune implements Runnable
{ {
_boat = boat; _boat = boat;
ARRIVED_AT_GLUDIN = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_GLUDIN_HARBOR); ARRIVED_AT_GLUDIN = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_GLUDIN_HARBOR);
ARRIVED_AT_GLUDIN_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_AFTER_ANCHORING_FOR_TEN_MINUTES); ARRIVED_AT_GLUDIN_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_AFTER_ANCHORING_FOR_TEN_MINUTES);
LEAVE_GLUDIN5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES); LEAVE_GLUDIN5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES);
LEAVE_GLUDIN1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE); LEAVE_GLUDIN1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_RUNE_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE);
LEAVE_GLUDIN0 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY_2); LEAVE_GLUDIN0 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY_2);
LEAVING_GLUDIN = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE); LEAVING_GLUDIN = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE);
ARRIVED_AT_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR); ARRIVED_AT_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR);
ARRIVED_AT_RUNE_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_GLUDIN_HARBOR_AFTER_ANCHORING_FOR_TEN_MINUTES); ARRIVED_AT_RUNE_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_GLUDIN_HARBOR_AFTER_ANCHORING_FOR_TEN_MINUTES);
LEAVE_RUNE5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES); LEAVE_RUNE5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_FIVE_MINUTES);
LEAVE_RUNE1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE); LEAVE_RUNE1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.DEPARTURE_FOR_GLUDIN_HARBOR_WILL_TAKE_PLACE_IN_ONE_MINUTE);
LEAVE_RUNE0 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY); LEAVE_RUNE0 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.MAKE_HASTE_WE_WILL_BE_DEPARTING_FOR_GLUDIN_HARBOR_SHORTLY);
LEAVING_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE); LEAVING_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WE_ARE_NOW_DEPARTING_FOR_GLUDIN_HARBOR_HOLD_ON_AND_ENJOY_THE_RIDE);
BUSY_GLUDIN = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_TO_GLUDIN_HARBOR_HAS_BEEN_DELAYED); BUSY_GLUDIN = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_TO_GLUDIN_HARBOR_HAS_BEEN_DELAYED);
BUSY_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_TO_RUNE_HARBOR_HAS_BEEN_DELAYED); BUSY_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_TO_RUNE_HARBOR_HAS_BEEN_DELAYED);
ARRIVAL_RUNE15 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_15_MINUTES); ARRIVAL_RUNE15 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_15_MINUTES);
ARRIVAL_RUNE10 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_10_MINUTES); ARRIVAL_RUNE10 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_10_MINUTES);
ARRIVAL_RUNE5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_5_MINUTES); ARRIVAL_RUNE5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_5_MINUTES);
ARRIVAL_RUNE1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_1_MINUTE); ARRIVAL_RUNE1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_GLUDIN_HARBOR_WILL_BE_ARRIVING_AT_RUNE_HARBOR_IN_APPROXIMATELY_1_MINUTE);
ARRIVAL_GLUDIN15 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_15_MINUTES); ARRIVAL_GLUDIN15 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_15_MINUTES);
ARRIVAL_GLUDIN10 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_10_MINUTES); ARRIVAL_GLUDIN10 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_10_MINUTES);
ARRIVAL_GLUDIN5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_5_MINUTES); ARRIVAL_GLUDIN5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_5_MINUTES);
ARRIVAL_GLUDIN1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_1_MINUTE); ARRIVAL_GLUDIN1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_RUNE_HARBOR_WILL_BE_ARRIVING_AT_GLUDIN_HARBOR_IN_APPROXIMATELY_1_MINUTE);
GLUDIN_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), GLUDIN_DOCK[0].getX(), GLUDIN_DOCK[0].getY(), GLUDIN_DOCK[0].getZ()); GLUDIN_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), GLUDIN_DOCK[0].getX(), GLUDIN_DOCK[0].getY(), GLUDIN_DOCK[0].getZ());
RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ()); RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ());

View File

@@ -94,17 +94,17 @@ public class BoatInnadrilTour implements Runnable
{ {
_boat = boat; _boat = boat;
ARRIVED_AT_INNADRIL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_HAS_ARRIVED_IT_WILL_ANCHOR_FOR_TEN_MINUTES); ARRIVED_AT_INNADRIL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_HAS_ARRIVED_IT_WILL_ANCHOR_FOR_TEN_MINUTES);
LEAVE_INNADRIL5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_FIVE_MINUTES); LEAVE_INNADRIL5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_FIVE_MINUTES);
LEAVE_INNADRIL1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_ONE_MINUTE); LEAVE_INNADRIL1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_LEAVE_IN_ONE_MINUTE);
LEAVE_INNADRIL0 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_BE_LEAVING_SOON); LEAVE_INNADRIL0 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_BE_LEAVING_SOON);
LEAVING_INNADRIL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_IS_LEAVING); LEAVING_INNADRIL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_IS_LEAVING);
ARRIVAL20 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_20_MINUTES); ARRIVAL20 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_20_MINUTES);
ARRIVAL15 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_15_MINUTES); ARRIVAL15 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_15_MINUTES);
ARRIVAL10 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_10_MINUTES); ARRIVAL10 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_10_MINUTES);
ARRIVAL5 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_5_MINUTES); ARRIVAL5 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_5_MINUTES);
ARRIVAL1 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_1_MINUTE); ARRIVAL1 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_INNADRIL_PLEASURE_BOAT_WILL_ARRIVE_IN_APPROXIMATELY_1_MINUTE);
INNADRIL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), DOCK.getX(), DOCK.getY(), DOCK.getZ()); INNADRIL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), DOCK.getX(), DOCK.getY(), DOCK.getZ());
} }

View File

@@ -90,13 +90,13 @@ public class BoatRunePrimeval implements Runnable
{ {
_boat = boat; _boat = boat;
ARRIVED_AT_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR); ARRIVED_AT_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.WELCOME_TO_RUNE_HARBOR);
ARRIVED_AT_RUNE_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_PRIMEVAL_ISLE_AFTER_ANCHORING_FOR_THREE_MINUTES); ARRIVED_AT_RUNE_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_PRIMEVAL_ISLE_AFTER_ANCHORING_FOR_THREE_MINUTES);
LEAVING_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_RUNE_HARBOR_FOR_PRIMEVAL_ISLE); LEAVING_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_RUNE_HARBOR_FOR_PRIMEVAL_ISLE);
ARRIVED_AT_PRIMEVAL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_PRIMEVAL_ISLE); ARRIVED_AT_PRIMEVAL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_HAS_ARRIVED_AT_PRIMEVAL_ISLE);
ARRIVED_AT_PRIMEVAL_2 = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_RUNE_HARBOR_AFTER_ANCHORING_FOR_THREE_MINUTES); ARRIVED_AT_PRIMEVAL_2 = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_WILL_LEAVE_FOR_RUNE_HARBOR_AFTER_ANCHORING_FOR_THREE_MINUTES);
LEAVING_PRIMEVAL = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_PRIMEVAL_ISLE_FOR_RUNE_HARBOR); LEAVING_PRIMEVAL = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_IS_NOW_DEPARTING_PRIMEVAL_ISLE_FOR_RUNE_HARBOR);
BUSY_RUNE = new CreatureSay(0, ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_PRIMEVAL_ISLE_TO_RUNE_HARBOR_HAS_BEEN_DELAYED); BUSY_RUNE = new CreatureSay(ChatType.BOAT, 801, SystemMessageId.THE_FERRY_FROM_PRIMEVAL_ISLE_TO_RUNE_HARBOR_HAS_BEEN_DELAYED);
RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ()); RUNE_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), RUNE_DOCK[0].getX(), RUNE_DOCK[0].getY(), RUNE_DOCK[0].getZ());
PRIMEVAL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), PRIMEVAL_DOCK.getX(), PRIMEVAL_DOCK.getY(), PRIMEVAL_DOCK.getZ()); PRIMEVAL_SOUND = new PlaySound(0, "itemsound.ship_arrival_departure", 1, _boat.getObjectId(), PRIMEVAL_DOCK.getX(), PRIMEVAL_DOCK.getY(), PRIMEVAL_DOCK.getZ());

View File

@@ -110,9 +110,7 @@ public class AnnouncementsTable
{ {
if (announce.isValid() && (announce.getType() == type)) if (announce.isValid() && (announce.getType() == type))
{ {
player.sendPacket(new CreatureSay(0, // player.sendPacket(new CreatureSay(null, type == AnnouncementType.CRITICAL ? ChatType.CRITICAL_ANNOUNCE : ChatType.ANNOUNCEMENT, player.getName(), announce.getContent()));
type == AnnouncementType.CRITICAL ? ChatType.CRITICAL_ANNOUNCE : ChatType.ANNOUNCEMENT, //
player.getName(), announce.getContent()));
} }
} }
} }

View File

@@ -179,7 +179,7 @@ public class FakePlayerChatManager implements IXmlReader
final Npc npc = spawn.getLastSpawn(); final Npc npc = spawn.getLastSpawn();
if (npc != null) if (npc != null)
{ {
player.sendPacket(new CreatureSay(npc, fpcName, ChatType.WHISPER, message)); player.sendPacket(new CreatureSay(npc, ChatType.WHISPER, fpcName, message));
} }
} }
} }

View File

@@ -339,7 +339,7 @@ public class PetitionManager
if ((currPetition.getPetitioner() != null) && (currPetition.getPetitioner().getObjectId() == player.getObjectId())) if ((currPetition.getPetitioner() != null) && (currPetition.getPetitioner().getObjectId() == player.getObjectId()))
{ {
cs = new CreatureSay(player.getObjectId(), ChatType.PETITION_PLAYER, player.getName(), messageText); cs = new CreatureSay(player, ChatType.PETITION_PLAYER, player.getName(), messageText);
currPetition.addLogMessage(cs); currPetition.addLogMessage(cs);
currPetition.sendResponderPacket(cs); currPetition.sendResponderPacket(cs);
@@ -349,7 +349,7 @@ public class PetitionManager
if ((currPetition.getResponder() != null) && (currPetition.getResponder().getObjectId() == player.getObjectId())) if ((currPetition.getResponder() != null) && (currPetition.getResponder().getObjectId() == player.getObjectId()))
{ {
cs = new CreatureSay(player.getObjectId(), ChatType.PETITION_GM, player.getName(), messageText); cs = new CreatureSay(player, ChatType.PETITION_GM, player.getName(), messageText);
currPetition.addLogMessage(cs); currPetition.addLogMessage(cs);
currPetition.sendResponderPacket(cs); currPetition.sendResponderPacket(cs);
@@ -423,7 +423,7 @@ public class PetitionManager
// Notify all GMs that a new petition has been submitted. // Notify all GMs that a new petition has been submitted.
final String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ")."; final String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ").";
AdminData.getInstance().broadcastToGMs(new CreatureSay(petitioner.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent)); AdminData.getInstance().broadcastToGMs(new CreatureSay(petitioner, ChatType.HERO_VOICE, "Petition System", msgContent));
return newPetitionId; return newPetitionId;
} }

View File

@@ -222,7 +222,7 @@ public class Attackable extends Npc
_commandChannelTimer = new CommandChannelTimer(this); _commandChannelTimer = new CommandChannelTimer(this);
_commandChannelLastAttack = System.currentTimeMillis(); _commandChannelLastAttack = System.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(0, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg _firstCommandChannelAttacked.broadcastPacket(new CreatureSay(null, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
} }
} }
} }

View File

@@ -185,7 +185,7 @@ public abstract class VoteSystem implements Runnable
private void announce(String msg) private void announce(String msg)
{ {
final CreatureSay cs = new CreatureSay(0, ChatType.CRITICAL_ANNOUNCE, "", msg); final CreatureSay cs = new CreatureSay(null, ChatType.CRITICAL_ANNOUNCE, "", msg);
Broadcast.toAllOnlinePlayers(cs); Broadcast.toAllOnlinePlayers(cs);
} }

View File

@@ -481,7 +481,7 @@ public class EnterWorld implements IClientIncomingPacket
if ((Config.SERVER_RESTART_SCHEDULE_ENABLED) && (Config.SERVER_RESTART_SCHEDULE_MESSAGE)) if ((Config.SERVER_RESTART_SCHEDULE_ENABLED) && (Config.SERVER_RESTART_SCHEDULE_MESSAGE))
{ {
player.sendPacket(new CreatureSay(2, ChatType.BATTLEFIELD, "[SERVER]", "Next restart is scheduled at " + ServerRestartManager.getInstance().getNextRestartTime() + ".")); player.sendPacket(new CreatureSay(null, ChatType.BATTLEFIELD, "[SERVER]", "Next restart is scheduled at " + ServerRestartManager.getInstance().getNextRestartTime() + "."));
} }
if (showClanNotice) if (showClanNotice)

View File

@@ -80,7 +80,7 @@ public class RequestPetitionCancel implements IClientIncomingPacket
// Notify all GMs that the player's pending petition has been cancelled. // Notify all GMs that the player's pending petition has been cancelled.
final String msgContent = player.getName() + " has canceled a pending petition."; final String msgContent = player.getName() + " has canceled a pending petition.";
AdminData.getInstance().broadcastToGMs(new CreatureSay(player.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent)); AdminData.getInstance().broadcastToGMs(new CreatureSay(player, ChatType.HERO_VOICE, "Petition System", msgContent));
} }
else else
{ {

View File

@@ -22,7 +22,7 @@ import java.util.List;
import org.l2jmobius.commons.network.PacketWriter; import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.enums.ChatType; import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.MentorManager; import org.l2jmobius.gameserver.instancemanager.MentorManager;
import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.NpcStringId; import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.OutgoingPackets; import org.l2jmobius.gameserver.network.OutgoingPackets;
@@ -30,30 +30,29 @@ import org.l2jmobius.gameserver.network.SystemMessageId;
public class CreatureSay implements IClientOutgoingPacket public class CreatureSay implements IClientOutgoingPacket
{ {
private final int _objectId; private final Creature _sender;
private final ChatType _textType; private final ChatType _chatType;
private String _charName = null; private String _senderName = null;
private int _charId = 0;
private String _text = null; private String _text = null;
private int _npcString = -1; private int _charId = 0;
private int _messageId = -1;
private int _mask; private int _mask;
private int _charLevel = -1;
private List<String> _parameters; private List<String> _parameters;
/** /**
* @param sender * @param sender
* @param receiver * @param receiver
* @param name * @param name
* @param messageType * @param chatType
* @param text * @param text
*/ */
public CreatureSay(PlayerInstance sender, PlayerInstance receiver, String name, ChatType messageType, String text) public CreatureSay(PlayerInstance sender, PlayerInstance receiver, String name, ChatType chatType, String text)
{ {
_objectId = sender.getObjectId(); _sender = sender;
_charName = name; _senderName = name;
_charLevel = sender.getLevel(); _chatType = chatType;
_textType = messageType;
_text = text; _text = text;
if (receiver != null) if (receiver != null)
{ {
if (receiver.getFriendList().contains(sender.getObjectId())) if (receiver.getFriendList().contains(sender.getObjectId()))
@@ -81,66 +80,27 @@ public class CreatureSay implements IClientOutgoingPacket
} }
} }
/** public CreatureSay(Creature sender, ChatType chatType, String senderName, String text)
* Used by fake players.
* @param sender
* @param name
* @param messageType
* @param text
*/
public CreatureSay(Npc sender, String name, ChatType messageType, String text)
{ {
_objectId = sender.getObjectId(); _sender = sender;
_charName = name; _chatType = chatType;
_charLevel = sender.getLevel(); _senderName = senderName;
_textType = messageType;
_text = text; _text = text;
} }
/** public CreatureSay(Creature sender, ChatType chatType, NpcStringId npcStringId)
* @param objectId
* @param messageType
* @param charName
* @param text
*/
public CreatureSay(int objectId, ChatType messageType, String charName, String text)
{ {
_objectId = objectId; _sender = sender;
_textType = messageType; _chatType = chatType;
_charName = charName; _messageId = npcStringId.getId();
_text = text;
} }
public CreatureSay(PlayerInstance player, ChatType messageType, String text) public CreatureSay(ChatType chatType, int charId, SystemMessageId systemMessageId)
{ {
_objectId = player.getObjectId(); _sender = null;
_textType = messageType; _chatType = chatType;
_charName = player.getAppearance().getVisibleName();
_text = text;
}
public CreatureSay(int objectId, ChatType messageType, int charId, NpcStringId npcString)
{
_objectId = objectId;
_textType = messageType;
_charId = charId; _charId = charId;
_npcString = npcString.getId(); _messageId = systemMessageId.getId();
}
public CreatureSay(int objectId, ChatType messageType, String charName, NpcStringId npcString)
{
_objectId = objectId;
_textType = messageType;
_charName = charName;
_npcString = npcString.getId();
}
public CreatureSay(int objectId, ChatType messageType, int charId, SystemMessageId sysString)
{
_objectId = objectId;
_textType = messageType;
_charId = charId;
_npcString = sysString.getId();
} }
/** /**
@@ -161,26 +121,26 @@ public class CreatureSay implements IClientOutgoingPacket
{ {
OutgoingPackets.SAY2.writeId(packet); OutgoingPackets.SAY2.writeId(packet);
packet.writeD(_objectId); packet.writeD(_sender == null ? 0 : _sender.getObjectId());
packet.writeD(_textType.getClientId()); packet.writeD(_chatType.getClientId());
if (_charName != null) if (_senderName != null)
{ {
packet.writeS(_charName); packet.writeS(_senderName);
} }
else else
{ {
packet.writeD(_charId); packet.writeD(_charId);
} }
packet.writeD(_npcString); // High Five NPCString ID packet.writeD(_messageId); // High Five NPCString ID
if (_text != null) if (_text != null)
{ {
packet.writeS(_text); packet.writeS(_text);
if ((_charLevel > 0) && (_textType == ChatType.WHISPER)) if ((_sender != null) && (_sender.isPlayer() || _sender.isFakePlayer()) && (_chatType == ChatType.WHISPER))
{ {
packet.writeC(_mask); packet.writeC(_mask);
if ((_mask & 0x10) == 0) if ((_mask & 0x10) == 0)
{ {
packet.writeC(_charLevel); packet.writeC(_sender.getLevel());
} }
} }
} }
@@ -199,7 +159,7 @@ public class CreatureSay implements IClientOutgoingPacket
{ {
if (player != null) if (player != null)
{ {
player.broadcastSnoop(_textType, _charName, _text); player.broadcastSnoop(_chatType, _senderName, _text);
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show More