From 5822cb1ab485a16a19462aeafd0dc5123ae3da33 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 12 May 2024 16:40:00 -0500 Subject: [PATCH] mob resist issue --- src/engine/objects/Mob.java | 159 ++++++++++++++++++------------------ 1 file changed, 81 insertions(+), 78 deletions(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index a3656bb9..cabee966 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -216,84 +216,87 @@ public class Mob extends AbstractIntelligenceAgent { break; } } - switch(mob.mobBase.raceType){ - case "Aelfborn": - case "NPC": - case "Rat": - case "Reptile": - case "Grave": - case "Human": - case "Goblin": - case "CSR": - case "Construct": - case "Celestial": - case "Animal": - case "All": - case "SiegeEngineer": - resists.addResists(new Resists("Generic")); - break; - case "Aracoix": - resists.addResists(Resists.getResists(22)); - break; - case "Centaur": - resists.addResists(Resists.getResists(24)); - break; - case "Dragon": - resists.addResists(Resists.getResists(10)); - break; - case "Dwarf": - resists.addResists(Resists.getResists(25)); - break; - case "Elf": - resists.addResists(Resists.getResists(5)); - break; - case "Giant": - resists.addResists(Resists.getResists(34)); - break; - case "HalfGiant": - resists.addResists(Resists.getResists(6)); - break; - case "Infernal": - resists.addResists(Resists.getResists(18)); - break; - case "Insect": - case "Pet": - case "Summoned": - resists.addResists(Resists.getResists(19)); - break; - case "Irekei": - resists.addResists(Resists.getResists(12)); - break; - case "Minotaur": - resists.addResists(Resists.getResists(13)); - break; - case "Monster": - resists.addResists(Resists.getResists(35)); - break; - case "NecroPet": - resists.addResists(Resists.getResists(23)); - break; - case "Plant": - resists.addResists(Resists.getResists(36)); - break; - case "Shade": - resists.addResists(Resists.getResists(26)); - break; - case "Siege": - resists.addResists(Resists.getResists(38)); - break; - case "Troll": - resists.addResists(Resists.getResists(33)); - break; - case "Undead": - resists.addResists(Resists.getResists(27)); - break; - case "Nephilim": - resists.addResists(Resists.getResists(7)); - break; - case "Vampire": - resists.addResists(Resists.getResists(11)); - break; + int mobbaseID = mob.getMobBaseID(); + if(mobbaseID != 0) { + switch (MobBase.mobbase_race_types.get(mobbaseID)) { + case "Aelfborn": + case "NPC": + case "Rat": + case "Reptile": + case "Grave": + case "Human": + case "Goblin": + case "CSR": + case "Construct": + case "Celestial": + case "Animal": + case "All": + case "SiegeEngineer": + resists.addResists(new Resists("Generic")); + break; + case "Aracoix": + resists.addResists(Resists.getResists(22)); + break; + case "Centaur": + resists.addResists(Resists.getResists(24)); + break; + case "Dragon": + resists.addResists(Resists.getResists(10)); + break; + case "Dwarf": + resists.addResists(Resists.getResists(25)); + break; + case "Elf": + resists.addResists(Resists.getResists(5)); + break; + case "Giant": + resists.addResists(Resists.getResists(34)); + break; + case "HalfGiant": + resists.addResists(Resists.getResists(6)); + break; + case "Infernal": + resists.addResists(Resists.getResists(18)); + break; + case "Insect": + case "Pet": + case "Summoned": + resists.addResists(Resists.getResists(19)); + break; + case "Irekei": + resists.addResists(Resists.getResists(12)); + break; + case "Minotaur": + resists.addResists(Resists.getResists(13)); + break; + case "Monster": + resists.addResists(Resists.getResists(35)); + break; + case "NecroPet": + resists.addResists(Resists.getResists(23)); + break; + case "Plant": + resists.addResists(Resists.getResists(36)); + break; + case "Shade": + resists.addResists(Resists.getResists(26)); + break; + case "Siege": + resists.addResists(Resists.getResists(38)); + break; + case "Troll": + resists.addResists(Resists.getResists(33)); + break; + case "Undead": + resists.addResists(Resists.getResists(27)); + break; + case "Nephilim": + resists.addResists(Resists.getResists(7)); + break; + case "Vampire": + resists.addResists(Resists.getResists(11)); + break; + } } mob.mobResists = resists; }