Browse Source

saetor skills

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
fe39454113
  1. 22
      src/engine/db/handlers/dbCharacterSkillHandler.java
  2. 23
      src/engine/objects/PlayerCharacter.java

22
src/engine/db/handlers/dbCharacterSkillHandler.java

@ -14,6 +14,7 @@ import engine.gameManager.DbManager; @@ -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 { @@ -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);
}

23
src/engine/objects/PlayerCharacter.java

@ -40,7 +40,6 @@ import engine.server.MBServerStatics; @@ -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 { @@ -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 { @@ -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.

Loading…
Cancel
Save