Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Rates.ini b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Rates.ini
- index efd2c30451..ba68eb87c0 100644
- --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Rates.ini
- +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Rates.ini
- @@ -30,6 +30,11 @@ RateInstancePartyXp = -1
- # Instance Skill points multiplier (Party)
- RateInstancePartySp = -1
- +# XP/SP Rates based on player level
- +LvlRatesEnabled = false
- +# lv 0-61:3x ~ lv 62-76:2.5x ~ lv 77-83:2x
- +LvlRates = 61,3;76,2.5;83,2
- +
- RateDropManor = 1
- # Karma decreasing rate
- # Note: -1 means RateXp so it means it will use retail rate for decreasing karma upon death or receiving exp by farming mobs.
- diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java
- index 803238e615..cef40ff4ab 100644
- --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java
- +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java
- @@ -42,6 +42,7 @@ import java.util.HashMap;
- import java.util.HashSet;
- import java.util.List;
- import java.util.Map;
- +import java.util.TreeMap;
- import java.util.Properties;
- import java.util.Set;
- import java.util.logging.Level;
- @@ -718,6 +719,8 @@ public class Config
- public static float RATE_INSTANCE_SP;
- public static float RATE_INSTANCE_PARTY_XP;
- public static float RATE_INSTANCE_PARTY_SP;
- + public static boolean ENABLE_LVL_RATES;
- + public static Map<Integer, Float> LVL_RATES;
- public static float RATE_RAIDBOSS_POINTS;
- public static float RATE_EXTRACTABLE;
- public static int RATE_DROP_MANOR;
- @@ -2260,6 +2263,32 @@ public class Config
- RATE_PARTY_XP = ratesConfig.getFloat("RatePartyXp", 1);
- RATE_PARTY_SP = ratesConfig.getFloat("RatePartySp", 1);
- RATE_INSTANCE_XP = ratesConfig.getFloat("RateInstanceXp", -1);
- + ENABLE_LVL_RATES = ratesConfig.getBoolean("LvlRatesEnabled", false);
- +
- + final String[] ratesLvlSplit = ratesConfig.getString("LvlRates", "").split(";");
- + LVL_RATES = new HashMap<>(ratesLvlSplit.length);
- + for (String rlvl : ratesLvlSplit)
- + {
- + final String[] raLvlSplit = rlvl.split(",");
- + if (raLvlSplit.length != 2)
- + {
- + LOGGER.warning(StringUtil.concat("[LvlRates]: invalid config property -> LvlRates \"", rlvl, "\""));
- + }
- + try
- + {
- + LVL_RATES.put(Integer.parseInt(raLvlSplit[0]), Float.parseFloat(raLvlSplit[1]));
- + }
- + catch (NumberFormatException nfe)
- + {
- + if (!rlvl.isEmpty())
- + {
- + LOGGER.warning(StringUtil.concat("[LvlRates]: invalid config property -> LvlRates \"", raLvlSplit[0], "\"", raLvlSplit[1]));
- + }
- + }
- + }
- +
- + LVL_RATES = new TreeMap<>(LVL_RATES);
- +
- if (RATE_INSTANCE_XP < 0)
- {
- RATE_INSTANCE_XP = RATE_XP;
- diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java
- index 537ce5c5f5..910f2f2742 100644
- --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java
- +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java
- @@ -112,6 +112,21 @@ public class PlayerStat extends PlayableStat
- double addToExp = addToExpValue;
- double addToSp = addToSpValue;
- + if(Config.ENABLE_LVL_RATES)
- + {
- + Integer previous_lvl = 0;
- + for (var entry : Config.LVL_RATES.entrySet())
- + {
- + if(player.getLevel() > previous_lvl && player.getLevel() <= entry.getKey())
- + {
- + addToExp *= entry.getValue();
- + addToSp *= entry.getValue();
- + break;
- + }
- + previous_lvl = entry.getKey();
- + }
- + }
- +
- // Premium rates
- if (player.hasPremiumStatus())
- {
Add Comment
Please, Sign In to add comment