Sync with L2JServer Feb 7th 2015.
This commit is contained in:
@@ -43,9 +43,11 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
@@ -59,6 +61,7 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.enums.IllegalActionPunishmentType;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
import com.l2jserver.gameserver.model.Location;
|
||||
@@ -524,6 +527,7 @@ public final class Config
|
||||
public static int PEACE_ZONE_MODE;
|
||||
public static String DEFAULT_GLOBAL_CHAT;
|
||||
public static String DEFAULT_TRADE_CHAT;
|
||||
public static int MINIMUM_CHAT_LEVEL;
|
||||
public static boolean ALLOW_WAREHOUSE;
|
||||
public static boolean WAREHOUSE_CACHE;
|
||||
public static int WAREHOUSE_CACHE_TIME;
|
||||
@@ -546,13 +550,12 @@ public final class Config
|
||||
public static int BOAT_BROADCAST_RADIUS;
|
||||
public static boolean ALLOW_CURSED_WEAPONS;
|
||||
public static boolean ALLOW_MANOR;
|
||||
public static boolean ALLOW_PET_WALKERS;
|
||||
public static boolean SERVER_NEWS;
|
||||
public static boolean ENABLE_COMMUNITY_BOARD;
|
||||
public static String BBS_DEFAULT;
|
||||
public static boolean USE_SAY_FILTER;
|
||||
public static String CHAT_FILTER_CHARS;
|
||||
public static int[] BAN_CHAT_CHANNELS;
|
||||
public static Set<ChatType> BAN_CHAT_CHANNELS;
|
||||
public static int WORLD_CHAT_MIN_LEVEL;
|
||||
public static int WORLD_CHAT_POINTS_PER_DAY;
|
||||
public static Duration WORLD_CHAT_INTERVAL;
|
||||
@@ -1888,6 +1891,7 @@ public final class Config
|
||||
PEACE_ZONE_MODE = General.getInt("PeaceZoneMode", 0);
|
||||
DEFAULT_GLOBAL_CHAT = General.getString("GlobalChat", "ON");
|
||||
DEFAULT_TRADE_CHAT = General.getString("TradeChat", "ON");
|
||||
MINIMUM_CHAT_LEVEL = General.getInt("MinimumChatLevel", 0);
|
||||
ALLOW_WAREHOUSE = General.getBoolean("AllowWarehouse", true);
|
||||
WAREHOUSE_CACHE = General.getBoolean("WarehouseCache", false);
|
||||
WAREHOUSE_CACHE_TIME = General.getInt("WarehouseCacheTime", 15);
|
||||
@@ -1910,20 +1914,18 @@ public final class Config
|
||||
ALLOW_BOAT = General.getBoolean("AllowBoat", true);
|
||||
BOAT_BROADCAST_RADIUS = General.getInt("BoatBroadcastRadius", 20000);
|
||||
ALLOW_CURSED_WEAPONS = General.getBoolean("AllowCursedWeapons", true);
|
||||
ALLOW_PET_WALKERS = General.getBoolean("AllowPetWalkers", true);
|
||||
SERVER_NEWS = General.getBoolean("ShowServerNews", false);
|
||||
ENABLE_COMMUNITY_BOARD = General.getBoolean("EnableCommunityBoard", true);
|
||||
BBS_DEFAULT = General.getString("BBSDefault", "_bbshome");
|
||||
USE_SAY_FILTER = General.getBoolean("UseChatFilter", false);
|
||||
CHAT_FILTER_CHARS = General.getString("ChatFilterChars", "^_^");
|
||||
String[] propertySplit4 = General.getString("BanChatChannels", "0;1;8;17").trim().split(";");
|
||||
BAN_CHAT_CHANNELS = new int[propertySplit4.length];
|
||||
final String[] propertySplit4 = General.getString("BanChatChannels", "GENERAL;SHOUT;GLOBAL;TRADE;HERO_VOICE").trim().split(";");
|
||||
BAN_CHAT_CHANNELS = new HashSet<>();
|
||||
try
|
||||
{
|
||||
int i = 0;
|
||||
for (String chatId : propertySplit4)
|
||||
{
|
||||
BAN_CHAT_CHANNELS[i++] = Integer.parseInt(chatId);
|
||||
BAN_CHAT_CHANNELS.add(Enum.valueOf(ChatType.class, chatId));
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
@@ -3324,9 +3326,6 @@ public final class Config
|
||||
case "allowmanor":
|
||||
ALLOW_MANOR = Boolean.parseBoolean(pValue);
|
||||
break;
|
||||
case "allowpetwalkers":
|
||||
ALLOW_PET_WALKERS = Boolean.parseBoolean(pValue);
|
||||
break;
|
||||
case "enablecommunityboard":
|
||||
ENABLE_COMMUNITY_BOARD = Boolean.parseBoolean(pValue);
|
||||
break;
|
||||
|
@@ -28,12 +28,12 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.announce.Announcement;
|
||||
import com.l2jserver.gameserver.model.announce.AnnouncementType;
|
||||
import com.l2jserver.gameserver.model.announce.AutoAnnouncement;
|
||||
import com.l2jserver.gameserver.model.announce.IAnnouncement;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
|
||||
|
||||
/**
|
||||
@@ -112,7 +112,7 @@ public final class AnnouncementsTable
|
||||
{
|
||||
if (announce.isValid() && (announce.getType() == type))
|
||||
{
|
||||
player.sendPacket(new CreatureSay(0, Say2.ANNOUNCEMENT, player.getName(), announce.getContent()));
|
||||
player.sendPacket(new CreatureSay(0, ChatType.ANNOUNCEMENT, player.getName(), announce.getContent()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
84
trunk/java/com/l2jserver/gameserver/enums/ChatType.java
Normal file
84
trunk/java/com/l2jserver/gameserver/enums/ChatType.java
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
* L2J Server 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.
|
||||
*
|
||||
* L2J Server 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 com.l2jserver.gameserver.enums;
|
||||
|
||||
/**
|
||||
* @author St3eT
|
||||
*/
|
||||
public enum ChatType
|
||||
{
|
||||
GENERAL(0),
|
||||
SHOUT(1),
|
||||
TELL(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),
|
||||
SCREEN_ANNOUNCE(19),
|
||||
BATTLEFIELD(20),
|
||||
MPCC_ROOM(21),
|
||||
NPC_GENERAL(22),
|
||||
NPC_SHOUT(23),
|
||||
NPC_TELL(24),
|
||||
GLOBAL(25);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J Server
|
||||
*
|
||||
* This file is part of L2J Server.
|
||||
*
|
||||
* L2J Server 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.
|
||||
*
|
||||
* L2J Server 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 com.l2jserver.gameserver.enums;
|
||||
|
||||
/**
|
||||
* @author malyelfik
|
||||
*/
|
||||
public enum SubclassInfoType
|
||||
{
|
||||
NO_CHANGES,
|
||||
NEW_SLOT_USED,
|
||||
CLASS_CHANGED
|
||||
}
|
@@ -18,23 +18,25 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.handler;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
|
||||
/**
|
||||
* This class handles all chat handlers
|
||||
* @author durgus, UnAfraid
|
||||
*/
|
||||
public class ChatHandler implements IHandler<IChatHandler, Integer>
|
||||
public class ChatHandler implements IHandler<IChatHandler, ChatType>
|
||||
{
|
||||
private final Map<Integer, IChatHandler> _datatable;
|
||||
private final Map<ChatType, IChatHandler> _datatable = new EnumMap<>(ChatType.class);
|
||||
|
||||
/**
|
||||
* Singleton constructor
|
||||
*/
|
||||
protected ChatHandler()
|
||||
{
|
||||
_datatable = new HashMap<>();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,20 +46,18 @@ public class ChatHandler implements IHandler<IChatHandler, Integer>
|
||||
@Override
|
||||
public void registerHandler(IChatHandler handler)
|
||||
{
|
||||
int[] ids = handler.getChatTypeList();
|
||||
for (int id : ids)
|
||||
for (ChatType type : handler.getChatTypeList())
|
||||
{
|
||||
_datatable.put(id, handler);
|
||||
_datatable.put(type, handler);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void removeHandler(IChatHandler handler)
|
||||
{
|
||||
int[] ids = handler.getChatTypeList();
|
||||
for (int id : ids)
|
||||
for (ChatType type : handler.getChatTypeList())
|
||||
{
|
||||
_datatable.remove(id);
|
||||
_datatable.remove(type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ChatHandler implements IHandler<IChatHandler, Integer>
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IChatHandler getHandler(Integer chatType)
|
||||
public IChatHandler getHandler(ChatType chatType)
|
||||
{
|
||||
return _datatable.get(chatType);
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.handler;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
@@ -33,11 +34,11 @@ public interface IChatHandler
|
||||
* @param target
|
||||
* @param text
|
||||
*/
|
||||
public void handleChat(int type, L2PcInstance activeChar, String target, String text);
|
||||
public void handleChat(ChatType type, L2PcInstance activeChar, String target, String text);
|
||||
|
||||
/**
|
||||
* Returns a list of all chat types registered to this handler
|
||||
* @return
|
||||
*/
|
||||
public int[] getChatTypeList();
|
||||
public ChatType[] getChatTypeList();
|
||||
}
|
@@ -26,11 +26,11 @@ import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.data.xml.impl.AdminData;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.enums.PetitionState;
|
||||
import com.l2jserver.gameserver.model.Petition;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -342,7 +342,7 @@ public final 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);
|
||||
@@ -352,7 +352,7 @@ public final 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);
|
||||
@@ -425,7 +425,7 @@ public final 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.getInstance().broadcastToGMs(new CreatureSay(petitioner.getObjectId(), Say2.HERO_VOICE, "Petition System", msgContent));
|
||||
AdminData.getInstance().broadcastToGMs(new CreatureSay(petitioner.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent));
|
||||
|
||||
return newPetitionId;
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@ import org.w3c.dom.Node;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.data.xml.IXmlReader;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.instancemanager.tasks.StartMovingTask;
|
||||
import com.l2jserver.gameserver.model.L2NpcWalkerNode;
|
||||
import com.l2jserver.gameserver.model.L2WalkRoute;
|
||||
@@ -42,7 +43,6 @@ import com.l2jserver.gameserver.model.events.EventDispatcher;
|
||||
import com.l2jserver.gameserver.model.events.impl.character.npc.OnNpcMoveNodeArrived;
|
||||
import com.l2jserver.gameserver.model.holders.NpcRoutesHolder;
|
||||
import com.l2jserver.gameserver.network.NpcStringId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
import com.l2jserver.gameserver.util.Broadcast;
|
||||
|
||||
@@ -429,11 +429,11 @@ public final class WalkingManager implements IXmlReader
|
||||
|
||||
if (node.getNpcString() != null)
|
||||
{
|
||||
Broadcast.toKnownPlayers(npc, new NpcSay(npc, Say2.NPC_ALL, node.getNpcString()));
|
||||
Broadcast.toKnownPlayers(npc, new NpcSay(npc, ChatType.NPC_GENERAL, node.getNpcString()));
|
||||
}
|
||||
else if (!node.getChatText().isEmpty())
|
||||
{
|
||||
Broadcast.toKnownPlayers(npc, new NpcSay(npc, Say2.NPC_ALL, node.getChatText()));
|
||||
Broadcast.toKnownPlayers(npc, new NpcSay(npc, ChatType.NPC_GENERAL, node.getChatText()));
|
||||
}
|
||||
|
||||
if (npc.isDebug())
|
||||
|
@@ -858,8 +858,7 @@ public final class CharEffectList
|
||||
public void stopEffects(L2EffectType type)
|
||||
{
|
||||
boolean update = false;
|
||||
final Consumer<BuffInfo> action = info ->
|
||||
{
|
||||
final Consumer<BuffInfo> action = info -> {
|
||||
if (info.getEffects().stream().anyMatch(effect -> (effect != null) && (effect.getEffectType() == type)))
|
||||
{
|
||||
stopAndRemove(info);
|
||||
@@ -1022,25 +1021,25 @@ public final class CharEffectList
|
||||
{
|
||||
if (hasBuffs())
|
||||
{
|
||||
getBuffs().values().stream().filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getBuffs()));
|
||||
getBuffs().values().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getBuffs()));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasTriggered())
|
||||
{
|
||||
getTriggered().values().stream().filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getTriggered()));
|
||||
getTriggered().values().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getTriggered()));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasDances())
|
||||
{
|
||||
getDances().values().stream().filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getDances()));
|
||||
getDances().values().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getDances()));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasToggles())
|
||||
{
|
||||
getToggles().values().stream().filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getToggles()));
|
||||
getToggles().values().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getToggles()));
|
||||
update = true;
|
||||
}
|
||||
}
|
||||
@@ -1049,7 +1048,7 @@ public final class CharEffectList
|
||||
{
|
||||
if (hasDebuffs())
|
||||
{
|
||||
getDebuffs().values().stream().filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getDebuffs()));
|
||||
getDebuffs().values().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getDebuffs()));
|
||||
update = true;
|
||||
}
|
||||
}
|
||||
|
@@ -39,6 +39,7 @@ import com.l2jserver.gameserver.ai.L2SiegeGuardAI;
|
||||
import com.l2jserver.gameserver.datatables.EventDroplist;
|
||||
import com.l2jserver.gameserver.datatables.EventDroplist.DateDrop;
|
||||
import com.l2jserver.gameserver.datatables.ItemTable;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.enums.InstanceType;
|
||||
import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;
|
||||
import com.l2jserver.gameserver.instancemanager.PcCafePointsManager;
|
||||
@@ -69,7 +70,6 @@ import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.model.stats.Stats;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jserver.gameserver.taskmanager.DecayTaskManager;
|
||||
@@ -279,7 +279,7 @@ public class L2Attackable extends L2Npc
|
||||
_commandChannelTimer = new CommandChannelTimer(this);
|
||||
_commandChannelLastAttack = System.currentTimeMillis();
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(_commandChannelTimer, 10000); // check for last attack
|
||||
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(0, Say2.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
|
||||
_firstCommandChannelAttacked.broadcastPacket(new CreatureSay(0, ChatType.PARTYROOM_ALL, "", "You have looting rights!")); // TODO: retail msg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -23,6 +23,7 @@ import javolution.util.FastList;
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.enums.InstanceType;
|
||||
import com.l2jserver.gameserver.instancemanager.FortSiegeManager;
|
||||
import com.l2jserver.gameserver.model.FortSiegeSpawn;
|
||||
@@ -32,7 +33,6 @@ import com.l2jserver.gameserver.model.actor.L2Summon;
|
||||
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.network.NpcStringId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
|
||||
public class L2FortCommanderInstance extends L2DefenderInstance
|
||||
@@ -148,7 +148,7 @@ public class L2FortCommanderInstance extends L2DefenderInstance
|
||||
}
|
||||
if (npcString != null)
|
||||
{
|
||||
NpcSay ns = new NpcSay(getObjectId(), Say2.NPC_SHOUT, getId(), npcString);
|
||||
NpcSay ns = new NpcSay(getObjectId(), ChatType.NPC_SHOUT, getId(), npcString);
|
||||
if (npcString.getParamCount() == 1)
|
||||
{
|
||||
ns.addStringParameter(attacker.getName());
|
||||
|
@@ -84,6 +84,7 @@ import com.l2jserver.gameserver.datatables.ItemTable;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.enums.CastleSide;
|
||||
import com.l2jserver.gameserver.enums.CategoryType;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.enums.HtmlActionScope;
|
||||
import com.l2jserver.gameserver.enums.IllegalActionPunishmentType;
|
||||
import com.l2jserver.gameserver.enums.InstanceType;
|
||||
@@ -96,6 +97,7 @@ import com.l2jserver.gameserver.enums.Race;
|
||||
import com.l2jserver.gameserver.enums.Sex;
|
||||
import com.l2jserver.gameserver.enums.ShortcutType;
|
||||
import com.l2jserver.gameserver.enums.ShotType;
|
||||
import com.l2jserver.gameserver.enums.SubclassInfoType;
|
||||
import com.l2jserver.gameserver.enums.Team;
|
||||
import com.l2jserver.gameserver.enums.UserInfoType;
|
||||
import com.l2jserver.gameserver.handler.IItemHandler;
|
||||
@@ -365,8 +367,8 @@ public final class L2PcInstance extends L2Playable
|
||||
private static final String DELETE_ITEM_REUSE_SAVE = "DELETE FROM character_item_reuse_save WHERE charId=?";
|
||||
|
||||
// Character Character SQL String Definitions:
|
||||
private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,createDate) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,newbie=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,pccafe_points=?,language=?,faction=? WHERE charId=?";
|
||||
private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,clan_privs,wantspeace,base_class,nobless,power_grade,createDate) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,pccafe_points=?,language=?,faction=? WHERE charId=?";
|
||||
private static final String RESTORE_CHARACTER = "SELECT * FROM characters WHERE charId=?";
|
||||
|
||||
// Character Premium System String Definitions:
|
||||
@@ -400,8 +402,6 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
private static final String COND_OVERRIDE_KEY = "cond_override";
|
||||
|
||||
public static final String NEWBIE_KEY = "NEWBIE";
|
||||
|
||||
public static final int ID_NONE = -1;
|
||||
|
||||
public static final int REQUEST_TIMEOUT = 15;
|
||||
@@ -608,9 +608,6 @@ public final class L2PcInstance extends L2Playable
|
||||
// Multisell
|
||||
private PreparedListContainer _currentMultiSell = null;
|
||||
|
||||
/** Bitmask used to keep track of one-time/newbie quest rewards */
|
||||
private int _newbie;
|
||||
|
||||
private boolean _noble = false;
|
||||
private boolean _hero = false;
|
||||
|
||||
@@ -935,6 +932,8 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
private boolean _hasCharmOfCourage = false;
|
||||
|
||||
private final Set<Integer> _whispepers = ConcurrentHashMap.newKeySet();
|
||||
|
||||
private int _jumpTrackId = 0;
|
||||
|
||||
/**
|
||||
@@ -961,8 +960,6 @@ public final class L2PcInstance extends L2Playable
|
||||
player.setCreateDate(Calendar.getInstance());
|
||||
// Set the base class ID to that of the actual class ID.
|
||||
player.setBaseClass(player.getClassId());
|
||||
// Kept for backwards compatibility.
|
||||
player.setNewbie(1);
|
||||
// Give 20 recommendations
|
||||
player.setRecomLeft(20);
|
||||
// Add the player in the characters table of the database
|
||||
@@ -1259,23 +1256,6 @@ public final class L2PcInstance extends L2Playable
|
||||
return super.getLevelMod();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the _newbie rewards state of the L2PcInstance.
|
||||
*/
|
||||
public int getNewbie()
|
||||
{
|
||||
return _newbie;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the _newbie rewards state of the L2PcInstance.
|
||||
* @param newbieRewards The Identifier of the _newbie state
|
||||
*/
|
||||
public void setNewbie(int newbieRewards)
|
||||
{
|
||||
_newbie = newbieRewards;
|
||||
}
|
||||
|
||||
public void setBaseClass(int baseClass)
|
||||
{
|
||||
_baseClass = baseClass;
|
||||
@@ -2426,6 +2406,8 @@ public final class L2PcInstance extends L2Playable
|
||||
getClan().broadcastToOnlineMembers(new PledgeShowMemberListUpdate(this));
|
||||
}
|
||||
|
||||
sendPacket(new ExSubjobInfo(this, SubclassInfoType.CLASS_CHANGED));
|
||||
|
||||
// Add AutoGet skills and normal skills and/or learnByFS depending on configurations.
|
||||
rewardSkills();
|
||||
|
||||
@@ -7025,14 +7007,12 @@ public final class L2PcInstance extends L2Playable
|
||||
statement.setInt(27, getAppearance().getTitleColor());
|
||||
statement.setInt(28, getAccessLevel().getLevel());
|
||||
statement.setInt(29, isOnlineInt());
|
||||
statement.setInt(30, 0); // Unused
|
||||
statement.setInt(31, getClanPrivileges().getBitmask());
|
||||
statement.setInt(32, getWantsPeace());
|
||||
statement.setInt(33, getBaseClass());
|
||||
statement.setInt(34, getNewbie());
|
||||
statement.setInt(35, isNoble() ? 1 : 0);
|
||||
statement.setLong(36, 0);
|
||||
statement.setDate(37, new Date(getCreateDate().getTimeInMillis()));
|
||||
statement.setInt(30, getClanPrivileges().getBitmask());
|
||||
statement.setInt(31, getWantsPeace());
|
||||
statement.setInt(32, getBaseClass());
|
||||
statement.setInt(33, isNoble() ? 1 : 0);
|
||||
statement.setLong(34, 0);
|
||||
statement.setDate(35, new Date(getCreateDate().getTimeInMillis()));
|
||||
statement.executeUpdate();
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -7088,7 +7068,6 @@ public final class L2PcInstance extends L2Playable
|
||||
player.setPvpKills(rset.getInt("pvpkills"));
|
||||
player.setPkKills(rset.getInt("pkkills"));
|
||||
player.setOnlineTime(rset.getLong("onlinetime"));
|
||||
player.setNewbie(rset.getInt("newbie"));
|
||||
player.setNoble(rset.getInt("nobless") == 1);
|
||||
|
||||
final int factionId = rset.getInt("faction");
|
||||
@@ -7660,10 +7639,9 @@ public final class L2PcInstance extends L2Playable
|
||||
statement.setInt(28, getAppearance().getTitleColor());
|
||||
statement.setInt(29, getAccessLevel().getLevel());
|
||||
statement.setInt(30, isOnlineInt());
|
||||
statement.setInt(31, 0); // Unused
|
||||
statement.setInt(32, getClanPrivileges().getBitmask());
|
||||
statement.setInt(33, getWantsPeace());
|
||||
statement.setInt(34, getBaseClass());
|
||||
statement.setInt(31, getClanPrivileges().getBitmask());
|
||||
statement.setInt(32, getWantsPeace());
|
||||
statement.setInt(33, getBaseClass());
|
||||
|
||||
long totalOnlineTime = _onlineTime;
|
||||
if (_onlineBeginTime > 0)
|
||||
@@ -7671,22 +7649,21 @@ public final class L2PcInstance extends L2Playable
|
||||
totalOnlineTime += (System.currentTimeMillis() - _onlineBeginTime) / 1000;
|
||||
}
|
||||
|
||||
statement.setLong(35, totalOnlineTime);
|
||||
statement.setInt(36, getNewbie());
|
||||
statement.setInt(37, isNoble() ? 1 : 0);
|
||||
statement.setInt(38, getPowerGrade());
|
||||
statement.setInt(39, getPledgeType());
|
||||
statement.setInt(40, getLvlJoinedAcademy());
|
||||
statement.setLong(41, getApprentice());
|
||||
statement.setLong(42, getSponsor());
|
||||
statement.setLong(43, getClanJoinExpiryTime());
|
||||
statement.setLong(44, getClanCreateExpiryTime());
|
||||
statement.setString(45, getName());
|
||||
statement.setLong(46, 0); // unset
|
||||
statement.setInt(47, getBookMarkSlot());
|
||||
statement.setInt(48, _vitalityPoints); // unset
|
||||
statement.setInt(49, getPcBangPoints());
|
||||
statement.setString(50, getLang());
|
||||
statement.setLong(34, totalOnlineTime);
|
||||
statement.setInt(35, isNoble() ? 1 : 0);
|
||||
statement.setInt(36, getPowerGrade());
|
||||
statement.setInt(37, getPledgeType());
|
||||
statement.setInt(38, getLvlJoinedAcademy());
|
||||
statement.setLong(39, getApprentice());
|
||||
statement.setLong(40, getSponsor());
|
||||
statement.setLong(41, getClanJoinExpiryTime());
|
||||
statement.setLong(42, getClanCreateExpiryTime());
|
||||
statement.setString(43, getName());
|
||||
statement.setLong(44, 0); // unset
|
||||
statement.setInt(45, getBookMarkSlot());
|
||||
statement.setInt(46, _vitalityPoints); // unset
|
||||
statement.setInt(47, getPcBangPoints());
|
||||
statement.setString(48, getLang());
|
||||
|
||||
int factionId = 0;
|
||||
if (isGood())
|
||||
@@ -7697,9 +7674,9 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
factionId = 2;
|
||||
}
|
||||
statement.setInt(51, factionId);
|
||||
statement.setInt(49, factionId);
|
||||
|
||||
statement.setInt(52, getObjectId());
|
||||
statement.setInt(50, getObjectId());
|
||||
statement.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -10752,7 +10729,6 @@ public final class L2PcInstance extends L2Playable
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendPacket(new ExSubjobInfo(this));
|
||||
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
return true;
|
||||
@@ -11176,8 +11152,7 @@ public final class L2PcInstance extends L2Playable
|
||||
pet.updateAndBroadcastStatus(0);
|
||||
}
|
||||
|
||||
getServitors().values().forEach(s ->
|
||||
{
|
||||
getServitors().values().forEach(s -> {
|
||||
s.setFollowStatus(false);
|
||||
s.teleToLocation(getLocation(), false);
|
||||
((L2SummonAI) s.getAI()).setStartFollowController(true);
|
||||
@@ -11282,11 +11257,11 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastSnoop(int type, String name, String _text)
|
||||
public void broadcastSnoop(ChatType type, String name, String _text)
|
||||
{
|
||||
if (!_snoopListener.isEmpty())
|
||||
{
|
||||
Snoop sn = new Snoop(getObjectId(), getName(), type, name, _text);
|
||||
final Snoop sn = new Snoop(getObjectId(), getName(), type, name, _text);
|
||||
|
||||
for (L2PcInstance pci : _snoopListener)
|
||||
{
|
||||
@@ -11780,8 +11755,7 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
}
|
||||
|
||||
getServitors().values().forEach(s ->
|
||||
{
|
||||
getServitors().values().forEach(s -> {
|
||||
s.setRestoreSummon(true);
|
||||
s.unSummon(this);
|
||||
});
|
||||
@@ -15196,4 +15170,13 @@ public final class L2PcInstance extends L2Playable
|
||||
vars.set("PRIME_POINTS", points);
|
||||
vars.storeMe();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the whisperers.
|
||||
* @return the whisperers
|
||||
*/
|
||||
public Set<Integer> getWhisperers()
|
||||
{
|
||||
return _whispepers;
|
||||
}
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ package com.l2jserver.gameserver.model.actor.instance;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.enums.InstanceType;
|
||||
import com.l2jserver.gameserver.instancemanager.FourSepulchersManager;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
@@ -359,7 +360,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
|
||||
return;
|
||||
}
|
||||
|
||||
broadcastPacket(new NpcSay(getObjectId(), 0, getId(), "forgive me!!"));
|
||||
broadcastPacket(new NpcSay(getObjectId(), ChatType.NPC_GENERAL, getId(), "forgive me!!"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -386,7 +387,7 @@ public class L2SepulcherMonsterInstance extends L2MonsterInstance
|
||||
}
|
||||
|
||||
FourSepulchersManager.getInstance().spawnKeyBox(_activeChar);
|
||||
broadcastPacket(new NpcSay(getObjectId(), 0, getId(), "Many thanks for rescue me."));
|
||||
broadcastPacket(new NpcSay(getObjectId(), ChatType.NPC_GENERAL, getId(), "Many thanks for rescue me."));
|
||||
if (_victimShout != null)
|
||||
{
|
||||
_victimShout.cancel(true);
|
||||
|
@@ -24,6 +24,7 @@ import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.ai.CtrlIntention;
|
||||
import com.l2jserver.gameserver.data.xml.impl.DoorData;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.enums.InstanceType;
|
||||
import com.l2jserver.gameserver.instancemanager.FourSepulchersManager;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
@@ -34,7 +35,6 @@ import com.l2jserver.gameserver.model.events.EventType;
|
||||
import com.l2jserver.gameserver.model.events.impl.character.npc.OnNpcFirstTalk;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jserver.gameserver.network.NpcStringId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
@@ -433,7 +433,7 @@ public class L2SepulcherNpcInstance extends L2Npc
|
||||
return;// wrong usage
|
||||
}
|
||||
|
||||
final CreatureSay creatureSay = new CreatureSay(0, Say2.NPC_SHOUT, getName(), msg);
|
||||
final CreatureSay creatureSay = new CreatureSay(0, ChatType.NPC_SHOUT, getName(), msg);
|
||||
for (L2PcInstance player : L2World.getInstance().getPlayers())
|
||||
{
|
||||
if (Util.checkIfInRange(15000, player, this, true))
|
||||
|
@@ -34,6 +34,7 @@ import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.enums.FortTeleportWhoType;
|
||||
import com.l2jserver.gameserver.enums.SiegeClanType;
|
||||
import com.l2jserver.gameserver.instancemanager.FortManager;
|
||||
@@ -57,7 +58,6 @@ import com.l2jserver.gameserver.model.events.impl.sieges.fort.OnFortSiegeFinish;
|
||||
import com.l2jserver.gameserver.model.events.impl.sieges.fort.OnFortSiegeStart;
|
||||
import com.l2jserver.gameserver.network.NpcStringId;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
@@ -648,7 +648,7 @@ public class FortSiege implements Siegable
|
||||
}
|
||||
if (npcString != null)
|
||||
{
|
||||
instance.broadcastPacket(new NpcSay(instance.getObjectId(), Say2.NPC_SHOUT, instance.getId(), npcString));
|
||||
instance.broadcastPacket(new NpcSay(instance.getObjectId(), ChatType.NPC_SHOUT, instance.getId(), npcString));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -45,6 +45,7 @@ import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.data.xml.impl.DoorData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.enums.InstanceReenterType;
|
||||
import com.l2jserver.gameserver.enums.InstanceRemoveBuffType;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
@@ -64,7 +65,6 @@ import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
import com.l2jserver.gameserver.model.holders.InstanceReenterTimeHolder;
|
||||
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jserver.gameserver.util.Broadcast;
|
||||
@@ -801,14 +801,14 @@ public final class Instance
|
||||
{
|
||||
timeLeft = remaining / 1000;
|
||||
interval = 30000;
|
||||
cs = new CreatureSay(0, Say2.ALLIANCE, "Notice", timeLeft + " seconds left.");
|
||||
cs = new CreatureSay(0, ChatType.ALLIANCE, "Notice", timeLeft + " seconds left.");
|
||||
remaining = remaining - 30000;
|
||||
}
|
||||
else
|
||||
{
|
||||
timeLeft = remaining / 1000;
|
||||
interval = 10000;
|
||||
cs = new CreatureSay(0, Say2.ALLIANCE, "Notice", timeLeft + " seconds left.");
|
||||
cs = new CreatureSay(0, ChatType.ALLIANCE, "Notice", timeLeft + " seconds left.");
|
||||
remaining = remaining - 10000;
|
||||
}
|
||||
if (cs != null)
|
||||
@@ -857,8 +857,7 @@ public final class Instance
|
||||
{
|
||||
if ((player != null))
|
||||
{
|
||||
_ejectDeadTasks.put(player.getObjectId(), ThreadPoolManager.getInstance().scheduleGeneral(() ->
|
||||
{
|
||||
_ejectDeadTasks.put(player.getObjectId(), ThreadPoolManager.getInstance().scheduleGeneral(() -> {
|
||||
if (player.isDead() && (player.getInstanceId() == getId()))
|
||||
{
|
||||
player.setInstanceId(0);
|
||||
|
@@ -34,6 +34,7 @@ import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.datatables.ItemTable;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.instancemanager.AntiFeedManager;
|
||||
import com.l2jserver.gameserver.instancemanager.InstanceManager;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
@@ -54,7 +55,6 @@ import com.l2jserver.gameserver.model.events.impl.events.OnTvTEventStart;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
||||
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
|
||||
@@ -856,7 +856,7 @@ public class TvTEvent
|
||||
|
||||
killerTeam.increasePoints();
|
||||
|
||||
CreatureSay cs = new CreatureSay(killerPlayerInstance.getObjectId(), Say2.TELL, killerPlayerInstance.getName(), "I have killed " + killedPlayerInstance.getName() + "!");
|
||||
CreatureSay cs = new CreatureSay(killerPlayerInstance.getObjectId(), ChatType.TELL, killerPlayerInstance.getName(), "I have killed " + killedPlayerInstance.getName() + "!");
|
||||
|
||||
for (L2PcInstance playerInstance : _teams[killerTeamId].getParticipatedPlayers().values())
|
||||
{
|
||||
|
@@ -35,6 +35,7 @@ import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jserver.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.enums.SiegeClanType;
|
||||
import com.l2jserver.gameserver.instancemanager.CHSiegeManager;
|
||||
import com.l2jserver.gameserver.instancemanager.MapRegionManager;
|
||||
@@ -480,7 +481,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
return Config.CHS_FAME_FREQUENCY;
|
||||
}
|
||||
|
||||
public final void broadcastNpcSay(final L2Npc npc, final int type, final NpcStringId messageId)
|
||||
public final void broadcastNpcSay(final L2Npc npc, final ChatType type, final NpcStringId messageId)
|
||||
{
|
||||
final NpcSay npcSay = new NpcSay(npc.getObjectId(), type, npc.getId(), messageId);
|
||||
final int sourceRegion = MapRegionManager.getInstance().getMapRegionLocId(npc);
|
||||
|
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.model.events.impl.character.player;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.events.EventType;
|
||||
import com.l2jserver.gameserver.model.events.impl.IBaseEvent;
|
||||
@@ -30,9 +31,9 @@ public class OnPlayerChat implements IBaseEvent
|
||||
private final L2PcInstance _activeChar;
|
||||
private final L2PcInstance _target;
|
||||
private final String _text;
|
||||
private final int _type;
|
||||
private final ChatType _type;
|
||||
|
||||
public OnPlayerChat(L2PcInstance activeChar, L2PcInstance target, String text, int type)
|
||||
public OnPlayerChat(L2PcInstance activeChar, L2PcInstance target, String text, ChatType type)
|
||||
{
|
||||
_activeChar = activeChar;
|
||||
_target = target;
|
||||
@@ -55,7 +56,7 @@ public class OnPlayerChat implements IBaseEvent
|
||||
return _text;
|
||||
}
|
||||
|
||||
public int getChatType()
|
||||
public ChatType getChatType()
|
||||
{
|
||||
return _type;
|
||||
}
|
||||
|
@@ -21,10 +21,10 @@ package com.l2jserver.gameserver.model.olympiad;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.SpawnTable;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.model.L2Spawn;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.network.NpcStringId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
|
||||
|
||||
/**
|
||||
@@ -79,7 +79,7 @@ public final class OlympiadAnnouncer implements Runnable
|
||||
manager = spawn.getLastSpawn();
|
||||
if (manager != null)
|
||||
{
|
||||
packet = new NpcSay(manager.getObjectId(), Say2.NPC_SHOUT, manager.getId(), npcString);
|
||||
packet = new NpcSay(manager.getObjectId(), ChatType.NPC_SHOUT, manager.getId(), npcString);
|
||||
packet.addStringParameter(arenaId);
|
||||
manager.broadcastPacket(packet);
|
||||
}
|
||||
|
@@ -172,6 +172,7 @@ public enum AbnormalType
|
||||
IRON_SHIELD_I,
|
||||
KAMAEL_SPECIAL,
|
||||
KNIGHT_AURA,
|
||||
KNOCK_DOWN,
|
||||
LIFE_FORCE_KAMAEL,
|
||||
LIFE_FORCE_ORC,
|
||||
LIFE_FORCE_OTHERS,
|
||||
@@ -183,6 +184,7 @@ public enum AbnormalType
|
||||
MAX_BREATH_UP,
|
||||
MAX_HP_DOWN,
|
||||
MAX_HP_UP,
|
||||
MAX_HP_CP_UP,
|
||||
MAX_MP_UP,
|
||||
MA_DOWN,
|
||||
MA_MD_UP,
|
||||
|
@@ -66,6 +66,8 @@ public enum TraitType
|
||||
UNK_40(40, 3),
|
||||
DUALDAGGER(41, 1),
|
||||
DUALBLUNT(42, 1),
|
||||
KNOCKBACK(43, 3),
|
||||
KNOCKDOWN(44, 3),
|
||||
NONE(43, 0);
|
||||
|
||||
private final int _id;
|
||||
@@ -86,4 +88,4 @@ public enum TraitType
|
||||
{
|
||||
return _type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,15 +18,15 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.model.variables;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.L2Summon;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* NPC Variables implementation.
|
||||
* @author GKR
|
||||
*/
|
||||
public class NpcVariables extends AbstractVariables
|
||||
{
|
||||
public NpcVariables()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInt(String key)
|
||||
{
|
||||
@@ -50,4 +50,24 @@ public class NpcVariables extends AbstractVariables
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the stored player.
|
||||
* @param name the name of the variable
|
||||
* @return the stored player or {@code null}
|
||||
*/
|
||||
public L2PcInstance getPlayer(String name)
|
||||
{
|
||||
return getObject(name, L2PcInstance.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the stored summon.
|
||||
* @param name the name of the variable
|
||||
* @return the stored summon or {@code null}
|
||||
*/
|
||||
public L2Summon getSummon(String name)
|
||||
{
|
||||
return getObject(name, L2Summon.class);
|
||||
}
|
||||
}
|
@@ -27,6 +27,7 @@ import com.l2jserver.gameserver.data.xml.impl.AdminData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.BeautyShopData;
|
||||
import com.l2jserver.gameserver.data.xml.impl.SkillTreesData;
|
||||
import com.l2jserver.gameserver.enums.Race;
|
||||
import com.l2jserver.gameserver.enums.SubclassInfoType;
|
||||
import com.l2jserver.gameserver.instancemanager.CHSiegeManager;
|
||||
import com.l2jserver.gameserver.instancemanager.CastleManager;
|
||||
import com.l2jserver.gameserver.instancemanager.ClanHallManager;
|
||||
@@ -73,6 +74,7 @@ import com.l2jserver.gameserver.network.serverpackets.ExNotifyPremiumItem;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExPCCafePointInfo;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExPledgeCount;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExPledgeWaitingListAlarm;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExRotation;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExShowUsm;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
@@ -372,7 +374,7 @@ public class EnterWorld extends L2GameClientPacket
|
||||
activeChar.broadcastUserInfo();
|
||||
|
||||
// Send SubClass Info
|
||||
activeChar.sendPacket(new ExSubjobInfo(activeChar));
|
||||
activeChar.sendPacket(new ExSubjobInfo(activeChar, SubclassInfoType.NO_CHANGES));
|
||||
|
||||
// Send Inventory Info
|
||||
activeChar.sendPacket(new ExUserInfoInvenWeight(activeChar));
|
||||
@@ -419,6 +421,7 @@ public class EnterWorld extends L2GameClientPacket
|
||||
}
|
||||
|
||||
activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());
|
||||
activeChar.sendPacket(new ExRotation(activeChar.getObjectId(), activeChar.getHeading()));
|
||||
|
||||
activeChar.getInventory().applyItemSkills();
|
||||
|
||||
|
@@ -29,6 +29,7 @@ import com.l2jserver.gameserver.data.sql.impl.SummonSkillsTable;
|
||||
import com.l2jserver.gameserver.data.xml.impl.PetDataTable;
|
||||
import com.l2jserver.gameserver.datatables.BotReportTable;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.enums.MountType;
|
||||
import com.l2jserver.gameserver.enums.PrivateStoreType;
|
||||
import com.l2jserver.gameserver.instancemanager.AirShipManager;
|
||||
@@ -450,7 +451,7 @@ public final class RequestActionUse extends L2GameClientPacket
|
||||
case 1001: // Sin Eater - Ultimate Bombastic Buster
|
||||
if (validateSummon(pet, true) && (pet.getId() == SIN_EATER_ID))
|
||||
{
|
||||
pet.broadcastPacket(new NpcSay(pet.getObjectId(), Say2.NPC_ALL, pet.getId(), NPC_STRINGS[Rnd.get(NPC_STRINGS.length)]));
|
||||
pet.broadcastPacket(new NpcSay(pet.getObjectId(), ChatType.NPC_GENERAL, pet.getId(), NPC_STRINGS[Rnd.get(NPC_STRINGS.length)]));
|
||||
}
|
||||
break;
|
||||
case 1003: // Wind Hatchling/Strider - Wild Stun
|
||||
@@ -709,8 +710,7 @@ public final class RequestActionUse extends L2GameClientPacket
|
||||
useSkill(6684, true);
|
||||
break;
|
||||
case 1099: // All servitor attack
|
||||
activeChar.getServitors().values().forEach(s ->
|
||||
{
|
||||
activeChar.getServitors().values().forEach(s -> {
|
||||
if (validateSummon(s, false))
|
||||
{
|
||||
if (s.canAttack(_ctrlPressed))
|
||||
@@ -721,8 +721,7 @@ public final class RequestActionUse extends L2GameClientPacket
|
||||
});
|
||||
break;
|
||||
case 1100: // All servitor move to
|
||||
activeChar.getServitors().values().forEach(s ->
|
||||
{
|
||||
activeChar.getServitors().values().forEach(s -> {
|
||||
if (validateSummon(s, false))
|
||||
{
|
||||
if ((target != null) && (s != target) && !s.isMovementDisabled())
|
||||
@@ -734,8 +733,7 @@ public final class RequestActionUse extends L2GameClientPacket
|
||||
});
|
||||
break;
|
||||
case 1101: // All servitor stop
|
||||
activeChar.getServitors().values().forEach(summon ->
|
||||
{
|
||||
activeChar.getServitors().values().forEach(summon -> {
|
||||
if (validateSummon(summon, false))
|
||||
{
|
||||
summon.cancelAction();
|
||||
@@ -744,7 +742,8 @@ public final class RequestActionUse extends L2GameClientPacket
|
||||
break;
|
||||
case 1102: // Unsummon all servitors
|
||||
boolean canUnsummon = true;
|
||||
OUT: for (L2Summon s : activeChar.getServitors().values())
|
||||
OUT:
|
||||
for (L2Summon s : activeChar.getServitors().values())
|
||||
{
|
||||
if (validateSummon(s, false))
|
||||
{
|
||||
@@ -759,8 +758,7 @@ public final class RequestActionUse extends L2GameClientPacket
|
||||
}
|
||||
if (canUnsummon)
|
||||
{
|
||||
activeChar.getServitors().values().stream().forEach(s ->
|
||||
{
|
||||
activeChar.getServitors().values().stream().forEach(s -> {
|
||||
s.unSummon(activeChar);
|
||||
});
|
||||
}
|
||||
@@ -1117,8 +1115,7 @@ public final class RequestActionUse extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
activeChar.getServitors().values().forEach(servitor ->
|
||||
{
|
||||
activeChar.getServitors().values().forEach(servitor -> {
|
||||
if (!validateSummon(servitor, false))
|
||||
{
|
||||
return;
|
||||
|
@@ -20,6 +20,7 @@ package com.l2jserver.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.data.xml.impl.AdminData;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.instancemanager.PetitionManager;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
@@ -81,7 +82,7 @@ public final class RequestPetitionCancel extends L2GameClientPacket
|
||||
|
||||
// Notify all GMs that the player's pending petition has been cancelled.
|
||||
String msgContent = activeChar.getName() + " has canceled a pending petition.";
|
||||
AdminData.getInstance().broadcastToGMs(new CreatureSay(activeChar.getObjectId(), Say2.HERO_VOICE, "Petition System", msgContent));
|
||||
AdminData.getInstance().broadcastToGMs(new CreatureSay(activeChar.getObjectId(), ChatType.HERO_VOICE, "Petition System", msgContent));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -23,6 +23,7 @@ import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.handler.ChatHandler;
|
||||
import com.l2jserver.gameserver.handler.IChatHandler;
|
||||
import com.l2jserver.gameserver.model.L2Object;
|
||||
@@ -46,63 +47,6 @@ public final class Say2 extends L2GameClientPacket
|
||||
private static final String _C__49_SAY2 = "[C] 49 Say2";
|
||||
private static Logger _logChat = 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;
|
||||
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;
|
||||
public static final int BOAT = 11;
|
||||
public static final int L2FRIEND = 12;
|
||||
public static final int MSNCHAT = 13;
|
||||
public static final int PARTYMATCH_ROOM = 14;
|
||||
public static final int PARTYROOM_COMMANDER = 15; // (Yellow)
|
||||
public static final int PARTYROOM_ALL = 16; // (Red)
|
||||
public static final int HERO_VOICE = 17;
|
||||
public static final int CRITICAL_ANNOUNCE = 18;
|
||||
public static final int SCREEN_ANNOUNCE = 19;
|
||||
public static final int BATTLEFIELD = 20;
|
||||
public static final int MPCC_ROOM = 21;
|
||||
public static final int NPC_ALL = 22;
|
||||
public static final int NPC_SHOUT = 23;
|
||||
public static final int NPC_TELL = 24;
|
||||
public static final int GLOBAL = 25;
|
||||
|
||||
private static final String[] CHAT_NAMES =
|
||||
{
|
||||
"ALL",
|
||||
"SHOUT",
|
||||
"TELL",
|
||||
"PARTY",
|
||||
"CLAN",
|
||||
"GM",
|
||||
"PETITION_PLAYER",
|
||||
"PETITION_GM",
|
||||
"TRADE",
|
||||
"ALLIANCE",
|
||||
"ANNOUNCEMENT", // 10
|
||||
"BOAT",
|
||||
"L2FRIEND",
|
||||
"MSNCHAT",
|
||||
"PARTYMATCH_ROOM",
|
||||
"PARTYROOM_COMMANDER",
|
||||
"PARTYROOM_ALL",
|
||||
"HERO_VOICE",
|
||||
"CRITICAL_ANNOUNCE",
|
||||
"SCREEN_ANNOUNCE",
|
||||
"BATTLEFIELD",
|
||||
"MPCC_ROOM",
|
||||
"NPC_ALL",
|
||||
"NPC_SHOUT",
|
||||
"NEW_TELL",
|
||||
"GLOBAL"
|
||||
};
|
||||
|
||||
private static final String[] WALKER_COMMAND_LIST =
|
||||
{
|
||||
"USESKILL",
|
||||
@@ -151,7 +95,7 @@ public final class Say2 extends L2GameClientPacket
|
||||
{
|
||||
_text = readS();
|
||||
_type = readD();
|
||||
_target = (_type == TELL) ? readS() : null;
|
||||
_target = (_type == ChatType.TELL.getClientId()) ? readS() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -162,13 +106,14 @@ public final class Say2 extends L2GameClientPacket
|
||||
_log.info("Say2: Msg Type = '" + _type + "' Text = '" + _text + "'.");
|
||||
}
|
||||
|
||||
L2PcInstance activeChar = getClient().getActiveChar();
|
||||
final L2PcInstance activeChar = getClient().getActiveChar();
|
||||
if (activeChar == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((_type < 0) || (_type >= CHAT_NAMES.length))
|
||||
ChatType chatType = ChatType.findByClientId(_type);
|
||||
if (chatType == null)
|
||||
{
|
||||
_log.warning("Say2: Invalid type: " + _type + " Player : " + activeChar.getName() + " text: " + String.valueOf(_text));
|
||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
@@ -193,13 +138,13 @@ public final class Say2 extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.L2WALKER_PROTECTION && (_type == TELL) && checkBot(_text))
|
||||
if (Config.L2WALKER_PROTECTION && (chatType == ChatType.TELL) && checkBot(_text))
|
||||
{
|
||||
Util.handleIllegalPlayerAction(activeChar, "Client Emulator Detect: Player " + activeChar.getName() + " using l2walker.", Config.DEFAULT_PUNISH);
|
||||
return;
|
||||
}
|
||||
|
||||
if (activeChar.isCursedWeaponEquipped() && ((_type == TRADE) || (_type == SHOUT)))
|
||||
if (activeChar.isCursedWeaponEquipped() && ((chatType == ChatType.TRADE) || (chatType == ChatType.SHOUT)))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.SHOUT_AND_TRADE_CHATTING_CANNOT_BE_USED_WHILE_POSSESSING_A_CURSED_WEAPON);
|
||||
return;
|
||||
@@ -213,12 +158,9 @@ public final class Say2 extends L2GameClientPacket
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int chatId : Config.BAN_CHAT_CHANNELS)
|
||||
if (Config.BAN_CHAT_CHANNELS.contains(chatType))
|
||||
{
|
||||
if (_type == chatId)
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
|
||||
}
|
||||
activeChar.sendPacket(SystemMessageId.CHATTING_IS_CURRENTLY_PROHIBITED_IF_YOU_TRY_TO_CHAT_BEFORE_THE_PROHIBITION_IS_REMOVED_THE_PROHIBITION_TIME_WILL_INCREASE_EVEN_FURTHER);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -226,28 +168,28 @@ public final class Say2 extends L2GameClientPacket
|
||||
|
||||
if (activeChar.isJailed() && Config.JAIL_DISABLE_CHAT)
|
||||
{
|
||||
if ((_type == TELL) || (_type == SHOUT) || (_type == TRADE) || (_type == HERO_VOICE))
|
||||
if ((chatType == ChatType.TELL) || (chatType == ChatType.SHOUT) || (chatType == ChatType.TRADE) || (chatType == ChatType.HERO_VOICE))
|
||||
{
|
||||
activeChar.sendMessage("You can not chat with players outside of the jail.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ((_type == PETITION_PLAYER) && activeChar.isGM())
|
||||
if ((chatType == ChatType.PETITION_PLAYER) && activeChar.isGM())
|
||||
{
|
||||
_type = PETITION_GM;
|
||||
chatType = ChatType.PETITION_GM;
|
||||
}
|
||||
|
||||
if (Config.LOG_CHAT)
|
||||
{
|
||||
LogRecord record = new LogRecord(Level.INFO, _text);
|
||||
final LogRecord record = new LogRecord(Level.INFO, _text);
|
||||
record.setLoggerName("chat");
|
||||
|
||||
if (_type == TELL)
|
||||
if (chatType == ChatType.TELL)
|
||||
{
|
||||
record.setParameters(new Object[]
|
||||
{
|
||||
CHAT_NAMES[_type],
|
||||
chatType.name(),
|
||||
"[" + activeChar.getName() + " to " + _target + "]"
|
||||
});
|
||||
}
|
||||
@@ -255,7 +197,7 @@ public final class Say2 extends L2GameClientPacket
|
||||
{
|
||||
record.setParameters(new Object[]
|
||||
{
|
||||
CHAT_NAMES[_type],
|
||||
chatType.name(),
|
||||
"[" + activeChar.getName() + "]"
|
||||
});
|
||||
}
|
||||
@@ -271,7 +213,7 @@ public final class Say2 extends L2GameClientPacket
|
||||
}
|
||||
}
|
||||
|
||||
final ChatFilterReturn filter = EventDispatcher.getInstance().notifyEvent(new OnPlayerChat(activeChar, L2World.getInstance().getPlayer(_target), _text, _type), ChatFilterReturn.class);
|
||||
final ChatFilterReturn filter = EventDispatcher.getInstance().notifyEvent(new OnPlayerChat(activeChar, L2World.getInstance().getPlayer(_target), _text, chatType), ChatFilterReturn.class);
|
||||
if (filter != null)
|
||||
{
|
||||
_text = filter.getFilteredText();
|
||||
@@ -283,10 +225,10 @@ public final class Say2 extends L2GameClientPacket
|
||||
checkText();
|
||||
}
|
||||
|
||||
final IChatHandler handler = ChatHandler.getInstance().getHandler(_type);
|
||||
final IChatHandler handler = ChatHandler.getInstance().getHandler(chatType);
|
||||
if (handler != null)
|
||||
{
|
||||
handler.handleChat(_type, activeChar, _target, _text);
|
||||
handler.handleChat(chatType, activeChar, _target, _text);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -332,9 +274,9 @@ public final class Say2 extends L2GameClientPacket
|
||||
{
|
||||
result.append(_text.charAt(pos++));
|
||||
}
|
||||
int id = Integer.parseInt(result.toString());
|
||||
L2Object item = L2World.getInstance().findObject(id);
|
||||
if (item instanceof L2ItemInstance)
|
||||
final int id = Integer.parseInt(result.toString());
|
||||
final L2Object item = L2World.getInstance().findObject(id);
|
||||
if (item.isItem())
|
||||
{
|
||||
if (owner.getInventory().getItemByObjectId(id) == null)
|
||||
{
|
||||
|
@@ -21,6 +21,7 @@ package com.l2jserver.gameserver.network.serverpackets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.instancemanager.MentorManager;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.NpcStringId;
|
||||
@@ -29,7 +30,7 @@ import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
public final class CreatureSay extends L2GameServerPacket
|
||||
{
|
||||
private final int _objectId;
|
||||
private final int _textType;
|
||||
private final ChatType _textType;
|
||||
private String _charName = null;
|
||||
private int _charId = 0;
|
||||
private String _text = null;
|
||||
@@ -45,7 +46,7 @@ public final class CreatureSay extends L2GameServerPacket
|
||||
* @param messageType
|
||||
* @param text
|
||||
*/
|
||||
public CreatureSay(L2PcInstance sender, L2PcInstance receiver, String name, int messageType, String text)
|
||||
public CreatureSay(L2PcInstance sender, L2PcInstance receiver, String name, ChatType messageType, String text)
|
||||
{
|
||||
_objectId = sender.getObjectId();
|
||||
_charName = name;
|
||||
@@ -82,7 +83,7 @@ public final class CreatureSay extends L2GameServerPacket
|
||||
* @param charName
|
||||
* @param text
|
||||
*/
|
||||
public CreatureSay(int objectId, int messageType, String charName, String text)
|
||||
public CreatureSay(int objectId, ChatType messageType, String charName, String text)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
@@ -90,7 +91,7 @@ public final class CreatureSay extends L2GameServerPacket
|
||||
_text = text;
|
||||
}
|
||||
|
||||
public CreatureSay(L2PcInstance player, int messageType, String text)
|
||||
public CreatureSay(L2PcInstance player, ChatType messageType, String text)
|
||||
{
|
||||
_objectId = player.getObjectId();
|
||||
_textType = messageType;
|
||||
@@ -98,7 +99,7 @@ public final class CreatureSay extends L2GameServerPacket
|
||||
_text = text;
|
||||
}
|
||||
|
||||
public CreatureSay(int objectId, int messageType, int charId, NpcStringId npcString)
|
||||
public CreatureSay(int objectId, ChatType messageType, int charId, NpcStringId npcString)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
@@ -106,7 +107,7 @@ public final class CreatureSay extends L2GameServerPacket
|
||||
_npcString = npcString.getId();
|
||||
}
|
||||
|
||||
public CreatureSay(int objectId, int messageType, String charName, NpcStringId npcString)
|
||||
public CreatureSay(int objectId, ChatType messageType, String charName, NpcStringId npcString)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
@@ -114,7 +115,7 @@ public final class CreatureSay extends L2GameServerPacket
|
||||
_npcString = npcString.getId();
|
||||
}
|
||||
|
||||
public CreatureSay(int objectId, int messageType, int charId, SystemMessageId sysString)
|
||||
public CreatureSay(int objectId, ChatType messageType, int charId, SystemMessageId sysString)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
@@ -140,7 +141,7 @@ public final class CreatureSay extends L2GameServerPacket
|
||||
{
|
||||
writeC(0x4A);
|
||||
writeD(_objectId);
|
||||
writeD(_textType);
|
||||
writeD(_textType.getClientId());
|
||||
if (_charName != null)
|
||||
{
|
||||
writeS(_charName);
|
||||
@@ -153,7 +154,7 @@ public final class CreatureSay extends L2GameServerPacket
|
||||
if (_text != null)
|
||||
{
|
||||
writeS(_text);
|
||||
if ((_charLevel > 0) && (_textType == 2))
|
||||
if ((_charLevel > 0) && (_textType == ChatType.TELL))
|
||||
{
|
||||
writeC(_mask);
|
||||
if ((_mask & 0x10) == 0)
|
||||
@@ -174,7 +175,7 @@ public final class CreatureSay extends L2GameServerPacket
|
||||
@Override
|
||||
public final void runImpl()
|
||||
{
|
||||
L2PcInstance _pci = getClient().getActiveChar();
|
||||
final L2PcInstance _pci = getClient().getActiveChar();
|
||||
if (_pci != null)
|
||||
{
|
||||
_pci.broadcastSnoop(_textType, _charName, _text);
|
||||
|
@@ -21,6 +21,7 @@ package com.l2jserver.gameserver.network.serverpackets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.gameserver.enums.SubclassInfoType;
|
||||
import com.l2jserver.gameserver.enums.SubclassType;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.base.SubClass;
|
||||
@@ -31,18 +32,17 @@ import com.l2jserver.gameserver.model.base.SubClass;
|
||||
public class ExSubjobInfo extends L2GameServerPacket
|
||||
{
|
||||
private final int _currClassId;
|
||||
private final int _currClassIndex;
|
||||
private final int _currRace;
|
||||
private final int _type;
|
||||
private final List<SubInfo> _subs;
|
||||
|
||||
public ExSubjobInfo(L2PcInstance player)
|
||||
public ExSubjobInfo(L2PcInstance player, SubclassInfoType type)
|
||||
{
|
||||
_subs = new ArrayList<>();
|
||||
|
||||
_currClassId = player.getClassId().getId();
|
||||
_currClassIndex = player.getClassIndex();
|
||||
_currRace = player.getRace().ordinal();
|
||||
_type = type.ordinal();
|
||||
|
||||
_subs = new ArrayList<>();
|
||||
_subs.add(0, new SubInfo(player));
|
||||
|
||||
for (SubClass sub : player.getSubClasses().values())
|
||||
@@ -100,7 +100,7 @@ public class ExSubjobInfo extends L2GameServerPacket
|
||||
{
|
||||
writeC(0xFE);
|
||||
writeH(0xEA);
|
||||
writeC(_currClassIndex);
|
||||
writeC(_type);
|
||||
writeD(_currClassId);
|
||||
writeD(_currRace);
|
||||
writeD(_subs.size());
|
||||
|
@@ -21,6 +21,7 @@ package com.l2jserver.gameserver.network.serverpackets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.network.NpcStringId;
|
||||
|
||||
@@ -30,7 +31,7 @@ import com.l2jserver.gameserver.network.NpcStringId;
|
||||
public final class NpcSay extends L2GameServerPacket
|
||||
{
|
||||
private final int _objectId;
|
||||
private final int _textType;
|
||||
private final ChatType _textType;
|
||||
private final int _npcId;
|
||||
private String _text;
|
||||
private final int _npcString;
|
||||
@@ -42,7 +43,7 @@ public final class NpcSay extends L2GameServerPacket
|
||||
* @param npcId
|
||||
* @param text
|
||||
*/
|
||||
public NpcSay(int objectId, int messageType, int npcId, String text)
|
||||
public NpcSay(int objectId, ChatType messageType, int npcId, String text)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
@@ -51,7 +52,7 @@ public final class NpcSay extends L2GameServerPacket
|
||||
_text = text;
|
||||
}
|
||||
|
||||
public NpcSay(L2Npc npc, int messageType, String text)
|
||||
public NpcSay(L2Npc npc, ChatType messageType, String text)
|
||||
{
|
||||
_objectId = npc.getObjectId();
|
||||
_textType = messageType;
|
||||
@@ -60,7 +61,7 @@ public final class NpcSay extends L2GameServerPacket
|
||||
_text = text;
|
||||
}
|
||||
|
||||
public NpcSay(int objectId, int messageType, int npcId, NpcStringId npcString)
|
||||
public NpcSay(int objectId, ChatType messageType, int npcId, NpcStringId npcString)
|
||||
{
|
||||
_objectId = objectId;
|
||||
_textType = messageType;
|
||||
@@ -68,7 +69,7 @@ public final class NpcSay extends L2GameServerPacket
|
||||
_npcString = npcString.getId();
|
||||
}
|
||||
|
||||
public NpcSay(L2Npc npc, int messageType, NpcStringId npcString)
|
||||
public NpcSay(L2Npc npc, ChatType messageType, NpcStringId npcString)
|
||||
{
|
||||
_objectId = npc.getObjectId();
|
||||
_textType = messageType;
|
||||
@@ -119,7 +120,7 @@ public final class NpcSay extends L2GameServerPacket
|
||||
{
|
||||
writeC(0x30);
|
||||
writeD(_objectId);
|
||||
writeD(_textType);
|
||||
writeD(_textType.getClientId());
|
||||
writeD(_npcId);
|
||||
writeD(_npcString);
|
||||
if (_npcString == -1)
|
||||
|
@@ -85,7 +85,7 @@ public final class RelationChanged extends L2GameServerPacket
|
||||
{
|
||||
if (activeChar.isInvisible())
|
||||
{
|
||||
_log.severe("Cannot add invisible character to multi relation packet.");
|
||||
// _log.severe("Cannot add invisible character to multi relation packet.");
|
||||
return;
|
||||
}
|
||||
Relation r = new Relation();
|
||||
|
@@ -18,15 +18,17 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.serverpackets;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
|
||||
public class Snoop extends L2GameServerPacket
|
||||
{
|
||||
private final int _convoId;
|
||||
private final String _name;
|
||||
private final int _type;
|
||||
private final ChatType _type;
|
||||
private final String _speaker;
|
||||
private final String _msg;
|
||||
|
||||
public Snoop(int id, String name, int type, String speaker, String msg)
|
||||
public Snoop(int id, String name, ChatType type, String speaker, String msg)
|
||||
{
|
||||
_convoId = id;
|
||||
_name = name;
|
||||
@@ -43,7 +45,7 @@ public class Snoop extends L2GameServerPacket
|
||||
writeD(_convoId);
|
||||
writeS(_name);
|
||||
writeD(0x00); // ??
|
||||
writeD(_type);
|
||||
writeD(_type.getClientId());
|
||||
writeS(_speaker);
|
||||
writeS(_msg);
|
||||
|
||||
|
@@ -243,7 +243,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
||||
writeD(_activeChar.getX());
|
||||
writeD(_activeChar.getY());
|
||||
writeD(_activeChar.getZ());
|
||||
writeD(_activeChar.getHeading());
|
||||
writeD(_activeChar.isInVehicle() ? _activeChar.getVehicle().getObjectId() : 0);
|
||||
}
|
||||
|
||||
if (containsMask(UserInfoType.SPEED))
|
||||
|
@@ -22,11 +22,11 @@ import java.util.Collection;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ChatType;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Summon;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CharInfo;
|
||||
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
@@ -212,7 +212,7 @@ public final class Broadcast
|
||||
|
||||
public static void toAllOnlinePlayers(String text, boolean isCritical)
|
||||
{
|
||||
toAllOnlinePlayers(new CreatureSay(0, isCritical ? Say2.CRITICAL_ANNOUNCE : Say2.ANNOUNCEMENT, "", text));
|
||||
toAllOnlinePlayers(new CreatureSay(0, isCritical ? ChatType.CRITICAL_ANNOUNCE : ChatType.ANNOUNCEMENT, "", text));
|
||||
}
|
||||
|
||||
public static void toPlayersInInstance(L2GameServerPacket packet, int instanceId)
|
||||
|
Reference in New Issue
Block a user