|
|
@ -25,6 +25,7 @@ import engine.net.Dispatch; |
|
|
|
import engine.net.DispatchMessage; |
|
|
|
import engine.net.DispatchMessage; |
|
|
|
import engine.net.client.msg.PetMsg; |
|
|
|
import engine.net.client.msg.PetMsg; |
|
|
|
import engine.net.client.msg.PlaceAssetMsg; |
|
|
|
import engine.net.client.msg.PlaceAssetMsg; |
|
|
|
|
|
|
|
import engine.powers.EffectsBase; |
|
|
|
import engine.server.MBServerStatics; |
|
|
|
import engine.server.MBServerStatics; |
|
|
|
import org.joda.time.DateTime; |
|
|
|
import org.joda.time.DateTime; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
@ -974,7 +975,7 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
this.setLoc(this.lastBindLoc); |
|
|
|
this.setLoc(this.lastBindLoc); |
|
|
|
this.stopMovement(this.lastBindLoc); |
|
|
|
this.stopMovement(this.lastBindLoc); |
|
|
|
|
|
|
|
|
|
|
|
NPCManager.applyRuneSetEffects(this); |
|
|
|
this.applyMobbaseEffects(); |
|
|
|
|
|
|
|
|
|
|
|
this.recalculateStats(); |
|
|
|
this.recalculateStats(); |
|
|
|
this.setHealth(this.healthMax); |
|
|
|
this.setHealth(this.healthMax); |
|
|
@ -1663,8 +1664,7 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
if (this.getMobBase().enemy.size() > 0) |
|
|
|
if (this.getMobBase().enemy.size() > 0) |
|
|
|
this.enemy.addAll(this.getMobBase().enemy); |
|
|
|
this.enemy.addAll(this.getMobBase().enemy); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.applyMobbaseEffects(); |
|
|
|
NPCManager.applyRuneSetEffects(this); |
|
|
|
|
|
|
|
recalculateStats(); |
|
|
|
recalculateStats(); |
|
|
|
this.setHealth(this.healthMax); |
|
|
|
this.setHealth(this.healthMax); |
|
|
|
|
|
|
|
|
|
|
@ -1870,5 +1870,43 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
lock.writeLock().unlock(); |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|