Skill mastery related changes.
Contributed by NviX.
This commit is contained in:
@ -1143,6 +1143,7 @@ public class Config
|
||||
public static Map<ClassId, Float> PVE_BLOW_SKILL_DEFENCE_MULTIPLIERS = new ConcurrentHashMap<>();
|
||||
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 boolean MULTILANG_ENABLE;
|
||||
public static List<String> MULTILANG_ALLOWED = new ArrayList<>();
|
||||
public static String MULTILANG_DEFAULT;
|
||||
@ -2956,6 +2957,20 @@ public class Config
|
||||
}
|
||||
}
|
||||
}
|
||||
final String[] skillMasteryChanceMultipliers = ClassBalance.getString("SkillMasteryChanceMultipliers", "").trim().split(";");
|
||||
SKILL_MASTERY_CHANCE_MULTIPLIERS.clear();
|
||||
if (skillMasteryChanceMultipliers.length > 0)
|
||||
{
|
||||
for (String info : skillMasteryChanceMultipliers)
|
||||
{
|
||||
final String[] classInfo = info.trim().split("[*]");
|
||||
if (classInfo.length == 2)
|
||||
{
|
||||
final String id = classInfo[0].trim();
|
||||
SKILL_MASTERY_CHANCE_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);
|
||||
|
@ -960,7 +960,7 @@ public class Formulas
|
||||
|
||||
final double chance = BaseStats.values()[val].calcBonus(actor) * actor.getStat().getValue(Stats.SKILL_CRITICAL_PROBABILITY, 1);
|
||||
|
||||
return ((Rnd.nextDouble() * 100.) < chance);
|
||||
return ((Rnd.nextDouble() * 100.) < (chance * Config.SKILL_MASTERY_CHANCE_MULTIPLIERS.getOrDefault(actor.getActingPlayer().getClassId(), 1f)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user