From fe39454113fc407919963f0c0463b6324d7562d5 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 27 Mar 2024 20:12:51 -0500 Subject: [PATCH] saetor skills --- .../db/handlers/dbCharacterSkillHandler.java | 22 ++++++++++++++++++ src/engine/objects/PlayerCharacter.java | 23 +------------------ 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/engine/db/handlers/dbCharacterSkillHandler.java b/src/engine/db/handlers/dbCharacterSkillHandler.java index 49e88952..99fada7d 100644 --- a/src/engine/db/handlers/dbCharacterSkillHandler.java +++ b/src/engine/db/handlers/dbCharacterSkillHandler.java @@ -14,6 +14,7 @@ import engine.gameManager.DbManager; import engine.objects.AbstractCharacter; import engine.objects.CharacterSkill; import engine.objects.PlayerCharacter; +import engine.objects.SkillsBase; import engine.server.MBServerStatics; import org.pmw.tinylog.Logger; @@ -114,6 +115,27 @@ public class dbCharacterSkillHandler extends dbHandlerBase { characterSkills.put(cs.getSkillsBase().getName(), cs); } + if (playerCharacter.getRace().getName().equals("Saetor")) { + SkillsBase staff = SkillsBase.getFromCache(71438003); + if(staff != null && playerCharacter.getSkills().containsKey(staff.getName()) == false){ + CharacterSkill newSkill = new CharacterSkill(staff,playerCharacter); //staff + playerCharacter.getSkills().put("Staff",newSkill); + newSkill.updateDatabase(); + } + SkillsBase staffMastery = SkillsBase.getFromCache(-61022283); + if(staffMastery != null && playerCharacter.getSkills().containsKey(staffMastery.getName()) == false){ + CharacterSkill newSkill = new CharacterSkill(staffMastery,playerCharacter); //staff mastery + playerCharacter.getSkills().put(newSkill.getName(),newSkill); + newSkill.updateDatabase(); + } + SkillsBase parry = SkillsBase.getFromCache(95961104); + if(parry != null && playerCharacter.getSkills().containsKey(parry.getName()) == false){ + CharacterSkill newSkill = new CharacterSkill(parry,playerCharacter); //parry + playerCharacter.getSkills().put("Parry",newSkill); + newSkill.updateDatabase(); + } + } + } catch (SQLException e) { Logger.error(e); } diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 44973b53..17df3fdc 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -40,7 +40,6 @@ import engine.server.MBServerStatics; import engine.server.login.LoginServer; import engine.server.login.LoginServerMsgHandler; import engine.server.world.WorldServer; -import engine.util.MiscUtils; import org.joda.time.DateTime; import org.pmw.tinylog.Logger; @@ -4206,26 +4205,7 @@ public class PlayerCharacter extends AbstractCharacter { //Call this function to recalculate granted skills and powers for player public synchronized void calculateSkills() { - if (this.race.getName().equals("Saetor")) { - 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(); - } - 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(); - } - 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(); - } - } + //tell the player to applyBonuses because something has changed runSkillCalc(); @@ -4237,7 +4217,6 @@ public class PlayerCharacter extends AbstractCharacter { //through SkillCalcJob. Designed to only run from one worker thread public void runSkillCalc() { try { - //see if any new skills or powers granted CharacterSkill.calculateSkills(this); // calculate granted Trains in powers.