Jump to content
  • 0

Adapting Anarchy's Dressme to L2JMobius


Question

Posted

Hello maxcheaters! We are a small group of friends that are developing a closed roleplay community, and want to adapt some customs to our L2JMobius free pack (currently we are using Classic Zaken 2.1). We have currently adapted a Skin Manager and L2JDevs ModEngine, but we are having some problem with An4rchy's Dressme. So far, te code is "working". Panel works, get target appearance works, but only for other players. That's surely because our CharInfo implementation is ok, but the UserInfo is messed up. That's something that we can usually fix on our end but...

 

We have realised that the UserInfo in L2JMobius is pretty different from the one present on aCIs or Frozen, and that the appareance of the player is controlled by ExUserInfoEquipSlot (I guess?). We have currently tried some approachs to solve this, none of them with success. This is our last try:

 

/*
 * This file is part of the L2J Mobius project.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.l2jmobius.gameserver.network.serverpackets;

import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.enums.InventorySlot;
import org.l2jmobius.gameserver.model.VariationInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.itemcontainer.PlayerInventory;
import org.l2jmobius.gameserver.network.OutgoingPackets;

/**
 * @author Sdw
 */
public class ExUserInfoEquipSlot extends AbstractMaskPacket<InventorySlot>
{
	private final PlayerInstance _player;
	
	private final byte[] _masks = new byte[]
	{
		(byte) 0x00,
		(byte) 0x00,
		(byte) 0x00,
		(byte) 0x00,
		(byte) 0x00
	};
	
	public ExUserInfoEquipSlot(PlayerInstance player)
	{
		this(player, true);
	}
	
	public ExUserInfoEquipSlot(PlayerInstance player, boolean addAll)
	{
		_player = player;
		
		if (addAll)
		{
			addComponentType(InventorySlot.values());
		}
	}
	
	@Override
	protected byte[] getMasks()
	{
		return _masks;
	}
	
	@Override
	public boolean write(PacketWriter packet)
	{
		OutgoingPackets.EX_USER_INFO_EQUIP_SLOT.writeId(packet);
		
		packet.writeD(_player.getObjectId());
		packet.writeH(InventorySlot.values().length);
		packet.writeB(_masks);
		
		final PlayerInventory inventory = _player.getInventory();
		for (InventorySlot slot : InventorySlot.values())
		{
			if (containsMask(slot))
			{
				if (!_player.isDressMeEnabled())
				{
					final VariationInstance augment = inventory.getPaperdollAugmentation(slot.getSlot());
					packet.writeH(22); // 10 + 4 * 3
					packet.writeD(inventory.getPaperdollObjectId(slot.getSlot()));
					packet.writeD(inventory.getPaperdollItemId(slot.getSlot()));
					packet.writeD(augment != null ? augment.getOption1Id() : 0);
					packet.writeD(augment != null ? augment.getOption2Id() : 0);
					packet.writeD(inventory.getPaperdollItemVisualId(slot.getSlot()));
				}
				else
				{
					switch (slot)
					{
						case RHAND:
							final VariationInstance augmentRHand = inventory.getPaperdollAugmentation(slot.getSlot());
							packet.writeH(22); // 10 + 4 * 3
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollObjectId(slot.getSlot()) : (_player.getDressMeData().getWeapId() == 0 ? inventory.getPaperdollObjectId(slot.getSlot()) : _player.getDressMeData().getWeapId()));
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollItemId(slot.getSlot()) : (_player.getDressMeData().getWeapId() == 0 ? inventory.getPaperdollItemId(slot.getSlot()) : _player.getDressMeData().getWeapId()));
							packet.writeD(augmentRHand != null ? augmentRHand.getOption1Id() : 0);
							packet.writeD(augmentRHand != null ? augmentRHand.getOption2Id() : 0);
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollItemVisualId(slot.getSlot()) : (_player.getDressMeData().getWeapId() == 0 ? inventory.getPaperdollItemVisualId(slot.getSlot()) : _player.getDressMeData().getWeapId()));
							break;
						case GLOVES:
							final VariationInstance augmentGloves = inventory.getPaperdollAugmentation(slot.getSlot());
							packet.writeH(22); // 10 + 4 * 3
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollObjectId(slot.getSlot()) : (_player.getDressMeData().getGlovesId() == 0 ? inventory.getPaperdollObjectId(slot.getSlot()) : _player.getDressMeData().getGlovesId()));
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollItemId(slot.getSlot()) : (_player.getDressMeData().getGlovesId() == 0 ? inventory.getPaperdollItemId(slot.getSlot()) : _player.getDressMeData().getGlovesId()));
							packet.writeD(augmentGloves != null ? augmentGloves.getOption1Id() : 0);
							packet.writeD(augmentGloves != null ? augmentGloves.getOption2Id() : 0);
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollItemVisualId(slot.getSlot()) : (_player.getDressMeData().getGlovesId() == 0 ? inventory.getPaperdollItemVisualId(slot.getSlot()) : _player.getDressMeData().getGlovesId()));
							break;
						case CHEST:
							final VariationInstance augmentChest = inventory.getPaperdollAugmentation(slot.getSlot());
							packet.writeH(22); // 10 + 4 * 3
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollObjectId(slot.getSlot()) : (_player.getDressMeData().getChestId() == 0 ? inventory.getPaperdollObjectId(slot.getSlot()) : _player.getDressMeData().getChestId()));
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollItemId(slot.getSlot()) : (_player.getDressMeData().getChestId() == 0 ? inventory.getPaperdollItemId(slot.getSlot()) : _player.getDressMeData().getChestId()));
							packet.writeD(augmentChest != null ? augmentChest.getOption1Id() : 0);
							packet.writeD(augmentChest != null ? augmentChest.getOption2Id() : 0);
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollItemVisualId(slot.getSlot()) : (_player.getDressMeData().getChestId() == 0 ? inventory.getPaperdollItemVisualId(slot.getSlot()) : _player.getDressMeData().getChestId()));
							break;
						case LEGS:
							final VariationInstance augmentLegs = inventory.getPaperdollAugmentation(slot.getSlot());
							packet.writeH(22); // 10 + 4 * 3
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollObjectId(slot.getSlot()) : (_player.getDressMeData().getLegsId() == 0 ? inventory.getPaperdollObjectId(slot.getSlot()) : _player.getDressMeData().getLegsId()));
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollItemId(slot.getSlot()) : (_player.getDressMeData().getLegsId() == 0 ? inventory.getPaperdollItemId(slot.getSlot()) : _player.getDressMeData().getLegsId()));
							packet.writeD(augmentLegs != null ? augmentLegs.getOption1Id() : 0);
							packet.writeD(augmentLegs != null ? augmentLegs.getOption2Id() : 0);
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollItemVisualId(slot.getSlot()) : (_player.getDressMeData().getLegsId() == 0 ? inventory.getPaperdollItemVisualId(slot.getSlot()) : _player.getDressMeData().getLegsId()));
							break;
						case FEET:
							final VariationInstance augmentFeet = inventory.getPaperdollAugmentation(slot.getSlot());
							packet.writeH(22); // 10 + 4 * 3
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollObjectId(slot.getSlot()) : (_player.getDressMeData().getBootsId() == 0 ? inventory.getPaperdollObjectId(slot.getSlot()) : _player.getDressMeData().getBootsId()));
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollItemId(slot.getSlot()) : (_player.getDressMeData().getBootsId() == 0 ? inventory.getPaperdollItemId(slot.getSlot()) : _player.getDressMeData().getBootsId()));
							packet.writeD(augmentFeet != null ? augmentFeet.getOption1Id() : 0);
							packet.writeD(augmentFeet != null ? augmentFeet.getOption2Id() : 0);
							packet.writeD(_player.getDressMeData() == null ? inventory.getPaperdollItemVisualId(slot.getSlot()) : (_player.getDressMeData().getBootsId() == 0 ? inventory.getPaperdollItemVisualId(slot.getSlot()) : _player.getDressMeData().getBootsId()));
							break;
						default:
							final VariationInstance augment = inventory.getPaperdollAugmentation(slot.getSlot());
							packet.writeH(22); // 10 + 4 * 3
							packet.writeD(inventory.getPaperdollObjectId(slot.getSlot()));
							packet.writeD(inventory.getPaperdollItemId(slot.getSlot()));
							packet.writeD(augment != null ? augment.getOption1Id() : 0);
							packet.writeD(augment != null ? augment.getOption2Id() : 0);
							packet.writeD(inventory.getPaperdollItemVisualId(slot.getSlot()));
							break;
					}
				}
			}
		}
		return true;
	}
}

I know it can be wrote WAY better, but we are ourselves PHP devs, so pls understand :p

 

These are the reference classes, so you can see the difference:

https://bitbucket.org/MobiusDev/l2j_mobius/src/master/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java

https://bitbucket.org/MobiusDev/l2j_mobius/src/master/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExUserInfoEquipSlot.java

and

https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/UserInfo.java

 

We are adapting An4rchy's dressme:

 

Some help would be much appreciated. In exchange, we will release and share it with the community!

 

Have a nice corona-day!

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

Welp... just solved it xD

 

The code is fine (ugly, but fine), it only required sending this packet on every dressme action on RequestBypassToServer:

 

player.sendPacket(new ExUserInfoEquipSlot(player));

 

It's working frawlessly now. Gonna clean it a little and share it soon!

 

EDIT: Can close now!

Edited by Ikeryn

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • TP Data: X=150148 Y=203643 Z=-3634
    • Hello everyone, this is ADENA L2REBORN / LU4 / MASTERWORK We also have items, epics, etc. discord - adver745645 Our prices are reasonable, so have a nice shopping and a nice day.
    • Dear friends, we are pleased to announce great news — we are launching our new bot for purchasing and renting virtual numbers for receiving SMS from any services! Are you tired of reused or resold numbers from other platforms? Try our solution! Our service allows you to receive SMS from any major popular services. The list includes more than 200 services! SMS receiving country: USA (+1). Real physical US numbers are used — never previously used on other platforms! Currently, only short-term rental is available. The rental duration for each phone number is shown when purchasing. The cost of each number is also shown next to the service before purchase. You can also receive an additional SMS for your number for the selected service (no extra charge for receiving one more SMS). To quickly find the service you need, you can use the convenient search — just type the name of the service you need and get a number for activation. Available payment methods: cryptocurrencies, bank cards, and balance transfer from our other bots. Thank you for your trust! Active links: Virtual Number Service: Go Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear friends, we are pleased to announce great news — we are launching our new bot for purchasing and renting virtual numbers for receiving SMS from any services! Are you tired of reused or resold numbers from other platforms? Try our solution! Our service allows you to receive SMS from any major popular services. The list includes more than 200 services! SMS receiving country: USA (+1). Real physical US numbers are used — never previously used on other platforms! Currently, only short-term rental is available. The rental duration for each phone number is shown when purchasing. The cost of each number is also shown next to the service before purchase. You can also receive an additional SMS for your number for the selected service (no extra charge for receiving one more SMS). To quickly find the service you need, you can use the convenient search — just type the name of the service you need and get a number for activation. Available payment methods: cryptocurrencies, bank cards, and balance transfer from our other bots. Thank you for your trust! Active links: Virtual Number Service: Go Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock