From 95c203b0ed9adc8d737b8e22405448c7ee8d0cba Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 2 Sep 2023 20:39:36 -0500 Subject: [PATCH] load and apply mobbaseSkill --- src/engine/gameManager/NPCManager.java | 7 ++++--- src/engine/objects/Mob.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/engine/gameManager/NPCManager.java b/src/engine/gameManager/NPCManager.java index bc94d359..4ece92d9 100644 --- a/src/engine/gameManager/NPCManager.java +++ b/src/engine/gameManager/NPCManager.java @@ -14,7 +14,6 @@ import org.pmw.tinylog.Logger; import java.util.ArrayList; import java.util.HashMap; -import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ThreadLocalRandom; import static engine.math.FastMath.acos; @@ -401,7 +400,9 @@ public enum NPCManager { } } - public static void applyMobbaseSkills(Mob mob) { - + public static void applyMobbaseSkill(Mob mob) { + SkillsBase baseSkill = DbManager.SkillsBaseQueries.GET_BASE_BY_TOKEN(mob.mobBase.getMobBaseStats().getBaseSkill()); + if(baseSkill != null) + mob.getSkills().put(baseSkill.getName(),new CharacterSkill(baseSkill,mob,mob.mobBase.getMobBaseStats().getBaseSkillAmount())); } } diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 96d88b57..04059f1b 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1686,7 +1686,7 @@ public class Mob extends AbstractIntelligenceAgent { } NPCManager.applyMobbaseEffects(this); NPCManager.applyEquipmentResists(this); - NPCManager.applyMobbaseSkills(this); + NPCManager.applyMobbaseSkill(this); this.recalculateStats(); this.setHealth(this.healthMax);