Browse Source

stronghold mobs

lakebane-strongholds
FatBoy-DOTC 2 months ago
parent
commit
c8473cbe03
  1. 6
      src/engine/gameManager/StrongholdManager.java
  2. 26
      src/engine/objects/Mob.java

6
src/engine/gameManager/StrongholdManager.java

@ -84,6 +84,8 @@ public class StrongholdManager {
guard.defenseRating = 2200; guard.defenseRating = 2200;
guard.setFirstName("Elite Guardian"); guard.setFirstName("Elite Guardian");
InterestManager.setObjectDirty(guard); InterestManager.setObjectDirty(guard);
WorldGrid.addObject(guard,loc.x,loc.z);
WorldGrid.updateObject(guard);
guard.stronghold = mine; guard.stronghold = mine;
guard.mobPowers.clear(); guard.mobPowers.clear();
guard.mobPowers.put(429399948,20); // find weakness guard.mobPowers.put(429399948,20); // find weakness
@ -121,6 +123,8 @@ public class StrongholdManager {
commander.defenseRating = 3500; commander.defenseRating = 3500;
commander.setFirstName("Guardian Commander"); commander.setFirstName("Guardian Commander");
InterestManager.setObjectDirty(commander); InterestManager.setObjectDirty(commander);
WorldGrid.addObject(commander,loc.x,loc.z);
WorldGrid.updateObject(commander);
commander.stronghold = mine; commander.stronghold = mine;
} }
@ -333,6 +337,8 @@ public class StrongholdManager {
commander.defenseRating = 3500; commander.defenseRating = 3500;
commander.setFirstName("Defender of " + mine.getParentZone().getParent().getName()); commander.setFirstName("Defender of " + mine.getParentZone().getParent().getName());
InterestManager.setObjectDirty(commander); InterestManager.setObjectDirty(commander);
WorldGrid.addObject(commander,loc.x,loc.z);
WorldGrid.updateObject(commander);
commander.stronghold = mine; commander.stronghold = mine;
} }

26
src/engine/objects/Mob.java

@ -575,6 +575,32 @@ public class Mob extends AbstractIntelligenceAgent {
return mob; return mob;
} }
public static Mob createStrongholdMob(int loadID, Vector3fImmutable spawn, Guild guild, boolean isMob, Zone parent, Building building, int contractID, String pirateName, int level) {
// Create a new Mob instance
Mob mobWithoutID = new Mob(pirateName, "", (short) 0, (short) 0, (short) 0, (short) 0, (short) 0, (short) 1, 0, false, false, false, spawn, spawn, Vector3fImmutable.ZERO, (short) 1, (short) 1, (short) 1, guild, (byte) 0, loadID, isMob, parent, building, contractID);
// Check if mobBase is null
if (mobWithoutID.mobBase == null)
return null;
// Set mob level
mobWithoutID.level = (short) level;
// Set the parent zone and parentZoneID
mobWithoutID.parentZone = parent;
mobWithoutID.parentZoneID = parent.getObjectUUID();
// If the mob is in a building, bind it to zero position
if (mobWithoutID.building != null)
mobWithoutID.bindLoc = Vector3fImmutable.ZERO;
// Avoid database actions and directly return the created mobWithoutID
mobWithoutID.setObjectTypeMask(MBServerStatics.MASK_MOB | mobWithoutID.getTypeMasks());
return mobWithoutID;
}
public static Mob createPet(int loadID, Guild guild, Zone parent, PlayerCharacter owner, short level) { public static Mob createPet(int loadID, Guild guild, Zone parent, PlayerCharacter owner, short level) {
MobBase mobBase = MobBase.getMobBase(loadID); MobBase mobBase = MobBase.getMobBase(loadID);
Mob mob = null; Mob mob = null;

Loading…
Cancel
Save