L2JMobius

C4 PK Quest (Q422_RepentYourSins)

speedwel · 7 · 5452

Offline speedwel

  • Vassal
  • *
    • Posts: 3
In the pk quest (Q422_RepentYourSins), I can't level the pet because it is already born level 78


https://ibb.co/GxP2B1s


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16147

Offline speedwel

  • Vassal
  • *
    • Posts: 3

I checked the pet's SQL and it is about to be born with lvl 15 but it is born with level 78 ... I verified the .xml seems to be correct.


https://ibb.co/cyR8Fq9

https://ibb.co/q0wj2rN


Offline emilianoify

  • Heir
  • **
    • Posts: 35
  • Try first after ask for help
Try this in PetInstance.

1-Look for public PetInstance(int objectId, NpcTemplate template, PlayerInstance owner, ItemInstance control)

2-Replace for this:

public PetInstance(int objectId, NpcTemplate template, PlayerInstance owner, ItemInstance control)
   {
      super(objectId, template, owner);
      super.setStat(new PetStat(this));
      
      _controlItemId = control.getObjectId();
      
      // Pet's initial level is supposed to be read from DB
      // Pets start at :
      // Wolf : Level 15
      // Hatcling : Level 35
      // Tested and confirmed on official servers
      // Sin-eaters are defaulted at the owner's level
      if ((template.getNpcId() == 12564) && (getOwner().getLevel() <= 77))
      {
         getStat().setLevel((byte) getOwner().getLevel());
      }
      else if ((template.getNpcId() == 12564) && (getOwner().getLevel() == 78))
      {
         getStat().setLevel(77);
      }
      
      _inventory = new PetInventory(this);
      
      final int npcId = template.getNpcId();
      _mountable = PetDataTable.isMountable(npcId);
   }

3-Now make quest again and  if you are 78 your pet born 77 else this get the owner level


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16147
Code: [Select]
// Tested and confirmed on official servers
// Sin-eaters are defaulted at the owner's level

 ;D

Try this.
Code: [Select]
Index: java/org/l2jmobius/gameserver/model/actor/instance/PetInstance.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/instance/PetInstance.java (revision 8545)
+++ java/org/l2jmobius/gameserver/model/actor/instance/PetInstance.java (working copy)
@@ -27,6 +27,7 @@
 import org.l2jmobius.commons.database.DatabaseFactory;
 import org.l2jmobius.gameserver.ai.CtrlIntention;
 import org.l2jmobius.gameserver.data.sql.PetDataTable;
+import org.l2jmobius.gameserver.data.xml.ExperienceData;
 import org.l2jmobius.gameserver.instancemanager.IdManager;
 import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
 import org.l2jmobius.gameserver.model.PetData;
@@ -219,7 +220,8 @@
  // Sin-eaters are defaulted at the owner's level
  if (template.getNpcId() == 12564)
  {
- getStat().setLevel((byte) getOwner().getLevel());
+ final byte ownerLevel = (byte) getOwner().getLevel();
+ getStat().setLevel(ownerLevel == ExperienceData.getInstance().getMaxLevel() ? ownerLevel - 1 : ownerLevel);
  }
  else
  {


Offline speedwel

  • Vassal
  • *
    • Posts: 3

Thanks for listening..
I made the modifications but still have the same problem, pet is born at level 78 ...

https://ibb.co/fSP8QLh


Offline emilianoify

  • Heir
  • **
    • Posts: 35
  • Try first after ask for help
For me work fine. I think you dont make the quest again for a new Manacles.
//Create test char dont use GM for testing.