Browse Source

hotfixes

lakebane-strongholds
FatBoy-DOTC 4 months ago
parent
commit
d511641410
  1. 4
      src/engine/gameManager/StrongholdManager.java
  2. 4
      src/engine/loot/ItemTableEntry.java
  3. 4
      src/engine/loot/ModTableEntry.java
  4. 10
      src/engine/mobileAI/MobAI.java
  5. 5
      src/engine/objects/Mob.java

4
src/engine/gameManager/StrongholdManager.java

@ -119,7 +119,7 @@ public class StrongholdManager {
commander.stronghold = mine; commander.stronghold = mine;
} }
mine.setActive(true); mine.isActive = true;
tower.setProtectionState(Enum.ProtectionState.PROTECTED); tower.setProtectionState(Enum.ProtectionState.PROTECTED);
tower.getBounds().setRegions(tower); tower.getBounds().setRegions(tower);
InterestManager.setObjectDirty(tower); InterestManager.setObjectDirty(tower);
@ -158,7 +158,7 @@ public class StrongholdManager {
//update tower to become Mine Tower again //update tower to become Mine Tower again
tower.setMeshUUID(1500100); tower.setMeshUUID(1500100);
mine.setActive(false); mine.isActive = false;
tower.setProtectionState(Enum.ProtectionState.NPC); tower.setProtectionState(Enum.ProtectionState.NPC);
tower.getBounds().setRegions(tower); tower.getBounds().setRegions(tower);
InterestManager.setObjectDirty(tower); InterestManager.setObjectDirty(tower);

4
src/engine/loot/ItemTableEntry.java

@ -37,11 +37,11 @@ public class ItemTableEntry {
List<ItemTableEntry> itemTableEntryList; List<ItemTableEntry> itemTableEntryList;
itemTableEntryList = LootManager._itemTables.get(itemTable); itemTableEntryList = LootManager._itemTables.get(itemTable);
if(itemTableEntryList != null) {
for (ItemTableEntry iteration : itemTableEntryList) for (ItemTableEntry iteration : itemTableEntryList)
if (roll >= iteration.minRoll && roll <= iteration.maxRoll) if (roll >= iteration.minRoll && roll <= iteration.maxRoll)
itemTableEntry = iteration; itemTableEntry = iteration;
}
return itemTableEntry; return itemTableEntry;
} }

4
src/engine/loot/ModTableEntry.java

@ -33,11 +33,11 @@ public class ModTableEntry {
List<ModTableEntry> itemTableEntryList; List<ModTableEntry> itemTableEntryList;
itemTableEntryList = LootManager._modTables.get(modTablwe); itemTableEntryList = LootManager._modTables.get(modTablwe);
if(itemTableEntryList != null) {
for (ModTableEntry iteration : itemTableEntryList) for (ModTableEntry iteration : itemTableEntryList)
if (roll >= iteration.minRoll && roll <= iteration.maxRoll) if (roll >= iteration.minRoll && roll <= iteration.maxRoll)
modTableEntry = iteration; modTableEntry = iteration;
}
return modTableEntry; return modTableEntry;
} }
} }

10
src/engine/mobileAI/MobAI.java

@ -911,12 +911,13 @@ public class MobAI {
private static void CheckToSendMobHome(Mob mob) { private static void CheckToSendMobHome(Mob mob) {
try {
if(mob.BehaviourType.equals(Enum.MobBehaviourType.Pet1)){ if(mob.BehaviourType.equals(Enum.MobBehaviourType.Pet1)){
if(mob.loc.distanceSquared(mob.getOwner().loc) > 60 * 60) if(mob.loc.distanceSquared(mob.getOwner().loc) > 60 * 60)
mob.teleport(mob.getOwner().loc); mob.teleport(mob.getOwner().loc);
return; return;
} }
try {
if (mob.BehaviourType.isAgressive) { if (mob.BehaviourType.isAgressive) {
if (mob.isPlayerGuard()) { if (mob.isPlayerGuard()) {
@ -1353,9 +1354,9 @@ public class MobAI {
return null; return null;
} }
public static void RecoverHealth(Mob mob){ public static void RecoverHealth(Mob mob) {
//recover health //recover health
try {
if (mob.getTimestamps().containsKey("HEALTHRECOVERED") == false) if (mob.getTimestamps().containsKey("HEALTHRECOVERED") == false)
mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis()); mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis());
@ -1369,5 +1370,8 @@ public class MobAI {
if (mob.getHealth() > mob.getHealthMax()) if (mob.getHealth() > mob.getHealthMax())
mob.setHealth(mob.getHealthMax()); mob.setHealth(mob.getHealthMax());
} }
} catch (Exception e) {
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: RecoverHealth" + " " + e.getMessage());
}
} }
} }

5
src/engine/objects/Mob.java

@ -1423,8 +1423,9 @@ public class Mob extends AbstractIntelligenceAgent {
WorldGrid.RemoveWorldObject(this); WorldGrid.RemoveWorldObject(this);
this.charItemManager.clearInventory(); this.charItemManager.clearInventory();
if(this.StrongholdEpic) if(this.StrongholdEpic && this.stronghold != null && this.stronghold.isActive)
StrongholdManager.EndStronghold(this.stronghold); this.stronghold.isActive = false;
//StrongholdManager.EndStronghold(this.stronghold);
} }
@Override @Override

Loading…
Cancel
Save