forked from MagicBane/Server
infrastructure for mob skills loading
This commit is contained in:
@@ -14,6 +14,7 @@ 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;
|
||||
@@ -399,4 +400,8 @@ public enum NPCManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void applyMobbaseSkills(Mob mob) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1127,6 +1127,26 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
this.defenseRating = 0;
|
||||
return;
|
||||
}
|
||||
this.atrHandOne = (short) this.mobBase.getAttackRating();
|
||||
this.minDamageHandOne = (short) this.mobBase.getMinDmg();
|
||||
this.maxDamageHandOne = (short) this.mobBase.getMaxDmg();
|
||||
this.rangeHandOne = 6.5f;
|
||||
this.speedHandOne = 20;
|
||||
|
||||
this.atrHandTwo = (short) this.mobBase.getAttackRating();
|
||||
this.minDamageHandTwo = (short) this.mobBase.getMinDmg();
|
||||
this.maxDamageHandTwo = (short) this.mobBase.getMaxDmg();
|
||||
this.rangeHandTwo = 6.5f;
|
||||
this.speedHandTwo = 20;
|
||||
|
||||
if(this.equip.get(MBServerStatics.SLOT_MAINHAND) != null){
|
||||
//has mainhand weapon to calculate
|
||||
calculateAtrDamageForWeapon(this.equip.get(MBServerStatics.SLOT_MAINHAND), true);
|
||||
}
|
||||
if(this.equip.get(MBServerStatics.SLOT_OFFHAND) != null && !this.equip.get(MBServerStatics.SLOT_OFFHAND).getItemBase().isShield()){
|
||||
//has offhand weapon to calculate
|
||||
calculateAtrDamageForWeapon(this.equip.get(MBServerStatics.SLOT_OFFHAND), false);
|
||||
}
|
||||
|
||||
try {
|
||||
calculateAtrDamageForWeapon(this.equip.get(MBServerStatics.SLOT_MAINHAND), true);
|
||||
@@ -1666,6 +1686,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
}
|
||||
NPCManager.applyMobbaseEffects(this);
|
||||
NPCManager.applyEquipmentResists(this);
|
||||
NPCManager.applyMobbaseSkills(this);
|
||||
this.recalculateStats();
|
||||
this.setHealth(this.healthMax);
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@ public class MobBaseStats {
|
||||
private final int baseSpi;
|
||||
private final int baseDex;
|
||||
|
||||
private final int mobbaseSkill;
|
||||
private final int mobbaseSkillAmount;
|
||||
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
@@ -31,6 +34,8 @@ public class MobBaseStats {
|
||||
this.baseCon = rs.getInt("Constitution");
|
||||
this.baseSpi = rs.getInt("Spirit");
|
||||
this.baseDex = rs.getInt("Dexterity");
|
||||
this.mobbaseSkill = rs.getInt("baseSkills");
|
||||
this.mobbaseSkillAmount = rs.getInt("skillAmount");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,6 +48,8 @@ public class MobBaseStats {
|
||||
this.baseCon = 0;
|
||||
this.baseSpi = 0;
|
||||
this.baseDex = 0;
|
||||
this.mobbaseSkill = 0;
|
||||
this.mobbaseSkillAmount = 0;
|
||||
}
|
||||
|
||||
public static MobBaseStats GetGenericStats() {
|
||||
@@ -72,5 +79,8 @@ public class MobBaseStats {
|
||||
return baseDex;
|
||||
}
|
||||
|
||||
public int getBaseSkill(){return mobbaseSkill;}
|
||||
|
||||
public int getBaseSkillAmount(){return mobbaseSkillAmount;}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user