From e39c7bebb508f7c1e18e914bcfbb7ba5914336d7 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 11 May 2024 19:13:51 -0500 Subject: [PATCH] mob resist issue --- src/engine/objects/AbstractCharacter.java | 7 +------ src/engine/objects/Mob.java | 5 ++--- src/engine/objects/Resists.java | 8 -------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index 94ca987e..8c2dc2c4 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -678,13 +678,8 @@ public abstract class AbstractCharacter extends AbstractWorldObject { } public final Resists getResists() { - if (this.resists == null) + if (this.resists == null && !this.getObjectType().equals(GameObjectType.Mob)) return Resists.getResists(0); - if(Mob.disciplineDroppers.contains(this)){ - return new Resists("Dropper"); - } - if(this.getObjectType().equals(GameObjectType.Mob) && ((Mob)this).behaviourType.equals(MobBehaviourType.HamletGuard)) - return new Resists("HamletGuard"); return this.resists; } diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 4cc2e5a1..a5b28aaf 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -161,6 +161,8 @@ public class Mob extends AbstractIntelligenceAgent { this.agentType = AIAgentType.MOBILE; + this.setResists(Resists.getResists(rs.getInt("mob_spawnType"))); + } catch (Exception e) { Logger.error(e + " " + this.dbID); } @@ -1083,8 +1085,6 @@ public class Mob extends AbstractIntelligenceAgent { } catch (Exception e) { Logger.error(e.getMessage()); } - if(this.dropper == false) - Resists.calculateResists(this); } public void calculateMaxHealthManaStamina() { @@ -1753,7 +1753,6 @@ public class Mob extends AbstractIntelligenceAgent { if(this.dropper){ this.level = 65; - this.resists = new Resists("Dropper"); this.atrHandOne *= 2; this.atrHandTwo *= 2; this.defenseRating *= 2; diff --git a/src/engine/objects/Resists.java b/src/engine/objects/Resists.java index 02e4c77f..fa0188ea 100644 --- a/src/engine/objects/Resists.java +++ b/src/engine/objects/Resists.java @@ -46,10 +46,6 @@ public class Resists { case "Mine": setMineResists(); break; - case "Dropper": - setDropperResists(); - case "HamletGuard": - setDropperResists(); default: setGenericResists(); break; @@ -476,10 +472,6 @@ public class Resists { public void calculateResists(AbstractCharacter ac, boolean val) { - if(ac.getObjectType().equals(Enum.GameObjectType.Mob) && ((Mob)ac).dropper){ - this.setDropperResists(); - return; - } this.immuneTo.clear(); // get resists for runes