L2JMobius

Public Development => Shares/Contributions => Topic started by: Lenox102 on March 13, 2024, 07:27:35 AM

Title: Show hair2 accessories
Post by: Lenox102 on March 13, 2024, 07:27:35 AM
/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java

Quote
find this code

Code: [Select]
   public static final int PAPERDOLL_FACE = 14;
   public static final int PAPERDOLL_HAIR = 15;
   public static final int PAPERDOLL_HAIR2 = 16;

and replace it with this

Code: [Select]
   public static final int PAPERDOLL_HAIR = 14;
   public static final int PAPERDOLL_HAIR2 = 15;
   public static final int PAPERDOLL_HAIRALL = 16;

/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/GMViewCharacterInfo.java
Quote
find this code

Code: [Select]
      writeInt(_player.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FACE));
      writeInt(_player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FACE));

and replace it with this

Code: [Select]
      writeInt(_player.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR2));
      writeInt(_player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR2));


/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
Quote
find this code

Code: [Select]
      writeInt(_player.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FACE));     
      writeInt(_player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_FACE));

and replace it with this

Code: [Select]
      writeInt(_player.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR2));
      writeInt(_player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_HAIR2));
Title: Re: Show hair2 accessories
Post by: proelf on April 09, 2025, 12:29:53 AM
Which files should i pull out after build, i already have server running and lot of things has been done. THX
Title: Re: Show hair2 accessories
Post by: lovepako on April 09, 2025, 04:26:04 AM
/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java

/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/GMViewCharacterInfo.java

/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java

grato

UPDATER CODE

and replace it with this


     
Quote
writeInt(_player.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR2));
      writeInt(_player.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_HAIR2));
Title: Re: Show hair2 accessories
Post by: lovepako on May 02, 2025, 12:12:03 AM
/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java


To complete the correction, you need to change the inventory code.
because when you put something in hair 2 it removes the item from the hair the correct code would be this in the inventory look for the line and replace the code completely

Code: [Select]
-case ItemTemplate.SLOT_HAIR2:
-{
-final Item hair2 = getPaperdollItem(PAPERDOLL_HAIR);
-if ((hair2 != null) && (hair2.getTemplate().getBodyPart() == ItemTemplate.SLOT_HAIRALL))
-{
- setPaperdollItem(PAPERDOLL_HAIR2, null);
-}
-else
-{
- setPaperdollItem(PAPERDOLL_HAIR, null);
-}
-setPaperdollItem(PAPERDOLL_HAIR2, item);
-break;
-}

with this code the correction is 100%

   
Code: [Select]
+case ItemTemplate.SLOT_HAIR2:
+{
+final Item hair2 = getPaperdollItem(PAPERDOLL_HAIR2);
+if ((hair2 != null) && (hair2.getTemplate().getBodyPart() == ItemTemplate.SLOT_HAIR2))
+{
+ setPaperdollItem(PAPERDOLL_HAIR2, null);
+}
+setPaperdollItem(PAPERDOLL_HAIR2, item);
+break;
+}