Browse Source

mob resists

lakebane-master
FatBoy-DOTC 7 months ago
parent
commit
6ee1c02e08
  1. 57
      src/engine/objects/Mob.java

57
src/engine/objects/Mob.java

@ -12,6 +12,7 @@ package engine.objects;
import ch.claude_martin.enumbitset.EnumBitSet; import ch.claude_martin.enumbitset.EnumBitSet;
import engine.Enum; import engine.Enum;
import engine.Enum.*; import engine.Enum.*;
import engine.InterestManagement.RealmMap;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.exception.SerializationException; import engine.exception.SerializationException;
import engine.gameManager.*; import engine.gameManager.*;
@ -175,54 +176,54 @@ public class Mob extends AbstractIntelligenceAgent {
public static void setResistsForMob(Mob mob){ public static void setResistsForMob(Mob mob){
Resists resists = new Resists("Generic"); Resists resists = new Resists("Generic");
Zone parentMacro = null; int realmID = RealmMap.getRealmIDAtLocation(mob.loc);
for(Zone zone : ZoneManager.getAllZonesIn(mob.loc)){ Realm realm = Realm.getRealm(realmID);
if(zone.isMacroZone() == false) //Zone parentMacro = null;
continue; //for(Zone zone : ZoneManager.getAllZonesIn(mob.loc)){
parentMacro = zone; // if(zone.isMacroZone() == false)
} // continue;
if(parentMacro != null) { // parentMacro = zone;
switch (parentMacro.getName()) { //}
if(realm != null) {
switch (realm.getRealmName()) {
//ice generics //ice generics
case "Ymur's Crown": case "Hethlund":
case "Kralgaar Holm": case "Hregenlund":
case "Ecklund Wilds": case "Ecklund":
case "Aurrochs Skrae": case "Kralgaard":
resists.addResists(Resists.getResists(28)); resists.addResists(Resists.getResists(28));
break; break;
//Desert Generics //Desert Generics
case "Leth'khalivar Desert": case "Letharuun":
case "Kharsoom": case "Adduram":
case "Vale of Nar Addad": case "Neshraa":
case "The Blood Sands":
resists.addResists(Resists.getResists(2)); resists.addResists(Resists.getResists(2));
break; break;
//Swamp Generics //Swamp Generics
case "Thollok Marsh": case "Aeglund":
case "The Black Bog": case "Thollmar":
case "Sevaath Mere":
resists.addResists(Resists.getResists(8)); resists.addResists(Resists.getResists(8));
break; break;
//Oblivion Generics //Oblivion Generics
case "Plain of Ashes": case "Oblivion":
case "Bone Marches": case "Vandernoch":
case "The Doomplain":
case "Greensward Pyre":
resists.addResists(Resists.getResists(4)); resists.addResists(Resists.getResists(4));
break; break;
//Maelstrom Generics //Maelstrom Generics
case "Pandemonium": case "Maelstrom":
case "Western Battleground":
resists.addResists(Resists.getResists(32)); resists.addResists(Resists.getResists(32));
break; break;
case "Valkos":
case "Ulward":
resists.addResists(Resists.getResists(5));
} }
} }
if(MobBase.mobbase_race_types.size() == 0){ if(MobBase.mobbase_race_types.size() == 0){
DbManager.MobBaseQueries.LOAD_ALL_MOBBASE_RACES(); DbManager.MobBaseQueries.LOAD_ALL_MOBBASE_RACES();
} }
int mobbaseID = mob.getMobBaseID(); String raceType = MobBase.mobbase_race_types.get(mob.getMobBaseID());
if(mobbaseID != 0) { if(raceType != null) {
switch (MobBase.mobbase_race_types.get(mobbaseID)) { switch (raceType) {
case "Aelfborn": case "Aelfborn":
case "NPC": case "NPC":
case "Rat": case "Rat":

Loading…
Cancel
Save