|
|
@ -63,12 +63,10 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
public float spawnRadius; |
|
|
|
public float spawnRadius; |
|
|
|
//used by static mobs
|
|
|
|
//used by static mobs
|
|
|
|
public int parentZoneUUID; |
|
|
|
public int parentZoneUUID; |
|
|
|
protected int dbID; //the database ID
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int currentID; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO implement feared object system
|
|
|
|
//TODO implement feared object system
|
|
|
|
public AbstractWorldObject fearedObject = null; |
|
|
|
public AbstractWorldObject fearedObject = null; |
|
|
|
|
|
|
|
protected int dbID; //the database ID
|
|
|
|
|
|
|
|
private int currentID; |
|
|
|
private long lastAttackTime = 0; |
|
|
|
private long lastAttackTime = 0; |
|
|
|
private int lastMobPowerToken = 0; |
|
|
|
private int lastMobPowerToken = 0; |
|
|
|
private HashMap<Integer, MobEquipment> equip = null; |
|
|
|
private HashMap<Integer, MobEquipment> equip = null; |
|
|
@ -314,13 +312,13 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
writer.put((byte) 1); |
|
|
|
writer.put((byte) 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((PlayerCharacter) mob.guardCaptain != null) { |
|
|
|
if (mob.guardCaptain != null) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
writer.putInt(((PlayerCharacter) mob.guardCaptain).getObjectType().ordinal()); |
|
|
|
writer.putInt(mob.guardCaptain.getObjectType().ordinal()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
writer.putInt(((PlayerCharacter) mob.guardCaptain).getObjectUUID()); |
|
|
|
writer.putInt(mob.guardCaptain.getObjectUUID()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
writer.putInt(0); //ownerType
|
|
|
|
writer.putInt(0); //ownerType
|
|
|
|
writer.putInt(0); //ownerID
|
|
|
|
writer.putInt(0); //ownerID
|
|
|
@ -554,6 +552,7 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
|
|
|
|
|
|
|
|
return petMinion; |
|
|
|
return petMinion; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static Mob getMob(int id) { |
|
|
|
public static Mob getMob(int id) { |
|
|
|
|
|
|
|
|
|
|
|
if (id == 0) |
|
|
|
if (id == 0) |
|
|
@ -696,7 +695,7 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
public Vector3fImmutable getBindLoc() { |
|
|
|
public Vector3fImmutable getBindLoc() { |
|
|
|
|
|
|
|
|
|
|
|
if (this.isPet() && !this.behaviourType.equals(MobBehaviourType.SiegeEngine)) |
|
|
|
if (this.isPet() && !this.behaviourType.equals(MobBehaviourType.SiegeEngine)) |
|
|
|
return (PlayerCharacter) this.guardCaptain != null ? ((PlayerCharacter) this.guardCaptain).getLoc() : this.getLoc(); |
|
|
|
return this.guardCaptain != null ? this.guardCaptain.getLoc() : this.getLoc(); |
|
|
|
else |
|
|
|
else |
|
|
|
return this.bindLoc; |
|
|
|
return this.bindLoc; |
|
|
|
} |
|
|
|
} |
|
|
@ -1599,8 +1598,8 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
//TODO set these correctly later
|
|
|
|
//TODO set these correctly later
|
|
|
|
this.rangeHandOne = this.mobBase.getAttackRange(); |
|
|
|
this.rangeHandOne = this.mobBase.getAttackRange(); |
|
|
|
this.rangeHandTwo = -1; |
|
|
|
this.rangeHandTwo = -1; |
|
|
|
this.minDamageHandOne = (int)this.mobBase.getMinDmg(); |
|
|
|
this.minDamageHandOne = (int) this.mobBase.getMinDmg(); |
|
|
|
this.maxDamageHandOne = (int)this.mobBase.getMaxDmg(); |
|
|
|
this.maxDamageHandOne = (int) this.mobBase.getMaxDmg(); |
|
|
|
this.minDamageHandTwo = 0; |
|
|
|
this.minDamageHandTwo = 0; |
|
|
|
this.maxDamageHandTwo = 0; |
|
|
|
this.maxDamageHandTwo = 0; |
|
|
|
this.atrHandOne = this.mobBase.getAtr(); |
|
|
|
this.atrHandOne = this.mobBase.getAtr(); |
|
|
@ -1665,28 +1664,23 @@ public class Mob extends AbstractIntelligenceAgent { |
|
|
|
this.enemy.addAll(this.getMobBase().enemy); |
|
|
|
this.enemy.addAll(this.getMobBase().enemy); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
NPCManager.applyRuneSetEffects(this); |
|
|
|
NPCManager.applyRuneSetEffects(this); |
|
|
|
recalculateStats(); |
|
|
|
recalculateStats(); |
|
|
|
this.setHealth(this.healthMax); |
|
|
|
this.setHealth(this.healthMax); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set bounds for this mobile
|
|
|
|
// Set bounds for this mobile
|
|
|
|
|
|
|
|
|
|
|
|
Bounds mobBounds = Bounds.borrow(); |
|
|
|
Bounds mobBounds = Bounds.borrow(); |
|
|
|
mobBounds.setBounds(this.getLoc()); |
|
|
|
mobBounds.setBounds(this.getLoc()); |
|
|
|
this.setBounds(mobBounds); |
|
|
|
this.setBounds(mobBounds); |
|
|
|
|
|
|
|
|
|
|
|
//assign 5 random patrol points for regular mobs
|
|
|
|
//assign 5 random patrol points for regular mobs
|
|
|
|
|
|
|
|
|
|
|
|
if (this.agentType.equals(AIAgentType.MOBILE)) { |
|
|
|
if (this.agentType.equals(AIAgentType.MOBILE)) |
|
|
|
|
|
|
|
NPCManager.AssignPatrolPoints(this); |
|
|
|
|
|
|
|
|
|
|
|
NPCManager.AssignPatrolPoints(this); |
|
|
|
this.deathTime = 0; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.deathTime = 0; |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
Logger.error(e.getMessage()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|