From e777434d5735d66d5a38b1b815e0432603621df4 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 3 Sep 2023 20:10:57 -0500 Subject: [PATCH] Mob specific rune skill loading --- src/engine/gameManager/NPCManager.java | 10 +++++----- src/engine/objects/CharacterSkill.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/gameManager/NPCManager.java b/src/engine/gameManager/NPCManager.java index a6d473b8..249befe8 100644 --- a/src/engine/gameManager/NPCManager.java +++ b/src/engine/gameManager/NPCManager.java @@ -407,7 +407,7 @@ public enum NPCManager { mob.getSkills().put(baseSkill.getName(),new CharacterSkill(baseSkill,mob,mob.mobBase.getMobBaseStats().getBaseSkillAmount())); } - public static void applyRuneSkills(AbstractCharacter character,int runeID){ + public static void applyRuneSkills(Mob mob, int runeID){ //load mob skill adjustments from mobbase rune if(PowersManager._allRuneSkillAdjusts.containsKey(runeID)) for(RuneSkillAdjustEntry entry : PowersManager._allRuneSkillAdjusts.get(runeID)) { @@ -416,11 +416,11 @@ public enum NPCManager { SkillsBase skillBase = SkillsBase.getFromCache(entry.skill_type); if(skillBase == null) continue; - if (entry.level <= character.level) - if (character.skills.containsKey(entry.name) == false) - character.skills.put(entry.skill_type, new CharacterSkill(skillBase, character, entry.rank)); + if (entry.level <= mob.level) + if (mob.skills.containsKey(entry.name) == false) + mob.skills.put(entry.skill_type, new CharacterSkill(skillBase, mob, entry.rank)); else - character.skills.put(entry.skill_type, new CharacterSkill(skillBase, character, entry.rank + character.skills.get(entry.skill_type).getNumTrains())); + mob.skills.put(entry.skill_type, new CharacterSkill(skillBase, mob, entry.rank + mob.skills.get(entry.skill_type).getNumTrains())); } } } diff --git a/src/engine/objects/CharacterSkill.java b/src/engine/objects/CharacterSkill.java index aacebba7..a4cb9588 100644 --- a/src/engine/objects/CharacterSkill.java +++ b/src/engine/objects/CharacterSkill.java @@ -258,7 +258,7 @@ public class CharacterSkill extends AbstractGameObject { this.skillType = CharacterSkills.GetCharacterSkillByToken(this.skillsBase.getToken()); } - public CharacterSkill(SkillsBase sb, AbstractCharacter mob, int trains) { + public CharacterSkill(SkillsBase sb, Mob mob, int trains) { super(); this.skillsBase = sb; this.numTrains.set(trains);