Sync with L2JServer Feb 7th 2015.

This commit is contained in:
mobius
2015-02-07 23:48:56 +00:00
parent 1e166ca657
commit ecd17fdefb
1949 changed files with 3120 additions and 33466 deletions

View File

@@ -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();

View File

@@ -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;

View File

@@ -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
{

View File

@@ -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)
{

View File

@@ -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);

View File

@@ -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());

View File

@@ -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)

View File

@@ -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();

View File

@@ -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);

View File

@@ -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))