Addition of EXP and SP multipliers by class.
This commit is contained in:
		@@ -49,3 +49,6 @@ PvpBlowSkillDefenceMultipliers =
 | 
			
		||||
PlayerHealingSkillMultipliers = 
 | 
			
		||||
 | 
			
		||||
SkillMasteryChanceMultipliers = 
 | 
			
		||||
 | 
			
		||||
ExpAmountMultipliers = 
 | 
			
		||||
SpAmountMultipliers = 
 | 
			
		||||
 
 | 
			
		||||
@@ -1094,6 +1094,8 @@ public class Config
 | 
			
		||||
	public static Map<ClassId, Float> PVP_BLOW_SKILL_DEFENCE_MULTIPLIERS = new ConcurrentHashMap<>();
 | 
			
		||||
	public static Map<ClassId, Float> PLAYER_HEALING_SKILL_MULTIPLIERS = new ConcurrentHashMap<>();
 | 
			
		||||
	public static Map<ClassId, Float> SKILL_MASTERY_CHANCE_MULTIPLIERS = new ConcurrentHashMap<>();
 | 
			
		||||
	public static Map<ClassId, Float> EXP_AMOUNT_MULTIPLIERS = new ConcurrentHashMap<>();
 | 
			
		||||
	public static Map<ClassId, Float> SP_AMOUNT_MULTIPLIERS = new ConcurrentHashMap<>();
 | 
			
		||||
	public static boolean MULTILANG_ENABLE;
 | 
			
		||||
	public static List<String> MULTILANG_ALLOWED = new ArrayList<>();
 | 
			
		||||
	public static String MULTILANG_DEFAULT;
 | 
			
		||||
@@ -2936,6 +2938,34 @@ public class Config
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			final String[] expAmountMultipliers = ClassBalance.getString("ExpAmountMultipliers", "").trim().split(";");
 | 
			
		||||
			EXP_AMOUNT_MULTIPLIERS.clear();
 | 
			
		||||
			if (expAmountMultipliers.length > 0)
 | 
			
		||||
			{
 | 
			
		||||
				for (String info : expAmountMultipliers)
 | 
			
		||||
				{
 | 
			
		||||
					final String[] classInfo = info.trim().split("[*]");
 | 
			
		||||
					if (classInfo.length == 2)
 | 
			
		||||
					{
 | 
			
		||||
						final String id = classInfo[0].trim();
 | 
			
		||||
						EXP_AMOUNT_MULTIPLIERS.put(Util.isDigit(id) ? ClassId.getClassId(Integer.parseInt(id)) : Enum.valueOf(ClassId.class, id), Float.parseFloat(classInfo[1].trim()));
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			final String[] spAmountMultipliers = ClassBalance.getString("SpAmountMultipliers", "").trim().split(";");
 | 
			
		||||
			SP_AMOUNT_MULTIPLIERS.clear();
 | 
			
		||||
			if (spAmountMultipliers.length > 0)
 | 
			
		||||
			{
 | 
			
		||||
				for (String info : spAmountMultipliers)
 | 
			
		||||
				{
 | 
			
		||||
					final String[] classInfo = info.trim().split("[*]");
 | 
			
		||||
					if (classInfo.length == 2)
 | 
			
		||||
					{
 | 
			
		||||
						final String id = classInfo[0].trim();
 | 
			
		||||
						SP_AMOUNT_MULTIPLIERS.put(Util.isDigit(id) ? ClassId.getClassId(Integer.parseInt(id)) : Enum.valueOf(ClassId.class, id), Float.parseFloat(classInfo[1].trim()));
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			
 | 
			
		||||
			// Load CommunityBoard config file (if exists)
 | 
			
		||||
			final PropertiesParser CommunityBoard = new PropertiesParser(CUSTOM_COMMUNITY_BOARD_CONFIG_FILE);
 | 
			
		||||
 
 | 
			
		||||
@@ -903,6 +903,9 @@ public class Party extends AbstractPlayerGroup
 | 
			
		||||
	
 | 
			
		||||
	private double calculateExpSpPartyCutoff(PlayerInstance player, int topLvl, double addExp, double addSp, boolean vit)
 | 
			
		||||
	{
 | 
			
		||||
		addExp *= Config.EXP_AMOUNT_MULTIPLIERS.getOrDefault(player.getClassId(), 1f);
 | 
			
		||||
		addSp *= Config.SP_AMOUNT_MULTIPLIERS.getOrDefault(player.getClassId(), 1f);
 | 
			
		||||
		
 | 
			
		||||
		double xp = addExp;
 | 
			
		||||
		double sp = addSp;
 | 
			
		||||
		if (Config.PARTY_XP_CUTOFF_METHOD.equalsIgnoreCase("highfive"))
 | 
			
		||||
 
 | 
			
		||||
@@ -497,8 +497,8 @@ public class Attackable extends Npc
 | 
			
		||||
							// Distribute the Exp and SP between the PlayerInstance and its Summon
 | 
			
		||||
							if (!attacker.isDead())
 | 
			
		||||
							{
 | 
			
		||||
								exp = attacker.getStat().getValue(Stats.EXPSP_RATE, exp);
 | 
			
		||||
								sp = attacker.getStat().getValue(Stats.EXPSP_RATE, sp);
 | 
			
		||||
								exp = attacker.getStat().getValue(Stats.EXPSP_RATE, exp) * Config.EXP_AMOUNT_MULTIPLIERS.getOrDefault(attacker.getClassId(), 1f);
 | 
			
		||||
								sp = attacker.getStat().getValue(Stats.EXPSP_RATE, sp) * Config.SP_AMOUNT_MULTIPLIERS.getOrDefault(attacker.getClassId(), 1f);
 | 
			
		||||
								
 | 
			
		||||
								attacker.addExpAndSp(exp, sp, useVitalityRate());
 | 
			
		||||
								if (exp > 0)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user