|
|
|
@ -25,7 +25,6 @@ import engine.net.Dispatch;
@@ -25,7 +25,6 @@ import engine.net.Dispatch;
|
|
|
|
|
import engine.net.DispatchMessage; |
|
|
|
|
import engine.net.client.msg.PetMsg; |
|
|
|
|
import engine.net.client.msg.PlaceAssetMsg; |
|
|
|
|
import engine.powers.EffectsBase; |
|
|
|
|
import engine.server.MBServerStatics; |
|
|
|
|
import org.joda.time.DateTime; |
|
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
@ -70,7 +69,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -70,7 +69,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
private int currentID; |
|
|
|
|
private long lastAttackTime = 0; |
|
|
|
|
private int lastMobPowerToken = 0; |
|
|
|
|
private HashMap<Integer, MobEquipment> equip = null; |
|
|
|
|
public HashMap<Integer, MobEquipment> equip = null; |
|
|
|
|
private DeferredPowerJob weaponPower; |
|
|
|
|
private DateTime upgradeDateTime = null; |
|
|
|
|
private boolean lootSync = false; |
|
|
|
@ -974,7 +973,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -974,7 +973,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
this.setLoc(this.lastBindLoc); |
|
|
|
|
this.stopMovement(this.lastBindLoc); |
|
|
|
|
|
|
|
|
|
this.applyMobbaseEffects(); |
|
|
|
|
NPCManager.applyMobbaseEffects(this); |
|
|
|
|
|
|
|
|
|
this.recalculateStats(); |
|
|
|
|
this.setHealth(this.healthMax); |
|
|
|
@ -1663,8 +1662,8 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -1663,8 +1662,8 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
if (this.getMobBase().enemy.size() > 0) |
|
|
|
|
this.enemy.addAll(this.getMobBase().enemy); |
|
|
|
|
} |
|
|
|
|
this.applyMobbaseEffects(); |
|
|
|
|
this.applyEquipmentResists(); |
|
|
|
|
NPCManager.applyMobbaseEffects(this); |
|
|
|
|
NPCManager.applyEquipmentResists(this); |
|
|
|
|
this.recalculateStats(); |
|
|
|
|
this.setHealth(this.healthMax); |
|
|
|
|
|
|
|
|
@ -1683,18 +1682,6 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -1683,18 +1682,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void applyEquipmentResists(){ |
|
|
|
|
if(this.equip != null){ |
|
|
|
|
for(MobEquipment equipped : this.equip.values()){ |
|
|
|
|
ItemBase itemBase = equipped.getItemBase(); |
|
|
|
|
if(itemBase.isHeavyArmor() || itemBase.isLightArmor() || itemBase.isMediumArmor()){ |
|
|
|
|
this.resists.setResist(DamageType.Crush, this.resists.getResist(DamageType.Crush,0) + itemBase.getCrushResist()); |
|
|
|
|
this.resists.setResist(DamageType.Slash, this.resists.getResist(DamageType.Slash,0) + itemBase.getCrushResist()); |
|
|
|
|
this.resists.setResist(DamageType.Pierce, this.resists.getResist(DamageType.Pierce,0) + itemBase.getCrushResist()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@Override |
|
|
|
|
protected ConcurrentHashMap<Integer, CharacterPower> initializePowers() { |
|
|
|
|
return new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); |
|
|
|
@ -1875,43 +1862,4 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -1875,43 +1862,4 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
lock.writeLock().unlock(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
public void applyMobbaseEffects(){ |
|
|
|
|
EffectsBase effectsBase; |
|
|
|
|
for (MobBaseEffects mbe : this.mobBase.effectsList) { |
|
|
|
|
|
|
|
|
|
effectsBase = PowersManager.getEffectByToken(mbe.getToken()); |
|
|
|
|
|
|
|
|
|
if (effectsBase == null) { |
|
|
|
|
Logger.info("Mob: " + this.getObjectUUID() + " EffectsBase Null for Token " + mbe.getToken()); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//check to upgrade effects if needed.
|
|
|
|
|
if (this.effects.containsKey(Integer.toString(effectsBase.getUUID()))) { |
|
|
|
|
|
|
|
|
|
if (mbe.getReqLvl() > (int) this.level) |
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
Effect eff = this.effects.get(Integer.toString(effectsBase.getUUID())); |
|
|
|
|
|
|
|
|
|
if (eff == null) |
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
//Current effect is a higher rank, dont apply.
|
|
|
|
|
if (eff.getTrains() > mbe.getRank()) |
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
//new effect is of a higher rank. remove old effect and apply new one.
|
|
|
|
|
eff.cancelJob(); |
|
|
|
|
this.addEffectNoTimer(Integer.toString(effectsBase.getUUID()), effectsBase, mbe.getRank(), true); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
if (mbe.getReqLvl() > (int) this.level) |
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
this.addEffectNoTimer(Integer.toString(effectsBase.getUUID()), effectsBase, mbe.getRank(), true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|