Browse Source

mob resist issue

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
8cc92e9792
  1. 4
      src/engine/objects/AbstractCharacter.java
  2. 110
      src/engine/objects/Mob.java
  3. 2
      src/engine/objects/Resists.java

4
src/engine/objects/AbstractCharacter.java

@ -681,6 +681,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
if (this.resists == null && !this.getObjectType().equals(GameObjectType.Mob)) if (this.resists == null && !this.getObjectType().equals(GameObjectType.Mob))
return Resists.getResists(0); return Resists.getResists(0);
if(this.getObjectType().equals(GameObjectType.Mob)){
return ((Mob)this).mobResists;
}
return this.resists; return this.resists;
} }

110
src/engine/objects/Mob.java

@ -43,6 +43,7 @@ import static engine.net.client.msg.ErrorPopupMsg.sendErrorPopup;
public class Mob extends AbstractIntelligenceAgent { public class Mob extends AbstractIntelligenceAgent {
public Resists mobResists = null;
private static int staticID = 0; private static int staticID = 0;
public static ArrayList<Mob> disciplineDroppers = new ArrayList<>(); public static ArrayList<Mob> disciplineDroppers = new ArrayList<>();
public static HashMap<Integer,Mob> dynamic_pets = new HashMap<>(); public static HashMap<Integer,Mob> dynamic_pets = new HashMap<>();
@ -172,7 +173,7 @@ public class Mob extends AbstractIntelligenceAgent {
} }
public static void setResistsForMob(Mob mob){ public static void setResistsForMob(Mob mob){
mob.resists = new Resists("Generic"); Resists resists = new Resists("Generic");
Zone parentMacro = null; Zone parentMacro = null;
for(Zone zone : ZoneManager.getAllZonesIn(mob.loc)){ for(Zone zone : ZoneManager.getAllZonesIn(mob.loc)){
if(zone.isMacroZone() == false) if(zone.isMacroZone() == false)
@ -186,142 +187,115 @@ public class Mob extends AbstractIntelligenceAgent {
case "Kralgaar Holm": case "Kralgaar Holm":
case "Ecklund Wilds": case "Ecklund Wilds":
case "Aurrochs Skrae": case "Aurrochs Skrae":
mob.getResists().addResists(Resists.getResists(28)); resists.addResists(Resists.getResists(28));
break; break;
//Desert Generics //Desert Generics
case "Leth'khalivar Desert": case "Leth'khalivar Desert":
case "Kharsoom": case "Kharsoom":
case "Vale of Nar Addad": case "Vale of Nar Addad":
case "The Blood Sands": case "The Blood Sands":
mob.getResists().addResists(Resists.getResists(2)); resists.addResists(Resists.getResists(2));
break; break;
//Swamp Generics //Swamp Generics
case "Thollok Marsh": case "Thollok Marsh":
case "The Black Bog": case "The Black Bog":
case "Sevaath Mere": case "Sevaath Mere":
mob.getResists().addResists(Resists.getResists(8)); resists.addResists(Resists.getResists(8));
break; break;
//Oblivion Generics //Oblivion Generics
case "Plain of Ashes": case "Plain of Ashes":
case "Bone Marches": case "Bone Marches":
case "The Doomplain": case "The Doomplain":
case "Greensward Pyre": case "Greensward Pyre":
mob.getResists().addResists(Resists.getResists(4)); resists.addResists(Resists.getResists(4));
break; break;
//Maelstrom Generics //Maelstrom Generics
case "Pandemonium": case "Pandemonium":
case "Western Battleground": case "Western Battleground":
mob.getResists().addResists(Resists.getResists(32)); resists.addResists(Resists.getResists(32));
break; break;
} }
} }
switch(mob.mobBase.raceType){ switch(mob.mobBase.raceType){
case "Aelfborn": case "Aelfborn":
mob.getResists().addResists(Resists.getResists(0)); case "NPC":
break; case "Rat":
case "All": case "Reptile":
mob.getResists().addResists(Resists.getResists(0)); case "Grave":
break; case "Human":
case "Goblin":
case "CSR":
case "Construct":
case "Celestial":
case "Animal": case "Animal":
mob.getResists().addResists(Resists.getResists(0)); case "All":
case "SiegeEngineer":
resists.addResists(new Resists("Generic"));
break; break;
case "Aracoix": case "Aracoix":
mob.getResists().addResists(Resists.getResists(22)); resists.addResists(Resists.getResists(22));
break;
case "Celestial":
mob.getResists().addResists(Resists.getResists(0));
break; break;
case "Centaur": case "Centaur":
mob.getResists().addResists(Resists.getResists(24)); resists.addResists(Resists.getResists(24));
break;
case "Construct":
mob.getResists().addResists(Resists.getResists(0));
break;
case "CSR":
mob.getResists().addResists(Resists.getResists(0));
break; break;
case "Dragon": case "Dragon":
mob.getResists().addResists(Resists.getResists(10)); resists.addResists(Resists.getResists(10));
break; break;
case "Dwarf": case "Dwarf":
mob.getResists().addResists(Resists.getResists(25)); resists.addResists(Resists.getResists(25));
break; break;
case "Elf": case "Elf":
mob.getResists().addResists(Resists.getResists(5)); resists.addResists(Resists.getResists(5));
break; break;
case "Giant": case "Giant":
mob.getResists().addResists(Resists.getResists(34)); resists.addResists(Resists.getResists(34));
break;
case "Goblin":
mob.getResists().addResists(Resists.getResists(0));
break;
case "Grave":
mob.getResists().addResists(Resists.getResists(0));
break; break;
case "HalfGiant": case "HalfGiant":
mob.getResists().addResists(Resists.getResists(6)); resists.addResists(Resists.getResists(6));
break;
case "Human":
mob.getResists().addResists(Resists.getResists(0));
break; break;
case "Infernal": case "Infernal":
mob.getResists().addResists(Resists.getResists(18)); resists.addResists(Resists.getResists(18));
break; break;
case "Insect": case "Insect":
mob.getResists().addResists(Resists.getResists(19)); case "Pet":
case "Summoned":
resists.addResists(Resists.getResists(19));
break; break;
case "Irekei": case "Irekei":
mob.getResists().addResists(Resists.getResists(12)); resists.addResists(Resists.getResists(12));
break; break;
case "Minotaur": case "Minotaur":
mob.getResists().addResists(Resists.getResists(13)); resists.addResists(Resists.getResists(13));
break; break;
case "Monster": case "Monster":
mob.getResists().addResists(Resists.getResists(35)); resists.addResists(Resists.getResists(35));
break; break;
case "NecroPet": case "NecroPet":
mob.getResists().addResists(Resists.getResists(23)); resists.addResists(Resists.getResists(23));
break;
case "NPC":
mob.getResists().addResists(Resists.getResists(0));
break;
case "Pet":
mob.getResists().addResists(Resists.getResists(19));
break; break;
case "Plant": case "Plant":
mob.getResists().addResists(Resists.getResists(36)); resists.addResists(Resists.getResists(36));
break;
case "Rat":
mob.getResists().addResists(Resists.getResists(0));
break;
case "Reptile":
mob.getResists().addResists(Resists.getResists(0));
break; break;
case "Shade": case "Shade":
mob.getResists().addResists(Resists.getResists(26)); resists.addResists(Resists.getResists(26));
break; break;
case "Siege": case "Siege":
mob.getResists().addResists(Resists.getResists(38)); resists.addResists(Resists.getResists(38));
break;
case "Summoned":
mob.getResists().addResists(Resists.getResists(19));
break; break;
case "Troll": case "Troll":
mob.getResists().addResists(Resists.getResists(33)); resists.addResists(Resists.getResists(33));
break; break;
case "Undead": case "Undead":
mob.getResists().addResists(Resists.getResists(27)); resists.addResists(Resists.getResists(27));
break; break;
case "Nephilim": case "Nephilim":
mob.getResists().addResists(Resists.getResists(7)); resists.addResists(Resists.getResists(7));
break; break;
case "Vampire": case "Vampire":
mob.getResists().addResists(Resists.getResists(11)); resists.addResists(Resists.getResists(11));
break;
case "SiegeEngineer":
mob.getResists().addResists(Resists.getResists(0));
break; break;
} }
mob.mobResists = resists;
} }
public static void serializeMobForClientMsgOtherPlayer(Mob mob, ByteBufferWriter writer) throws SerializationException { public static void serializeMobForClientMsgOtherPlayer(Mob mob, ByteBufferWriter writer) throws SerializationException {

2
src/engine/objects/Resists.java

@ -217,7 +217,7 @@ public class Resists {
} }
//failed, may want to debug this //failed, may want to debug this
return null; return new Resists("Generic");
} }
/** /**

Loading…
Cancel
Save