Initial Antharas changes.

This commit is contained in:
MobiusDev
2018-05-11 18:05:51 +00:00
parent 79386d731b
commit 9279da0e08
51 changed files with 2506 additions and 265 deletions

View File

@@ -56,7 +56,12 @@ public enum InventorySlot implements IUpdateTypeComponent
BROOCH_JEWEL3(Inventory.PAPERDOLL_BROOCH_JEWEL3),
BROOCH_JEWEL4(Inventory.PAPERDOLL_BROOCH_JEWEL4),
BROOCH_JEWEL5(Inventory.PAPERDOLL_BROOCH_JEWEL5),
BROOCH_JEWEL6(Inventory.PAPERDOLL_BROOCH_JEWEL6);
BROOCH_JEWEL6(Inventory.PAPERDOLL_BROOCH_JEWEL6),
AGATION1(32), // new 140
AGATION2(33), // new 140
AGATION3(34), // new 140
AGATION4(35), // new 140
AGATION5(36); // new 140
private final int _paperdollSlot;

View File

@@ -992,7 +992,7 @@ public class L2FortManagerInstance extends L2MerchantInstance
{
player.sendPacket(ActionFailed.STATIC_PACKET);
player.setActiveWarehouse(player.getClan().getWarehouse());
player.sendPacket(new WareHouseDepositList(player, WareHouseDepositList.CLAN));
player.sendPacket(new WareHouseDepositList(1, player, WareHouseDepositList.CLAN));
}
private void showVaultWindowWithdraw(L2PcInstance player)
@@ -1001,7 +1001,7 @@ public class L2FortManagerInstance extends L2MerchantInstance
{
player.sendPacket(ActionFailed.STATIC_PACKET);
player.setActiveWarehouse(player.getClan().getWarehouse());
player.sendPacket(new WareHouseWithdrawalList(player, WareHouseWithdrawalList.CLAN));
player.sendPacket(new WareHouseWithdrawalList(1, player, WareHouseWithdrawalList.CLAN));
}
else
{

View File

@@ -4607,7 +4607,8 @@ public final class L2PcInstance extends L2Playable
standUp();
}
setPrivateStoreType(PrivateStoreType.BUY_MANAGE);
sendPacket(new PrivateStoreManageListBuy(this));
sendPacket(new PrivateStoreManageListBuy(1, this));
sendPacket(new PrivateStoreManageListBuy(2, this));
}
}
else
@@ -5615,7 +5616,8 @@ public final class L2PcInstance extends L2Playable
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.YOU_BEGIN_TRADING_WITH_C1);
msg.addPcName(partner);
sendPacket(msg);
sendPacket(new TradeStart(this));
sendPacket(new TradeStart(1, this));
sendPacket(new TradeStart(2, this));
}
public void onTradeConfirm(L2PcInstance partner)
@@ -13697,8 +13699,10 @@ public final class L2PcInstance extends L2Playable
*/
public void sendItemList(boolean open)
{
sendPacket(new ItemList(this, open));
sendPacket(new ExQuestItemList(this));
sendPacket(new ItemList(1, this, open));
sendPacket(new ItemList(2, this, open));
sendPacket(new ExQuestItemList(1, this));
sendPacket(new ExQuestItemList(2, this));
sendPacket(new ExAdenaInvenCount(this));
sendPacket(new ExUserInfoInvenWeight(this));
}

View File

@@ -113,7 +113,12 @@ public abstract class Inventory extends ItemContainer
public static final int PAPERDOLL_BROOCH_JEWEL4 = 29;
public static final int PAPERDOLL_BROOCH_JEWEL5 = 30;
public static final int PAPERDOLL_BROOCH_JEWEL6 = 31;
public static final int PAPERDOLL_TOTALSLOTS = 32;
public static final int PAPERDOLL_AGATION1 = 32; // new 140
public static final int PAPERDOLL_AGATION2 = 33; // new 140
public static final int PAPERDOLL_AGATION3 = 34; // new 140
public static final int PAPERDOLL_AGATION4 = 35; // new 140
public static final int PAPERDOLL_AGATION5 = 36; // new 140
public static final int PAPERDOLL_TOTALSLOTS = 37;
// Speed percentage mods
public static final double MAX_ARMOR_WEIGHT = 12000;

View File

@@ -392,9 +392,47 @@ public enum ExIncomingPackets implements IIncomingPackets<L2GameClient>
EXREQUEST_MATCH_GROUP_WITHDRAW(0x133, null, ConnectionState.IN_GAME),
EXREQUEST_MATCH_GROUP_OUST(0x134, null, ConnectionState.IN_GAME),
EXREQUEST_MATCH_GROUP_CHANGE_MASTER(0x135, null, ConnectionState.IN_GAME),
REQUEST_BLOCK_LIST_FOR_AD(0x136, null, ConnectionState.IN_GAME),
REQUEST_UPGRADE_SYSTEM_RESULT(0x137, null, ConnectionState.IN_GAME),
REQUEST_USER_BAN_INFO(0x138, null, ConnectionState.IN_GAME);
REQUEST_UPGRADE_SYSTEM_RESULT(0x136, null, ConnectionState.IN_GAME),
EX_CARD_UPDOWN_PICK_NUMB(0x137, null, ConnectionState.IN_GAME),
EX_CARD_UPDOWN_GAME_REWARD_REQUEST(0x138, null, ConnectionState.IN_GAME),
EX_CARD_UPDOWN_GAME_RETRY(0x139, null, ConnectionState.IN_GAME),
EX_CARD_UPDOWN_GAME_QUIT(0x13A, null, ConnectionState.IN_GAME),
EX_ARENA_RANK_ALL(0x13B, null, ConnectionState.IN_GAME),
EX_ARENA_MYRANK(0x13C, null, ConnectionState.IN_GAME),
EX_SWAP_AGATHION_SLOT_ITEMS(0x13D, null, ConnectionState.IN_GAME),
EX_PLEDGE_CONTRIBUTION_RANK(0x13E, null, ConnectionState.IN_GAME),
EX_PLEDGE_CONTRIBUTION_INFO(0x13F, null, ConnectionState.IN_GAME),
EX_PLEDGE_CONTRIBUTION_REWARD(0x140, null, ConnectionState.IN_GAME),
EX_PLEDGE_LEVEL_UP(0x141, null, ConnectionState.IN_GAME),
EX_PLEDGE_MISSION_INFO(0x142, null, ConnectionState.IN_GAME),
EX_PLEDGE_MISSION_REWARD(0x143, null, ConnectionState.IN_GAME),
EX_PLEDGE_MASTERY_INFO(0x144, null, ConnectionState.IN_GAME),
EX_PLEDGE_MASTERY_SET(0x145, null, ConnectionState.IN_GAME),
EX_PLEDGE_MASTERY_RESET(0x146, null, ConnectionState.IN_GAME),
EX_PLEDGE_SKILL_INFO(0x147, null, ConnectionState.IN_GAME),
EX_PLEDGE_SKILL_ACTIVATE(0x148, null, ConnectionState.IN_GAME),
EX_PLEDGE_ITEM_LIST(0x149, null, ConnectionState.IN_GAME),
EX_PLEDGE_ITEM_ACTIVATE(0x14A, null, ConnectionState.IN_GAME),
EX_PLEDGE_ANNOUNCE(0x14B, null, ConnectionState.IN_GAME),
EX_PLEDGE_ANNOUNCE_SET(0x14C, null, ConnectionState.IN_GAME),
EX_CREATE_PLEDGE(0x14D, null, ConnectionState.IN_GAME),
EX_PLEDGE_ITEM_INFO(0x14E, null, ConnectionState.IN_GAME),
EX_PLEDGE_ITEM_BUY(0x14F, null, ConnectionState.IN_GAME),
EX_ELEMENTAL_SPIRIT_INFO(0x150, null, ConnectionState.IN_GAME),
EX_ELEMENTAL_SPIRIT_EXTRACT_INFO(0x151, null, ConnectionState.IN_GAME),
EX_ELEMENTAL_SPIRIT_EXTRACT(0x152, null, ConnectionState.IN_GAME),
EX_ELEMENTAL_SPIRIT_EVOLUTION_INFO(0x153, null, ConnectionState.IN_GAME),
EX_ELEMENTAL_SPIRIT_EVOLUTION(0x154, null, ConnectionState.IN_GAME),
EX_ELEMENTAL_SPIRIT_SET_TALENT(0x155, null, ConnectionState.IN_GAME),
EX_ELEMENTAL_SPIRIT_INIT_TALENT(0x156, null, ConnectionState.IN_GAME),
EX_ELEMENTAL_SPIRIT_ABSORB_INFO(0x157, null, ConnectionState.IN_GAME),
EX_ELEMENTAL_SPIRIT_ABSORB(0x158, null, ConnectionState.IN_GAME),
EX_REQUEST_LOCKED_ITEM(0x159, null, ConnectionState.IN_GAME),
EX_REQUEST_UNLOCKED_ITEM(0x15A, null, ConnectionState.IN_GAME),
EX_LOCKED_ITEM_CANCEL(0x15B, null, ConnectionState.IN_GAME),
EX_UNLOCKED_ITEM_CANCEL(0x15C, null, ConnectionState.IN_GAME),
REQUEST_BLOCK_LIST_FOR_AD(0x15D, null, ConnectionState.IN_GAME),
REQUEST_USER_BAN_INFO(0x15E, null, ConnectionState.IN_GAME);
public static final ExIncomingPackets[] PACKET_ARRAY;

View File

@@ -741,11 +741,53 @@ public enum OutgoingPackets
EX_MATCH_GROUP_WITHDRAW(0xFE, 0x1CA),
EX_MATCH_GROUP_OUST(0xFE, 0x1CB),
EX_ARENA_SHOW_ENEMY_PARTY_LOCATION(0xFE, 0x1CC),
EX_DRESS_ROOM_UI_OPEN(0xFE, 0x1CD),
EX_DRESS_HANGER_LIST(0xFE, 0x1CE),
EX_SHOW_UPGRADE_SYSTEM(0xFE, 0x1CF),
EX_UPGRADE_SYSTEM_RESULT(0xFE, 0x1D0),
EX_USER_BAN_INFO(0xFE, 0x1D1);
EX_SHOW_UPGRADE_SYSTEM(0xFE, 0x1CD),
EX_UPGRADE_SYSTEM_RESULT(0xFE, 0x1CE),
EX_CARD_UPDOWN_GAME_START(0xFE, 0x1CF),
EX_CARD_UPDOWN_PICK_RESULT(0xFE, 0x1D0),
EX_CARD_UPDOWN_GAME_PREPARE_REWARD(0xFE, 0x1D1),
EX_CARD_UPDOWN_GAME_REWARD_REPLY(0xFE, 0x1D2),
EX_CARD_UPDOWN_GAME_QUIT(0xFE, 0x1D3),
EX_ARENA_RANK_ALL(0xFE, 0x1D4),
EX_ARENA_MYRANK(0xFE, 0x1D5),
EX_PLEDGE_CLASSIC_RAID_INFO(0xFE, 0x1D6),
EX_ARENA_OBSERVE(0xFE, 0x1D7),
EX_HTML_WITH_NPC_VIEWPORT(0xFE, 0x1D8),
EX_PLEDGE_CONTRIBUTION_RANK(0xFE, 0x1D9),
EX_PLEDGE_CONTRIBUTION_INFO(0xFE, 0x1DA),
EX_PLEDGE_CONTRIBUTION_REWARD(0xFE, 0x1DB),
EX_PLEDGE_RAID_INFO(0xFE, 0x1DC),
EX_PLEDGE_RAID_RANK(0xFE, 0x1DD),
EX_PLEDGE_LEVEL_UP(0xFE, 0x1DE),
EX_PLEDGE_SHOW_INFO_UPDATE(0xFE, 0x1DF),
EX_PLEDGE_MISSION_INFO(0xFE, 0x1E0),
EX_PLEDGE_MISSION_REWARD_COUNT(0xFE, 0x1E1),
EX_PLEDGE_MASTERY_INFO(0xFE, 0x1E2),
EX_PLEDGE_MASTERY_SET(0xFE, 0x1E3),
EX_PLEDGE_MASTERY_RESET(0xFE, 0x1E4),
EX_TUTORIAL_SHOW_ID(0xFE, 0x1E5),
EX_PLEDGE_SKILL_INFO(0xFE, 0x1E6),
EX_PLEDGE_SKILL_ACTIVATE(0xFE, 0x1E7),
EX_PLEDGE_ITEM_LIST(0xFE, 0x1E8),
EX_PLEDGE_ITEM_ACTIVATE(0xFE, 0x1E9),
EX_PLEDGE_ANNOUNCE(0xFE, 0x1EA),
EX_PLEDGE_ANNOUNCE_SET(0xFE, 0x1EB),
EX_SET_PLEDGE_EMBLEM(0xFE, 0x1EC),
EX_SHOW_CREATE_PLEDGE(0xFE, 0x1ED),
EX_PLEDGE_ITEM_INFO(0xFE, 0x1EE),
EX_PLEDGE_ITEM_BUY(0xFE, 0x1EF),
EX_ELEMENTAL_SPIRIT_INFO(0xFE, 0x1F0),
EX_ELEMENTAL_SPIRIT_EXTRACT_INFO(0xFE, 0x1F1),
EX_ELEMENTAL_SPIRIT_EVOLUTION_INFO(0xFE, 0x1F2),
EX_ELEMENTAL_SPIRIT_EVOLUTION(0xFE, 0x1F3),
EX_ELEMENTAL_SPIRIT_SET_TALENT(0xFE, 0x1F4),
EX_ELEMENTAL_SPIRIT_ABSORB_INFO(0xFE, 0x1F5),
EX_ELEMENTAL_SPIRIT_ABSORB(0xFE, 0x1F6),
EX_CHOOSE_LOCKED_ITEM(0xFE, 0x1F7),
EX_LOCKED_RESULT(0xFE, 0x1F8),
EX_DRESS_ROOM_UI_OPEN(0xFE, 0x1F9),
EX_DRESS_HANGER_LIST(0xFE, 0x1FA),
EX_USER_BAN_INFO(0xFE, 0x1FB);
private final int _id1;
private final int _id2;

View File

@@ -21,6 +21,7 @@ import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.TradeItem;
import com.l2jmobius.gameserver.model.TradeList;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.TradeOtherAdd;
@@ -94,12 +95,16 @@ public final class AddTradeItem implements IClientIncomingPacket
return;
}
final TradeItem item = trade.addItem(_objectId, _count);
if (item != null)
final L2ItemInstance item1 = player.getInventory().getItemByObjectId(_objectId);
final TradeItem item2 = trade.addItem(_objectId, _count);
if (item2 != null)
{
player.sendPacket(new TradeOwnAdd(item));
player.sendPacket(new TradeUpdate(player, item));
partner.sendPacket(new TradeOtherAdd(item));
player.sendPacket(new TradeOwnAdd(1, item2));
player.sendPacket(new TradeOwnAdd(2, item2));
player.sendPacket(new TradeUpdate(1, null, null, 0));
player.sendPacket(new TradeUpdate(2, player, item2, item1.getCount() - item2.getCount()));
partner.sendPacket(new TradeOtherAdd(1, item2));
partner.sendPacket(new TradeOtherAdd(2, item2));
}
}
}

View File

@@ -354,10 +354,12 @@ public class EnterWorld implements IClientIncomingPacket
client.sendPacket(new ExGetBookMarkInfoPacket(activeChar));
// Send Item List
client.sendPacket(new ItemList(activeChar, false));
client.sendPacket(new ItemList(1, activeChar, false));
client.sendPacket(new ItemList(2, activeChar, false));
// Send Quest Item List
client.sendPacket(new ExQuestItemList(activeChar));
client.sendPacket(new ExQuestItemList(1, activeChar));
client.sendPacket(new ExQuestItemList(2, activeChar));
// Send Adena and Inventory Count
client.sendPacket(new ExAdenaInvenCount(activeChar));

View File

@@ -44,7 +44,6 @@ public final class RequestGMCommand implements IClientIncomingPacket
{
_targetName = packet.readS();
_command = packet.readD();
// _unknown = packet.readD();
return true;
}
@@ -95,7 +94,8 @@ public final class RequestGMCommand implements IClientIncomingPacket
}
case 5: // player inventory
{
client.sendPacket(new GMViewItemList(player));
client.sendPacket(new GMViewItemList(1, player));
client.sendPacket(new GMViewItemList(2, player));
client.sendPacket(new GMHennaInfo(player));
break;
}
@@ -113,7 +113,6 @@ public final class RequestGMCommand implements IClientIncomingPacket
}
break;
}
}
}
}

View File

@@ -55,6 +55,7 @@ public final class RequestPostItemList implements IClientIncomingPacket
return;
}
client.sendPacket(new ExReplyPostItemList(activeChar));
client.sendPacket(new ExReplyPostItemList(1, activeChar));
client.sendPacket(new ExReplyPostItemList(2, activeChar));
}
}

View File

@@ -144,14 +144,16 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || player.isInDuel())
{
player.sendPacket(SystemMessageId.WHILE_YOU_ARE_ENGAGED_IN_COMBAT_YOU_CANNOT_OPERATE_A_PRIVATE_STORE_OR_PRIVATE_WORKSHOP);
player.sendPacket(new PrivateStoreManageListBuy(player));
player.sendPacket(new PrivateStoreManageListBuy(1, player));
player.sendPacket(new PrivateStoreManageListBuy(2, player));
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
if (player.isInsideZone(ZoneId.NO_STORE))
{
player.sendPacket(new PrivateStoreManageListBuy(player));
player.sendPacket(new PrivateStoreManageListBuy(1, player));
player.sendPacket(new PrivateStoreManageListBuy(2, player));
player.sendPacket(SystemMessageId.YOU_CANNOT_OPEN_A_PRIVATE_STORE_HERE);
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
@@ -163,7 +165,8 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
// Check maximum number of allowed slots for pvt shops
if (_items.length > player.getPrivateBuyStoreLimit())
{
player.sendPacket(new PrivateStoreManageListBuy(player));
player.sendPacket(new PrivateStoreManageListBuy(1, player));
player.sendPacket(new PrivateStoreManageListBuy(2, player));
player.sendPacket(SystemMessageId.YOU_HAVE_EXCEEDED_THE_QUANTITY_THAT_CAN_BE_INPUTTED);
return;
}
@@ -190,7 +193,8 @@ public final class SetPrivateStoreListBuy implements IClientIncomingPacket
// Check for available funds
if (totalCost > player.getAdena())
{
player.sendPacket(new PrivateStoreManageListBuy(player));
player.sendPacket(new PrivateStoreManageListBuy(1, player));
player.sendPacket(new PrivateStoreManageListBuy(2, player));
player.sendPacket(SystemMessageId.THE_PURCHASE_PRICE_IS_HIGHER_THAN_THE_AMOUNT_OF_MONEY_THAT_YOU_HAVE_AND_SO_YOU_CANNOT_OPEN_A_PERSONAL_STORE);
return;
}

View File

@@ -97,14 +97,16 @@ public class SetPrivateStoreListSell implements IClientIncomingPacket
if (AttackStanceTaskManager.getInstance().hasAttackStanceTask(player) || player.isInDuel())
{
player.sendPacket(SystemMessageId.WHILE_YOU_ARE_ENGAGED_IN_COMBAT_YOU_CANNOT_OPERATE_A_PRIVATE_STORE_OR_PRIVATE_WORKSHOP);
player.sendPacket(new PrivateStoreManageListSell(player, _packageSale));
player.sendPacket(new PrivateStoreManageListSell(1, player, _packageSale));
player.sendPacket(new PrivateStoreManageListSell(2, player, _packageSale));
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
if (player.isInsideZone(ZoneId.NO_STORE))
{
player.sendPacket(new PrivateStoreManageListSell(player, _packageSale));
player.sendPacket(new PrivateStoreManageListSell(1, player, _packageSale));
player.sendPacket(new PrivateStoreManageListSell(2, player, _packageSale));
player.sendPacket(SystemMessageId.YOU_CANNOT_OPEN_A_PRIVATE_STORE_HERE);
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
@@ -113,7 +115,8 @@ public class SetPrivateStoreListSell implements IClientIncomingPacket
// Check maximum number of allowed slots for pvt shops
if (_items.length > player.getPrivateSellStoreLimit())
{
player.sendPacket(new PrivateStoreManageListSell(player, _packageSale));
player.sendPacket(new PrivateStoreManageListSell(1, player, _packageSale));
player.sendPacket(new PrivateStoreManageListSell(2, player, _packageSale));
player.sendPacket(SystemMessageId.YOU_HAVE_EXCEEDED_THE_QUANTITY_THAT_CAN_BE_INPUTTED);
return;
}

View File

@@ -84,7 +84,9 @@ public abstract class AbstractInventoryUpdate extends AbstractItemPacket
protected final void writeItems(PacketWriter packet)
{
packet.writeH(_items.size());
packet.writeC(0); // 140
packet.writeD(0); // 140
packet.writeD(_items.size()); // 140
for (ItemInfo item : _items.values())
{
packet.writeH(item.getChange()); // Update type : 01-add, 02-modify, 03-remove

View File

@@ -43,6 +43,11 @@ public abstract class AbstractItemPacket extends AbstractMaskPacket<ItemListType
return MASKS;
}
protected void writeItem(PacketWriter packet, TradeItem item, long count)
{
writeItem(packet, new ItemInfo(item), count);
}
protected void writeItem(PacketWriter packet, TradeItem item)
{
writeItem(packet, new ItemInfo(item));
@@ -81,6 +86,8 @@ public abstract class AbstractItemPacket extends AbstractMaskPacket<ItemListType
packet.writeD(item.getMana());
packet.writeD(item.getTime());
packet.writeC(0x01); // GOD Item enabled = 1 disabled (red) = 0
packet.writeC(0x00); // 140 protocol
packet.writeC(0x00); // 140 protocol
if (containsMask(mask, ItemListType.AUGMENT_BONUS))
{
writeItemAugment(packet, item);
@@ -103,6 +110,56 @@ public abstract class AbstractItemPacket extends AbstractMaskPacket<ItemListType
}
}
protected void writeItem(PacketWriter packet, ItemInfo item, long count)
{
final int mask = calculateMask(item);
packet.writeC(mask);
packet.writeD(item.getObjectId()); // ObjectId
packet.writeD(item.getItem().getDisplayId()); // ItemId
packet.writeC(item.getItem().isQuestItem() || (item.getEquipped() == 1) ? 0xFF : item.getLocation()); // T1
packet.writeQ(count); // Quantity
packet.writeC(item.getItem().getType2()); // Item Type 2 : 00-weapon, 01-shield/armor, 02-ring/earring/necklace, 03-questitem, 04-adena, 05-item
packet.writeC(item.getCustomType1()); // Filler (always 0)
packet.writeH(item.getEquipped()); // Equipped : 00-No, 01-yes
packet.writeQ(item.getItem().getBodyPart()); // Slot : 0006-lr.ear, 0008-neck, 0030-lr.finger, 0040-head, 0100-l.hand, 0200-gloves, 0400-chest, 0800-pants, 1000-feet, 4000-r.hand, 8000-r.hand
packet.writeC(item.getEnchantLevel()); // Enchant level (pet level shown in control item)
packet.writeC(0x01); // TODO : Find me
packet.writeD(item.getMana());
packet.writeD(item.getTime());
packet.writeC(0x01); // GOD Item enabled = 1 disabled (red) = 0
packet.writeC(0x00); // 140 protocol
packet.writeC(0x00); // 140 protocol
if (containsMask(mask, ItemListType.AUGMENT_BONUS))
{
writeItemAugment(packet, item);
}
if (containsMask(mask, ItemListType.ELEMENTAL_ATTRIBUTE))
{
writeItemElemental(packet, item);
}
if (containsMask(mask, ItemListType.ENCHANT_EFFECT))
{
writeItemEnchantEffect(packet, item);
}
if (containsMask(mask, ItemListType.VISUAL_ID))
{
packet.writeD(item.getVisualId()); // Item remodel visual ID
}
if (containsMask(mask, ItemListType.SOUL_CRYSTAL))
{
packet.writeC(item.getSoulCrystalOptions().size());
for (EnsoulOption option : item.getSoulCrystalOptions())
{
packet.writeD(option.getId());
}
packet.writeC(item.getSoulCrystalSpecialOptions().size());
for (EnsoulOption option : item.getSoulCrystalSpecialOptions())
{
packet.writeD(option.getId());
}
}
}
protected static int calculateMask(ItemInfo item)
{
int mask = 0;

View File

@@ -96,7 +96,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
packet.writeC(size == Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT ? 0x01 : 0x00); // if 1 can't create new char
packet.writeC(0x01); // play mode, if 1 can create only 2 char in regular lobby
packet.writeD(0x02); // if 1, korean client
packet.writeC(0x00); // if 1 suggest premium account
packet.writeH(0x00); // if 1 suggest premium account
long lastAccess = 0L;
if (_activeId == -1)
@@ -184,6 +184,12 @@ public class CharSelectionInfo implements IClientOutgoingPacket
packet.writeD(charInfoPackage.getHairColor());
packet.writeD(charInfoPackage.getFace());
packet.writeD(0x00); // Salvation
packet.writeD(0x00); // Salvation
packet.writeD(0x00); // Salvation
packet.writeD(0x00); // Salvation
packet.writeD(0x00); // Salvation
packet.writeF(charInfoPackage.getMaxHp()); // hp max
packet.writeF(charInfoPackage.getMaxMp()); // mp max

View File

@@ -28,11 +28,13 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
*/
public class ExQuestItemList extends AbstractItemPacket
{
private final int _sendType;
private final L2PcInstance _activeChar;
private final Collection<L2ItemInstance> _items;
public ExQuestItemList(L2PcInstance activeChar)
public ExQuestItemList(int sendType, L2PcInstance activeChar)
{
_sendType = sendType;
_activeChar = activeChar;
_items = activeChar.getInventory().getItems(L2ItemInstance::isQuestItem);
}
@@ -41,8 +43,16 @@ public class ExQuestItemList extends AbstractItemPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_QUEST_ITEM_LIST.writeId(packet);
packet.writeH(_items.size());
packet.writeC(_sendType);
if (_sendType == 2)
{
packet.writeD(_items.size());
}
else
{
packet.writeH(0);
}
packet.writeD(_items.size());
for (L2ItemInstance item : _items)
{
writeItem(packet, item);

View File

@@ -28,11 +28,13 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
*/
public class ExReplyPostItemList extends AbstractItemPacket
{
private final int _sendType;
private final L2PcInstance _activeChar;
private final Collection<L2ItemInstance> _itemList;
public ExReplyPostItemList(L2PcInstance activeChar)
public ExReplyPostItemList(int sendType, L2PcInstance activeChar)
{
_sendType = sendType;
_activeChar = activeChar;
_itemList = _activeChar.getInventory().getAvailableItems(true, false, false);
}
@@ -41,11 +43,15 @@ public class ExReplyPostItemList extends AbstractItemPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_REPLY_POST_ITEM_LIST.writeId(packet);
packet.writeC(_sendType);
packet.writeD(_itemList.size());
for (L2ItemInstance item : _itemList)
if (_sendType == 2)
{
writeItem(packet, item);
packet.writeD(_itemList.size());
for (L2ItemInstance item : _itemList)
{
writeItem(packet, item);
}
}
return true;
}

View File

@@ -27,12 +27,14 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
public class GMViewItemList extends AbstractItemPacket
{
private final int _sendType;
private final List<L2ItemInstance> _items = new ArrayList<>();
private final int _limit;
private final String _playerName;
public GMViewItemList(L2PcInstance cha)
public GMViewItemList(int sendType, L2PcInstance cha)
{
_sendType = sendType;
_playerName = cha.getName();
_limit = cha.getInventoryLimit();
for (L2ItemInstance item : cha.getInventory().getItems())
@@ -41,8 +43,9 @@ public class GMViewItemList extends AbstractItemPacket
}
}
public GMViewItemList(L2PetInstance cha)
public GMViewItemList(int sendType, L2PetInstance cha)
{
_sendType = sendType;
_playerName = cha.getName();
_limit = cha.getInventoryLimit();
for (L2ItemInstance item : cha.getInventory().getItems())
@@ -55,11 +58,17 @@ public class GMViewItemList extends AbstractItemPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.GM_VIEW_ITEM_LIST.writeId(packet);
packet.writeS(_playerName);
packet.writeD(_limit); // inventory limit
packet.writeH(0x01); // show window ??
packet.writeH(_items.size());
packet.writeC(_sendType);
if (_sendType == 2)
{
packet.writeD(_items.size());
}
else
{
packet.writeS(_playerName);
packet.writeD(_limit); // inventory limit
}
packet.writeD(_items.size());
for (L2ItemInstance item : _items)
{
writeItem(packet, item);

View File

@@ -63,7 +63,6 @@ public class HennaEquipList implements IClientOutgoingPacket
packet.writeQ(henna.getWearCount()); // amount of dyes required
packet.writeQ(henna.getWearFee()); // amount of Adena required
packet.writeD(henna.isAllowedClass(_player.getClassId()) ? 0x01 : 0x00); // meet the requirement or not
packet.writeD(0x00); // TODO: Find me!
}
}
return true;

View File

@@ -51,7 +51,6 @@ public class HennaRemoveList implements IClientOutgoingPacket
packet.writeQ(henna.getCancelCount());
packet.writeQ(henna.getCancelFee());
packet.writeD(0x00);
packet.writeD(0x00);
}
}
return true;

View File

@@ -26,12 +26,14 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
public final class ItemList extends AbstractItemPacket
{
private final int _sendType;
private final L2PcInstance _activeChar;
private final List<L2ItemInstance> _items;
private final boolean _showWindow;
public ItemList(L2PcInstance activeChar, boolean showWindow)
public ItemList(int sendType, L2PcInstance activeChar, boolean showWindow)
{
_sendType = sendType;
_activeChar = activeChar;
_showWindow = showWindow;
_items = activeChar.getInventory().getItems(item -> !item.isQuestItem()).stream().collect(Collectors.toList());
@@ -41,12 +43,21 @@ public final class ItemList extends AbstractItemPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.ITEM_LIST.writeId(packet);
packet.writeH(_showWindow ? 0x01 : 0x00);
packet.writeH(_items.size());
for (L2ItemInstance item : _items)
if (_sendType == 2)
{
writeItem(packet, item);
packet.writeC(_sendType);
packet.writeD(_items.size());
packet.writeD(_items.size());
for (L2ItemInstance item : _items)
{
writeItem(packet, item);
}
}
else
{
packet.writeC(_showWindow ? 0x01 : 0x00);
packet.writeD(0x00);
packet.writeD(_items.size());
}
writeInventoryBlock(packet, _activeChar.getInventory());
return true;

View File

@@ -26,13 +26,15 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
public class PrivateStoreManageListBuy extends AbstractItemPacket
{
private final int _sendType;
private final int _objId;
private final long _playerAdena;
private final Collection<L2ItemInstance> _itemList;
private final TradeItem[] _buyList;
public PrivateStoreManageListBuy(L2PcInstance player)
public PrivateStoreManageListBuy(int sendType, L2PcInstance player)
{
_sendType = sendType;
_objId = player.getObjectId();
_playerAdena = player.getAdena();
_itemList = player.getInventory().getUniqueItems(false, true);
@@ -43,24 +45,35 @@ public class PrivateStoreManageListBuy extends AbstractItemPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.PRIVATE_STORE_BUY_MANAGE_LIST.writeId(packet);
packet.writeD(_objId);
packet.writeQ(_playerAdena);
packet.writeD(_itemList.size()); // inventory items for potential buy
for (L2ItemInstance item : _itemList)
packet.writeC(_sendType);
if (_sendType == 2)
{
writeItem(packet, item);
packet.writeQ(item.getItem().getReferencePrice() * 2);
packet.writeD(_itemList.size());
packet.writeD(_itemList.size());
for (L2ItemInstance item : _itemList)
{
writeItem(packet, item);
packet.writeQ(item.getItem().getReferencePrice() * 2);
}
}
packet.writeD(_buyList.length); // count for all items already added for buy
for (TradeItem item : _buyList)
else
{
writeItem(packet, item);
packet.writeQ(item.getPrice());
packet.writeQ(item.getItem().getReferencePrice() * 2);
packet.writeQ(item.getCount());
packet.writeD(_objId);
packet.writeQ(_playerAdena);
packet.writeD(0x00);
for (L2ItemInstance item : _itemList)
{
writeItem(packet, item);
packet.writeQ(item.getItem().getReferencePrice() * 2);
}
packet.writeD(0x00);
for (TradeItem item2 : _buyList)
{
writeItem(packet, item2);
packet.writeQ(item2.getPrice());
packet.writeQ(item2.getItem().getReferencePrice() * 2);
packet.writeQ(item2.getCount());
}
}
return true;
}

View File

@@ -25,14 +25,16 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
public class PrivateStoreManageListSell extends AbstractItemPacket
{
private final int _sendType;
private final int _objId;
private final long _playerAdena;
private final boolean _packageSale;
private final Collection<TradeItem> _itemList;
private final TradeItem[] _sellList;
public PrivateStoreManageListSell(L2PcInstance player, boolean isPackageSale)
public PrivateStoreManageListSell(int sendType, L2PcInstance player, boolean isPackageSale)
{
_sendType = sendType;
_objId = player.getObjectId();
_playerAdena = player.getAdena();
player.getSellList().updateItems();
@@ -45,24 +47,35 @@ public class PrivateStoreManageListSell extends AbstractItemPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.PRIVATE_STORE_MANAGE_LIST.writeId(packet);
packet.writeD(_objId);
packet.writeD(_packageSale ? 1 : 0); // Package sell
packet.writeQ(_playerAdena);
packet.writeD(_itemList.size()); // for potential sells
for (TradeItem item : _itemList)
packet.writeC(_sendType);
if (_sendType == 2)
{
writeItem(packet, item);
packet.writeQ(item.getItem().getReferencePrice() * 2);
packet.writeD(_itemList.size());
packet.writeD(_itemList.size());
for (TradeItem item : _itemList)
{
writeItem(packet, item);
packet.writeQ(item.getItem().getReferencePrice() * 2);
}
}
packet.writeD(_sellList.length); // count for any items already added for sell
for (TradeItem item : _sellList)
else
{
writeItem(packet, item);
packet.writeQ(item.getPrice());
packet.writeQ(item.getItem().getReferencePrice() * 2);
packet.writeD(_objId);
packet.writeD(_packageSale ? 1 : 0);
packet.writeQ(_playerAdena);
packet.writeD(0x00);
for (TradeItem item : _itemList)
{
writeItem(packet, item);
packet.writeQ(item.getItem().getReferencePrice() * 2);
}
packet.writeD(0x00);
for (TradeItem item2 : _sellList)
{
writeItem(packet, item2);
packet.writeQ(item2.getPrice());
packet.writeQ(item2.getItem().getReferencePrice() * 2);
}
}
return true;
}

View File

@@ -25,10 +25,12 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
*/
public final class TradeOtherAdd extends AbstractItemPacket
{
private final int _sendType;
private final TradeItem _item;
public TradeOtherAdd(TradeItem item)
public TradeOtherAdd(int sendType, TradeItem item)
{
_sendType = sendType;
_item = item;
}
@@ -36,7 +38,12 @@ public final class TradeOtherAdd extends AbstractItemPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.TRADE_OTHER_ADD.writeId(packet);
packet.writeH(1); // item count
packet.writeC(_sendType);
if (_sendType == 2)
{
packet.writeD(0x01);
}
packet.writeD(0x01);
writeItem(packet, _item);
return true;
}

View File

@@ -25,10 +25,12 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
*/
public final class TradeOwnAdd extends AbstractItemPacket
{
private final int _sendType;
private final TradeItem _item;
public TradeOwnAdd(TradeItem item)
public TradeOwnAdd(int sendType, TradeItem item)
{
_sendType = sendType;
_item = item;
}
@@ -36,7 +38,12 @@ public final class TradeOwnAdd extends AbstractItemPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.TRADE_OWN_ADD.writeId(packet);
packet.writeH(1); // items added count
packet.writeC(_sendType);
if (_sendType == 2)
{
packet.writeD(0x01);
}
packet.writeD(0x01);
writeItem(packet, _item);
return true;
}

View File

@@ -28,13 +28,15 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
public final class TradeStart extends AbstractItemPacket
{
private final int _sendType;
private final L2PcInstance _activeChar;
private final L2PcInstance _partner;
private final Collection<L2ItemInstance> _itemList;
private int _mask = 0;
public TradeStart(L2PcInstance player)
public TradeStart(int sendType, L2PcInstance player)
{
_sendType = sendType;
_activeChar = player;
_partner = player.getActiveTradeList().getPartner();
_itemList = _activeChar.getInventory().getAvailableItems(true, (_activeChar.canOverrideCond(PcCondOverride.ITEM_CONDITIONS) && Config.GM_TRADE_RESTRICTED_ITEMS), false);
@@ -75,16 +77,24 @@ public final class TradeStart extends AbstractItemPacket
}
OutgoingPackets.TRADE_START.writeId(packet);
packet.writeD(_partner.getObjectId());
packet.writeC(_mask); // some kind of mask
if ((_mask & 0x10) == 0)
packet.writeC(_sendType);
if (_sendType == 2)
{
packet.writeC(_partner.getLevel());
packet.writeD(_itemList.size());
packet.writeD(_itemList.size());
for (L2ItemInstance item : _itemList)
{
writeItem(packet, item);
}
}
packet.writeH(_itemList.size());
for (L2ItemInstance item : _itemList)
else
{
writeItem(packet, item);
packet.writeD(_partner.getObjectId());
packet.writeC(_mask); // some kind of mask
if ((_mask & 0x10) == 0)
{
packet.writeC(_partner.getLevel());
}
}
return true;
}

View File

@@ -26,11 +26,15 @@ import com.l2jmobius.gameserver.network.OutgoingPackets;
*/
public class TradeUpdate extends AbstractItemPacket
{
private final int _sendType;
private final TradeItem _item;
private final long _newCount;
private final long _count;
public TradeUpdate(L2PcInstance player, TradeItem item)
public TradeUpdate(int sendType, L2PcInstance player, TradeItem item, long count)
{
_sendType = sendType;
_count = count;
_item = item;
_newCount = player.getInventory().getItemByObjectId(item.getObjectId()).getCount() - item.getCount();
}
@@ -39,10 +43,14 @@ public class TradeUpdate extends AbstractItemPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.TRADE_UPDATE.writeId(packet);
packet.writeH(1);
packet.writeH((_newCount > 0) && _item.getItem().isStackable() ? 3 : 2);
writeItem(packet, _item);
packet.writeC(_sendType);
packet.writeD(0x01);
if (_sendType == 2)
{
packet.writeD(0x01);
packet.writeH((_newCount > 0) && _item.getItem().isStackable() ? 3 : 2);
writeItem(packet, _item, _count);
}
return true;
}
}

View File

@@ -132,7 +132,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
packet.writeD(_activeChar.getObjectId());
packet.writeD(_initSize);
packet.writeH(23);
packet.writeH(24);
packet.writeB(_masks);
if (containsMask(UserInfoType.RELATION))
@@ -322,14 +322,13 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
if (containsMask(UserInfoType.SLOTS))
{
packet.writeH(9);
packet.writeC(_activeChar.getInventory().getTalismanSlots()); // Confirmed
packet.writeC(_activeChar.getInventory().getBroochJewelSlots()); // Confirmed
packet.writeC(_activeChar.getTeam().getId()); // Confirmed
packet.writeC(0x00); // (1 = Red, 2 = White, 3 = White Pink) dotted ring on the floor
packet.writeC(0x00);
packet.writeH(11); // 140
packet.writeC(_activeChar.getInventory().getTalismanSlots());
packet.writeC(_activeChar.getInventory().getBroochJewelSlots());
packet.writeC(_activeChar.getTeam().getId());
packet.writeC(0x00);
packet.writeC(0x00);
packet.writeD(0x00);
}
if (containsMask(UserInfoType.MOVEMENTS))

View File

@@ -30,8 +30,8 @@ public final class WareHouseDepositList extends AbstractItemPacket
public static final int CLAN = 2;
public static final int CASTLE = 3;
public static final int FREIGHT = 1;
private final int _sendType;
private final long _playerAdena;
private final int _warehouseSize;
private final List<L2ItemInstance> _items = new ArrayList<>();
private final List<Integer> _itemsStackable = new ArrayList<>();
/**
@@ -44,11 +44,11 @@ public final class WareHouseDepositList extends AbstractItemPacket
*/
private final int _whType;
public WareHouseDepositList(L2PcInstance player, int type)
public WareHouseDepositList(int sendType, L2PcInstance player, int type)
{
_sendType = sendType;
_whType = type;
_playerAdena = player.getAdena();
_warehouseSize = player.getActiveWarehouse() != null ? player.getActiveWarehouse().getSize() : 0;
final boolean isPrivate = _whType == PRIVATE;
for (L2ItemInstance temp : player.getInventory().getAvailableItems(true, isPrivate, false))
@@ -68,23 +68,23 @@ public final class WareHouseDepositList extends AbstractItemPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.WAREHOUSE_DEPOSIT_LIST.writeId(packet);
packet.writeH(_whType);
packet.writeQ(_playerAdena);
packet.writeD(_warehouseSize);
packet.writeH(_itemsStackable.size());
for (int itemId : _itemsStackable)
packet.writeC(_sendType);
if (_sendType == 2)
{
packet.writeD(itemId);
packet.writeD(_whType);
packet.writeD(_items.size());
for (L2ItemInstance item : _items)
{
writeItem(packet, item);
packet.writeD(item.getObjectId());
}
}
packet.writeH(_items.size());
for (L2ItemInstance item : _items)
else
{
writeItem(packet, item);
packet.writeD(item.getObjectId());
packet.writeH(_whType);
packet.writeQ(_playerAdena);
packet.writeD(_itemsStackable.size());
packet.writeD(_items.size());
}
return true;
}

View File

@@ -31,6 +31,7 @@ public final class WareHouseWithdrawalList extends AbstractItemPacket
public static final int CLAN = 2;
public static final int CASTLE = 3; // not sure
public static final int FREIGHT = 1;
private final int _sendType;
private L2PcInstance _activeChar;
private long _playerAdena;
private final int _invSize;
@@ -46,8 +47,9 @@ public final class WareHouseWithdrawalList extends AbstractItemPacket
*/
private int _whType;
public WareHouseWithdrawalList(L2PcInstance player, int type)
public WareHouseWithdrawalList(int sendType, L2PcInstance player, int type)
{
_sendType = sendType;
_activeChar = player;
_whType = type;
@@ -74,22 +76,26 @@ public final class WareHouseWithdrawalList extends AbstractItemPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.WAREHOUSE_WITHDRAW_LIST.writeId(packet);
packet.writeH(_whType);
packet.writeQ(_playerAdena);
packet.writeH(_items.size());
packet.writeH(_itemsStackable.size());
for (int itemId : _itemsStackable)
packet.writeC(_sendType);
if (_sendType == 2)
{
packet.writeD(itemId);
packet.writeH(0x00);
packet.writeD(_invSize);
packet.writeD(_items.size());
for (L2ItemInstance item : _items)
{
writeItem(packet, item);
packet.writeD(item.getObjectId());
packet.writeD(0x00);
packet.writeD(0x00);
}
}
packet.writeD(_invSize);
for (L2ItemInstance item : _items)
else
{
writeItem(packet, item);
packet.writeD(item.getObjectId());
packet.writeD(0);
packet.writeD(0);
packet.writeH(_whType);
packet.writeQ(_playerAdena);
packet.writeD(_invSize);
packet.writeD(_items.size());
}
return true;
}