mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-09-12 22:45:31 -04:00
Some AI fixes
This commit is contained in:
@@ -14,5 +14,6 @@ def addTemplate(core):
|
||||
mobileTemplate.setAttacks(attacks)
|
||||
mobileTemplate.setCreatureName('krayt_dragon_ancient')
|
||||
mobileTemplate.setScale(2)
|
||||
mobileTemplate.setAttackRange(12)
|
||||
core.spawnService.addMobileTemplate('krayt_dragon_ancient', mobileTemplate)
|
||||
|
||||
@@ -112,6 +112,8 @@ public abstract class AIState {
|
||||
|
||||
float distance = oldWorldPos.getDistance(currentPathPosition.getWorldPosition());
|
||||
float travelDistance = distance - (pathDistance - maxDistance);
|
||||
// temp fix for melee npcs
|
||||
travelDistance *= 1.3;
|
||||
if(travelDistance <= 0) {
|
||||
newX = currentPathPosition.x;
|
||||
newZ = currentPathPosition.z;
|
||||
|
||||
@@ -110,6 +110,13 @@ public class AttackState extends AIState {
|
||||
actor.scheduleRecovery();
|
||||
return StateResult.UNFINISHED;
|
||||
}
|
||||
if(target.getPosture() == 13 || target.getPosture() == 14) {
|
||||
actor.getDamageMap().remove(target);
|
||||
actor.setFollowObject(actor.getHighestDamageDealer());
|
||||
target = actor.getFollowObject();
|
||||
if(target == null)
|
||||
return StateResult.FINISHED;
|
||||
}
|
||||
if(target.getWorldPosition().getDistance(creature.getWorldPosition()) > 128 || target.getPosture() == 13 || target.getPosture() == 14) {
|
||||
actor.removeDefender(target);
|
||||
actor.scheduleRecovery();
|
||||
|
||||
@@ -41,6 +41,8 @@ public class MobileTemplate {
|
||||
private int health, action;
|
||||
private String creatureName;
|
||||
private float scale = 1;
|
||||
// this is a custom attack Range setting to use for large mobs like krayts
|
||||
private int attackRange;
|
||||
|
||||
public Vector<String> getTemplates() {
|
||||
return templates;
|
||||
@@ -146,4 +148,12 @@ public class MobileTemplate {
|
||||
this.scale = scale;
|
||||
}
|
||||
|
||||
public int getAttackRange() {
|
||||
return attackRange;
|
||||
}
|
||||
|
||||
public void setAttackRange(int attackRange) {
|
||||
this.attackRange = attackRange;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -116,6 +116,8 @@ public class SpawnService {
|
||||
defaultWeapon.setAttackSpeed(2);
|
||||
defaultWeapon.setDamageType("@obj_attr_n:armor_eff_kinetic");
|
||||
defaultWeapon.setStringAttribute("cat_wpn_damage.damage", "0-0");
|
||||
if(mobileTemplate.getAttackRange() > 0)
|
||||
defaultWeapon.setMaxRange(mobileTemplate.getAttackRange());
|
||||
if(mobileTemplate.getMaxDamage() != 0) {
|
||||
defaultWeapon.setMaxDamage(mobileTemplate.getMaxDamage());
|
||||
defaultWeapon.setMinDamage(mobileTemplate.getMinDamage());
|
||||
|
||||
Reference in New Issue
Block a user