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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...