L2JMobius

C6 Pet equipment

Strelook66 · 3 · 5034

Offline Strelook66

  • Knight
  • ***
    • Posts: 82
Hi,

(Moved from General section to here since its a bug. Please delete it from General.)

I've been testing the server out and there seems to be an issue regarding the pets and its equipment. When i try to equip the pet with an item it says: "Your pet cannot carry this item".

 https://imgur.com/a/x13TBpq

And after that, the item becomes unequipable from the pet. To retrieve the item, i must unsummon the pet. There are no errors in the gamerserver or in the log files.

I am using the latest interlude pack from: https://bitbucket.org/MobiusDev/l2j_mobius.git

FYI: What i observed is that in the table from sql (items.sql) when you transfer the item to the pet, it changes the LOCATION column from PAPERDOLL to PET but the loc_data doesnt change the number to the appropriate slot.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16145
Thank you for your report.
Since none reported this on the private version I wil share you my fix.

Code: [Select]
Index: java/org/l2jmobius/gameserver/engines/DocumentItem.java
===================================================================
--- java/org/l2jmobius/gameserver/engines/DocumentItem.java (revision 7034)
+++ java/org/l2jmobius/gameserver/engines/DocumentItem.java (working copy)
@@ -176,6 +176,7 @@
 
  if (className.equals("Weapon"))
  {
+ int bodypart = _slots.get(_currentItem.set.getString("bodypart"));
  _currentItem.type = _weaponTypes.get(_currentItem.set.getString("weapon_type"));
 
  // lets see if this is a shield
@@ -218,14 +219,16 @@
  }
  }
 
- _currentItem.set.set("bodypart", Item.SLOT_R_HAND);
+ bodypart = Item.SLOT_R_HAND;
  }
+
+ _currentItem.set.set("bodypart", bodypart);
  }
  else if (className.equals("Armor"))
  {
  _currentItem.type = _armorTypes.get(_currentItem.set.getString("armor_type"));
 
- final int bodypart = _slots.get(_currentItem.set.getString("bodypart"));
+ int bodypart = _slots.get(_currentItem.set.getString("bodypart"));
  if ((bodypart == Item.SLOT_NECK) || (bodypart == Item.SLOT_HAIR) || (bodypart == Item.SLOT_FACE) || (bodypart == Item.SLOT_DHAIR) || ((bodypart & Item.SLOT_L_EAR) != 0) || ((bodypart & Item.SLOT_L_FINGER) != 0))
  {
  _currentItem.set.set("type1", Item.TYPE1_WEAPON_RING_EARRING_NECKLACE);
@@ -265,8 +268,10 @@
  }
  }
 
- _currentItem.set.set("bodypart", Item.SLOT_CHEST);
+ bodypart = Item.SLOT_CHEST;
  }
+
+ _currentItem.set.set("bodypart", bodypart);
  }
  else
  {
Index: java/org/l2jmobius/gameserver/model/items/Item.java
===================================================================
--- java/org/l2jmobius/gameserver/model/items/Item.java (revision 7034)
+++ java/org/l2jmobius/gameserver/model/items/Item.java (working copy)
@@ -170,6 +170,7 @@
  _weight = set.getInt("weight", 0);
  _crystallizable = set.getBoolean("crystallizable", false);
  _stackable = set.getBoolean("stackable", false);
+
  switch (set.getString("crystal_type", ""))
  {
  case "d":
@@ -203,133 +204,9 @@
  break;
  }
  }
+
  _duration = set.getInt("duration", -1);
- switch (set.getString("bodypart", ""))
- {
- case "chest":
- {
- _bodyPart = SLOT_CHEST;
- break;
- }
- case "fullarmor":
- {
- _bodyPart = SLOT_FULL_ARMOR;
- break;
- }
- case "head":
- {
- _bodyPart = SLOT_HEAD;
- break;
- }
- case "hair":
- {
- _bodyPart = SLOT_HAIR;
- break;
- }
- case "face":
- {
- _bodyPart = SLOT_FACE;
- break;
- }
- case "dhair":
- {
- _bodyPart = SLOT_DHAIR;
- break;
- }
- case "underwear":
- {
- _bodyPart = SLOT_UNDERWEAR;
- break;
- }
- case "back":
- {
- _bodyPart = SLOT_BACK;
- break;
- }
- case "neck":
- {
- _bodyPart = SLOT_NECK;
- break;
- }
- case "legs":
- {
- _bodyPart = SLOT_LEGS;
- break;
- }
- case "feet":
- {
- _bodyPart = SLOT_FEET;
- break;
- }
- case "gloves":
- {
- _bodyPart = SLOT_GLOVES;
- break;
- }
- case "chest,legs":
- {
- _bodyPart = SLOT_CHEST | SLOT_LEGS;
- break;
- }
- case "rhand":
- {
- _bodyPart = SLOT_R_HAND;
- break;
- }
- case "lhand":
- {
- _bodyPart = SLOT_L_HAND;
- break;
- }
- case "lrhand":
- {
- _bodyPart = SLOT_LR_HAND;
- break;
- }
- case "rear,lear":
- {
- _bodyPart = SLOT_R_EAR | SLOT_L_EAR;
- break;
- }
- case "rfinger,lfinger":
- {
- _bodyPart = SLOT_R_FINGER | SLOT_L_FINGER;
- break;
- }
- case "wolf":
- {
- _bodyPart = SLOT_WOLF;
- break;
- }
- case "hatchling":
- {
- _bodyPart = SLOT_HATCHLING;
- break;
- }
- case "strider":
- {
- _bodyPart = SLOT_STRIDER;
- break;
- }
- case "babypet":
- {
- _bodyPart = SLOT_BABYPET;
- break;
- }
- default: // "none"
- {
- if (_name.contains(" Arrow") || _name.contains(" Lure")) // Tempfix for invisible equipped consumables.
- {
- _bodyPart = Item.SLOT_L_HAND; // TODO: Should be done on XML.
- }
- else
- {
- _bodyPart = SLOT_NONE;
- }
- break;
- }
- }
-
+ _bodyPart = set.getInt("bodypart", SLOT_NONE);
  _referencePrice = set.getInt("price", 0);
  _crystalCount = set.getInt("crystal_count", 0);
  _sellable = set.getBoolean("sellable", true);

It also fixes the invisible equipped consumables.


Offline Strelook66

  • Knight
  • ***
    • Posts: 82
WOW!! Thank you very much Mobius! You are awesome! Keep up the good work!