public override bool ExternalCondition(BehaviorInputData Input) { if (!CombatHelper.InAttackRange(Input.Attacker, Input.Attacker.Action.TargetNpc)) { return(true); } return(false); }
protected override BehaviorRunningState OnExecute(BehaviorInputData Input) { if (Input.Attacker.Actor.IsFsmState(FsmStateName.Walk) && Input.Attacker.Action.IsValidTarget()) { if (!CombatHelper.InAttackRange(Input.Attacker, Input.Attacker.Action.TargetNpc)) { Input.Attacker.Action.MoveTo(Input.Attacker.Action.TargetNpc.Position); } return(BehaviorRunningState.Running); } return(BehaviorRunningState.Finish); }