|
|
@ -29,8 +29,8 @@ import java.util.ArrayList; |
|
|
|
|
|
|
|
|
|
|
|
public abstract class AbstractIntelligenceAgent extends AbstractCharacter { |
|
|
|
public abstract class AbstractIntelligenceAgent extends AbstractCharacter { |
|
|
|
protected Vector3fImmutable lastBindLoc; |
|
|
|
protected Vector3fImmutable lastBindLoc; |
|
|
|
private boolean assist = false; |
|
|
|
public boolean assist = false; |
|
|
|
private Enum.AIAgentType agentType = Enum.AIAgentType.MOBILE; |
|
|
|
public Enum.AIAgentType agentType = Enum.AIAgentType.MOBILE; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AbstractIntelligenceAgent(ResultSet rs) throws SQLException { |
|
|
|
public AbstractIntelligenceAgent(ResultSet rs) throws SQLException { |
|
|
@ -79,10 +79,6 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setMob() { |
|
|
|
|
|
|
|
this.agentType = Enum.AIAgentType.MOBILE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setPet(PlayerCharacter owner, boolean summoned) { |
|
|
|
public void setPet(PlayerCharacter owner, boolean summoned) { |
|
|
|
|
|
|
|
|
|
|
|
if (summoned) |
|
|
|
if (summoned) |
|
|
@ -96,32 +92,12 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isMob() { |
|
|
|
|
|
|
|
return (this.agentType.equals(Enum.AIAgentType.MOBILE)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isPet() { |
|
|
|
public boolean isPet() { |
|
|
|
|
|
|
|
|
|
|
|
return (this.agentType.equals(Enum.AIAgentType.PET) || |
|
|
|
return (this.agentType.equals(Enum.AIAgentType.PET) || |
|
|
|
this.agentType.equals(Enum.AIAgentType.CHARMED)); |
|
|
|
this.agentType.equals(Enum.AIAgentType.CHARMED)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isSummonedPet() { |
|
|
|
|
|
|
|
return (this.agentType.equals(Enum.AIAgentType.PET)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isCharmedPet() { |
|
|
|
|
|
|
|
return (this.agentType.equals(Enum.AIAgentType.CHARMED)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isGuard() { |
|
|
|
|
|
|
|
return (this.agentType.equals(Enum.AIAgentType.GUARD)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean assist() { |
|
|
|
|
|
|
|
return this.assist; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void toggleAssist() { |
|
|
|
public void toggleAssist() { |
|
|
|
this.assist = !this.assist; |
|
|
|
this.assist = !this.assist; |
|
|
|
} |
|
|
|
} |
|
|
@ -154,9 +130,12 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public float getAggroRange() { |
|
|
|
public float getAggroRange() { |
|
|
|
|
|
|
|
|
|
|
|
float ret = MobAIThread.AI_BASE_AGGRO_RANGE; |
|
|
|
float ret = MobAIThread.AI_BASE_AGGRO_RANGE; |
|
|
|
|
|
|
|
|
|
|
|
if (this.bonuses != null) |
|
|
|
if (this.bonuses != null) |
|
|
|
ret *= (1 + this.bonuses.getFloatPercentAll(ModType.ScanRange, SourceType.None)); |
|
|
|
ret *= (1 + this.bonuses.getFloatPercentAll(ModType.ScanRange, SourceType.None)); |
|
|
|
|
|
|
|
|
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -164,28 +143,31 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter { |
|
|
|
|
|
|
|
|
|
|
|
if (this.isPet()) { |
|
|
|
if (this.isPet()) { |
|
|
|
|
|
|
|
|
|
|
|
if (this.isSummonedPet()) { //delete summoned pet
|
|
|
|
if ((this.agentType.equals(Enum.AIAgentType.PET))) { //delete summoned pet
|
|
|
|
|
|
|
|
|
|
|
|
WorldGrid.RemoveWorldObject(this); |
|
|
|
WorldGrid.RemoveWorldObject(this); |
|
|
|
if (this.getObjectType() == GameObjectType.Mob) { |
|
|
|
|
|
|
|
//((Mob)this).state = STATE.Disabled;
|
|
|
|
if (this.getObjectType() == GameObjectType.Mob) |
|
|
|
if (((Mob) this).getParentZone() != null) |
|
|
|
if (((Mob) this).getParentZone() != null) |
|
|
|
((Mob) this).getParentZone().zoneMobSet.remove(this); |
|
|
|
((Mob) this).getParentZone().zoneMobSet.remove(this); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { //revert charmed pet
|
|
|
|
} else { //revert charmed pet
|
|
|
|
this.setMob(); |
|
|
|
this.agentType = Enum.AIAgentType.MOBILE; |
|
|
|
this.setCombatTarget(null); |
|
|
|
this.setCombatTarget(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//clear owner
|
|
|
|
//clear owner
|
|
|
|
|
|
|
|
|
|
|
|
PlayerCharacter owner = this.getOwner(); |
|
|
|
PlayerCharacter owner = this.getOwner(); |
|
|
|
|
|
|
|
|
|
|
|
//close pet window
|
|
|
|
//close pet window
|
|
|
|
|
|
|
|
|
|
|
|
if (owner != null) { |
|
|
|
if (owner != null) { |
|
|
|
|
|
|
|
|
|
|
|
Mob pet = owner.getPet(); |
|
|
|
Mob pet = owner.getPet(); |
|
|
|
PetMsg pm = new PetMsg(5, null); |
|
|
|
|
|
|
|
Dispatch dispatch = Dispatch.borrow(owner, pm); |
|
|
|
PetMsg petMsg = new PetMsg(5, null); |
|
|
|
|
|
|
|
Dispatch dispatch = Dispatch.borrow(owner, petMsg); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); |
|
|
|
|
|
|
|
|
|
|
|
if (pet != null && pet.getObjectUUID() == this.getObjectUUID()) |
|
|
|
if (pet != null && pet.getObjectUUID() == this.getObjectUUID()) |
|
|
@ -199,6 +181,5 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|