Addition of proper chat type enum.

This commit is contained in:
MobiusDevelopment
2020-02-11 22:25:13 +00:00
parent 83301a78ee
commit 8be467ada1
63 changed files with 432 additions and 485 deletions

View File

@@ -0,0 +1,75 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.enums;
/**
* @author St3eT
*/
public enum ChatType
{
GENERAL(0),
SHOUT(1),
WHISPER(2),
PARTY(3),
CLAN(4),
GM(5),
PETITION_PLAYER(6),
PETITION_GM(7),
TRADE(8),
ALLIANCE(9),
ANNOUNCEMENT(10),
BOAT(11),
FRIEND(12),
MSNCHAT(13),
PARTYMATCH_ROOM(14),
PARTYROOM_COMMANDER(15),
PARTYROOM_ALL(16),
HERO_VOICE(17),
CRITICAL_ANNOUNCE(18);
private final int _clientId;
private ChatType(int clientId)
{
_clientId = clientId;
}
/**
* @return the client id.
*/
public int getClientId()
{
return _clientId;
}
/**
* Finds the {@code ChatType} by its clientId
* @param clientId the clientId
* @return the {@code ChatType} if its found, {@code null} otherwise.
*/
public static ChatType findByClientId(int clientId)
{
for (ChatType ChatType : values())
{
if (ChatType.getClientId() == clientId)
{
return ChatType;
}
}
return null;
}
}

View File

@@ -30,6 +30,7 @@ import java.util.logging.Logger;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -787,7 +788,7 @@ public class AutoChatHandler implements SpawnListener
return;
}
final CreatureSay cs = new CreatureSay(chatNpc.getObjectId(), 0, creatureName, text);
final CreatureSay cs = new CreatureSay(chatNpc.getObjectId(), ChatType.GENERAL, creatureName, text);
for (PlayerInstance nearbyPlayer : nearbyPlayers)
{
nearbyPlayer.sendPacket(cs);

View File

@@ -19,12 +19,12 @@ package org.l2jmobius.gameserver.handler.admincommandhandlers;
import java.util.StringTokenizer;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.AutoAnnouncementHandler;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.entity.Announcements;
import org.l2jmobius.gameserver.network.clientpackets.Say2;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import org.l2jmobius.gameserver.util.Broadcast;
import org.l2jmobius.gameserver.util.BuilderUtil;
@@ -156,7 +156,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
{
text1 = activeChar.getName() + ": " + text1;
}
Broadcast.toAllOnlinePlayers(new CreatureSay(activeChar.getObjectId(), Say2.CRITICAL_ANNOUNCE, "", text1));
Broadcast.toAllOnlinePlayers(new CreatureSay(activeChar.getObjectId(), ChatType.CRITICAL_ANNOUNCE, "", text1));
return true;
}
case "admin_list_autoannouncements":

View File

@@ -16,7 +16,7 @@
*/
package org.l2jmobius.gameserver.handler.admincommandhandlers;
import org.l2jmobius.gameserver.datatables.xml.AdminData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -102,21 +102,15 @@ public class AdminGmChat implements IAdminCommandHandler
{
try
{
int offset = 0;
String text;
if (command.contains("menu"))
final int offset = command.contains("menu") ? 17 : 13;
final String text = command.substring(offset);
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
offset = 17;
if (player.isGM())
{
player.sendPacket(new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text));
}
}
else
{
offset = 13;
}
text = command.substring(offset);
AdminData.broadcastToGMs(new CreatureSay(0, 9, activeChar.getName(), text));
}
catch (StringIndexOutOfBoundsException e)
{

View File

@@ -104,15 +104,15 @@ public class AdminTownWar implements IAdminCommandHandler
// Announce for all towns
if (Config.TW_ALL_TOWNS)
{
Announcements.getInstance().gameAnnounceToAll("Town War Event!");
Announcements.getInstance().gameAnnounceToAll("All towns have been set to war zone by " + activeChar.getName() + ".");
Announcements.getInstance().criticalAnnounceToAll("Town War Event!");
Announcements.getInstance().criticalAnnounceToAll("All towns have been set to war zone by " + activeChar.getName() + ".");
}
// Announce for one town
if (!Config.TW_ALL_TOWNS)
{
Announcements.getInstance().gameAnnounceToAll("Town War Event!");
Announcements.getInstance().gameAnnounceToAll(MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set to war zone by " + activeChar.getName() + ".");
Announcements.getInstance().criticalAnnounceToAll("Town War Event!");
Announcements.getInstance().criticalAnnounceToAll(MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set to war zone by " + activeChar.getName() + ".");
}
}
@@ -179,13 +179,13 @@ public class AdminTownWar implements IAdminCommandHandler
// Announce for all towns
if (Config.TW_ALL_TOWNS)
{
Announcements.getInstance().gameAnnounceToAll("All towns have been set back to normal by " + activeChar.getName() + ".");
Announcements.getInstance().criticalAnnounceToAll("All towns have been set back to normal by " + activeChar.getName() + ".");
}
// Announce for one town
if (!Config.TW_ALL_TOWNS)
{
Announcements.getInstance().gameAnnounceToAll(MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set back to normal by " + activeChar.getName() + ".");
Announcements.getInstance().criticalAnnounceToAll(MapRegionData.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set back to normal by " + activeChar.getName() + ".");
}
}

View File

@@ -26,6 +26,7 @@ import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.gameserver.datatables.ItemTable;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.idfactory.IdFactory;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.WorldObject;
@@ -545,7 +546,7 @@ public class ChristmasManager
*/
protected CreatureSay getXMasMessage()
{
return new CreatureSay(0, 17, getRandomSender(), getRandomXMasMessage());
return new CreatureSay(0, ChatType.HERO_VOICE, getRandomSender(), getRandomXMasMessage());
}
/**

View File

@@ -26,10 +26,10 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.datatables.xml.AdminData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.idfactory.IdFactory;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.Say2;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import org.l2jmobius.gameserver.network.serverpackets.GameServerPacket;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -507,7 +507,7 @@ public class PetitionManager
if ((currPetition.getPetitioner() != null) && (currPetition.getPetitioner().getObjectId() == player.getObjectId()))
{
cs = new CreatureSay(player.getObjectId(), Say2.PETITION_PLAYER, player.getName(), messageText);
cs = new CreatureSay(player.getObjectId(), ChatType.PETITION_PLAYER, player.getName(), messageText);
currPetition.addLogMessage(cs);
currPetition.sendResponderPacket(cs);
@@ -518,7 +518,7 @@ public class PetitionManager
if ((currPetition.getResponder() != null) && (currPetition.getResponder().getObjectId() == player.getObjectId()))
{
cs = new CreatureSay(player.getObjectId(), Say2.PETITION_GM, player.getName(), messageText);
cs = new CreatureSay(player.getObjectId(), ChatType.PETITION_GM, player.getName(), messageText);
currPetition.addLogMessage(cs);
currPetition.sendResponderPacket(cs);
@@ -580,7 +580,7 @@ public class PetitionManager
// Notify all GMs that a new petition has been submitted.
final String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ").";
AdminData.broadcastToGMs(new CreatureSay(petitioner.getObjectId(), 17, "Petition System", msgContent));
AdminData.broadcastToGMs(new CreatureSay(petitioner.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent));
return newPetitionId;
}

View File

@@ -33,6 +33,7 @@ import org.l2jmobius.gameserver.ai.FortSiegeGuardAI;
import org.l2jmobius.gameserver.ai.SiegeGuardAI;
import org.l2jmobius.gameserver.datatables.ItemTable;
import org.l2jmobius.gameserver.datatables.xml.ManorSeedData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.CursedWeaponsManager;
import org.l2jmobius.gameserver.model.CommandChannel;
import org.l2jmobius.gameserver.model.DropCategory;
@@ -60,7 +61,6 @@ import org.l2jmobius.gameserver.model.quest.EventType;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.skills.Stat;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.Say2;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
@@ -454,7 +454,7 @@ public class Attackable extends NpcInstance
_commandChannelTimer = new CommandChannelTimer(this);
_commandChannelLastAttack = System.currentTimeMillis();
ThreadPool.schedule(_commandChannelTimer, 10000); // check for last attack
_firstCommandChannelAttacked.broadcastToChannelMembers(new CreatureSay(0, Say2.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
_firstCommandChannelAttacked.broadcastToChannelMembers(new CreatureSay(0, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
}
}
}

View File

@@ -231,16 +231,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
}
}
/**
* This will return true if the player is GM,<br>
* but if the player is not GM it will return false.
* @return GM status
*/
public boolean charIsGM()
{
return (this instanceof PlayerInstance) && ((PlayerInstance) this).isGM();
}
/**
* Constructor of Creature.<BR>
* <BR>

View File

@@ -23,6 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.knownlist.BoatKnownList;
import org.l2jmobius.gameserver.model.actor.templates.CreatureTemplate;
@@ -30,7 +31,6 @@ import org.l2jmobius.gameserver.model.holders.BoatPathHolder;
import org.l2jmobius.gameserver.model.holders.BoatPathHolder.BoatPoint;
import org.l2jmobius.gameserver.model.items.Weapon;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.network.clientpackets.Say2;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import org.l2jmobius.gameserver.network.serverpackets.OnVehicleCheckLocation;
@@ -263,11 +263,11 @@ public class BoatInstance extends Creature
{
if (cycle == 1)
{
sm = new CreatureSay(0, Say2.SHOUT, pathA.npc, pathA.sysmess10);
sm = new CreatureSay(0, ChatType.SHOUT, pathA.npc, pathA.sysmess10);
}
else
{
sm = new CreatureSay(0, Say2.SHOUT, pathB.npc, pathB.sysmess10);
sm = new CreatureSay(0, ChatType.SHOUT, pathB.npc, pathB.sysmess10);
}
ps = new PlaySound(0, "itemsound.ship_arrival_departure", this);
if ((knownPlayers == null) || knownPlayers.isEmpty())
@@ -287,11 +287,11 @@ public class BoatInstance extends Creature
{
if (cycle == 1)
{
sm = new CreatureSay(0, Say2.SHOUT, pathA.npc, pathA.sysmess5);
sm = new CreatureSay(0, ChatType.SHOUT, pathA.npc, pathA.sysmess5);
}
else
{
sm = new CreatureSay(0, Say2.SHOUT, pathB.npc, pathB.sysmess5);
sm = new CreatureSay(0, ChatType.SHOUT, pathB.npc, pathB.sysmess5);
}
ps = new PlaySound(0, "itemsound.ship_5min", this);
if ((knownPlayers == null) || knownPlayers.isEmpty())
@@ -309,11 +309,11 @@ public class BoatInstance extends Creature
{
if (cycle == 1)
{
sm = new CreatureSay(0, Say2.SHOUT, pathA.npc, pathA.sysmess1);
sm = new CreatureSay(0, ChatType.SHOUT, pathA.npc, pathA.sysmess1);
}
else
{
sm = new CreatureSay(0, Say2.SHOUT, pathB.npc, pathB.sysmess1);
sm = new CreatureSay(0, ChatType.SHOUT, pathB.npc, pathB.sysmess1);
}
ps = new PlaySound(0, "itemsound.ship_1min", this);
if ((knownPlayers == null) || knownPlayers.isEmpty())
@@ -331,11 +331,11 @@ public class BoatInstance extends Creature
{
if (cycle == 1)
{
sm = new CreatureSay(0, Say2.SHOUT, pathA.npc, pathA.sysmess0);
sm = new CreatureSay(0, ChatType.SHOUT, pathA.npc, pathA.sysmess0);
}
else
{
sm = new CreatureSay(0, Say2.SHOUT, pathB.npc, pathB.sysmess0);
sm = new CreatureSay(0, ChatType.SHOUT, pathB.npc, pathB.sysmess0);
}
if ((knownPlayers == null) || knownPlayers.isEmpty())
{
@@ -351,11 +351,11 @@ public class BoatInstance extends Creature
{
if (cycle == 1)
{
sm = new CreatureSay(0, Say2.SHOUT, pathA.npc, pathA.sysmessb);
sm = new CreatureSay(0, ChatType.SHOUT, pathA.npc, pathA.sysmessb);
}
else
{
sm = new CreatureSay(0, Say2.SHOUT, pathB.npc, pathB.sysmessb);
sm = new CreatureSay(0, ChatType.SHOUT, pathB.npc, pathB.sysmessb);
}
ps = new PlaySound(0, "itemsound.ship_arrival_departure", this);
for (PlayerInstance player : knownPlayers)

View File

@@ -32,6 +32,7 @@ import org.l2jmobius.gameserver.datatables.sql.ClanTable;
import org.l2jmobius.gameserver.datatables.sql.HelperBuffTable;
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
import org.l2jmobius.gameserver.datatables.xml.ZoneData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.idfactory.IdFactory;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.CustomNpcInstanceManager;
@@ -79,7 +80,6 @@ import org.l2jmobius.gameserver.model.spawn.Spawn;
import org.l2jmobius.gameserver.model.zone.type.TownZone;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.Say2;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import org.l2jmobius.gameserver.network.serverpackets.ExShowVariationCancelWindow;
@@ -1929,7 +1929,7 @@ public class NpcInstance extends Creature
*/
public void broadcastNpcSay(String message)
{
broadcastPacket(new CreatureSay(getObjectId(), Say2.ALL, getName(), message));
broadcastPacket(new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), message));
}
/**

View File

@@ -20,6 +20,7 @@ import java.util.Map;
import org.l2jmobius.gameserver.ai.CreatureAI;
import org.l2jmobius.gameserver.ai.NpcWalkerAI;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
@@ -81,7 +82,7 @@ public class NpcWalkerInstance extends NpcInstance
// we send message to known players only!
if (!knownPlayers.isEmpty())
{
final CreatureSay cs = new CreatureSay(getObjectId(), 0, getName(), chat);
final CreatureSay cs = new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), chat);
// we interact and list players here
for (PlayerInstance players : knownPlayers.values())

View File

@@ -19,10 +19,10 @@ package org.l2jmobius.gameserver.model.actor.instance;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlEvent;
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.spawn.Spawn;
import org.l2jmobius.gameserver.network.clientpackets.Say2;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
public class PenaltyMonsterInstance extends MonsterInstance
@@ -58,7 +58,7 @@ public class PenaltyMonsterInstance extends MonsterInstance
{
if (Rnd.get(100) <= 80)
{
broadcastPacket(new CreatureSay(getObjectId(), Say2.ALL, getName(), "mmm your bait was delicious"));
broadcastPacket(new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), "mmm your bait was delicious"));
}
_ptk = ptk;
addDamageHate(ptk, 10, 10);
@@ -76,7 +76,7 @@ public class PenaltyMonsterInstance extends MonsterInstance
if (Rnd.get(100) <= 75)
{
broadcastPacket(new CreatureSay(getObjectId(), Say2.ALL, getName(), "I will tell fishes not to take your bait"));
broadcastPacket(new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), "I will tell fishes not to take your bait"));
}
return true;
}

View File

@@ -67,6 +67,7 @@ import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
import org.l2jmobius.gameserver.datatables.xml.PlayerTemplateData;
import org.l2jmobius.gameserver.datatables.xml.RecipeData;
import org.l2jmobius.gameserver.datatables.xml.ZoneData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Race;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -6353,7 +6354,7 @@ public class PlayerInstance extends Playable
CTF.removeFlagFromPlayer(this);
broadcastUserInfo();
_haveFlagCTF = false;
Announcements.getInstance().gameAnnounceToAll(CTF.getEventName() + "(CTF): " + _teamNameHaveFlagCTF + "'s flag returned.");
Announcements.getInstance().criticalAnnounceToAll(CTF.getEventName() + "(CTF): " + _teamNameHaveFlagCTF + "'s flag returned.");
}
/**
@@ -6788,7 +6789,7 @@ public class PlayerInstance extends Playable
if ((_heroConsecutiveKillCount == Config.KILLS_TO_GET_WAR_LEGEND_AURA) && Config.WAR_LEGEND_AURA)
{
setHeroAura(true);
Announcements.getInstance().gameAnnounceToAll(getName() + " becames War Legend with " + Config.KILLS_TO_GET_WAR_LEGEND_AURA + " PvP!!");
Announcements.getInstance().criticalAnnounceToAll(getName() + " becames War Legend with " + Config.KILLS_TO_GET_WAR_LEGEND_AURA + " PvP!!");
}
@@ -6827,7 +6828,7 @@ public class PlayerInstance extends Playable
{
if (Config.ENABLE_ANTI_PVP_FARM_MSG)
{
final CreatureSay cs12 = new CreatureSay(0, 15, "", getName() + " 5 consecutive kill! Only Gm."); // 8D
final CreatureSay cs12 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " 5 consecutive kill! Only Gm."); // 8D
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline() && player.isGM())
@@ -6840,7 +6841,7 @@ public class PlayerInstance extends Playable
}
case 6:
{
final CreatureSay cs = new CreatureSay(0, 15, "", getName() + " is Dominating!"); // 8D
final CreatureSay cs = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is Dominating!"); // 8D
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline())
@@ -6852,7 +6853,7 @@ public class PlayerInstance extends Playable
}
case 9:
{
final CreatureSay cs2 = new CreatureSay(0, 15, "", getName() + " is on a Rampage!"); // 8D
final CreatureSay cs2 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Rampage!"); // 8D
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline())
@@ -6864,7 +6865,7 @@ public class PlayerInstance extends Playable
}
case 14:
{
final CreatureSay cs3 = new CreatureSay(0, 15, "", getName() + " is on a Killing Spree!"); // 8D
final CreatureSay cs3 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Killing Spree!"); // 8D
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline())
@@ -6876,7 +6877,7 @@ public class PlayerInstance extends Playable
}
case 18:
{
final CreatureSay cs4 = new CreatureSay(0, 15, "", getName() + " is on a Monster Kill!"); // 8D
final CreatureSay cs4 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Monster Kill!"); // 8D
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline())
@@ -6888,7 +6889,7 @@ public class PlayerInstance extends Playable
}
case 22:
{
final CreatureSay cs5 = new CreatureSay(0, 15, "", getName() + " is Unstoppable!"); // 8D
final CreatureSay cs5 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is Unstoppable!"); // 8D
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline())
@@ -6900,7 +6901,7 @@ public class PlayerInstance extends Playable
}
case 25:
{
final CreatureSay cs6 = new CreatureSay(0, 15, "", getName() + " is on an Ultra Kill!"); // 8D
final CreatureSay cs6 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on an Ultra Kill!"); // 8D
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline())
@@ -6912,7 +6913,7 @@ public class PlayerInstance extends Playable
}
case 28:
{
final CreatureSay cs7 = new CreatureSay(0, 15, "", getName() + " God Blessed!"); // 8D
final CreatureSay cs7 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " God Blessed!"); // 8D
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline())
@@ -6924,7 +6925,7 @@ public class PlayerInstance extends Playable
}
case 32:
{
final CreatureSay cs8 = new CreatureSay(0, 15, "", getName() + " is Wicked Sick!"); // 8D
final CreatureSay cs8 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is Wicked Sick!"); // 8D
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline())
@@ -6936,7 +6937,7 @@ public class PlayerInstance extends Playable
}
case 35:
{
final CreatureSay cs9 = new CreatureSay(0, 15, "", getName() + " is on a Ludricrous Kill!"); // 8D
final CreatureSay cs9 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is on a Ludricrous Kill!"); // 8D
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline())
@@ -6948,7 +6949,7 @@ public class PlayerInstance extends Playable
}
case 40:
{
final CreatureSay cs10 = new CreatureSay(0, 15, "", getName() + " is GodLike!"); // 8D
final CreatureSay cs10 = new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", getName() + " is GodLike!"); // 8D
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline())
@@ -13873,11 +13874,11 @@ public class PlayerInstance extends Playable
}
}
public void broadcastSnoop(int type, String name, String text, CreatureSay cs)
public void broadcastSnoop(ChatType _chatType, String name, String text, CreatureSay cs)
{
if (!_snoopListener.isEmpty())
{
final Snoop sn = new Snoop(this, type, name, text);
final Snoop sn = new Snoop(this, _chatType, name, text);
for (PlayerInstance pci : _snoopListener)
{
if (pci != null)

View File

@@ -21,6 +21,7 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.gameserver.datatables.SkillTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Skill;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Summon;
@@ -87,7 +88,7 @@ public class ProtectorInstance extends NpcInstance
final int objId = _caster.getObjectId();
skill.getEffects(_caster, player, false, false, false);
broadcastPacket(new MagicSkillUse(_caster, player, skillId, skillLevel, Config.PROTECTOR_SKILLTIME, 0));
broadcastPacket(new CreatureSay(objId, 0, getName(), Config.PROTECTOR_MESSAGE));
broadcastPacket(new CreatureSay(objId, ChatType.GENERAL, getName(), Config.PROTECTOR_MESSAGE));
return true;
}
@@ -109,7 +110,7 @@ public class ProtectorInstance extends NpcInstance
final int objId = _caster.getObjectId();
skill.getEffects(_caster, player, false, false, false);
broadcastPacket(new MagicSkillUse(_caster, player, skillId, skillLevel, Config.PROTECTOR_SKILLTIME, 0));
broadcastPacket(new CreatureSay(objId, 0, getName(), Config.PROTECTOR_MESSAGE));
broadcastPacket(new CreatureSay(objId, ChatType.GENERAL, getName(), Config.PROTECTOR_MESSAGE));
return true;
}

View File

@@ -20,6 +20,7 @@ import java.util.concurrent.Future;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.gameserver.datatables.SkillTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
import org.l2jmobius.gameserver.model.Skill;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -370,7 +371,7 @@ public class SepulcherMonsterInstance extends MonsterInstance
return;
}
broadcastPacket(new CreatureSay(getObjectId(), 0, getName(), "forgive me!!"));
broadcastPacket(new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), "forgive me!!"));
}
}
@@ -397,7 +398,7 @@ public class SepulcherMonsterInstance extends MonsterInstance
}
FourSepulchersManager.getInstance().spawnKeyBox(_activeChar);
broadcastPacket(new CreatureSay(getObjectId(), 0, getName(), "Many thanks for rescue me."));
broadcastPacket(new CreatureSay(getObjectId(), ChatType.GENERAL, getName(), "Many thanks for rescue me."));
}
}

View File

@@ -26,6 +26,7 @@ import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.datatables.xml.DoorData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
@@ -436,7 +437,7 @@ public class SepulcherNpcInstance extends NpcInstance
{
return;
}
final CreatureSay sm = new CreatureSay(0, 1, getName(), msg);
final CreatureSay sm = new CreatureSay(0, ChatType.SHOUT, getName(), msg);
for (PlayerInstance player : knownPlayers)
{
if (player == null)

View File

@@ -901,7 +901,7 @@ public class CreatureStat
}
val /= _creature.getArmourExpertisePenalty();
if ((val > Config.MAX_RUN_SPEED) && !_creature.charIsGM())
if ((val > Config.MAX_RUN_SPEED) && !(_creature.isPlayer() && !_creature.getActingPlayer().isGM()))
{
val = Config.MAX_RUN_SPEED;
}

View File

@@ -29,10 +29,10 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.Say2;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
@@ -73,7 +73,7 @@ public class Announcements
{
for (String _announcement : _announcements)
{
player.sendPacket(new CreatureSay(0, Say2.ANNOUNCEMENT, player.getName(), _announcement.replace("%name%", player.getName())));
player.sendPacket(new CreatureSay(0, ChatType.ANNOUNCEMENT, player.getName(), _announcement.replace("%name%", player.getName())));
}
for (List<Object> entry : _eventAnnouncements)
@@ -225,18 +225,16 @@ public class Announcements
public void announceToAll(String text)
{
final CreatureSay cs = new CreatureSay(0, Say2.ANNOUNCEMENT, "", text);
final CreatureSay cs = new CreatureSay(0, ChatType.ANNOUNCEMENT, "", text);
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
player.sendPacket(cs);
}
}
// Colored Announcements 8D
// Used for events
public void gameAnnounceToAll(String text)
public void criticalAnnounceToAll(String text)
{
final CreatureSay cs = new CreatureSay(0, 18, null, text);
final CreatureSay cs = new CreatureSay(0, ChatType.CRITICAL_ANNOUNCE, null, text);
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if ((player != null) && player.isOnline())

View File

@@ -27,6 +27,7 @@ import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.gameserver.datatables.ItemTable;
import org.l2jmobius.gameserver.datatables.SkillTable;
import org.l2jmobius.gameserver.datatables.xml.ExperienceData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Skill;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
@@ -321,7 +322,7 @@ public class Rebirth
player.addSkill(bonusSkill, false);
// If you'd rather make it simple, simply comment this out and replace with a simple player.sendmessage();
rebirthText = new CreatureSay(0, 18, "Rebirth Manager ", " Granted you [ " + bonusSkill.getName() + " ] level [ " + bonusSkill.getLevel() + " ]!");
rebirthText = new CreatureSay(0, ChatType.HERO_VOICE, "Rebirth Manager ", " Granted you [ " + bonusSkill.getName() + " ] level [ " + bonusSkill.getLevel() + " ]!");
player.sendPacket(rebirthText);
}
}

View File

@@ -31,6 +31,7 @@ import org.l2jmobius.gameserver.datatables.ItemTable;
import org.l2jmobius.gameserver.datatables.SkillTable;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.model.Effect;
import org.l2jmobius.gameserver.model.Inventory;
@@ -744,17 +745,17 @@ public class CTF implements EventTask
_inProgress = true;
_joining = true;
spawnEventNpc();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Event " + _eventName + "!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Event " + _eventName + "!");
if (Config.CTF_ANNOUNCE_REWARD && (ItemTable.getInstance().getTemplate(_rewardId) != null))
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName());
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName());
}
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl);
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + ".");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl);
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + ".");
if (Config.CTF_COMMAND)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Commands .ctfjoin .ctfleave .ctfinfo!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Commands .ctfjoin .ctfleave .ctfinfo!");
}
return true;
@@ -781,7 +782,7 @@ public class CTF implements EventTask
}
else if (Config.CTF_EVEN_TEAMS.equals("SHUFFLE") && !checkMinPlayers(_playersShuffle.size()))
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size());
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size());
if (Config.CTF_STATS_LOGGER)
{
LOGGER.info(_eventName + ":Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size());
@@ -792,7 +793,7 @@ public class CTF implements EventTask
}
else if (!checkMinPlayers(_players.size()))
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _players.size());
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _players.size());
if (Config.CTF_STATS_LOGGER)
{
LOGGER.info(_eventName + ":Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _players.size());
@@ -801,7 +802,7 @@ public class CTF implements EventTask
}
_joining = false;
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!");
setUserData();
ThreadPool.schedule(() ->
@@ -889,7 +890,7 @@ public class CTF implements EventTask
afterStartOperations();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Started. Go Capture the Flags!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Started. Go Capture the Flags!");
_started = true;
return true;
@@ -925,7 +926,7 @@ public class CTF implements EventTask
_aborted = false;
final long delay = _intervalBetweenMatches;
Announcements.getInstance().gameAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!");
waiter(delay);
@@ -937,7 +938,7 @@ public class CTF implements EventTask
}
else
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": next event aborted!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": next event aborted!");
}
}
catch (Exception e)
@@ -972,21 +973,21 @@ public class CTF implements EventTask
if (Config.CTF_ANNOUNCE_TEAM_STATS)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + " Team Statistics:");
Announcements.getInstance().criticalAnnounceToAll(_eventName + " Team Statistics:");
for (String team : _teams)
{
final int _flags_ = teamPointsCount(team);
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Team: " + team + " - Flags taken: " + _flags_);
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Team: " + team + " - Flags taken: " + _flags_);
}
}
if (_topTeam != null)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Team " + _topTeam + " wins the match, with " + _topScore + " flags taken!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Team " + _topTeam + " wins the match, with " + _topScore + " flags taken!");
}
else
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": The event finished with a TIE: " + _topScore + " flags taken by each team!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": The event finished with a TIE: " + _topScore + " flags taken by each team!");
}
rewardTeam(_topTeam);
@@ -1005,7 +1006,7 @@ public class CTF implements EventTask
}
else
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": The event finished with a TIE: No team wins the match(nobody took flags)!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": The event finished with a TIE: No team wins the match(nobody took flags)!");
if (Config.CTF_STATS_LOGGER)
{
@@ -1047,7 +1048,7 @@ public class CTF implements EventTask
cleanCTF();
_joining = false;
_inProgress = false;
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!");
return;
}
_joining = false;
@@ -1058,7 +1059,7 @@ public class CTF implements EventTask
afterFinish();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!");
teleportFinish();
}
@@ -1076,7 +1077,7 @@ public class CTF implements EventTask
public static void teleportFinish()
{
sit();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!");
ThreadPool.schedule(() ->
{
@@ -1241,12 +1242,12 @@ public class CTF implements EventTask
removeOfflinePlayers();
if (_joining)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!");
}
else if (_started)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!");
}
break;
}
@@ -1261,12 +1262,12 @@ public class CTF implements EventTask
{
if (_joining)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!");
}
else if (_started)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!");
}
break;
}
@@ -1283,15 +1284,15 @@ public class CTF implements EventTask
{
if (_joining)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!");
}
else if (_teleport)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!");
}
else if (_started)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!");
}
break;
}
@@ -2639,7 +2640,7 @@ public class CTF implements EventTask
{
if (!_started && !_aborted)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Thank you For Participating At, " + _eventName + " Event.");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Thank you For Participating At, " + _eventName + " Event.");
}
}
@@ -2819,13 +2820,13 @@ public class CTF implements EventTask
// logged off with a flag in his hands
if (!player.isOnline() && player._haveFlagCTF)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player.getName() + " logged off with a CTF flag!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + player.getName() + " logged off with a CTF flag!");
player._haveFlagCTF = false;
if ((_teams.indexOf(player._teamNameHaveFlagCTF) >= 0) && _flagsTaken.get(_teams.indexOf(player._teamNameHaveFlagCTF)))
{
_flagsTaken.set(_teams.indexOf(player._teamNameHaveFlagCTF), false);
spawnFlag(player._teamNameHaveFlagCTF);
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player._teamNameHaveFlagCTF + " flag now returned to place.");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + player._teamNameHaveFlagCTF + " flag now returned to place.");
}
removeFlagFromPlayer(player);
player._teamNameHaveFlagCTF = null;
@@ -2851,7 +2852,7 @@ public class CTF implements EventTask
{
_flagsTaken.set(index, false);
spawnFlag(team);
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + team + " flag returned due to player error.");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + team + " flag returned due to player error.");
}
}
// Check if a player ran away from the event holding a flag:
@@ -2861,13 +2862,13 @@ public class CTF implements EventTask
{
if ((player != null) && player._haveFlagCTF && isOutsideCTFArea(player))
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player.getName() + " escaped from the event holding a flag!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + player.getName() + " escaped from the event holding a flag!");
player._haveFlagCTF = false;
if ((_teams.indexOf(player._teamNameHaveFlagCTF) >= 0) && _flagsTaken.get(_teams.indexOf(player._teamNameHaveFlagCTF)))
{
_flagsTaken.set(_teams.indexOf(player._teamNameHaveFlagCTF), false);
spawnFlag(player._teamNameHaveFlagCTF);
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player._teamNameHaveFlagCTF + " flag now returned to place.");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + player._teamNameHaveFlagCTF + " flag now returned to place.");
}
removeFlagFromPlayer(player);
player._teamNameHaveFlagCTF = null;
@@ -2915,7 +2916,7 @@ public class CTF implements EventTask
player.broadcastPacket(new SocialAction(player.getObjectId(), 16)); // Amazing glow
player._haveFlagCTF = true;
player.broadcastUserInfo();
player.sendPacket(new CreatureSay(player.getObjectId(), 15, ":", "You got it! Run back! ::"));
player.sendPacket(new CreatureSay(player.getObjectId(), ChatType.PARTYROOM_COMMANDER, ":", "You got it! Run back! ::"));
}
/**
@@ -3149,7 +3150,7 @@ public class CTF implements EventTask
player.broadcastUserInfo();
removeFlagFromPlayer(player);
_teamPointsCount.set(indexOwn, teamPointsCount(team) + 1);
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + player.getName() + " scores for " + player._teamNameCTF + ".");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + player.getName() + " scores for " + player._teamNameCTF + ".");
}
}
else
@@ -3164,7 +3165,7 @@ public class CTF implements EventTask
addFlagToPlayer(player);
player.broadcastUserInfo();
player._haveFlagCTF = true;
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + team + " flag taken by " + player.getName() + "...");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + team + " flag taken by " + player.getName() + "...");
pointTeamTo(player, team);
break;
}

View File

@@ -704,20 +704,20 @@ public class DM implements EventTask
_inProgress = true;
_joining = true;
spawnEventNpc();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Event " + _eventName + "!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Event " + _eventName + "!");
if (Config.DM_ANNOUNCE_REWARD && (ItemTable.getInstance().getTemplate(_rewardId) != null))
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName());
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName());
}
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl);
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName);
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl);
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName);
if (Config.DM_COMMAND)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Commands .dmjoin .dmleave .dminfo");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Commands .dmjoin .dmleave .dminfo");
}
Announcements.getInstance().gameAnnounceToAll(_eventName + ": FULL BUFF Event: be ready with your buffs, they won't be deleted!!!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": FULL BUFF Event: be ready with your buffs, they won't be deleted!!!");
return true;
}
@@ -742,7 +742,7 @@ public class DM implements EventTask
final int size = _players.size();
if (!checkMinPlayers(size))
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + size);
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + size);
if (Config.DM_STATS_LOGGER)
{
LOGGER.info(_eventName + ":Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + size);
@@ -754,7 +754,7 @@ public class DM implements EventTask
}
_joining = false;
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!");
setUserData();
ThreadPool.schedule(() ->
@@ -830,7 +830,7 @@ public class DM implements EventTask
afterStartOperations();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Started. Go to kill your enemies!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Started. Go to kill your enemies!");
_started = true;
return true;
@@ -873,7 +873,7 @@ public class DM implements EventTask
_aborted = false;
final long delay = _intervalBetweenMatches;
Announcements.getInstance().gameAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!");
waiter(delay);
@@ -885,7 +885,7 @@ public class DM implements EventTask
}
else
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": next event aborted!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": next event aborted!");
}
}
catch (Exception e)
@@ -925,7 +925,7 @@ public class DM implements EventTask
{
winners = winners + " " + winner.getName();
}
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + winners + " win the match! " + _topKills + " kills.");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + winners + " win the match! " + _topKills + " kills.");
rewardPlayer();
if (Config.DM_STATS_LOGGER)
@@ -936,7 +936,7 @@ public class DM implements EventTask
}
else
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": No players win the match(nobody killed).");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": No players win the match(nobody killed).");
if (Config.DM_STATS_LOGGER)
{
LOGGER.info(_eventName + ": No players win the match(nobody killed).");
@@ -970,7 +970,7 @@ public class DM implements EventTask
cleanDM();
_joining = false;
_inProgress = false;
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!");
return;
}
_joining = false;
@@ -981,7 +981,7 @@ public class DM implements EventTask
afterFinish();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!");
teleportFinish();
}
@@ -999,7 +999,7 @@ public class DM implements EventTask
{
sit();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!");
removeUserData();
ThreadPool.schedule(() ->
@@ -1155,12 +1155,12 @@ public class DM implements EventTask
removeOfflinePlayers();
if (_joining)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!");
}
else if (_started)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!");
}
break;
}
@@ -1175,12 +1175,12 @@ public class DM implements EventTask
{
if (_joining)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!");
}
else if (_started)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!");
}
break;
}
@@ -1197,15 +1197,15 @@ public class DM implements EventTask
{
if (_joining)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!");
}
else if (_teleport)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!");
}
else if (_started)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!");
}
break;
}
@@ -2034,7 +2034,7 @@ public class DM implements EventTask
{
if (!_started && !_aborted)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Thank you For participating!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Thank you For participating!");
}
}

View File

@@ -30,11 +30,11 @@ import java.util.logging.Logger;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.spawn.Spawn;
import org.l2jmobius.gameserver.network.clientpackets.Say2;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
@@ -281,7 +281,7 @@ public class GameEvent
public static void announceAllPlayers(String text)
{
final CreatureSay cs = new CreatureSay(0, Say2.ANNOUNCEMENT, "", text);
final CreatureSay cs = new CreatureSay(0, ChatType.ANNOUNCEMENT, "", text);
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
player.sendPacket(cs);

View File

@@ -709,17 +709,17 @@ public class TvT implements EventTask
_inProgress = true;
_joining = true;
spawnEventNpc();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Event " + _eventName + "!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Event " + _eventName + "!");
if (Config.TVT_ANNOUNCE_REWARD && (ItemTable.getInstance().getTemplate(_rewardId) != null))
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName());
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Reward: " + _rewardAmount + " " + ItemTable.getInstance().getTemplate(_rewardId).getName());
}
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl);
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + ".");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Recruiting levels: " + _minlvl + " to " + _maxlvl);
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + ".");
if (Config.TVT_COMMAND)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Commands .tvtjoin .tvtleave .tvtinfo");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Commands .tvtjoin .tvtleave .tvtinfo");
}
return true;
@@ -744,7 +744,7 @@ public class TvT implements EventTask
}
else if (Config.TVT_EVEN_TEAMS.equals("SHUFFLE") && !checkMinPlayers(_playersShuffle.size()))
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size());
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size());
if (Config.CTF_STATS_LOGGER)
{
LOGGER.info(_eventName + ":Not enough players for event. Min Requested : " + _minPlayers + ", Participating : " + _playersShuffle.size());
@@ -754,7 +754,7 @@ public class TvT implements EventTask
}
_joining = false;
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport to team spot in 20 seconds!");
setUserData();
ThreadPool.schedule(() ->
@@ -826,7 +826,7 @@ public class TvT implements EventTask
closeAdenColosseumDoors();
}
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Started. Go to kill your enemies!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Started. Go to kill your enemies!");
_started = true;
return true;
@@ -844,7 +844,7 @@ public class TvT implements EventTask
_aborted = false;
final long delay = _intervalBetweenMatches;
Announcements.getInstance().gameAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": joining period will be avaible again in " + _intervalBetweenMatches + " minute(s)!");
waiter(delay);
@@ -856,7 +856,7 @@ public class TvT implements EventTask
}
else
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": next event aborted!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": next event aborted!");
}
}
catch (Exception e)
@@ -895,30 +895,30 @@ public class TvT implements EventTask
if (Config.TVT_ANNOUNCE_TEAM_STATS)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + " Team Statistics:");
Announcements.getInstance().criticalAnnounceToAll(_eventName + " Team Statistics:");
for (String team : _teams)
{
final int _kills = teamKillsCount(team);
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Team: " + team + " - Kills: " + _kills);
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Team: " + team + " - Kills: " + _kills);
}
if (bestKiller != null)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Top killer: " + bestKiller.getName() + " - Kills: " + bestKiller._countTvTkills);
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Top killer: " + bestKiller.getName() + " - Kills: " + bestKiller._countTvTkills);
}
if ((looser != null) && (!looser.equals(bestKiller)))
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Top looser: " + looser.getName() + " - Dies: " + looser._countTvTdies);
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Top looser: " + looser.getName() + " - Dies: " + looser._countTvTdies);
}
}
if (_topTeam != null)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + _topTeam + "'s win the match! " + _topKills + " kills.");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + _topTeam + "'s win the match! " + _topKills + " kills.");
}
else
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": The event finished with a TIE: " + _topKills + " kills by each team!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": The event finished with a TIE: " + _topKills + " kills by each team!");
}
rewardTeam(_topTeam, bestKiller, looser);
@@ -946,7 +946,7 @@ public class TvT implements EventTask
}
else
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": The event finished with a TIE: No team wins the match(nobody killed)!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": The event finished with a TIE: No team wins the match(nobody killed)!");
if (Config.TVT_STATS_LOGGER)
{
@@ -997,7 +997,7 @@ public class TvT implements EventTask
cleanTvT();
_joining = false;
_inProgress = false;
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!");
return;
}
_joining = false;
@@ -1005,7 +1005,7 @@ public class TvT implements EventTask
_started = false;
_aborted = true;
unspawnEventNpc();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Match aborted!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Match aborted!");
teleportFinish();
}
@@ -1015,7 +1015,7 @@ public class TvT implements EventTask
public static void teleportFinish()
{
sit();
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Teleport back to participation NPC in 20 seconds!");
ThreadPool.schedule(() ->
{
@@ -1179,12 +1179,12 @@ public class TvT implements EventTask
removeOfflinePlayers();
if (_joining)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till registration close!");
}
else if (_started)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60 / 60) + " hour(s) till event finish!");
}
break;
}
@@ -1199,12 +1199,12 @@ public class TvT implements EventTask
{
if (_joining)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Joinable in " + _joiningLocationName + "!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till registration close!");
}
else if (_started)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + (seconds / 60) + " minute(s) till event finish!");
}
break;
}
@@ -1221,15 +1221,15 @@ public class TvT implements EventTask
{
if (_joining)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till registration close!");
}
else if (_teleport)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " seconds(s) till start fight!");
}
else if (_started)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": " + seconds + " second(s) till event finish!");
}
break;
}
@@ -2524,7 +2524,7 @@ public class TvT implements EventTask
{
if (!_started && !_aborted)
{
Announcements.getInstance().gameAnnounceToAll(_eventName + ": Thank you For Participating At, " + _eventName + " Event.");
Announcements.getInstance().criticalAnnounceToAll(_eventName + ": Thank you For Participating At, " + _eventName + " Event.");
}
}

View File

@@ -348,7 +348,7 @@ public class VIP
_inProgress = true;
_joining = true;
Announcements.getInstance().gameAnnounceToAll("Vip event has started.Use .vipjoin to join or .vipleave to leave.");
Announcements.getInstance().criticalAnnounceToAll("Vip event has started.Use .vipjoin to join or .vipleave to leave.");
spawnJoinNPC();
ThreadPool.schedule(() ->
@@ -361,22 +361,22 @@ public class VIP
public static void startEvent()
{
Announcements.getInstance().gameAnnounceToAll("Registration for the VIP event involving " + _teamName + " has ended.");
Announcements.getInstance().gameAnnounceToAll("Players will be teleported to their locations in 20 seconds.");
Announcements.getInstance().criticalAnnounceToAll("Registration for the VIP event involving " + _teamName + " has ended.");
Announcements.getInstance().criticalAnnounceToAll("Players will be teleported to their locations in 20 seconds.");
ThreadPool.schedule(() ->
{
teleportPlayers();
chooseVIP();
setUserData();
Announcements.getInstance().gameAnnounceToAll("Players have been teleported for the VIP event.");
Announcements.getInstance().gameAnnounceToAll("VIP event will start in 20 seconds.");
Announcements.getInstance().criticalAnnounceToAll("Players have been teleported for the VIP event.");
Announcements.getInstance().criticalAnnounceToAll("VIP event will start in 20 seconds.");
spawnEndNPC();
ThreadPool.schedule(() ->
{
Announcements.getInstance().gameAnnounceToAll("VIP event has started. " + _teamName + "'s VIP must get to the starter city and talk with " + getNPCName(_endNPC, null) + ". The opposing team must kill the VIP. All players except the VIP will respawn at their current locations.");
Announcements.getInstance().gameAnnounceToAll("VIP event will end if the " + _teamName + " team makes it to their town or when " + (_time / 1000 / 60) + " mins have elapsed.");
Announcements.getInstance().criticalAnnounceToAll("VIP event has started. " + _teamName + "'s VIP must get to the starter city and talk with " + getNPCName(_endNPC, null) + ". The opposing team must kill the VIP. All players except the VIP will respawn at their current locations.");
Announcements.getInstance().criticalAnnounceToAll("VIP event will end if the " + _teamName + " team makes it to their town or when " + (_time / 1000 / 60) + " mins have elapsed.");
VIP.sit();
ThreadPool.schedule(VIP::endEventTime, _time);
@@ -394,7 +394,7 @@ public class VIP
_started = false;
unspawnEventNpcs();
Announcements.getInstance().gameAnnounceToAll("The VIP has died. The opposing team has won.");
Announcements.getInstance().criticalAnnounceToAll("The VIP has died. The opposing team has won.");
rewardNotVIP();
teleportFinish();
}
@@ -409,7 +409,7 @@ public class VIP
_started = false;
unspawnEventNpcs();
Announcements.getInstance().gameAnnounceToAll("The time has run out and the " + _teamName + "'s have not made it to their goal. Everybody on the opposing team wins.");
Announcements.getInstance().criticalAnnounceToAll("The time has run out and the " + _teamName + "'s have not made it to their goal. Everybody on the opposing team wins.");
rewardNotVIP();
teleportFinish();
}
@@ -478,7 +478,7 @@ public class VIP
_started = false;
unspawnEventNpcs();
Announcements.getInstance().gameAnnounceToAll("The VIP has made it to the goal. " + _teamName + " has won. Everybody on that team wins.");
Announcements.getInstance().criticalAnnounceToAll("The VIP has made it to the goal. " + _teamName + " has won. Everybody on that team wins.");
rewardVIP();
teleportFinish();
}
@@ -631,7 +631,7 @@ public class VIP
public static void teleportFinish()
{
Announcements.getInstance().gameAnnounceToAll("Teleporting VIP players back to the Registration area in 20 seconds.");
Announcements.getInstance().criticalAnnounceToAll("Teleporting VIP players back to the Registration area in 20 seconds.");
ThreadPool.schedule(() ->
{

View File

@@ -25,6 +25,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.datatables.HeroSkillTable;
import org.l2jmobius.gameserver.datatables.SkillTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Party;
import org.l2jmobius.gameserver.model.Skill;
import org.l2jmobius.gameserver.model.StatSet;
@@ -1016,7 +1017,7 @@ class OlympiadGame
{
final int objId = manager.getLastSpawn().getObjectId();
final String npcName = manager.getLastSpawn().getName();
manager.getLastSpawn().broadcastPacket(new CreatureSay(objId, 1, npcName, "Olympiad is going to begin in Arena " + (_stadiumID + 1) + " in a moment."));
manager.getLastSpawn().broadcastPacket(new CreatureSay(objId, ChatType.SHOUT, npcName, "Olympiad is going to begin in Arena " + (_stadiumID + 1) + " in a moment."));
}
}
}

View File

@@ -36,6 +36,7 @@ import org.l2jmobius.gameserver.datatables.sql.ClanTable;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
import org.l2jmobius.gameserver.datatables.xml.ExperienceData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.Party;
@@ -4168,10 +4169,10 @@ public class SevenSignsFestival implements SpawnListener
return;
}
CreatureSay cs = new CreatureSay(_dawnChatGuide.getObjectId(), 1, senderName, message);
CreatureSay cs = new CreatureSay(_dawnChatGuide.getObjectId(), ChatType.SHOUT, senderName, message);
_dawnChatGuide.broadcastPacket(cs);
cs = new CreatureSay(_duskChatGuide.getObjectId(), 1, senderName, message);
cs = new CreatureSay(_duskChatGuide.getObjectId(), ChatType.SHOUT, senderName, message);
_duskChatGuide.broadcastPacket(cs);
}
@@ -4747,7 +4748,7 @@ public class SevenSignsFestival implements SpawnListener
{
if (!_participants.isEmpty())
{
final CreatureSay cs = new CreatureSay(_witchInst.getObjectId(), 0, "Festival Witch", message);
final CreatureSay cs = new CreatureSay(_witchInst.getObjectId(), ChatType.GENERAL, "Festival Witch", message);
for (PlayerInstance participant : _participants)
{
try

View File

@@ -28,6 +28,7 @@ import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.gameserver.datatables.sql.ClanTable;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.datatables.xml.DoorData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.idfactory.IdFactory;
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
import org.l2jmobius.gameserver.model.World;
@@ -552,7 +553,7 @@ public class BanditStrongholdSiege extends ClanHallSiege
{
if (type == 1)
{
final CreatureSay cs = new CreatureSay(0, 1, "Journal", text);
final CreatureSay cs = new CreatureSay(0, ChatType.SHOUT, "Journal", text);
for (String clanName : getRegisteredClans())
{
final Clan clan = ClanTable.getInstance().getClanByName(clanName);
@@ -568,7 +569,7 @@ public class BanditStrongholdSiege extends ClanHallSiege
}
else
{
final CreatureSay cs = new CreatureSay(0, 1, "Journal", text);
final CreatureSay cs = new CreatureSay(0, ChatType.SHOUT, "Journal", text);
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if (player.getInstanceId() == 0)

View File

@@ -28,6 +28,7 @@ import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.gameserver.datatables.sql.ClanTable;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.datatables.xml.DoorData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.idfactory.IdFactory;
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
import org.l2jmobius.gameserver.model.World;
@@ -540,7 +541,7 @@ public class WildBeastFarmSiege extends ClanHallSiege
{
if (type == 1)
{
final CreatureSay cs = new CreatureSay(0, 1, "Journal", text);
final CreatureSay cs = new CreatureSay(0, ChatType.SHOUT, "Journal", text);
for (String clanName : getRegisteredClans())
{
final Clan clan = ClanTable.getInstance().getClanByName(clanName);
@@ -556,7 +557,7 @@ public class WildBeastFarmSiege extends ClanHallSiege
}
else
{
final CreatureSay cs = new CreatureSay(0, 1, "Journal", text);
final CreatureSay cs = new CreatureSay(0, ChatType.SHOUT, "Journal", text);
for (PlayerInstance player : World.getInstance().getAllPlayers())
{
if (player.getInstanceId() == 0)

View File

@@ -1,74 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.network;
/**
* @author Beetle
*/
public enum SystemChatChannelId
{
CHAT_NORMAL("ALL"), // id = 0 , white
CHAT_SHOUT("SHOUT"), // ! id = 1 , dark orange
CHAT_TELL("WHISPER"), // " id = 2, purple
CHAT_PARTY("PARTY"), // # id = 3, green
CHAT_CLAN("CLAN"), // @ id = 4, blue/purple
CHAT_SYSTEM("EMOTE"), // ( id = 5
CHAT_USER_PET("USERPET"), // * id = 6
CHAT_GM_PET("GMPET"), // * id = 7
CHAT_MARKET("TRADE"), // + id = 8 pink
CHAT_ALLIANCE("ALLIANCE"), // $ id = 9 light green
CHAT_ANNOUNCE("ANNOUNCE"), // id = 10 light cyan
CHAT_CUSTOM("CRASH"), // id = 11 --> Crashes client
CHAT_L2FRIEND("L2FRIEND"), // id = 12
CHAT_MSN("MSN"), // id = 13
CHAT_PARTY_ROOM("PARTYROOM"), // id = 14
CHAT_COMMANDER("COMMANDER"), // id = 15
CHAT_INNER_PARTYMASTER("INNERPARTYMASTER"), // id = 16
CHAT_HERO("HERO"), // % id = 17 blue
CHAT_CRITICAL_ANNOUNCE("CRITANNOUNCE"), // id = 18 dark cyan
CHAT_UNKNOWN("UNKNOWN"), // id = 19
CHAT_BATTLEFIELD("BATTLEFIELD"), // ^ id = 20
CHAT_NONE("NONE");
private String _channelName;
private SystemChatChannelId(String channelName)
{
_channelName = channelName;
}
public int getId()
{
return ordinal();
}
public String getName()
{
return _channelName;
}
public static SystemChatChannelId getChatType(int channelId)
{
for (SystemChatChannelId channel : SystemChatChannelId.values())
{
if (channel.getId() == channelId)
{
return channel;
}
}
return SystemChatChannelId.CHAT_NONE;
}
}

View File

@@ -33,6 +33,7 @@ import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.communitybbs.Manager.MailBBSManager;
import org.l2jmobius.gameserver.datatables.SkillTable;
import org.l2jmobius.gameserver.datatables.xml.AdminData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
@@ -153,7 +154,7 @@ public class EnterWorld extends GameClientPacket
notifyPartner(player);
}
EnterGM(player);
enterGM(player);
Quest.playerEnter(player);
player.sendPacket(new QuestList(player));
@@ -561,7 +562,7 @@ public class EnterWorld extends GameClientPacket
return result;
}
private void EnterGM(PlayerInstance player)
private void enterGM(PlayerInstance player)
{
if (player.isGM())
{
@@ -659,8 +660,8 @@ public class EnterWorld extends GameClientPacket
if (Config.PM_MESSAGE_ON_START)
{
player.sendPacket(new CreatureSay(2, Say2.HERO_VOICE, Config.PM_TEXT1, Config.PM_SERVER_NAME));
player.sendPacket(new CreatureSay(15, Say2.PARTYROOM_COMMANDER, player.getName(), Config.PM_TEXT2));
player.sendPacket(new CreatureSay(2, ChatType.HERO_VOICE, Config.PM_TEXT1, Config.PM_SERVER_NAME));
player.sendPacket(new CreatureSay(15, ChatType.PARTYROOM_COMMANDER, player.getName(), Config.PM_TEXT2));
}
if (Config.SERVER_TIME_ON_START)

View File

@@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.datatables.xml.AdminData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.SystemMessageId;
@@ -70,7 +71,7 @@ public class RequestPetitionCancel extends GameClientPacket
// Notify all GMs that the player's pending petition has been cancelled.
final String msgContent = player.getName() + " has canceled a pending petition.";
AdminData.broadcastToGMs(new CreatureSay(player.getObjectId(), 17, "Petition System", msgContent));
AdminData.broadcastToGMs(new CreatureSay(player.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent));
}
else
{

View File

@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
@@ -110,7 +111,7 @@ public class RequestPrivateStoreManageBuy extends GameClientPacket
if (Config.SELL_BY_ITEM)
{
player.sendPacket(new CreatureSay(0, 15, "", "ATTENTION: Store System is not based on Adena, be careful!"));
player.sendPacket(new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", "ATTENTION: Store System is not based on Adena, be careful!"));
}
player.setPrivateStoreType(PlayerInstance.STORE_PRIVATE_BUY + 1);

View File

@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.network.clientpackets;
import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
@@ -110,7 +111,7 @@ public class RequestPrivateStoreManageSell extends GameClientPacket
if (Config.SELL_BY_ITEM)
{
player.sendPacket(new CreatureSay(0, 15, "", "ATTENTION: Store System is not based on Adena, be careful!"));
player.sendPacket(new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", "ATTENTION: Store System is not based on Adena, be careful!"));
}
player.setPrivateStoreType(PlayerInstance.STORE_PRIVATE_SELL + 1);

View File

@@ -16,15 +16,13 @@
*/
package org.l2jmobius.gameserver.network.clientpackets;
import java.nio.BufferUnderflowException;
import java.util.Collection;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.handler.VoicedCommandHandler;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
@@ -33,7 +31,6 @@ import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance.PunishLevel;
import org.l2jmobius.gameserver.network.SystemChatChannelId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
@@ -41,101 +38,84 @@ import org.l2jmobius.gameserver.util.Util;
public class Say2 extends GameClientPacket
{
private static final Logger LOGGER = Logger.getLogger(Say2.class.getName());
private static Logger _logChat = Logger.getLogger("chat");
private static final Logger LOGGER_CHAT = Logger.getLogger("chat");
public static final int ALL = 0;
public static final int SHOUT = 1; // !
public static final int TELL = 2;
public static final int PARTY = 3; // #
public static final int CLAN = 4; // @
public static final int GM = 5; // //gmchat
public static final int PETITION_PLAYER = 6; // used for petition
public static final int PETITION_GM = 7; // * used for petition
public static final int TRADE = 8; // +
public static final int ALLIANCE = 9; // $
public static final int ANNOUNCEMENT = 10; // //announce
public static final int PARTYROOM_ALL = 16; // (Red)
public static final int PARTYROOM_COMMANDER = 15; // (Yellow)
public static final int HERO_VOICE = 17; // %
public static final int CRITICAL_ANNOUNCE = 18;
private static final String[] CHAT_NAMES =
private static final String[] WALKER_COMMAND_LIST =
{
"ALL ",
"SHOUT",
"TELL ",
"PARTY",
"CLAN ",
"GM ",
"PETITION_PLAYER",
"PETITION_GM",
"TRADE",
"ALLIANCE",
"ANNOUNCEMENT", // 10
"WILLCRASHCLIENT:)",
"FAKEALL?",
"FAKEALL?",
"FAKEALL?",
"PARTYROOM_ALL",
"PARTYROOM_COMMANDER",
"CRITICAL_ANNOUNCE",
"HERO_VOICE"
"USESKILL",
"USEITEM",
"BUYITEM",
"SELLITEM",
"SAVEITEM",
"LOADITEM",
"MSG",
"SET",
"DELAY",
"LABEL",
"JMP",
"CALL",
"RETURN",
"MOVETO",
"NPCSEL",
"NPCDLG",
"DLGSEL",
"CHARSTATUS",
"POSOUTRANGE",
"POSINRANGE",
"GOHOME",
"SAY",
"EXIT",
"PAUSE",
"STRINDLG",
"STRNOTINDLG",
"CHANGEWAITTYPE",
"FORCEATTACK",
"ISMEMBER",
"REQUESTJOINPARTY",
"REQUESTOUTPARTY",
"QUITPARTY",
"MEMBERSTATUS",
"CHARBUFFS",
"ITEMCOUNT",
"FOLLOWTELEPORT"
};
private String _text;
private int _type;
private SystemChatChannelId _type2Check;
private String _target;
@Override
protected void readImpl()
{
_text = readS();
try
{
_type = readD();
_type2Check = SystemChatChannelId.getChatType(_type);
}
catch (BufferUnderflowException e)
{
_type = CHAT_NAMES.length;
_type2Check = SystemChatChannelId.CHAT_NONE;
}
_target = _type == TELL ? readS() : null;
_type = readD();
_target = _type == ChatType.WHISPER.getClientId() ? readS() : null;
}
@Override
protected void runImpl()
{
if ((_type < 0) || (_type >= CHAT_NAMES.length))
{
LOGGER.warning("Say2: Invalid type: " + _type);
return;
}
final PlayerInstance player = getClient().getPlayer();
// Anti-PHX Announce
if ((_type2Check == SystemChatChannelId.CHAT_NONE) || (_type2Check == SystemChatChannelId.CHAT_ANNOUNCE) || (_type2Check == SystemChatChannelId.CHAT_CRITICAL_ANNOUNCE) || (_type2Check == SystemChatChannelId.CHAT_SYSTEM) || (_type2Check == SystemChatChannelId.CHAT_CUSTOM) || ((_type2Check == SystemChatChannelId.CHAT_GM_PET) && !player.isGM()))
{
LOGGER.warning("[Anti-PHX Announce] Illegal Chat ( " + _type2Check + " ) channel was used by character: [" + player.getName() + "]");
return;
}
if (player == null)
{
LOGGER.warning("[Say2.java] Active Character is null.");
return;
}
if (player.isChatBanned() && !player.isGM() && (_type != CLAN) && (_type != ALLIANCE) && (_type != PARTY))
ChatType chatType = ChatType.findByClientId(_type);
if (chatType == null)
{
LOGGER.warning("Say2: Invalid type: " + _type + " Player : " + player.getName() + " text: " + _text);
return;
}
if (player.isChatBanned() && !player.isGM() && (chatType != ChatType.CLAN) && (chatType != ChatType.ALLIANCE) && (chatType != ChatType.PARTY))
{
player.sendMessage("You may not chat while a chat ban is in effect.");
return;
}
if (player.isInJail() && Config.JAIL_DISABLE_CHAT && ((_type == TELL) || (_type == SHOUT) || (_type == TRADE) || (_type == HERO_VOICE)))
if (player.isInJail() && Config.JAIL_DISABLE_CHAT && ((chatType == ChatType.WHISPER) || (chatType == ChatType.SHOUT) || (chatType == ChatType.TRADE) || (chatType == ChatType.HERO_VOICE)))
{
player.sendMessage("You can not chat with players outside of the jail.");
return;
@@ -147,15 +127,15 @@ public class Say2 extends GameClientPacket
return;
}
if (player.isCursedWeaponEquiped() && ((_type == TRADE) || (_type == SHOUT)))
if (player.isCursedWeaponEquiped() && ((chatType == ChatType.TRADE) || (chatType == ChatType.SHOUT)))
{
player.sendMessage("Shout and trade chatting cannot be used while possessing a cursed weapon.");
return;
}
if ((_type == PETITION_PLAYER) && player.isGM())
if ((chatType == ChatType.PETITION_PLAYER) && player.isGM())
{
_type = PETITION_GM;
chatType = ChatType.PETITION_GM;
}
if (_text.length() > Config.MAX_CHAT_LENGTH)
@@ -166,30 +146,17 @@ public class Say2 extends GameClientPacket
if (Config.LOG_CHAT)
{
final LogRecord record = new LogRecord(Level.INFO, _text);
record.setLoggerName("chat");
if (_type == TELL)
if (chatType == ChatType.WHISPER)
{
record.setParameters(new Object[]
{
CHAT_NAMES[_type],
"[" + player.getName() + " to " + _target + "]"
});
LOGGER_CHAT.info(chatType.name() + " [" + player + " to " + _target + "] " + _text);
}
else
{
record.setParameters(new Object[]
{
CHAT_NAMES[_type],
"[" + player.getName() + "]"
});
LOGGER_CHAT.info(chatType.name() + " [" + player + "] " + _text);
}
_logChat.log(record);
}
if (Config.L2WALKER_PROTECTION && (_type == TELL) && checkBot(_text))
if (Config.L2WALKER_PROTECTION && (chatType == ChatType.WHISPER) && checkBot(_text))
{
Util.handleIllegalPlayerAction(player, "Client Emulator Detect: Player " + player.getName() + " using l2walker.", Config.DEFAULT_PUNISH);
return;
@@ -210,7 +177,7 @@ public class Say2 extends GameClientPacket
_type = 0;
final Collection<WorldObject> list = saymode.getKnownList().getKnownObjects().values();
final CreatureSay cs = new CreatureSay(actor, _type, name, _text);
final CreatureSay cs = new CreatureSay(actor, chatType, name, _text);
for (WorldObject obj : list)
{
if (!(obj instanceof Creature))
@@ -223,10 +190,10 @@ public class Say2 extends GameClientPacket
return;
}
final CreatureSay cs = new CreatureSay(player.getObjectId(), _type, player.getName(), _text);
switch (_type)
final CreatureSay cs = new CreatureSay(player.getObjectId(), chatType, player.getName(), _text);
switch (chatType)
{
case TELL:
case WHISPER:
{
final PlayerInstance receiver = World.getInstance().getPlayer(_target);
if (receiver == null)
@@ -256,7 +223,7 @@ public class Say2 extends GameClientPacket
if (!receiver.isInRefusalMode())
{
receiver.sendPacket(cs);
player.sendPacket(new CreatureSay(player.getObjectId(), _type, "->" + receiver.getName(), _text));
player.sendPacket(new CreatureSay(player.getObjectId(), chatType, "->" + receiver.getName(), _text));
}
else
{
@@ -440,7 +407,7 @@ public class Say2 extends GameClientPacket
}
break;
}
case ALL:
case GENERAL:
{
if (_text.startsWith("."))
{
@@ -568,46 +535,6 @@ public class Say2 extends GameClientPacket
}
}
private static final String[] WALKER_COMMAND_LIST =
{
"USESKILL",
"USEITEM",
"BUYITEM",
"SELLITEM",
"SAVEITEM",
"LOADITEM",
"MSG",
"SET",
"DELAY",
"LABEL",
"JMP",
"CALL",
"RETURN",
"MOVETO",
"NPCSEL",
"NPCDLG",
"DLGSEL",
"CHARSTATUS",
"POSOUTRANGE",
"POSINRANGE",
"GOHOME",
"SAY",
"EXIT",
"PAUSE",
"STRINDLG",
"STRNOTINDLG",
"CHANGEWAITTYPE",
"FORCEATTACK",
"ISMEMBER",
"REQUESTJOINPARTY",
"REQUESTOUTPARTY",
"QUITPARTY",
"MEMBERSTATUS",
"CHARBUFFS",
"ITEMCOUNT",
"FOLLOWTELEPORT"
};
private boolean checkBot(String text)
{
for (String botCommand : WALKER_COMMAND_LIST)

View File

@@ -16,6 +16,7 @@
*/
package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
@@ -24,20 +25,20 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
public class CreatureSay extends GameServerPacket
{
private final int _objectId;
private final int _textType;
private final ChatType _chatType;
private final String _charName;
private final String _text;
/**
* @param objectId
* @param messageType
* @param chatType
* @param charName
* @param text
*/
public CreatureSay(int objectId, int messageType, String charName, String text)
public CreatureSay(int objectId, ChatType chatType, String charName, String text)
{
_objectId = objectId;
_textType = messageType;
_chatType = chatType;
_charName = charName;
_text = text;
}
@@ -47,14 +48,14 @@ public class CreatureSay extends GameServerPacket
{
writeC(0x4a);
writeD(_objectId);
writeD(_textType);
writeD(_chatType.getClientId());
writeS(_charName);
writeS(_text);
final PlayerInstance player = getClient().getPlayer();
if (player != null)
{
player.broadcastSnoop(_textType, _charName, _text, this);
player.broadcastSnoop(_chatType, _charName, _text, this);
}
}
}

View File

@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.TradeList;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -37,7 +38,7 @@ public class PrivateStoreListBuy extends GameServerPacket
if (Config.SELL_BY_ITEM)
{
_player.sendPacket(new CreatureSay(0, 15, "", "ATTENTION: Store System is not based on Adena, be careful!"));
_player.sendPacket(new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", "ATTENTION: Store System is not based on Adena, be careful!"));
_playerAdena = _player.getItemCount(Config.SELL_ITEM, -1);
}
else

View File

@@ -17,6 +17,7 @@
package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.TradeList;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -39,7 +40,7 @@ public class PrivateStoreListSell extends GameServerPacket
if (Config.SELL_BY_ITEM)
{
_player.sendPacket(new CreatureSay(0, 15, "", "ATTENTION: Store System is not based on Adena, be careful!"));
_player.sendPacket(new CreatureSay(0, ChatType.PARTYROOM_COMMANDER, "", "ATTENTION: Store System is not based on Adena, be careful!"));
_playerAdena = _player.getItemCount(Config.SELL_ITEM, -1);
}
else

View File

@@ -16,31 +16,27 @@
*/
package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
/**
* CDSDDSS -> (0xd5)(objId)(name)(0x00)(type)(speaker)(name)
*/
public class Snoop extends GameServerPacket
{
private final PlayerInstance _snooped;
private final int _type;
private final ChatType _type;
private final String _speaker;
private final String _msg;
public Snoop(PlayerInstance snooped, int type, String speaker, String msg)
public Snoop(PlayerInstance snooped, ChatType _chatType, String speaker, String msg)
{
_snooped = snooped;
_type = type;
_type = _chatType;
_speaker = speaker;
_msg = msg;
}
/*
* (non-Javadoc)
* @see net.sf.l2j.gameserver.serverpackets.ServerBasePacket#writeImpl()
*/
@Override
protected void writeImpl()
{
@@ -48,7 +44,7 @@ public class Snoop extends GameServerPacket
writeD(_snooped.getObjectId());
writeS(_snooped.getName());
writeD(0); // ??
writeD(_type);
writeD(_type.getClientId());
writeS(_speaker);
writeS(_msg);
}

View File

@@ -48,8 +48,8 @@ import org.l2jmobius.commons.util.LimitLinesDocumentListener;
import org.l2jmobius.commons.util.SplashScreen;
import org.l2jmobius.gameserver.Shutdown;
import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.multisell.Multisell;
import org.l2jmobius.gameserver.network.clientpackets.Say2;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import org.l2jmobius.gameserver.util.Broadcast;
import org.l2jmobius.gameserver.util.Util;
@@ -209,7 +209,7 @@ public class Gui
final String message = ((String) input).trim();
if (!message.isEmpty())
{
Broadcast.toAllOnlinePlayers(new CreatureSay(-1, Say2.ANNOUNCEMENT, "", message));
Broadcast.toAllOnlinePlayers(new CreatureSay(-1, ChatType.ANNOUNCEMENT, "", message));
}
}
});
@@ -225,7 +225,7 @@ public class Gui
final String message = ((String) input).trim();
if (!message.isEmpty())
{
Broadcast.toAllOnlinePlayers(new CreatureSay(-1, Say2.CRITICAL_ANNOUNCE, "", message));
Broadcast.toAllOnlinePlayers(new CreatureSay(-1, ChatType.CRITICAL_ANNOUNCE, "", message));
}
}
});

View File

@@ -17,8 +17,8 @@
package org.l2jmobius.gameserver.util;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.clientpackets.Say2;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
/**
@@ -40,7 +40,7 @@ public class BuilderUtil
{
if (Config.GM_STARTUP_BUILDER_HIDE)
{
player.sendPacket(new CreatureSay(0, Say2.ALL, "SYS", message));
player.sendPacket(new CreatureSay(0, ChatType.GENERAL, "SYS", message));
}
else
{
@@ -55,7 +55,7 @@ public class BuilderUtil
*/
public static void sendHtmlMessage(PlayerInstance player, String message)
{
player.sendPacket(new CreatureSay(0, Say2.ALL, "HTML", message));
player.sendPacket(new CreatureSay(0, ChatType.GENERAL, "HTML", message));
}
/**

View File

@@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
import org.l2jmobius.gameserver.datatables.sql.TeleportLocationTable;
import org.l2jmobius.gameserver.datatables.xml.AdminData;
import org.l2jmobius.gameserver.datatables.xml.ZoneData;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.DayNightSpawnManager;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
@@ -75,7 +76,6 @@ import org.l2jmobius.gameserver.model.entity.Announcements;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.multisell.Multisell;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.clientpackets.Say2;
import org.l2jmobius.gameserver.network.serverpackets.CharInfo;
import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
@@ -335,7 +335,7 @@ public class GameStatusThread extends Thread
final String name = st.nextToken();
final String message = val.substring(name.length() + 1);
final PlayerInstance reciever = World.getInstance().getPlayer(name);
final CreatureSay cs = new CreatureSay(0, Say2.TELL, "Telnet Priv", message);
final CreatureSay cs = new CreatureSay(0, ChatType.WHISPER, "Telnet Priv", message);
if (reciever != null)
{
reciever.sendPacket(cs);
@@ -357,7 +357,7 @@ public class GameStatusThread extends Thread
try
{
usrCommand = usrCommand.substring(7);
final CreatureSay cs = new CreatureSay(0, Say2.ALLIANCE, "Telnet GM Broadcast from " + _cSocket.getInetAddress().getHostAddress(), usrCommand);
final CreatureSay cs = new CreatureSay(0, ChatType.ALLIANCE, "Telnet GM Broadcast from " + _cSocket.getInetAddress().getHostAddress(), usrCommand);
AdminData.broadcastToGMs(cs);
_print.println("Your Message Has Been Sent To " + getOnlineGMs() + " GM(s).");
}