Jump to content

Recommended Posts

  • 1 month later...
Posted
Quote

  public boolean addExpAndSp(long addToExp, int addToSp)

  {

                        ........

      if (activeChar.getPet() instanceof L2PetInstance)

      {

        L2PetInstance pet = (L2PetInstance) activeChar.getPet();

        ratioTakenByPet = pet.getPetData().getOwnerExpTaken();

 

        // only give exp/sp to the pet by taking from the owner if the pet has a non-zero, positive ratio

        // allow possible customizations that would have the pet earning more than 100% of the owner's exp/sp

        if (ratioTakenByPet > 0 && !pet.isDead())

            pet.addExpAndSp((long) (addToExp * ratioTakenByPet), (int) (addToSp * ratioTakenByPet));

        // now adjust the max ratio to avoid the owner earning negative exp/sp

        if (ratioTakenByPet > 1)

            ratioTakenByPet = 1;

        addToExp = (long) (addToExp * (1 - ratioTakenByPet));

        addToSp = (int) (addToSp * (1 - ratioTakenByPet));

      }

        // From 20lv+ exp decrease x2.

      if (activeChar.getStat().getLevel() > 19)

      {

        addToExp = (long) (addToExp / 2);

        addToSp = (int) (addToSp / 2);

      }

 

        // From 76lv+ exp increase 50%.

      if (activeChar.getStat().getLevel() > 75)

      {

        addToExp = (long) (addToExp * 1.5);

        addToSp = (int) (addToSp * 1.5);

      }

By this you can edit code as you want...

 

rlly nice and helpfull thx bro

  • 4 months later...

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


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..