|
|
|
@ -67,7 +67,6 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -67,7 +67,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
public boolean isPlayerGuard = false; |
|
|
|
|
public AbstractCharacter npcOwner; |
|
|
|
|
public long deathTime = 0; |
|
|
|
|
public String nameOverride = ""; |
|
|
|
|
public int equipmentSetID = 0; |
|
|
|
|
public int runeSet = 0; |
|
|
|
|
public int bootySet = 0; |
|
|
|
@ -120,7 +119,9 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -120,7 +119,9 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
|
|
|
|
|
if (contractID == 0) this.contract = null; |
|
|
|
|
else this.contract = DbManager.ContractQueries.GET_CONTRACT(contractID); |
|
|
|
|
|
|
|
|
|
if(building != null && building.getOwner()!= null){ |
|
|
|
|
this.lastName = "the " + contract.getName(); |
|
|
|
|
} |
|
|
|
|
clearStatic(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -253,13 +254,16 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -253,13 +254,16 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
|
|
|
|
|
this.notEnemy = EnumBitSet.asEnumBitSet(rs.getLong("notEnemy"), Enum.MonsterType.class); |
|
|
|
|
this.enemy = EnumBitSet.asEnumBitSet(rs.getLong("enemy"), Enum.MonsterType.class); |
|
|
|
|
|
|
|
|
|
this.firstName = rs.getString("mob_name"); |
|
|
|
|
if(this.firstName.isEmpty()){ |
|
|
|
|
this.firstName = this.mobBase.getFirstName(); |
|
|
|
|
} |
|
|
|
|
if (this.contract != null) { |
|
|
|
|
this.equipmentSetID = this.contract.getEquipmentSet(); |
|
|
|
|
this.nameOverride = this.getContract().getName(); |
|
|
|
|
this.lastName = this.getContract().getName(); |
|
|
|
|
} else { |
|
|
|
|
this.equipmentSetID = rs.getInt("equipmentSet"); |
|
|
|
|
this.nameOverride = rs.getString("mob_name"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (rs.getString("fsm").length() > 1) this.BehaviourType = MobBehaviourType.valueOf(rs.getString("fsm")); |
|
|
|
@ -328,14 +332,11 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -328,14 +332,11 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
writer.putInt(0xFF665EC3); //Spi
|
|
|
|
|
writer.putInt(0); |
|
|
|
|
|
|
|
|
|
if (!mob.nameOverride.isEmpty()) { |
|
|
|
|
writer.putString(mob.nameOverride); |
|
|
|
|
writer.putInt(0); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
writer.putString(mob.firstName); |
|
|
|
|
writer.putString(mob.lastName); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
writer.putInt(0); |
|
|
|
|
writer.putInt(0); |
|
|
|
@ -706,10 +707,8 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -706,10 +707,8 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
else if (guardCaptain.getRank() == 6) rank = MBServerStatics.VETERAN; |
|
|
|
|
else rank = MBServerStatics.ELITE; |
|
|
|
|
|
|
|
|
|
if (rank.isEmpty()) |
|
|
|
|
mob.nameOverride = pirateName + " " + minionType.getRace() + " " + minionType.getName(); |
|
|
|
|
else |
|
|
|
|
mob.nameOverride = pirateName + " " + minionType.getRace() + " " + rank + " " + minionType.getName(); |
|
|
|
|
mob.firstName = NPC.getPirateName(mob.getMobBaseID()); |
|
|
|
|
mob.lastName = rank + " " + minionType.getRace() + " " + minionType.getName(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -717,6 +716,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -717,6 +716,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
|
|
|
|
|
// mob.setMob();
|
|
|
|
|
mob.isPlayerGuard = true; |
|
|
|
|
|
|
|
|
|
DbManager.addToCache(mob); |
|
|
|
|
|
|
|
|
|
RuneBase guardRune = RuneBase.getRuneBase(252621); |
|
|
|
@ -762,7 +762,8 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -762,7 +762,8 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
mob.spawnTime = 900; |
|
|
|
|
mob.npcOwner = guardCaptain; |
|
|
|
|
mob.BehaviourType = Enum.MobBehaviourType.GuardMinion; |
|
|
|
|
|
|
|
|
|
//add mob to zone set of captain
|
|
|
|
|
guardCaptain.getParentZone().zoneMobSet.add(mob); |
|
|
|
|
return mob; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -887,11 +888,6 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -887,11 +888,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
this.mana.set(this.manaMax); |
|
|
|
|
this.stamina.set(this.staminaMax); |
|
|
|
|
|
|
|
|
|
if (!this.nameOverride.isEmpty()) |
|
|
|
|
this.firstName = this.nameOverride; |
|
|
|
|
else |
|
|
|
|
this.firstName = this.mobBase.getFirstName(); |
|
|
|
|
|
|
|
|
|
if (isPet) |
|
|
|
|
this.setObjectTypeMask(MBServerStatics.MASK_PET | this.getTypeMasks()); |
|
|
|
|
|
|
|
|
@ -916,7 +912,10 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -916,7 +912,10 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
this.charItemManager.load(); |
|
|
|
|
|
|
|
|
|
//load AI for general mobs.
|
|
|
|
|
|
|
|
|
|
if(this.contract != null && NPC.ISWallArcher(this.contract)){ |
|
|
|
|
this.BehaviourType = MobBehaviourType.GuardWallArcher; |
|
|
|
|
this.isPlayerGuard = true; |
|
|
|
|
} |
|
|
|
|
if (isPet || isSiege || (isGuard && this.contract == null)) this.currentID = (--Mob.staticID); |
|
|
|
|
else this.currentID = this.dbID; |
|
|
|
|
|
|
|
|
@ -1281,7 +1280,6 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -1281,7 +1280,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
|
|
|
|
|
public void respawn() { |
|
|
|
|
//Commenting out Mob ID rotation.
|
|
|
|
|
|
|
|
|
|
this.despawned = false; |
|
|
|
|
this.playerAgroMap.clear(); |
|
|
|
|
this.setCombatTarget(null); |
|
|
|
@ -1300,7 +1298,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -1300,7 +1298,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
this.recalculateStats(); |
|
|
|
|
|
|
|
|
|
this.setHealth(this.healthMax); |
|
|
|
|
|
|
|
|
|
this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z); |
|
|
|
|
if (!this.isSiege && !this.isPlayerGuard && contract == null) loadInventory(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -1987,7 +1985,7 @@ public class Mob extends AbstractIntelligenceAgent {
@@ -1987,7 +1985,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getNameOverride() { |
|
|
|
|
return nameOverride; |
|
|
|
|
return firstName + " " + lastName; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void processUpgradeMob(PlayerCharacter player) { |
|
|
|
|