Browse Source

Bonus code removed.

mobile-class-refactor
MagicBot 1 year ago
parent
commit
445d40dc5f
  1. 4
      src/engine/objects/Mob.java
  2. 24
      src/engine/powers/poweractions/CreateMobPowerAction.java

4
src/engine/objects/Mob.java

@ -552,6 +552,7 @@ public class Mob extends AbstractIntelligenceAgent {
petMinion.level = level; petMinion.level = level;
petMinion.loadID = loadID; petMinion.loadID = loadID;
petMinion.bindLoc = petOwner.getLoc();
petMinion.loc = petOwner.getLoc(); petMinion.loc = petOwner.getLoc();
petMinion.guardCaptain = petOwner; petMinion.guardCaptain = petOwner;
petMinion.parentZoneUUID = parent.getObjectUUID(); petMinion.parentZoneUUID = parent.getObjectUUID();
@ -562,7 +563,7 @@ public class Mob extends AbstractIntelligenceAgent {
petMinion.runAfterLoad(); petMinion.runAfterLoad();
DbManager.addToCache(petMinion); DbManager.addToCache(petMinion);
createLock.writeLock().unlock(); createLock.writeLock().unlock();
petMinion.setLoc(petMinion.bindLoc);
return petMinion; return petMinion;
} }
public static Mob getMob(int id) { public static Mob getMob(int id) {
@ -741,7 +742,6 @@ public class Mob extends AbstractIntelligenceAgent {
public void setOwner(PlayerCharacter value) { public void setOwner(PlayerCharacter value) {
this.guardCaptain = value; this.guardCaptain = value;
} }

24
src/engine/powers/poweractions/CreateMobPowerAction.java

@ -12,7 +12,6 @@ package engine.powers.poweractions;
import engine.Enum; import engine.Enum;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.MovementManager;
import engine.gameManager.NPCManager; import engine.gameManager.NPCManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
@ -84,8 +83,6 @@ public class CreateMobPowerAction extends AbstractPowerAction {
WorldGrid.RemoveWorldObject(currentPet); WorldGrid.RemoveWorldObject(currentPet);
currentPet.setCombatTarget(null); currentPet.setCombatTarget(null);
//if (currentPet.getParentZone() != null)
//currentPet.getParentZone().zoneMobSet.remove(currentPet);
seaFloor.zoneMobSet.remove(currentPet); seaFloor.zoneMobSet.remove(currentPet);
currentPet.playerAgroMap.clear(); currentPet.playerAgroMap.clear();
@ -95,7 +92,6 @@ public class CreateMobPowerAction extends AbstractPowerAction {
Logger.error(e.getMessage()); Logger.error(e.getMessage());
} }
//currentPet.disableIntelligence();
} else if (currentPet != null && currentPet.isSiege()) { } else if (currentPet != null && currentPet.isSiege()) {
currentPet.agentType = Enum.AIAgentType.MOBILE; currentPet.agentType = Enum.AIAgentType.MOBILE;
currentPet.setOwner(null); currentPet.setOwner(null);
@ -106,7 +102,6 @@ public class CreateMobPowerAction extends AbstractPowerAction {
} }
//remove 10th pet //remove 10th pet
NPCManager.spawnNecroPet(owner, pet); NPCManager.spawnNecroPet(owner, pet);
} else { //is not a necro pet } else { //is not a necro pet
@ -137,26 +132,9 @@ public class CreateMobPowerAction extends AbstractPowerAction {
NPCManager.resetNecroPets(owner); NPCManager.resetNecroPets(owner);
} }
} }
/* if(owner.getPet() != null) {
if(owner.getPet().getMobBaseID() != 12021 && owner.getPet().getMobBaseID() != 12022) {
//if not a necro pet, remove pet
WorldGrid.removeWorldObject(owner.getPet());
owner.getPet().disableIntelligence();
Mob.removePet(owner.getPet().getUUID());
owner.setPet(null);
}
else {
//if it is a necro pet, add it to the line and set as mob
owner.getPet().setMob();
}
}*/
// if (mobID == 12021 || mobID == 12022) //Necro Pets
// pet.setPet(owner, true);
owner.setPet(pet); owner.setPet(pet);
if(pet.isSiege() == false) {
MovementManager.translocate(pet, owner.getLoc(), owner.region);
}
pet.recalculateStats(); pet.recalculateStats();
pet.healthMax = pet.level * 0.5f * 120; pet.healthMax = pet.level * 0.5f * 120;
pet.setHealth(pet.healthMax); pet.setHealth(pet.healthMax);

Loading…
Cancel
Save