Addition of EXP and SP multipliers by class.

This commit is contained in:
MobiusDevelopment
2020-01-06 22:57:59 +00:00
parent b9882ce3eb
commit 42d215998c
60 changed files with 570 additions and 30 deletions

View File

@ -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);

View 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"))

View File

@ -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)