|
|
@ -61,13 +61,14 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
public Zone parentZone; |
|
|
|
public Zone parentZone; |
|
|
|
public boolean hasLoot = false; |
|
|
|
public boolean hasLoot = false; |
|
|
|
public boolean isPlayerGuard = false; |
|
|
|
public boolean isPlayerGuard = false; |
|
|
|
public AbstractCharacter npcOwner; |
|
|
|
public AbstractCharacter guardCaptain; |
|
|
|
public long deathTime = 0; |
|
|
|
public long deathTime = 0; |
|
|
|
public int equipmentSetID = 0; |
|
|
|
public int equipmentSetID = 0; |
|
|
|
public int runeSet = 0; |
|
|
|
public int runeSet = 0; |
|
|
|
public int bootySet = 0; |
|
|
|
public int bootySet = 0; |
|
|
|
public EnumBitSet<MonsterType> notEnemy; |
|
|
|
public EnumBitSet<MonsterType> notEnemy = EnumBitSet.noneOf(MonsterType.class); |
|
|
|
public EnumBitSet<Enum.MonsterType> enemy; |
|
|
|
public EnumBitSet<Enum.MonsterType> enemy = EnumBitSet.noneOf(MonsterType.class); |
|
|
|
|
|
|
|
; |
|
|
|
public MobBehaviourType behaviourType; |
|
|
|
public MobBehaviourType behaviourType; |
|
|
|
public ArrayList<Vector3fImmutable> patrolPoints; |
|
|
|
public ArrayList<Vector3fImmutable> patrolPoints; |
|
|
|
public int lastPatrolPointIndex = 0; |
|
|
|
public int lastPatrolPointIndex = 0; |
|
|
@ -323,7 +324,7 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
|
|
|
|
|
|
|
|
writer.putInt(0); // NPC menu options
|
|
|
|
writer.putInt(0); // NPC menu options
|
|
|
|
|
|
|
|
|
|
|
|
if (mob.contract != null && mob.npcOwner == null) { |
|
|
|
if (mob.contract != null && mob.guardCaptain == null) { |
|
|
|
writer.put((byte) 1); |
|
|
|
writer.put((byte) 1); |
|
|
|
writer.putLong(0); |
|
|
|
writer.putLong(0); |
|
|
|
writer.putLong(0); |
|
|
|
writer.putLong(0); |
|
|
@ -336,12 +337,12 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
} else |
|
|
|
} else |
|
|
|
writer.put((byte) 0); |
|
|
|
writer.put((byte) 0); |
|
|
|
|
|
|
|
|
|
|
|
if (mob.npcOwner != null) { |
|
|
|
if (mob.guardCaptain != null) { |
|
|
|
writer.put((byte) 1); |
|
|
|
writer.put((byte) 1); |
|
|
|
writer.putInt(GameObjectType.PlayerCharacter.ordinal()); |
|
|
|
writer.putInt(GameObjectType.PlayerCharacter.ordinal()); |
|
|
|
writer.putInt(131117009); |
|
|
|
writer.putInt(131117009); |
|
|
|
writer.putInt(mob.npcOwner.getObjectType().ordinal()); |
|
|
|
writer.putInt(mob.guardCaptain.getObjectType().ordinal()); |
|
|
|
writer.putInt(mob.npcOwner.getObjectUUID()); |
|
|
|
writer.putInt(mob.guardCaptain.getObjectUUID()); |
|
|
|
writer.putInt(8); |
|
|
|
writer.putInt(8); |
|
|
|
} else |
|
|
|
} else |
|
|
|
writer.put((byte) 0); |
|
|
|
writer.put((byte) 0); |
|
|
@ -618,7 +619,7 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
minionMobile.notEnemy = guardCaptain.notEnemy; |
|
|
|
minionMobile.notEnemy = guardCaptain.notEnemy; |
|
|
|
|
|
|
|
|
|
|
|
minionMobile.deathTime = System.currentTimeMillis(); |
|
|
|
minionMobile.deathTime = System.currentTimeMillis(); |
|
|
|
minionMobile.npcOwner = guardCaptain; |
|
|
|
minionMobile.guardCaptain = guardCaptain; |
|
|
|
minionMobile.spawnTime = (int) (-2.500 * guardCaptain.building.getRank() + 22.5) * 60; |
|
|
|
minionMobile.spawnTime = (int) (-2.500 * guardCaptain.building.getRank() + 22.5) * 60; |
|
|
|
minionMobile.behaviourType = Enum.MobBehaviourType.GuardMinion; |
|
|
|
minionMobile.behaviourType = Enum.MobBehaviourType.GuardMinion; |
|
|
|
minionMobile.isPlayerGuard = true; |
|
|
|
minionMobile.isPlayerGuard = true; |
|
|
@ -651,7 +652,6 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
// Configure and spawn minion
|
|
|
|
// Configure and spawn minion
|
|
|
|
|
|
|
|
|
|
|
|
minionMobile.runAfterLoad(); |
|
|
|
minionMobile.runAfterLoad(); |
|
|
|
minionMobile.despawned = false; |
|
|
|
|
|
|
|
DbManager.addToCache(minionMobile); |
|
|
|
DbManager.addToCache(minionMobile); |
|
|
|
|
|
|
|
|
|
|
|
minionMobile.setLoc(minionMobile.bindLoc); |
|
|
|
minionMobile.setLoc(minionMobile.bindLoc); |
|
|
@ -665,26 +665,22 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
|
|
|
|
|
|
|
|
public static synchronized Mob createSiegeMob(NPC owner, int loadID, Guild guild, Zone parent, Vector3fImmutable loc, short level) { |
|
|
|
public static synchronized Mob createSiegeMob(NPC owner, int loadID, Guild guild, Zone parent, Vector3fImmutable loc, short level) { |
|
|
|
|
|
|
|
|
|
|
|
MobBase minionMobBase; |
|
|
|
Mob siegeMinion; |
|
|
|
Mob mob; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (owner.getSiegeMinionMap().size() == 3) |
|
|
|
if (owner.getSiegeMinionMap().size() == 3) |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
|
|
minionMobBase = MobBase.getMobBase(loadID); |
|
|
|
siegeMinion = new Mob(); |
|
|
|
|
|
|
|
|
|
|
|
if (minionMobBase == null) |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mob = new Mob(minionMobBase, guild, parent, level, new Vector3fImmutable(1, 1, 1), 0, false); |
|
|
|
|
|
|
|
//mob.runAfterLoad();
|
|
|
|
|
|
|
|
mob.despawned = true; |
|
|
|
|
|
|
|
DbManager.addToCache(mob); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mob.setObjectTypeMask(MBServerStatics.MASK_MOB | mob.getTypeMasks()); |
|
|
|
siegeMinion.level = 1; |
|
|
|
|
|
|
|
siegeMinion.loadID = loadID; |
|
|
|
//mob.setMob();
|
|
|
|
siegeMinion.guildUUID = guild.getObjectUUID(); |
|
|
|
// mob.setSiege(true);
|
|
|
|
siegeMinion.equipmentSetID = 0; |
|
|
|
|
|
|
|
siegeMinion.buildingUUID = owner.buildingUUID; |
|
|
|
|
|
|
|
siegeMinion.guardCaptain = owner; |
|
|
|
|
|
|
|
siegeMinion.parentZoneUUID = parent.getObjectUUID(); |
|
|
|
|
|
|
|
siegeMinion.behaviourType = MobBehaviourType.SiegeEngine; |
|
|
|
|
|
|
|
siegeMinion.bindLoc = Vector3fImmutable.ZERO; |
|
|
|
|
|
|
|
|
|
|
|
int slot = 0; |
|
|
|
int slot = 0; |
|
|
|
|
|
|
|
|
|
|
@ -693,12 +689,14 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
else if (!owner.getSiegeMinionMap().containsValue(2)) |
|
|
|
else if (!owner.getSiegeMinionMap().containsValue(2)) |
|
|
|
slot = 2; |
|
|
|
slot = 2; |
|
|
|
|
|
|
|
|
|
|
|
owner.getSiegeMinionMap().put(mob, slot); |
|
|
|
owner.getSiegeMinionMap().put(siegeMinion, slot); |
|
|
|
|
|
|
|
|
|
|
|
mob.setNpcOwner(owner); |
|
|
|
siegeMinion.runAfterLoad(); |
|
|
|
mob.behaviourType = MobBehaviourType.Pet1; |
|
|
|
siegeMinion.despawned = true; |
|
|
|
mob.behaviourType.canRoam = false; |
|
|
|
DbManager.addToCache(siegeMinion); |
|
|
|
return mob; |
|
|
|
siegeMinion.setLoc(siegeMinion.bindLoc); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return siegeMinion; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -995,7 +993,7 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
this.playerAgroMap.clear(); |
|
|
|
this.playerAgroMap.clear(); |
|
|
|
|
|
|
|
|
|
|
|
if (this.behaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()) |
|
|
|
if (this.behaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()) |
|
|
|
this.spawnTime = (int) (-2.500 * this.npcOwner.building.getRank() + 22.5) * 60; |
|
|
|
this.spawnTime = (int) (-2.500 * this.guardCaptain.building.getRank() + 22.5) * 60; |
|
|
|
|
|
|
|
|
|
|
|
if (this.isPet()) { |
|
|
|
if (this.isPet()) { |
|
|
|
|
|
|
|
|
|
|
@ -1084,8 +1082,8 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
this.recalculateStats(); |
|
|
|
this.recalculateStats(); |
|
|
|
this.setHealth(this.healthMax); |
|
|
|
this.setHealth(this.healthMax); |
|
|
|
|
|
|
|
|
|
|
|
if (this.building == null && this.npcOwner != null && ((Mob) this.npcOwner).behaviourType.ordinal() == MobBehaviourType.GuardCaptain.ordinal()) |
|
|
|
if (this.building == null && this.guardCaptain != null && ((Mob) this.guardCaptain).behaviourType.ordinal() == MobBehaviourType.GuardCaptain.ordinal()) |
|
|
|
this.building = this.npcOwner.building; |
|
|
|
this.building = this.guardCaptain.building; |
|
|
|
else if (this.building != null) |
|
|
|
else if (this.building != null) |
|
|
|
this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z); |
|
|
|
this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z); |
|
|
|
|
|
|
|
|
|
|
@ -1843,8 +1841,8 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
return this.behaviourType.equals(MobBehaviourType.SiegeEngine); |
|
|
|
return this.behaviourType.equals(MobBehaviourType.SiegeEngine); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setNpcOwner(AbstractCharacter npcOwner) { |
|
|
|
public void setGuardCaptain(AbstractCharacter guardCaptain) { |
|
|
|
this.npcOwner = npcOwner; |
|
|
|
this.guardCaptain = guardCaptain; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isNecroPet() { |
|
|
|
public boolean isNecroPet() { |
|
|
|