mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-09-29 14:13:03 -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:
@@ -43,8 +43,8 @@ expertise_sm_general_narrow_escape_1 sm_narrow_escape_2;sm_narrow_escape_3;sm_na
|
||||
expertise_sm_general_spot_a_sucker_1 sm_spot_a_sucker_2;sm_spot_a_sucker_3;sm_spot_a_sucker_4
|
||||
expertise_sm_path_pistol_whip_1 sm_pistol_whip_2;sm_pistol_whip_3;sm_pistol_whip_4
|
||||
expertise_sm_path_shoot_first_1 sm_shoot_first_2;sm_shoot_first_3;sm_shoot_first_4;sm_shoot_first_5
|
||||
expertise_sp_cloaked_attacks_1 sp_stealth_melee_1;sp_stealth_melee_2;sp_stealth_melee_3;sp_stealth_melee_4;sp_stealth_melee_5;sp_stealth_melee_6|sp_stealth_melee_1;sp_stealth_ranged_2;sp_stealth_ranged_3;sp_stealth_ranged_4;sp_stealth_ranged_5;sp_stealth_ranged_6
|
||||
expertise_sp_cloaked_attacks_1 sp_stealth_melee_0;sp_stealth_melee_1;sp_stealth_melee_2;sp_stealth_melee_3;sp_stealth_melee_4;sp_stealth_melee_5;sp_stealth_melee_6|sp_stealth_ranged_0;sp_stealth_ranged_1;sp_stealth_ranged_2;sp_stealth_ranged_3;sp_stealth_ranged_4;sp_stealth_ranged_5;sp_stealth_ranged_6
|
||||
expertise_sp_cloaked_recovery_1 sp_cloaked_recovery_1;sp_cloaked_recovery_2;sp_cloaked_recovery_3;sp_cloaked_recovery_4
|
||||
expertise_sp_hidden_daggers_1 sp_hd_melee_1;sp_hd_melee_2;sp_hd_melee_3;sp_hd_melee_4;sp_hd_melee_5;sp_hd_melee_6|sp_hd_ranged_1;sp_hd_ranged_2;sp_hd_ranged_3;sp_hd_ranged_4;sp_hd_ranged_5;sp_hd_ranged_6
|
||||
expertise_sp_hidden_daggers_1 sp_hd_melee_0;sp_hd_melee_1;sp_hd_melee_2;sp_hd_melee_3;sp_hd_melee_4;sp_hd_melee_5;sp_hd_melee_6|sp_hd_range_0;sp_hd_range_1;sp_hd_range_2;sp_hd_range_3;sp_hd_range_4;sp_hd_range_5;sp_hd_range_6
|
||||
expertise_sp_improved_arachnids_web_1 sp_improved_cc_dot_2;sp_improved_cc_dot_3;sp_improved_cc_dot_4
|
||||
expertise_sp_improved_spys_fang_1 sp_dot_1;sp_dot_2;sp_dot_3;sp_dot_4;sp_dot_5
|
||||
expertise_sp_improved_spys_fang_1 sp_dot_2;sp_dot_1;sp_dot_3;sp_dot_4;sp_dot_5
|
||||
|
||||
@@ -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