mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-18 08:02:56 -04:00
Resolved an issue where abilities for the spy were not given properly, and level 10 abilities were counted as level 30.
This commit is contained in:
@@ -255,6 +255,14 @@ public final class ExpertiseService extends Service {
|
||||
int baseRequirement = 18;
|
||||
int levelDifference = 12; // Amount of levels between each ability
|
||||
int level = creatureObject.getLevel();
|
||||
|
||||
// All first rank abilities have a required level of 10
|
||||
// The required level logic is required for ranks 2+
|
||||
if (abilityIndex == 0) {
|
||||
return level >= 10;
|
||||
}
|
||||
|
||||
// Otherwise, perform the check as usual
|
||||
int requiredLevel = baseRequirement + abilityIndex * levelDifference;
|
||||
|
||||
// TODO what if requiredLevel goes above the maximum level possible for a player?
|
||||
@@ -263,8 +271,8 @@ public final class ExpertiseService extends Service {
|
||||
|
||||
private void grantExtraAbilities(CreatureObject creatureObject, String expertise) {
|
||||
expertiseAbilities.get(expertise).forEach(chain -> {
|
||||
for (int abilityIndex = 1; abilityIndex <= chain.length; abilityIndex++) {
|
||||
String ability = chain[abilityIndex - 1];
|
||||
for (int abilityIndex = 0; abilityIndex < chain.length; abilityIndex++) {
|
||||
String ability = chain[abilityIndex];
|
||||
|
||||
if (isQualified(creatureObject, abilityIndex) && !creatureObject.hasAbility(ability)) {
|
||||
creatureObject.addAbility(ability);
|
||||
|
||||
Reference in New Issue
Block a user