Browse Source

Logic cleanup when dealing with contracts.

feature-workorder
MagicBot 1 year ago
parent
commit
65c2d2ea0b
  1. 18
      src/engine/mobileAI/MobAI.java

18
src/engine/mobileAI/MobAI.java

@ -309,16 +309,18 @@ public class MobAI { @@ -309,16 +309,18 @@ public class MobAI {
if (mob == null)
return false;
if (mob.isPlayerGuard() == true) {
int contractID;
int contractID = 0;
if (mob.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN))
if (mob.isPlayerGuard() == true) {
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
contractID = mob.guardCaptain.contract.getContractID();
else
contractID = mob.contract.getContractID();
//exception for werewolf and werebear guard captains
if (Enum.MinionType.ContractToMinionMap.get(contractID).isMage() == false && contractID != 980111 && contractID != 980110)
return false;
}
@ -331,7 +333,7 @@ public class MobAI { @@ -331,7 +333,7 @@ public class MobAI {
// Mobile has no powers defined in mobbase or contract..
if (PowersManager.getPowersForRune(mob.getMobBaseID()).isEmpty() &&
mob.getContract() != null && PowersManager.getPowersForRune(mob.getContract().getObjectUUID()).isEmpty())
PowersManager.getPowersForRune(contractID).isEmpty())
return false;
if (mob.nextCastTime == 0)
@ -372,10 +374,10 @@ public class MobAI { @@ -372,10 +374,10 @@ public class MobAI {
ArrayList<RunePowerEntry> contractEntries = new ArrayList<>();
if (mob.contract != null)
contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID));
contractEntries = PowersManager.getPowersForRune(mob.contractUUID);
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID));
contractEntries = PowersManager.getPowersForRune(mob.guardCaptain.contractUUID);
powerEntries.addAll(contractEntries);
@ -473,10 +475,10 @@ public class MobAI { @@ -473,10 +475,10 @@ public class MobAI {
ArrayList<RunePowerEntry> contractEntries = new ArrayList<>();
if (mob.contract != null)
contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID));
contractEntries = PowersManager.getPowersForRune(mob.contractUUID);
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID));
contractEntries = PowersManager.getPowersForRune(mob.guardCaptain.contractUUID);
powerEntries.addAll(contractEntries);

Loading…
Cancel
Save