Merge remote-tracking branch 'origin/mobile-effects' into magicbox-1.5.2

This commit is contained in:
2023-09-03 07:33:50 -04:00
5 changed files with 83 additions and 23 deletions
+33
View File
@@ -20,6 +20,7 @@ import engine.jobs.DeferredPowerJob;
import engine.jobs.UpgradeNPCJob;
import engine.math.Bounds;
import engine.math.Vector3fImmutable;
import engine.mobileAI.utilities.MovementUtilities;
import engine.net.ByteBufferWriter;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
@@ -427,6 +428,7 @@ public class Mob extends AbstractIntelligenceAgent {
else
mobile.contractUUID = contract.getContractID();
return mobile;
}
@@ -1117,6 +1119,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);
@@ -1656,6 +1678,7 @@ public class Mob extends AbstractIntelligenceAgent {
}
NPCManager.applyMobbaseEffects(this);
NPCManager.applyEquipmentResists(this);
NPCManager.applyMobbaseSkill(this);
this.recalculateStats();
this.setHealth(this.healthMax);
@@ -1670,6 +1693,16 @@ public class Mob extends AbstractIntelligenceAgent {
if (this.agentType.equals(AIAgentType.MOBILE))
NPCManager.AssignPatrolPoints(this);
if (this.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN)) {
Building barracks = this.building;
if (barracks != null && barracks.patrolPoints != null && !barracks.getPatrolPoints().isEmpty()) {
this.patrolPoints = barracks.patrolPoints;
MovementUtilities.aiMove(this, this.patrolPoints.get(0), true);
}
}
this.deathTime = 0;
}