From 74cf9d16c56f376ef6bc3820a94809ea92aab87a Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 27 Mar 2024 16:44:53 -0500 Subject: [PATCH] saetor skills --- src/engine/objects/PlayerCharacter.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index ac2a0f47..44973b53 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -4207,18 +4207,21 @@ public class PlayerCharacter extends AbstractCharacter { public synchronized void calculateSkills() { if (this.race.getName().equals("Saetor")) { - if(this.skills.containsKey("Staff") == false){ - CharacterSkill newSkill = new CharacterSkill(SkillsBase.getFromCache("Staff"),this); + SkillsBase staff = SkillsBase.getFromCache("Staff"); + if(staff != null && this.skills.containsKey(staff.getName()) == false){ + CharacterSkill newSkill = new CharacterSkill(staff,this); //staff this.skills.put("Staff",newSkill); newSkill.updateDatabase(); } - if(this.skills.containsKey("Staff Mastery") == false){ - CharacterSkill newSkill = new CharacterSkill(SkillsBase.getFromCache("Staff Mastery"),this); - this.skills.put("Staff Mastery",newSkill); + SkillsBase staffMastery = SkillsBase.getFromCache("Staff Mastery"); + if(staffMastery != null && this.skills.containsKey(staffMastery.getName()) == false){ + CharacterSkill newSkill = new CharacterSkill(staffMastery,this); //staff mastery + this.skills.put(newSkill.getName(),newSkill); newSkill.updateDatabase(); } - if(this.skills.containsKey("Parry") == false){ - CharacterSkill newSkill = new CharacterSkill(SkillsBase.getFromCache("Parry"),this); + SkillsBase parry = SkillsBase.getFromCache("Parry"); + if(parry != null && this.skills.containsKey(parry.getName()) == false){ + CharacterSkill newSkill = new CharacterSkill(parry,this); //parry this.skills.put("Parry",newSkill); newSkill.updateDatabase(); }