Jump to content

Recommended Posts

Posted

Hello, here is my first share. This code is good when you want to do something like when mob lvl is 76 or bigger, exp rate can be smaller.

Iam using L2jarchid.

open com.l2jarchid.gamesserver.model.actor.L2npc.java

Find:

	 public int getExpReward()
  {
  double rateXp = getStat().calcStat(Stats.MAX_HP, 1, this, null);
  return (int) (getTemplate().rewardExp * rateXp * Config.RATE_XP);
  }

REPLACE IT TO:

public int getExpReward()
 {
  if (getLevel() > 75)
  
  {
  double rateXp = getStat().calcStat(Stats.MAX_HP, 1, this, null);
  return (int) (getTemplate().rewardExp * rateXp * 1);
  }
  
  else
  {
  double rateXp = getStat().calcStat(Stats.MAX_HP, 1, this, null);
  return (int) (getTemplate().rewardExp * rateXp * Config.RATE_XP);
  }
  }

rateXp * 1 is exp rate you can change it to 20 or etc (number only change)... This code is when mob lvl is 76 or bigger exp rate will be 1... if you want to do intervals like from 52 to 65 - 20 exp , 65-76 - 10 exp 76 or bigger - 5 exp rate ... write this code

	 public int getExpReward()
 {
  if (getLevel() > 52 && getLevel() < 66)
  
  {
  double rateXp = getStat().calcStat(Stats.MAX_HP, 1, this, null);
  return (int) (getTemplate().rewardExp * rateXp * 20);
  }
  
  if (getLevel() > 66 && getLevel() < 75)
	  
  {
  double rateXp = getStat().calcStat(Stats.MAX_HP, 1, this, null);
  return (int) (getTemplate().rewardExp * rateXp * 10);
  }
  
  if (getLevel() > 75)
	  
  {
  double rateXp = getStat().calcStat(Stats.MAX_HP, 1, this, null);
  return (int) (getTemplate().rewardExp * rateXp * 5);
  }
  
  else
  {
  double rateXp = getStat().calcStat(Stats.MAX_HP, 1, this, null);
  return (int) (getTemplate().rewardExp * rateXp * Config.RATE_XP);
  }
  }

I think this code will be usefull

Credits to Intrepid,Horus and me ...

P.S. if someone will share code for character exp(when character reach 76lvl then exp for him will count as 1) will be great :)

public int getExpReward()
{
L2Attackable attacker;
  if (getLevel() > 75)
	  
  {
  double rateXp = getStat().calcStat(Stats.MAX_HP, 1, this, null);
  return (int) (getTemplate().rewardExp * rateXp * 5);
  }
  
  else
  {
  double rateXp = getStat().calcStat(Stats.MAX_HP, 1, this, null);
  return (int) (getTemplate().rewardExp * rateXp * Config.RATE_XP);
  }
  }

if some1 can test write feedback (i dont test it, maybe it work, for characters lvl)

Posted

I will explain more. You have server which is with 1000x exp rates.. Till 40 lvl exp rates will be 1000x, after 40lvl till 50lvl etc. rates will be reduced for character to 100x, 50lvl-60lvl reduced to 50x and so on.. It's good if you have a server with custom starting lvl and if you want to have pvp server, where you need to farm exp a bit.. It won't be only pvp server with this custom..

Posted

lool just make something like:

 if (attacker.getLevel() >= 40 && attacker.getLevel() <= 76)
	  
  {
  double rateXp = getStat().calcStat(Stats.MAX_HP, 1, this, null);
  return (int) ((getTemplate().rewardExp * rateXp) / 50);
  }

Posted

werlex I didn't say anything the first time, but since you did it twice:

Add the proper credits (since about 50% of that was done by me lool) or just don't at all. ^^

Posted

Horus, Firstly i said that iam just starting work with java, Secondly your code with attacker is wrong because i get error for attacker (with intrepid we was talking about this), Third what you help for me with this code? Intrepid said that need to put else, i put it and everything okay then ... what you said more than "1 is neutral, we can dont write it".

If you need that credits ill write ... its not very hard for me ...

Posted

I do like this:  ;)

 

FirstI open PcStat.java and I find this part:

 

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

Posted

this is not for pet? when activechar get lvl 20 with pet exp will decrease by 2 for activechar?

Offcourse not.. activeChar = player, NOT pet...  :D Works 100% tested a lot of times.. ;)

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.



  • Posts

    • My official facebook profile!: https://www.facebook.com/spectrumL2 Specifications: Revamped L2JACIS revision FROM the core Private project!!! Revision that has been receiving corrections for over 3 years!!! Events already installed in the revision: TVT CTF KTB PARTY FARM SPOIL EVENT CRAZY RATES TOURNAMENT TIME ZONE (INSTANCE) All working correctly!!! SIEGE ESSENTIAL FEATURES: Walls fix Gates fix Flags fix 100% functional: OLYMPIADS: Implemented settings Hero receives enchanted Weapons with equal status PvP Weapons Optional /true/false Hero can acquire all Hero Weapons Optional true/false OTHER IMPLEMENTATIONS: Teleport fixed (directly to Giran) Teleport effect classic Vip skins vip collor name Pack NPCs with effect already configured BOSES already configured Mobs already configured CLASS BALANCE SPECIAL SYSTEM We have a SPECIAL system developed for Class Balance with only 1 digit in XML %tage of configurable debuffs Player limitation system in BOSES or PvP zones BS blocking system in FLEG zones or events Among others dozens of improvements made in the review... price: 390 USD !  OBS: WE CAN CHANGE THE BANNER AND NAME OF THE SERVICE TO THE ONE OF YOUR PREFERENCE BUT THE SETTINGS MUST BE KEPT ANY CHANGES REQUIRE ADDITION        
    • Server is Online – 1,000+ Active Players! We’re excited to announce the addition of a Europe Proxy to improve connectivity for our EU players! Clans can now benefit from VIP Access to help you catch up faster. 🎯 If you're a clan leader with at least 9 active members, join our Discord and open a ticket to claim your VIP rewards!  
    • The Telegram team is rolling out a new batch of Stars-only gifts you’ll be able to mint as NFTs. Don’t miss your chance to join the next Telegram trend and earn from it! Buy Telegram Stars cheap and KYC-free 1 Star from $0.0149 (min. 50 Stars, bulk discounts available) Promo code STARS5 — 5 % off Pay any way you like: bank cards · crypto · other popular methods How to purchase: ➡Online Store — Click ➡ Telegram bot — Click Other services: ➡ SMM panel — Click Regular buyers get extra discounts and promo codes. Support: ➡ Telegram: https://t.me/solomon_bog ➡ Telegram channel: https://t.me/accsforyou_shop ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store Use these contacts to discuss wholesale orders, partnerships (current list: https://socnet.bgng.io/partners) or to become a supplier. SocNet — your shop for digital goods and premium subscriptions
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock