forked from MagicBane/Server
Equipment slot refactor started.
This commit is contained in:
+15
-15
@@ -1141,17 +1141,17 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
this.rangeHandTwo = 6.5f;
|
||||
this.speedHandTwo = 20;
|
||||
|
||||
if(this.equip.get(MBServerStatics.SLOT_MAINHAND) != null){
|
||||
if (this.equip.get(EquipSlotType.RHELD) != null) {
|
||||
//has mainhand weapon to calculate
|
||||
calculateAtrDamageForWeapon(this.equip.get(MBServerStatics.SLOT_MAINHAND), true);
|
||||
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.LHELD), true);
|
||||
}
|
||||
if(this.equip.get(MBServerStatics.SLOT_OFFHAND) != null && !this.equip.get(MBServerStatics.SLOT_OFFHAND).getItemBase().isShield()){
|
||||
if (this.equip.get(EquipSlotType.LHELD) != null && !this.equip.get(EquipSlotType.LHELD).getItemBase().isShield()) {
|
||||
//has offhand weapon to calculate
|
||||
calculateAtrDamageForWeapon(this.equip.get(MBServerStatics.SLOT_OFFHAND), false);
|
||||
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.LHELD), false);
|
||||
}
|
||||
|
||||
try {
|
||||
calculateAtrDamageForWeapon(this.equip.get(MBServerStatics.SLOT_MAINHAND), true);
|
||||
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.RHELD), true);
|
||||
} catch (Exception e) {
|
||||
|
||||
this.atrHandOne = (short) this.mobBase.getAttackRating();
|
||||
@@ -1163,7 +1163,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
}
|
||||
|
||||
try {
|
||||
calculateAtrDamageForWeapon(this.equip.get(MBServerStatics.SLOT_OFFHAND), false);
|
||||
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.LHELD), false);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -1177,13 +1177,13 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
|
||||
try {
|
||||
float defense = this.mobBase.getDefenseRating();
|
||||
defense += getShieldDefense(equip.get(MBServerStatics.SLOT_OFFHAND));
|
||||
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_HELMET));
|
||||
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_CHEST));
|
||||
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_ARMS));
|
||||
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_GLOVES));
|
||||
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_LEGGINGS));
|
||||
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_FEET));
|
||||
defense += getShieldDefense(equip.get(EquipSlotType.LHELD));
|
||||
defense += getArmorDefense(equip.get(EquipSlotType.HELM));
|
||||
defense += getArmorDefense(equip.get(EquipSlotType.CHEST));
|
||||
defense += getArmorDefense(equip.get(EquipSlotType.UPARM));
|
||||
defense += getArmorDefense(equip.get(EquipSlotType.HANDS));
|
||||
defense += getArmorDefense(equip.get(EquipSlotType.LEGS));
|
||||
defense += getArmorDefense(equip.get(EquipSlotType.FEET));
|
||||
defense += getWeaponDefense(equip);
|
||||
|
||||
// TODO add error log here
|
||||
@@ -1220,14 +1220,14 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
|
||||
private float getWeaponDefense(HashMap<Integer, MobEquipment> equipped) {
|
||||
|
||||
MobEquipment weapon = equipped.get(MBServerStatics.SLOT_MAINHAND);
|
||||
MobEquipment weapon = equipped.get(EquipSlotType.RHELD);
|
||||
ItemBase wb = null;
|
||||
CharacterSkill skill, mastery;
|
||||
float val = 0;
|
||||
boolean unarmed = false;
|
||||
|
||||
if (weapon == null) {
|
||||
weapon = equipped.get(MBServerStatics.SLOT_OFFHAND);
|
||||
weapon = equipped.get(EquipSlotType.LHELD);
|
||||
|
||||
if (weapon == null)
|
||||
unarmed = true;
|
||||
|
||||
Reference in New Issue
Block a user