forked from MagicBane/Server
trebuchets now have pet AI with canRoam disabled
This commit is contained in:
@@ -113,10 +113,10 @@ public class MobileFSM {
|
|||||||
}
|
}
|
||||||
City playercity = ZoneManager.getCityAtLocation(mob.getLoc());
|
City playercity = ZoneManager.getCityAtLocation(mob.getLoc());
|
||||||
if(playercity != null) {
|
if(playercity != null) {
|
||||||
for (Building barracks : playercity.cityBarracks) {
|
for (Mob guard : playercity.getParent().zoneMobSet) {
|
||||||
for(AbstractCharacter guardCaptain : barracks.getHirelings().keySet()){
|
if (guard.BehaviourType != null && guard.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal()) {
|
||||||
if(guardCaptain.getCombatTarget() == null){
|
if (guard.getCombatTarget() == null && guard.getGuild().equals(mob.getGuild()) == false) {
|
||||||
guardCaptain.setCombatTarget(mob);
|
guard.setCombatTarget(mob);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -584,7 +584,7 @@ public class MobileFSM {
|
|||||||
if(mob.getCombatTarget() != null && mob.getCombatTarget().isAlive() == false){
|
if(mob.getCombatTarget() != null && mob.getCombatTarget().isAlive() == false){
|
||||||
mob.setCombatTarget(null);
|
mob.setCombatTarget(null);
|
||||||
}
|
}
|
||||||
if(MovementUtilities.canMove(mob)){
|
if(MovementUtilities.canMove(mob) && mob.BehaviourType.canRoam){
|
||||||
CheckMobMovement(mob);
|
CheckMobMovement(mob);
|
||||||
}
|
}
|
||||||
if(mob.getCombatTarget() != null) {
|
if(mob.getCombatTarget() != null) {
|
||||||
|
|||||||
@@ -115,6 +115,9 @@ public class CombatUtilities {
|
|||||||
DispatchMessage.sendToAllInRange(agent,msg);
|
DispatchMessage.sendToAllInRange(agent,msg);
|
||||||
}
|
}
|
||||||
public static void swingIsDamage(Mob agent, AbstractWorldObject target, float damage, int animation){
|
public static void swingIsDamage(Mob agent, AbstractWorldObject target, float damage, int animation){
|
||||||
|
if(agent.isSiege() == true){
|
||||||
|
damage = ThreadLocalRandom.current().nextInt(1000) + 1500;
|
||||||
|
}
|
||||||
float trueDamage = damage;
|
float trueDamage = damage;
|
||||||
//target = agent.getCombatTarget();
|
//target = agent.getCombatTarget();
|
||||||
if (!target.isAlive())
|
if (!target.isAlive())
|
||||||
|
|||||||
@@ -950,6 +950,9 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
this.setLoc(buildingWorldLoc);
|
this.setLoc(buildingWorldLoc);
|
||||||
this.endLoc = buildingWorldLoc;
|
this.endLoc = buildingWorldLoc;
|
||||||
this.stopMovement(endLoc);
|
this.stopMovement(endLoc);
|
||||||
|
if(this.building.getBlueprint().isWallPiece()) {
|
||||||
|
MovementManager.translocate(this, new Vector3fImmutable(this.building.getLoc().x, this.npcOwner.getLoc().y, this.building.getLoc().z), this.region);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1458,7 +1458,7 @@ public class NPC extends AbstractCharacter {
|
|||||||
|
|
||||||
mob.setObjectTypeMask(MBServerStatics.MASK_MOB | mob.getTypeMasks());
|
mob.setObjectTypeMask(MBServerStatics.MASK_MOB | mob.getTypeMasks());
|
||||||
|
|
||||||
// mob.setMob();
|
//mob.setMob();
|
||||||
mob.setSiege(true);
|
mob.setSiege(true);
|
||||||
mob.setParentZone(parent);
|
mob.setParentZone(parent);
|
||||||
|
|
||||||
@@ -1478,7 +1478,8 @@ public class NPC extends AbstractCharacter {
|
|||||||
|
|
||||||
mob.setSpawnTime(10);
|
mob.setSpawnTime(10);
|
||||||
mob.setNpcOwner(this);
|
mob.setNpcOwner(this);
|
||||||
mob.region = AbstractWorldObject.GetRegionByWorldObject(mob);
|
mob.BehaviourType = MobBehaviourType.Pet1;
|
||||||
|
mob.BehaviourType.canRoam = false;
|
||||||
return mob;
|
return mob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user