ERAiAPI
Loading...
Searching...
No Matches
Goals.hpp File Reference
#include "AiConstants.hpp"

Go to the source code of this file.

Functions

void TopGoal ()
 The first goal, this goal has no parent. Always active.
 
void UndefinedGoalNotification ()
 Does nothing.
 
void Normal ()
 A very basic "default" battle goal.
 
void Stay (float enemyReactDist=0, TARGET turnTarget=TARGET_ENE_0)
 Goal used for waiting when not battling, such as an enemy that has no route (wait goal with the ability to spot targets).
 
void WalkAround (float radius=0, bool walk=false, float enemyReactDist=0, bool isWalkAroundFreePoint=false)
 Walk around.
 
void BackToHome (float enemyReactDist=0, bool forceBattleGoalOnHit=false, float unused_3, float unused_4, TARGET moveTarget=POINT_MOVE_POINT)
 Go back home.
 
void NonBattleAct (float enemyReactDist=0, bool reactToEnemy=false, bool run=false, TARGET turnTarget=TARGET_ENE_0, float homeStopDist=0, int standbyGoalId=0, bool forceBattleGoalOnHit=false)
 Every entity either has a battle goal active, or this "non" battle goal active (handles routing, and other idle behaviors).
 
void If (int codeNo=0)
 Calls function OnIf_<BATTLEGOALID> with args (ai, goal, codeNo)
 
void WaitCancelTiming ()
 Do nothing besides turning to TARGET_ENE_0 until life end or one of the animation cancels is satisfied (AiFunc::IsEnableComboAttack, AiFunc::IsEnableCancelMove, AiFunc::IsEnableCancelStep, AiFunc::IsEnableCancelAttack).
 
void Wait (TARGET turnTarget=TARGET_ENE_0)
 Do nothing besides turning until life end.
 
void Turn (TARGET turnTarget=TARGET_ENE_0, float stopAngleWidth=15, int guardStateId=0, GOAL_RESULT onGuardResult=GOAL_RESULT_Continue, bool guardSuccessOnEnd_Unused=true)
 Turn to target until target is within the specified angle.
 
void TurnAround (TARGET moveTarget=TARGET_ENE_0, AI_DIR_TYPE directionStart=AI_DIR_TYPE_CENTER, float stopAngleWidth=0, bool walk=false, bool successOnEnd=false, int guardStateId=0)
 Move around target, keeping yourself within the circle sector defined by the target as the center, starting angle with the direction type from directionDesire, and angle width from stopAngleWidth.
 
void WaitWithAnime (int animationId=0, TARGET target=TARGET_ENE_0)
 Executes an animation, no actual waiting (equivalent to AttackNonCancel(animationId, turnTarget, 9999, 0, -1)).
 
void MoveToSomewhereSmoothFly ()
 Undefined.
 
void MoveToSomewhereSmoothFly_Circling ()
 Undefined.
 
void MoveToSomewhereSmooth (TARGET moveTarget=TARGET_ENE_0, AI_DIR_TYPE directionFromTarget=AI_DIR_TYPE_CENTER, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, float directionalDistance=0)
 Move to the target in a point route "smoothly" using route and switch route goals.
 
void ApproachTargetLifeSuccess (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, GOAL_RESULT onGuardResult=GOAL_RESULT_Continue, bool guardSuccessOnEnd_Unused=true)
 Approach the target until you reach the given distance. Goal will be successful on life end.
 
void ApproachTarget (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, GOAL_RESULT onGuardResult=GOAL_RESULT_Continue, bool guardSuccessOnEnd_Unused=true, bool xzDistanceOnly=false)
 Approach the target until you reach the given distance.
 
void LeaveTarget (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, GUARD_GOAL_DESIRE_RET onGuardResult=GUARD_GOAL_DESIRE_RET_Continue, bool guardSuccessOnEnd=true)
 Leave the target until you reach the given distance.
 
void SidewayMove (TARGET moveTarget=TARGET_ENE_0, bool right=false, float angleThreshold=0, bool walk=false, bool successOnEnd=true, int guardStateId=0, GUARD_GOAL_DESIRE_RET onGuardResult=GUARD_GOAL_DESIRE_RET_Continue)
 Circle the target until the AI rotated enough to have their original look direction within their current direction view as given by angleThreshold.
 
void SidewayMoveAng (TARGET moveTarget=TARGET_ENE_0, float moveAngle=0, float angleThreshold=0, bool walk=false, bool successOnEnd=true, int guardStateId=0, GUARD_GOAL_DESIRE_RET onGuardResult=GUARD_GOAL_DESIRE_RET_Continue)
 Circle the target until the AI rotated enough to have their original look direction within their current direction view as given by angleThreshold.
 
void SidewayMoveAvoidChr (TARGET moveTarget=TARGET_ENE_0, bool right=false, float angleThreshold=0, bool walk=false, bool successOnEnd=true, int guardStateId=0, GUARD_GOAL_DESIRE_RET onGuardResult=GUARD_GOAL_DESIRE_RET_Continue)
 Circle the target until the AI rotated enough to have their original look direction within their current direction view as given by angleThreshold.
 
void KeepDist (TARGET moveTarget=TARGET_ENE_0, float minDist=0, float maxDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, GUARD_GOAL_DESIRE_RET onGuardResult=GUARD_GOAL_DESIRE_RET_Continue, bool guardSuccessOnEnd=false)
 Approach or leave the target until within the given range.
 
void MoveToSomewhere (TARGET moveTarget=TARGET_ENE_0, AI_DIR_TYPE directionFromTarget=AI_DIR_TYPE_CENTER, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, float directionalDistance=0, float unused_7, bool xzDistanceOnly=false, bool useDefaultArgs=false, bool closeProximityMode=false)
 Use pathing to move towards a spherical sector defined by the parameters.
 
void SpinStep (int animationId=0, TARGET target=TARGET_ENE_0, float turnTime=0, AI_DIR_TYPE dirSpaceCheck=AI_DIR_TYPE_CENTER, float distSpaceCheck=0)
 Turns to the target and then tests if there's space for the character to step/hop in the position they expect, and if so, executes the animation.
 
void Fall (TARGET stopTarget=TARGET_ENE_0, int ezStateIdFall=0, int ezStateIdStop=0, float stopDistY=0)
 Unused goal, perhaps for when an enemy can choose to "fall" in a specific manner (such as a bird)
 
void MoveToMovePointAir (TARGET moveTarget=TARGET_ENE_0, float unused_2, AI_DIR_TYPE directionFromTarget=AI_DIR_TYPE_CENTER)
 Sets fixed position move target via AiFunc::SetAIFixedMoveTarget.
 
void MoveTargetRelationPos (TARGET moveTarget=TARGET_ENE_0, AI_DIR_TYPE directionFromTarget=AI_DIR_TYPE_CENTER, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, float directionalDistance=0, float interceptAngle=0)
 
void MoveFollowPathSpecifyPos (TARGET moveTarget=TARGET_ENE_0, AI_DIR_TYPE directionFromTarget=AI_DIR_TYPE_CENTER, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, float directionalDistance=0, float x=0, float y=0, float z=0)
 
void MoveToSomewhere_RouteMove (TARGET moveTarget=TARGET_ENE_0, AI_DIR_TYPE directionFromTarget=AI_DIR_TYPE_CENTER, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, float directionalDistance=0, bool xzDistanceOnly=false, bool useDefaultArgs=false, bool closeProximityMode)
 Use pathing to move towards a spherical sector defined by the parameters.
 
void MoveToSomewhere_SwitchRouteMove (TARGET turnTarget=TARGET_ENE_0, bool walk=false, float directionalDistance=0, bool forceAndForgoCalculations=false)
 Use current pathing data to figure out how to reposition for next route point.
 
void MoveToSomewhere_SpecifyMove (TARGET turnTarget=TARGET_ENE_0, bool walk=false, float unused_3, int pointIndex=0)
 Used for pathing. Move to the given point.
 
void MoveFreeSpace ()
 Undefined.
 
void MoveGetwellSpace (int leavePriority=0, int leftPriority=0, int rightPriority=0, TARGET turnTarget_Unused, float distSpaceCheck=0, float leaveStopDist=0)
 Move around TARGET_ENE_0 going to the highest priority direction that is space-valid. Negative priority makes that option invalid.
 
void TeamCommand ()
 Undefined.
 
void TeamCommandManager ()
 Undefined.
 
void ActivateNoSubGoal ()
 Does nothing.
 
void ExecAction (int action=0)
 Executes unknown action.
 
void FollowPathExecAction (int action=0, TARGET moveTarget=TARGET_ENE_0, AI_DIR_TYPE directionFromTarget=AI_DIR_TYPE_CENTER, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, float directionalDistance=0)
 Executes unknown action while following path. Running, if possible.
 
void ToTargetWarp (TARGET warpTarget=TARGET_ENE_0, AI_DIR_TYPE directionFromTarget=AI_DIR_TYPE_CENTER, float distanceFromTarget=0, TARGET turnTarget=TARGET_ENE_0, float lowHeightOffset=0, float highHeightOffset=0, float warpPosMinDist=0)
 Teleports around the target's position if possible as defined by the parameters.
 
void ApproachTargetAllDirection (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, GOAL_RESULT onGuardResult=GOAL_RESULT_Continue, bool guardSuccessOnEnd_Unused=true, bool xzDistanceOnly=false)
 Approach target using all moving direction animations (forward, left, right, back)
 
void SideWay_On_FailedPath (float pathCheckInterval=0, int giveupAction=0, int giveupAttackLife=0, float giveupAttackCooldown=0, float giveUpTime=0, bool isGuard=false, bool determineSuccessOnHome=false)
 Idling when failing a path based on a large number of variables, occasionally attacking.

 
void ApproachTarget_ParallelMov (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, GUARD_GOAL_DESIRE_RET onGuardResult=GUARD_GOAL_DESIRE_RET_Continue, bool guardSuccessOnEnd_Unused=true)
 Approach the target until you reach the given distance allowing parallel move. See AiFunc::RequestParallelMove.
 
void FlexibleSideWayMove (int leftPriority=0, int rightPriority=0, TARGET moveTarget=TARGET_ENE_0, float distSpaceCheck=0, float angleThreshold=0, int guardOdds=0, float minDist=0, float maxDist=0)
 Move around the target going to the highest priority direction that is space-valid. Negative priority makes that option invalid.
 
void MoveToMultiPoint (float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, unsigned int point1=0, unsigned int point2=0, unsigned int point3=0, unsigned int point4=0, unsigned int point5=0, unsigned int point6=0, unsigned int point7=0, unsigned int point8=0, unsigned int point9=0, unsigned int point10=0)
 Move to the given event (region) points as a path from the closest point to the next, does not work, uses non existent goal and wrong logic.
 
void MoveToPossibleDirection (TARGET target=TARGET_ENE_0, TARGET turnTarget=TARGET_ENE_0, float wantDist=0, float angleWidth=0, float intervalOfAngles=0, int runOdds=0, int guardOdds=0, float stopDist=0)
 Complex goal that searches an angle width, starting from the angle to the target, for the straight line that has enough space for the character to walk to uninterrupted.
 
void SideWay_For_Fear_Of_Fire (float stopDist=0, int guardStateId=0, bool canGoSideways=false)
 Handles when TARGET_ENE_0 is holding beast repellent torch, resulting in making distance and then idling if remaining undamaged.
 
void ApproachTarget_OnUnfavorableAttack (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, GOAL_RESULT onGuardResult=GOAL_RESULT_Continue, bool guardSuccessOnEnd_Unused=true, bool xzDistanceOnly=false)
 Approaches target using close proximity mode. Used on AiFunc::IsInterupt(INTERUPT_UnfavorableAttack).
 
void ApproachForBuddy (TARGET moveTarget=TARGET_ENE_0, float stopDistToRelativePos=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, float searchAngleStart=0, float searchAngleWidth=0, float needsApproachDist=0)
 Goal used for summons to approach their owner. When really far (> needsApproachDist + 4), approach the target as normal, otherwise approach a random point around the target as specified by the parameters.
 
void SideWay_On_FailedPath_WhiteGhost (float pathCheckInterval=0)
 Idle sideways until in battle or has path to host.
 
void LiftOff ()
 Execute animation 9520 until either 5 vertical meters away from the target or no longer touching the ground.
 
void Landing (TARGET moveTarget=TARGET_ENE_0, float stopDist=0)
 Land while approaching where the target was when the goal was added.
 
void Landing_Move (float stopDist=0)
 The move portion of Landing.
 
void Landing_Landing ()
 The landing portion of Landing. Executes animation 9510.
 
void ComeDown (float stopDist=0)
 Execute animation 9510 until either touching the ground (goal failure) or within vertical stopDist from TARGET_ENE_0.
 
void KeepDistYAxis (TARGET moveTarget=TARGET_ENE_0, float minDist=0, float maxDist=0, TARGET turnTarget=TARGET_ENE_0)
 Move up and down using AiFunc::SetAttackRequest(705) (when needing to go up) and AiFunc::SetAttackRequest(706) (when needing to go down) until between minDist and maxDist vertically.
 
void ApproachSettingDirection (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, AI_DIR_TYPE directionFromTarget=AI_DIR_TYPE_CENTER, float directionalDistance=0)
 Use pathing to move towards a spherical sector defined by the parameters. Uses MoveToSomewhere.
 
void ApproachAround (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, AI_DIR_TYPE directionFromTarget=AI_DIR_TYPE_CENTER, float directionalDistance=0)
 Approach target. Uses MoveToSomewhere.
 
void LadderAct ()
 Goal when on a ladder, move up and down and adjust on the ladder to reach the current target, handles attacking as well.
 
void DoorAct ()
 Attempts to act on a nearby object such as a door or lever only if AiFunc::IsExistReqObjAct is true.
 
void LadderWait ()
 Idle around a ladder?
 
void AIJump (TARGET jumpTarget=TARGET_ENE_0)
 Jump to target.
 
void LadderMove ()
 Move up and down on a ladder to reach the current target, handles attacking as well.
 
void HoverAdjust ()
 Adjust on ladder using "HoverWarp"?
 
void FadeWarpToInitPos (float fadeTime=0, float unknown_2=0)
 Fade to and warp to init position.
 
void WalkAround_Anywhere (float stopDist=0, float moveLife=0, bool walk=false, int lookAroundAnimId=0, float lookAroundLife=0, int lookAroundAmount=0, bool lookAroundBeforeMove=false, bool resetMovementPoints=false, bool waitWithLookAround=false)
 Walk around then look around, repeat.
 
void Attack (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Turn towards target and execute the animation. Used as a standalone attack. Specifics in CommonAttack.
 
void Guard (int guardStateId=0, TARGET turnTarget=TARGET_ENE_0, GUARD_GOAL_DESIRE_RET onGuardResult=GUARD_GOAL_DESIRE_RET_Continue, bool guardSuccessOnEnd=false)
 Guards. Used by other goals.
 
void ComboAttack (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0, float successAngle=0)
 Turn towards target and execute the animation. Specifics in CommonAttack.
 
void GuardBreakAttack (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Turn towards target and execute the animation. Specifics in CommonAttack.
 
void NonspinningAttack (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Execute the animation. Used as a standalone attack. Specifics in CommonAttack.
 
void ContinueAttack (int animationId=0, TARGET target=TARGET_ENE_0, float constantSuccessDist=0, bool successOnHit=false)
 Add goal scoped team record to attack target. Repeatedly turn to the target and execute the animation until goal life ends.
 
void ApproachStep (int animationId=0, TARGET target=TARGET_ENE_0, float stopDist=0)
 Approach target using steps, SpinStep.
 
void UseItem (int itemIndex=0)
 Use item in the given slot in items shortcut section.
 
void DashAttack (TARGET target=TARGET_ENE_0, float stopDist=0, int animationId=0, int guardStateId=0)
 Run to target and attack.
 
void DashAttack_Attack (TARGET target=TARGET_ENE_0, int animationId=0)
 Attack part of DashAttack.
 
void DashTarget (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, int guardStateId=0, GOAL_RESULT onGuardResult=GOAL_RESULT_Continue, bool guardSuccessOnEnd_Unused=true)
 Run to the target.
 
void NPCStepAttack (TARGET target_Unused, float lightAttackRange=0, float heavyAttackRange=0, int lightOdds=0, bool isLightDualWield=false)
 Attack TARGET_ENE_0 using logic to determine whether to R1 or R2. Uses AttackTunableSpin.
 
void Parry (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0)
 Execute the animation. Specifics in CommonAttack.
 
void SpecialTurn (int animationId=0, TARGET target=TARGET_ENE_0, float stopAngleWidth=0)
 If the target is not within the angle width turn using the animation. Uses AttackTunableSpin.
 
void ObjActTest ()
 Attempts to act on a nearby object such as a door or lever only if AiFunc::IsExistReqObjAct is true.
 
void TeamCallHelp (TARGET turnTarget=TARGET_ENE_0)
 Turn to the target and use the call help action animation (callHelp_CallActionId) as defined by NpcThinkParam. Also call for help at the end of the goal using AiFunc::TeamHelp_Call.
 
void TeamReplyHelp ()
 Goal to use when replying to a call of help. All parameters are in NpcThinkParam.
 
void NpcComboAttack_WithMove (int animationId1=0, int animationId2=0, TARGET target=TARGET_ENE_0, float successDist=0, AI_DIR_TYPE spaceCheckDir1=AI_DIR_TYPE_CENTER, AI_DIR_TYPE spaceCheckDir2=AI_DIR_TYPE_CENTER, int comboLength=1, float spaceCheckDist=0, float turnTime=0, float turnFaceAngle=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Combos attack 1 and 2, choosing the valid one based on a space check, if both are valid randomly choose 50/50.
 
void NpcStanceAttack_WithMove (TARGET target=TARGET_ENE_0, int stanceStartButton=0, float spaceCheckDist=0, float turnTime=0, float turnFaceAngle=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Start moving to a random direction based on the target's distance and enter a stance. If target is closer than 5 meters or farther than 15 goal fails.
 
void CommonAttack (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float successAngle=0, float turnTime=0, float turnFaceAngle=0, bool comboAttack=false, bool moveCancel=false, bool guardBreakAttack=false, bool noTurn=false, float upAngleThreshold=0, float downAngleThreshold=0, bool attackCancel=false)
 Turn towards target and execute the animation, tracking the target. The generic execute animation goal all others use.
 
void ComboRepeat (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Execute the animation. Used after the starting attack. Has ENABLE_COMBO_ATK_CANCEL. Specifics in CommonAttack.
 
void ComboFinal (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Execute the animation. Used as the final attack. Has ENABLE_COMBO_ATK_CANCEL. Specifics in CommonAttack.
 
void AttackTunableSpin (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float turnTime=0, float turnFaceAngle=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Turn towards the target and execute the animation. Specifics in CommonAttack.
 
void ComboAttackTunableSpin (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float turnTime=0, float turnFaceAngle=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Turn towards the target and execute the animation. Used as the starting attack. Specifics in CommonAttack.
 
void ComboAttack_SuccessAngle180 (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Turn towards target and execute the animation. Specifics in CommonAttack.
 
void ComboRepeat_SuccessAngle180 (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Execute the animation. Used after the starting attack. Has ENABLE_COMBO_ATK_CANCEL. Specifics in CommonAttack.
 
void Pursuit (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Execute the animation. Specifics in CommonAttack.
 
void NonspinningComboAttack (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Execute the animation. Specifics in CommonAttack.
 
void NonspinningComboRepeat (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Execute the animation. Used after the starting attack. Has ENABLE_COMBO_ATK_CANCEL. Specifics in CommonAttack.
 
void NonspinningComboFinal (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Execute the animation. Used as the final attack. Has ENABLE_COMBO_ATK_CANCEL. Specifics in CommonAttack.
 
void ComboTunable_SuccessAngle180 (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float turnTime=0, float turnFaceAngle=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Turn towards the target and execute the animation. Used as the starting attack. Specifics in CommonAttack.
 
void GuardBreakTunable (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float turnTime=0, float turnFaceAngle=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Turn towards target and execute the animation. Used as the starting attack. Specifics in CommonAttack.
 
void EXEC_STATE ()
 Undefined.
 
void AttackNonCancel (int animationId=0, TARGET target=TARGET_ENE_0, float successDist=0, float turnTime=0, float turnFaceAngle=0, float upAngleThreshold=0, float downAngleThreshold=0)
 Turn towards the target and execute the animation. Used as a standalone attack. Specifics in CommonAttack.
 
void GOAL_COMMON_CautionStateApproachTarget ()
 Does nothing?
 
void CautionStateApproachTarget_WalkAround (bool execAction=false, float minGoalTimeFrames=0, bool walk=false)
 Walk to free point.
 
void CautionStateApproachTarget_WAEA (bool walk=false)
 Walk to free point and then ExecAction(51).
 
void TargetStateBehavior (int behaviorType=0, int goalOrAction)
 If behaviorType is 0 does nothing, if 3 adds goalOrAction as goal, otherwise ExecAction(goalOrAction).
 
void WeaponChange (int index=0)
 Doesn't work. Use NPC_ATK_ArrowKeyRight and NPC_ATK_ArrowKeyLeft instead.
 
void StepSafety (int frontPriority=0, int backPriority=0, int leftPriority=0, int rightPriority=0, TARGET target=TARGET_ENE_0, float distSpaceCheck=0, float turnTime=0, bool alwaysSuccess=false)
 Decide which direction to step/hop to using space checks, the highest priority valid direction is cohsen. Negative priority makes the direction invalid. Uses SpinStep.
 
void Wait_On_FailedPath (float pathCheckInterval=0)
 Check for a path and if one isn't found then wait and repeat.
 
void Approach_On_FailedPath (float pathCheckInterval=0, TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0)
 Approach target and inbetween check for a path.
 
void WalkAround_On_FailedPath (float pathCheckInterval=0)
 Walk around freely and inbetween check for a path.
 
void BackToHome_On_FailedPath (float pathCheckInterval=0, float enemyReactDist=0)
 Goes back home and inbetween check for a path.
 
void Guard_On_FailedPath (float pathCheckInterval=0, float giveUpTime=0, int guardStateIdGiveUp=0, bool determineSuccessOnHome=false)
 Guard and inbetween check for a path. When giving up approach POINT_INITIAL.
 
void MoveToWaitandSee (float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, float pathCheckInterval=0, float unused_5, float unused_6, float unused_7, bool xzDistanceOnly=false)
 Move to POINT_WaitAndSee and inbetween check for a path. Uniquely, finding a path is a goal failure.
 
void WaypointAct ()
 Undefined.
 
void WaypointAnimTrial (float waypointAttribute=0)
 Uses non existent functions.
 
void AfterAttackAct ()
 Generic battle AfterAttackAct. All params are stored as string indexed numbers. Resulting in either waiting, moving, stepping, guarding etc.
 
void ContinueKeepDist (TARGET moveTarget=TARGET_ENE_0, float minDist, float maxDist, float unused_4=0, int closeGuardOdds=0, int farGuardOdds=0)
 Keeps set distance, approaching when far, leaving when close, and moving sideways otherwise.
 
void GuardBreakCombo (int animationIdGuardBreak=0, int animationIdFollowup=0, TARGET target=TARGET_ENE_0, float successDistFollowup=0, float turnTime=0, float turnFaceAngle=0)
 Attempts to guard break the target, if successful does the follow up attack.
 
void Mount (float stopDist=0, float cantRideCooldown=300)
 Approaches TARGET_RIDE_0 and attempts to mount it. Cooldown is checked in RideRequest in common_func_plan.lua, not in this goal.
 
void Dismount ()
 Attempt to dismount.
 
void MountSub ()
 Goal used in Mount which is responsible for actually mounting.
 
void JumpEndWait ()
 Does nothing. Succeds when AiFunc::IsAiJumping is false.
 
void SetTimerRealtime (int timerIndex=0, float value=0)
 Sets timer.
 
void SetNumberRealtime (int numberIndex=0, float value=0)
 Sets number.
 
void Fall_Asleep (bool forceSleep=false)
 Fall asleep execuing animation 12001.
 
void LeaveTargetToPathEnd (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, GUARD_GOAL_DESIRE_RET onGuardResult=GUARD_GOAL_DESIRE_RET_Continue, bool guardSuccessOnEnd=true, float distSpaceCheck=0)
 Leave the target until you reach the given distance or don't have space in front of self.
 
void LeaveTargetContinuous (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, int guardStateId=0, GUARD_GOAL_DESIRE_RET onGuardResult=GUARD_GOAL_DESIRE_RET_Continue, bool guardSuccessOnEnd=true, float distSpaceCheck=0)
 Leave the target until you reach the given distance or don't have space in front or behind of self.
 
void LeaveTarget_Escape (TARGET moveTarget=TARGET_ENE_0, float stopDist=0, TARGET turnTarget=TARGET_ENE_0, bool walk=false, float stopDistPathPoint=0)
 Turn around and attempt to escape the target, constantly walking away using pathing to not get stuck. If turnTarget isn't self/none it will take priority over turning to pathing point, however this leads to odd behavior around walls.
 
void ErrorNotification (int errorCode=0)
 Does nothing. Meant to print to console.
 

Function Documentation

◆ ActivateNoSubGoal()

void ActivateNoSubGoal ( )

Does nothing.

◆ AfterAttackAct()

void AfterAttackAct ( )

Generic battle AfterAttackAct. All params are stored as string indexed numbers. Resulting in either waiting, moving, stepping, guarding etc.

after_attack_act.lua

◆ AIJump()

void AIJump ( TARGET jumpTarget = TARGET_ENE_0)

Jump to target.

Parameters
jumpTargettarget to jump to

◆ Approach_On_FailedPath()

void Approach_On_FailedPath ( float pathCheckInterval = 0,
TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0 )

Approach target and inbetween check for a path.

approach_on_failed_path.lua

Parameters
pathCheckIntervalinterval in seconds between looking for path
moveTargettarget to move to
stopDistsuccess when reached this distance from moveTarget
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId

◆ ApproachAround()

void ApproachAround ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
AI_DIR_TYPE directionFromTarget = AI_DIR_TYPE_CENTER,
float directionalDistance = 0 )

Approach target. Uses MoveToSomewhere.

approach_around.lua

Parameters
moveTargetorigin of the sphere
stopDistradius of the sphere
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId
directionFromTargetunused because of useDefaultArgs?
directionalDistanceunused because of useDefaultArgs?

◆ ApproachForBuddy()

void ApproachForBuddy ( TARGET moveTarget = TARGET_ENE_0,
float stopDistToRelativePos = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
float searchAngleStart = 0,
float searchAngleWidth = 0,
float needsApproachDist = 0 )

Goal used for summons to approach their owner. When really far (> needsApproachDist + 4), approach the target as normal, otherwise approach a random point around the target as specified by the parameters.

approach_ForBuddy.lua

Parameters
moveTargettarget to move to
stopDistToRelativePosstop approaching the current point when reached this distance from it
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId
searchAngleStartangle start from target's front to search
searchAngleWidthangle width of search (chooses a random angle out of this)
needsApproachDistgoal succeeds when closer to target than this

◆ ApproachSettingDirection()

void ApproachSettingDirection ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
AI_DIR_TYPE directionFromTarget = AI_DIR_TYPE_CENTER,
float directionalDistance = 0 )

Use pathing to move towards a spherical sector defined by the parameters. Uses MoveToSomewhere.

approach_setting_direction.lua

Parameters
moveTargetorigin of the sphere
stopDistradius of the sphere
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId
directionFromTargetdirection from the target's front with which the spherical sector is aligned, width is 180?
directionalDistance

◆ ApproachStep()

void ApproachStep ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float stopDist = 0 )

Approach target using steps, SpinStep.

Parameters
animationIdanimation to execute
targettarget to move to and attack
stopDistsuccess when reached this distance from moveTarget

◆ ApproachTarget()

void ApproachTarget ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
GOAL_RESULT onGuardResult = GOAL_RESULT_Continue,
bool guardSuccessOnEnd_Unused = true,
bool xzDistanceOnly = false )

Approach the target until you reach the given distance.

approach_target.lua - Update, Interrupt are in the exe (those in the lua file are overridden)

Parameters
moveTargettarget to move to
stopDistsuccess when reached this distance from moveTarget
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack
guardSuccessOnEnd_Unuseddoes the guard goal succeed on life end, broken
xzDistanceOnlyshould use xz distance only to calculate distance (no vertical part)

◆ ApproachTarget_OnUnfavorableAttack()

void ApproachTarget_OnUnfavorableAttack ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
GOAL_RESULT onGuardResult = GOAL_RESULT_Continue,
bool guardSuccessOnEnd_Unused = true,
bool xzDistanceOnly = false )

Approaches target using close proximity mode. Used on AiFunc::IsInterupt(INTERUPT_UnfavorableAttack).

guardSuccessOnEnd_Unused is always true due to a mistake (in lua, number 0 like all numbers is equivalent to true).

approach_target_onUnfavorableAttack.lua

Parameters
moveTargettarget to move to
stopDistsuccess when reached this distance from moveTarget
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId
onGuardResultgoal state successfully guarded an attack
guardSuccessOnEnd_Unuseddoes the goal succeed on life end, broken
xzDistanceOnlyshould use xz distance only to calculate distance (no vertical part)

◆ ApproachTarget_ParallelMov()

void ApproachTarget_ParallelMov ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
GUARD_GOAL_DESIRE_RET onGuardResult = GUARD_GOAL_DESIRE_RET_Continue,
bool guardSuccessOnEnd_Unused = true )

Approach the target until you reach the given distance allowing parallel move. See AiFunc::RequestParallelMove.

approach_target_parallelMov.lua

Parameters
moveTargettarget to move to
stopDistsuccess when reached this distance from moveTarget
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack
guardSuccessOnEnd_Unuseddoes the guard goal succeed on life end, broken

◆ ApproachTargetAllDirection()

void ApproachTargetAllDirection ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
GOAL_RESULT onGuardResult = GOAL_RESULT_Continue,
bool guardSuccessOnEnd_Unused = true,
bool xzDistanceOnly = false )

Approach target using all moving direction animations (forward, left, right, back)

guardSuccessOnEnd_Unused is always true due to a mistake (in lua, number 0 like all numbers is equivalent to true).

approach_target_allDirection.lua

Parameters
moveTargetorigin of the sphere
stopDistradius of the sphere
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack
guardSuccessOnEnd_Unuseddoes the guard goal succeed on life end, broken
xzDistanceOnlyshould use xz distance only to calculate distance (no vertical part)

◆ ApproachTargetLifeSuccess()

void ApproachTargetLifeSuccess ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
GOAL_RESULT onGuardResult = GOAL_RESULT_Continue,
bool guardSuccessOnEnd_Unused = true )

Approach the target until you reach the given distance. Goal will be successful on life end.

approach_lifeSuccess.lua

Parameters
moveTargettarget to move to
stopDistsuccess when reached this distance from moveTarget
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack
guardSuccessOnEnd_Unuseddoes the guard goal succeed on life end, broken

◆ Attack()

void Attack ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Turn towards target and execute the animation. Used as a standalone attack. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, 1.5, 20, false, true, false, false, upAngleThreshold, downAngleThreshold, true)

attack.lua

Parameters
animationIdanimation to execute
targettarget to turn to and attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ AttackNonCancel()

void AttackNonCancel ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float turnTime = 0,
float turnFaceAngle = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Turn towards the target and execute the animation. Used as a standalone attack. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, turnTime, turnFaceAngle, false, false, false, false, upAngleThreshold, downAngleThreshold, false)

attack_non_cancel.lua

Parameters
animationIdanimation to execute
targettarget to turn to and attack
successDistgoal fails if target is beyond this distance on goal's end
turnTimetime to turn to the target before executing the animation
turnFaceAngleif target is within this angle width from self's front finish turning early
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ AttackTunableSpin()

void AttackTunableSpin ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float turnTime = 0,
float turnFaceAngle = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Turn towards the target and execute the animation. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, turnTime, turnFaceAngle, false, true, false, false, upAngleThreshold, downAngleThreshold, true)

attack_tunable_spin.lua

Parameters
animationIdanimation to execute
targettarget to attack
successDistgoal fails if target is beyond this distance on goal's end
turnTimetime to turn to the target before executing the animation
turnFaceAngleif target is within this angle width from self's front finish turning early
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ BackToHome()

void BackToHome ( float enemyReactDist = 0,
bool forceBattleGoalOnHit = false,
float unused_3,
float unused_4,
TARGET moveTarget = POINT_MOVE_POINT )

Go back home.

Parameters
enemyReactDisttargets within this distance can be reacted to
forceBattleGoalOnHitis forced to enter battle goal when hit
unused_3
unused_4
moveTargettarget to move to

◆ BackToHome_On_FailedPath()

void BackToHome_On_FailedPath ( float pathCheckInterval = 0,
float enemyReactDist = 0 )

Goes back home and inbetween check for a path.

back_to_home_on_failed_path.lua

Parameters
pathCheckIntervalinterval in seconds between looking for path
enemyReactDisttargets within this distance can be reacted to

◆ CautionStateApproachTarget_WAEA()

void CautionStateApproachTarget_WAEA ( bool walk = false)

Walk to free point and then ExecAction(51).

Parameters
walkis walk or run

◆ CautionStateApproachTarget_WalkAround()

void CautionStateApproachTarget_WalkAround ( bool execAction = false,
float minGoalTimeFrames = 0,
bool walk = false )

Walk to free point.

Parameters
execActionif true then use CautionStateApproachTarget_WAEA instead of WalkAround
minGoalTimeFrameshas to walk around at least this many frames
walkis walk or run

◆ ComboAttack()

void ComboAttack ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0,
float successAngle = 0 )

Turn towards target and execute the animation. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, successAngle, 1.5, 20, true, true, false, false, upAngleThreshold, downAngleThreshold, true)

combo_attack.lua

Parameters
animationIdanimation to execute
targettarget to turn to and attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId
successAnglegoal fails if target is beyond this angle width from self's front on goal's end

◆ ComboAttack_SuccessAngle180()

void ComboAttack_SuccessAngle180 ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Turn towards target and execute the animation. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, 1.5, 20, true, true, false, false, upAngleThreshold, downAngleThreshold, true)

combo_attack_success_angle180.lua

Parameters
animationIdanimation to execute
targettarget to turn to and attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ ComboAttackTunableSpin()

void ComboAttackTunableSpin ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float turnTime = 0,
float turnFaceAngle = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Turn towards the target and execute the animation. Used as the starting attack. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 90, turnTime, turnFaceAngle, true, true, false, false, upAngleThreshold, downAngleThreshold, true)

combo_attack_tunable_spin.lua

Parameters
animationIdanimation to execute
targettarget to turn to and attack
successDistgoal fails if target is beyond this distance on goal's end
turnTimetime to turn to the target before executing the animation
turnFaceAngleif target is within this angle width from self's front finish turning early
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ ComboFinal()

void ComboFinal ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Execute the animation. Used as the final attack. Has ENABLE_COMBO_ATK_CANCEL. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, 0, 90, false, true, false, false, upAngleThreshold, downAngleThreshold, true)

combo_final.lua

Parameters
animationIdanimation to execute
targettarget to attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ ComboRepeat()

void ComboRepeat ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Execute the animation. Used after the starting attack. Has ENABLE_COMBO_ATK_CANCEL. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 90, 0, 90, true, true, false, false, upAngleThreshold, downAngleThreshold, true)

combo_repeat.lua

Parameters
animationIdanimation to execute
targettarget to attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ ComboRepeat_SuccessAngle180()

void ComboRepeat_SuccessAngle180 ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Execute the animation. Used after the starting attack. Has ENABLE_COMBO_ATK_CANCEL. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, 0, 90, true, true, false, false, upAngleThreshold, downAngleThreshold, true)

combo_repeat_success_angle180.lua

Parameters
animationIdanimation to execute
targettarget to attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ ComboTunable_SuccessAngle180()

void ComboTunable_SuccessAngle180 ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float turnTime = 0,
float turnFaceAngle = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Turn towards the target and execute the animation. Used as the starting attack. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, turnTime, turnFaceAngle, true, true, false, false, upAngleThreshold, downAngleThreshold, true)

combo_tunable_success_angle180.lua

Parameters
animationIdanimation to execute
targettarget to turn to and attack
successDistgoal fails if target is beyond this distance on goal's end
turnTimetime to turn to the target before executing the animation
turnFaceAngleif target is within this angle width from self's front finish turning early
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ ComeDown()

void ComeDown ( float stopDist = 0)

Execute animation 9510 until either touching the ground (goal failure) or within vertical stopDist from TARGET_ENE_0.

come_down.lua

Parameters
stopDistreach this distance from TARGET_ENE_0

◆ CommonAttack()

void CommonAttack ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float successAngle = 0,
float turnTime = 0,
float turnFaceAngle = 0,
bool comboAttack = false,
bool moveCancel = false,
bool guardBreakAttack = false,
bool noTurn = false,
float upAngleThreshold = 0,
float downAngleThreshold = 0,
bool attackCancel = false )

Turn towards target and execute the animation, tracking the target. The generic execute animation goal all others use.

Goal ends based on its cancel parameters, and succeeds or fails based on the success parameters.

Goal ends when AiFunc::IsFinishAttack is true.

Goal succeeds if AiFunc::IsHitAttack is true unless otherwise stated.

common_attack.lua - Activate, Update are in the exe (those in the lua file are overridden), Terminate is in the exe, lua Terminate executes after

Parameters
animationIdanimation to execute, animation offset is added; uses EzStateID
targettarget to turn to and attack
successDistgoal fails if target is beyond this distance on goal's end
successAnglegoal fails if target is beyond this angle width from self's front on goal's end, multiply by 2
turnTimetime to turn to the target before executing the animation
turnFaceAngleif target is within this angle width from self's front finish turning early
comboAttackallows the parent's next goal to end this goal when AiFunc::IsEnableComboAttack is true if that next goal has ENABLE_COMBO_ATK_CANCEL
moveCancelends goal when AiFunc::IsEnableCancelMove is true or when AiFunc::IsEnableCancelStep is true
guardBreakAttackgoal can only succeed if INTERUPT_GuardBreak occured while it ran
noTurnremoves turning before executing animation
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId
attackCancelends goal when AiFunc::IsEnableCancelAttack is true

◆ ContinueAttack()

void ContinueAttack ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float constantSuccessDist = 0,
bool successOnHit = false )

Add goal scoped team record to attack target. Repeatedly turn to the target and execute the animation until goal life ends.

continue_attack.lua

Parameters
animationIdanimation to execute
targettarget to turn to and attack
constantSuccessDistgoal fails when target is farther than this
successOnHitshould goal succeed on a successful hit

◆ ContinueKeepDist()

void ContinueKeepDist ( TARGET moveTarget = TARGET_ENE_0,
float minDist,
float maxDist,
float unused_4 = 0,
int closeGuardOdds = 0,
int farGuardOdds = 0 )

Keeps set distance, approaching when far, leaving when close, and moving sideways otherwise.

continue_keepdist.lua

Parameters
moveTargettarget to move around
minDistminimum distance to be within
maxDistmaximum distance to be within
unused_4
closeGuardOddspercentage chance to guard when closer than minDist
farGuardOddspercentage chance to guard when farther than maxDist

◆ DashAttack()

void DashAttack ( TARGET target = TARGET_ENE_0,
float stopDist = 0,
int animationId = 0,
int guardStateId = 0 )

Run to target and attack.

npc_subgoals.lua

Parameters
targettarget to approach and attack
stopDistapproach to this distance from the target
animationIdanimation to execute
guardStateIdguard EZStateId

◆ DashAttack_Attack()

void DashAttack_Attack ( TARGET target = TARGET_ENE_0,
int animationId = 0 )

Attack part of DashAttack.

npc_subgoals.lua

Parameters
targettarget to approach and attack
animationIdanimation to execute

◆ DashTarget()

void DashTarget ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
int guardStateId = 0,
GOAL_RESULT onGuardResult = GOAL_RESULT_Continue,
bool guardSuccessOnEnd_Unused = true )

Run to the target.

npc_subgoals.lua

Parameters
moveTargettarget to move to
stopDistsuccess when reached this distance from moveTarget
turnTargettarget to turn to
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack
guardSuccessOnEnd_Unuseddoes the guard goal succeed on life end, broken

◆ Dismount()

void Dismount ( )

Attempt to dismount.

dismount.lua

◆ DoorAct()

void DoorAct ( )

Attempts to act on a nearby object such as a door or lever only if AiFunc::IsExistReqObjAct is true.

door_act.lua

◆ ErrorNotification()

void ErrorNotification ( int errorCode = 0)

Does nothing. Meant to print to console.

Error code 0: "エラーゴール通知:戦闘行動として定義されていないActが選択されました。定義していない行動に確率が設定されていないか確認してください | Error goal notification: An Act was selected that is not defined as a combat action. Check whether a probability is set for an action that has not been defined."

Other: "エラーゴール通知:例外エラーが呼ばれました | Error goal notification: exception error called"

leave_target_continuous.lua

Parameters
errorCodeerror code

◆ EXEC_STATE()

void EXEC_STATE ( )

Undefined.

◆ ExecAction()

void ExecAction ( int action = 0)

Executes unknown action.

Parameters
action

◆ FadeWarpToInitPos()

void FadeWarpToInitPos ( float fadeTime = 0,
float unknown_2 = 0 )

Fade to and warp to init position.

Parameters
fadeTimetime in seconds it takes to fully fade and then warp
unknown_2

◆ Fall()

void Fall ( TARGET stopTarget = TARGET_ENE_0,
int ezStateIdFall = 0,
int ezStateIdStop = 0,
float stopDistY = 0 )

Unused goal, perhaps for when an enemy can choose to "fall" in a specific manner (such as a bird)

fall.lua

Parameters
stopTargettarget to comapre distance to
ezStateIdFallfalling animation
ezStateIdStopstop falling animation
stopDistYstops when at this distance from stopTarget

◆ Fall_Asleep()

void Fall_Asleep ( bool forceSleep = false)

Fall asleep execuing animation 12001.

fall_asleep.lua

Parameters
forceSleepif not true first approach POINT_INIT_POSE, then sleep

◆ FlexibleSideWayMove()

void FlexibleSideWayMove ( int leftPriority = 0,
int rightPriority = 0,
TARGET moveTarget = TARGET_ENE_0,
float distSpaceCheck = 0,
float angleThreshold = 0,
int guardOdds = 0,
float minDist = 0,
float maxDist = 0 )

Move around the target going to the highest priority direction that is space-valid. Negative priority makes that option invalid.

flexible_sideway.lua

Parameters
leftPriorityleft sideway move priority
rightPriorityright sideway move priority
moveTargettarget to move to
distSpaceCheckdistance from target in the given direction to check for space
angleThresholdangle threshold for sideway move goal
guardOddspercentage to guard
minDistif target is closer than this, goal succeeds
maxDistif target is farther than this, goal succeeds

◆ FollowPathExecAction()

void FollowPathExecAction ( int action = 0,
TARGET moveTarget = TARGET_ENE_0,
AI_DIR_TYPE directionFromTarget = AI_DIR_TYPE_CENTER,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
float directionalDistance = 0 )

Executes unknown action while following path. Running, if possible.

Parameters
action
moveTargetorigin of the sphere
directionFromTargetdirection from the target's front with which the spherical sector is aligned, width is 180?
stopDistradius of the sphere
turnTargettarget to turn to
directionalDistance

◆ GOAL_COMMON_CautionStateApproachTarget()

void GOAL_COMMON_CautionStateApproachTarget ( )

Does nothing?

◆ Guard()

void Guard ( int guardStateId = 0,
TARGET turnTarget = TARGET_ENE_0,
GUARD_GOAL_DESIRE_RET onGuardResult = GUARD_GOAL_DESIRE_RET_Continue,
bool guardSuccessOnEnd = false )

Guards. Used by other goals.

Some goals inaccurately first transform their own onGuardResult to GOAL_RESULT before calling this.

Parameters
guardStateIdguard EZStateId
turnTargettarget to turn to
onGuardResultgoal state successfully guarded an attack
guardSuccessOnEnddoes the guard goal succeed on life end

◆ Guard_On_FailedPath()

void Guard_On_FailedPath ( float pathCheckInterval = 0,
float giveUpTime = 0,
int guardStateIdGiveUp = 0,
bool determineSuccessOnHome = false )

Guard and inbetween check for a path. When giving up approach POINT_INITIAL.

guard_on_failed_path.lua

Parameters
pathCheckIntervalinterval in seconds between looking for path
giveUpTimetime until giving up forcing idling
guardStateIdGiveUpguard EZStateId for approaching initial point when giving up
determineSuccessOnHomedetermine success of goal based on distance from home

◆ GuardBreakAttack()

void GuardBreakAttack ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Turn towards target and execute the animation. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 90, 1.5, 20, true, true, true, false, upAngleThreshold, downAngleThreshold, true)

gaurd_break_attack.lua

Parameters
animationIdanimation to execute
targettarget to turn to and attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ GuardBreakCombo()

void GuardBreakCombo ( int animationIdGuardBreak = 0,
int animationIdFollowup = 0,
TARGET target = TARGET_ENE_0,
float successDistFollowup = 0,
float turnTime = 0,
float turnFaceAngle = 0 )

Attempts to guard break the target, if successful does the follow up attack.

guard_break_combo.lua

Parameters
animationIdGuardBreakattack that is meant to guard breaks
animationIdFollowupfollow up attack
targettarget to attack
successDistFollowupfor follow up goal, fails if target is beyond this distance on goal's end
turnTimetime to turn to the target before executing the animation
turnFaceAngleif target is within this angle width from self's front finish turning early

◆ GuardBreakTunable()

void GuardBreakTunable ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float turnTime = 0,
float turnFaceAngle = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Turn towards target and execute the animation. Used as the starting attack. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 90, turnTime, turnFaceAngle, true, true, true, false, upAngleThreshold, downAngleThreshold, true)

gaurd_break_tunable.lua

Parameters
animationIdanimation to execute
targettarget to turn to and attack
successDistgoal fails if target is beyond this distance on goal's end
turnTimetime to turn to the target before executing the animation
turnFaceAngleif target is within this angle width from self's front finish turning early
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ HoverAdjust()

void HoverAdjust ( )

Adjust on ladder using "HoverWarp"?

◆ If()

void If ( int codeNo = 0)

Calls function OnIf_<BATTLEGOALID> with args (ai, goal, codeNo)

if.lua

Parameters
codeNopassed as the third argument of the OnIf function

◆ JumpEndWait()

void JumpEndWait ( )

Does nothing. Succeds when AiFunc::IsAiJumping is false.

◆ KeepDist()

void KeepDist ( TARGET moveTarget = TARGET_ENE_0,
float minDist = 0,
float maxDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
GUARD_GOAL_DESIRE_RET onGuardResult = GUARD_GOAL_DESIRE_RET_Continue,
bool guardSuccessOnEnd = false )

Approach or leave the target until within the given range.

Parameters
moveTargettarget to move to/from
minDistminimum distance to be within
maxDistmaximum distance to be within
walkis walk or run
turnTargettarget to turn to
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack
guardSuccessOnEnddoes the guard goal succeed on life end

◆ KeepDistYAxis()

void KeepDistYAxis ( TARGET moveTarget = TARGET_ENE_0,
float minDist = 0,
float maxDist = 0,
TARGET turnTarget = TARGET_ENE_0 )

Move up and down using AiFunc::SetAttackRequest(705) (when needing to go up) and AiFunc::SetAttackRequest(706) (when needing to go down) until between minDist and maxDist vertically.

keep_dist_yaxis.lua

Parameters
moveTargettarget to move around
minDistminimum vertical distance to be within
maxDistmaximum vertical distance to be within
turnTargettarget to turn to

◆ LadderAct()

void LadderAct ( )

Goal when on a ladder, move up and down and adjust on the ladder to reach the current target, handles attacking as well.

ladder_act.lua

◆ LadderMove()

void LadderMove ( )

Move up and down on a ladder to reach the current target, handles attacking as well.

◆ LadderWait()

void LadderWait ( )

Idle around a ladder?

ladder_wait.lua

◆ Landing()

void Landing ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0 )

Land while approaching where the target was when the goal was added.

landing.lua

Parameters
moveTargettarget to move to
stopDistreach this distance from moveTarget's original position

◆ Landing_Landing()

void Landing_Landing ( )

The landing portion of Landing. Executes animation 9510.

landing.lua

◆ Landing_Move()

void Landing_Move ( float stopDist = 0)

The move portion of Landing.

landing.lua

Parameters
stopDistreach this distance from moveTarget's original position

◆ LeaveTarget()

void LeaveTarget ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
GUARD_GOAL_DESIRE_RET onGuardResult = GUARD_GOAL_DESIRE_RET_Continue,
bool guardSuccessOnEnd = true )

Leave the target until you reach the given distance.

If reached obstacle/wall goal ends early and succeeds.

Parameters
moveTargettarget to move from
stopDistsuccess when reached this distance from moveTarget
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack
guardSuccessOnEnddoes the guard goal succeed on life end

◆ LeaveTarget_Escape()

void LeaveTarget_Escape ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
float stopDistPathPoint = 0 )

Turn around and attempt to escape the target, constantly walking away using pathing to not get stuck. If turnTarget isn't self/none it will take priority over turning to pathing point, however this leads to odd behavior around walls.

Parameters
moveTargettarget to move from
stopDistsuccess when reached this distance from moveTarget
turnTargettarget to turn to
walkis walk or run
stopDistPathPointfind new pathing point when this distance away from current one

◆ LeaveTargetContinuous()

void LeaveTargetContinuous ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
GUARD_GOAL_DESIRE_RET onGuardResult = GUARD_GOAL_DESIRE_RET_Continue,
bool guardSuccessOnEnd = true,
float distSpaceCheck = 0 )

Leave the target until you reach the given distance or don't have space in front or behind of self.

leave_target_continuous.lua

Parameters
moveTargettarget to move from
stopDistsuccess when reached this distance from moveTarget
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack
guardSuccessOnEnddoes the guard goal succeed on life end
distSpaceCheckfree space needed in meters

◆ LeaveTargetToPathEnd()

void LeaveTargetToPathEnd ( TARGET moveTarget = TARGET_ENE_0,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
int guardStateId = 0,
GUARD_GOAL_DESIRE_RET onGuardResult = GUARD_GOAL_DESIRE_RET_Continue,
bool guardSuccessOnEnd = true,
float distSpaceCheck = 0 )

Leave the target until you reach the given distance or don't have space in front of self.

leave_target_to_path_end.lua

Parameters
moveTargettarget to move from
stopDistsuccess when reached this distance from moveTarget
turnTargettarget to turn to
walkis walk or run
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack
guardSuccessOnEnddoes the guard goal succeed on life end
distSpaceCheckfree space needed in meters

◆ LiftOff()

void LiftOff ( )

Execute animation 9520 until either 5 vertical meters away from the target or no longer touching the ground.

landing.lua

◆ Mount()

void Mount ( float stopDist = 0,
float cantRideCooldown = 300 )

Approaches TARGET_RIDE_0 and attempts to mount it. Cooldown is checked in RideRequest in common_func_plan.lua, not in this goal.

mount.lua

Parameters
stopDiststop when reached this distance from TARGET_RIDE_0
cantRideCooldowncooldown between possible ride attempts

◆ MountSub()

void MountSub ( )

Goal used in Mount which is responsible for actually mounting.

mount.lua

◆ MoveFollowPathSpecifyPos()

void MoveFollowPathSpecifyPos ( TARGET moveTarget = TARGET_ENE_0,
AI_DIR_TYPE directionFromTarget = AI_DIR_TYPE_CENTER,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
float directionalDistance = 0,
float x = 0,
float y = 0,
float z = 0 )

◆ MoveFreeSpace()

void MoveFreeSpace ( )

Undefined.

◆ MoveGetwellSpace()

void MoveGetwellSpace ( int leavePriority = 0,
int leftPriority = 0,
int rightPriority = 0,
TARGET turnTarget_Unused,
float distSpaceCheck = 0,
float leaveStopDist = 0 )

Move around TARGET_ENE_0 going to the highest priority direction that is space-valid. Negative priority makes that option invalid.

May be broken by being created as CSGoalMoveToSomewhere_SmoothCircling?

move_getwell_space.lua

Parameters
leavePriorityleave target priority
leftPriorityleft sideway move priority
rightPriorityright sideway move priority
turnTarget_Unused
distSpaceCheckdistance from target in the given direction to check for space
leaveStopDiststop distance if leaving the target

◆ MoveTargetRelationPos()

void MoveTargetRelationPos ( TARGET moveTarget = TARGET_ENE_0,
AI_DIR_TYPE directionFromTarget = AI_DIR_TYPE_CENTER,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
float directionalDistance = 0,
float interceptAngle = 0 )

◆ MoveToMovePointAir()

void MoveToMovePointAir ( TARGET moveTarget = TARGET_ENE_0,
float unused_2,
AI_DIR_TYPE directionFromTarget = AI_DIR_TYPE_CENTER )

Sets fixed position move target via AiFunc::SetAIFixedMoveTarget.

move_movepoint_air.lua

Parameters
moveTargettarget to move to
unused_2
directionFromTargetdirection from target's front to align other params with

◆ MoveToMultiPoint()

void MoveToMultiPoint ( float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
unsigned int point1 = 0,
unsigned int point2 = 0,
unsigned int point3 = 0,
unsigned int point4 = 0,
unsigned int point5 = 0,
unsigned int point6 = 0,
unsigned int point7 = 0,
unsigned int point8 = 0,
unsigned int point9 = 0,
unsigned int point10 = 0 )

Move to the given event (region) points as a path from the closest point to the next, does not work, uses non existent goal and wrong logic.

move_to_point.lua

Parameters
stopDistsuccess when reached this distance from last point
turnTargettarget to turn to
walkis walk or run
point1event region point 1
point2event region point 2
point3event region point 3
point4event region point 4
point5event region point 5
point6event region point 6
point7event region point 7
point8event region point 8
point9event region point 9
point10event region point 10

◆ MoveToPossibleDirection()

void MoveToPossibleDirection ( TARGET target = TARGET_ENE_0,
TARGET turnTarget = TARGET_ENE_0,
float wantDist = 0,
float angleWidth = 0,
float intervalOfAngles = 0,
int runOdds = 0,
int guardOdds = 0,
float stopDist = 0 )

Complex goal that searches an angle width, starting from the angle to the target, for the straight line that has enough space for the character to walk to uninterrupted.

Lines are ordered such that the one that has the closest distance (or more) to wantDist wins.

move_possible_direction.lua

Parameters
targetreference target
turnTargettarget to turn to
wantDistuninterrupted straight distance it wants, distance that exceeds this is equivalent to this
angleWidthangle width to search
intervalOfAnglesgranular accuracy of angle width search
runOddspercentage chance to run
guardOddspercentage chance to guard
stopDiststopDist for the approach target subgoal

◆ MoveToSomewhere()

void MoveToSomewhere ( TARGET moveTarget = TARGET_ENE_0,
AI_DIR_TYPE directionFromTarget = AI_DIR_TYPE_CENTER,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
float directionalDistance = 0,
float unused_7,
bool xzDistanceOnly = false,
bool useDefaultArgs = false,
bool closeProximityMode = false )

Use pathing to move towards a spherical sector defined by the parameters.

Uses AiFunc::FollowPath.

Parameters
moveTargetorigin of the sphere
directionFromTargetdirection from the target's front with which the spherical sector is aligned, width is 180?
stopDistradius of the sphere
turnTargettarget to turn to
walkis walk or run
directionalDistance
unused_7
xzDistanceOnlyshould use xz distance only to calculate distance (no vertical part)
useDefaultArgsis use default args of directionFromTarget = center and directionalDistance = 0
closeProximityMode

◆ MoveToSomewhere_RouteMove()

void MoveToSomewhere_RouteMove ( TARGET moveTarget = TARGET_ENE_0,
AI_DIR_TYPE directionFromTarget = AI_DIR_TYPE_CENTER,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
float directionalDistance = 0,
bool xzDistanceOnly = false,
bool useDefaultArgs = false,
bool closeProximityMode )

Use pathing to move towards a spherical sector defined by the parameters.

Uses AiFunc::FollowPath.

Parameters
moveTargetorigin of the sphere
directionFromTargetdirection from the target's front with which the spherical sector is aligned, width is 180?
stopDistradius of the sphere
turnTargettarget to turn to
walkis walk or run
directionalDistance
xzDistanceOnlyshould use xz distance only to calculate distance (no vertical part)
useDefaultArgsis use default args of directionFromTarget = center and directionalDistance = 0
closeProximityMode

◆ MoveToSomewhere_SpecifyMove()

void MoveToSomewhere_SpecifyMove ( TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
float unused_3,
int pointIndex = 0 )

Used for pathing. Move to the given point.

Parameters
turnTargettarget to turn to
walkis walk or run
unused_3
pointIndexroute point to move to

◆ MoveToSomewhere_SwitchRouteMove()

void MoveToSomewhere_SwitchRouteMove ( TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
float directionalDistance = 0,
bool forceAndForgoCalculations = false )

Use current pathing data to figure out how to reposition for next route point.

Parameters
turnTargettarget to turn to
walkis walk or run
directionalDistance
forceAndForgoCalculationsignore current pathing and forward arguments to MoveGetWellSpace

◆ MoveToSomewhereSmooth()

void MoveToSomewhereSmooth ( TARGET moveTarget = TARGET_ENE_0,
AI_DIR_TYPE directionFromTarget = AI_DIR_TYPE_CENTER,
float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
float directionalDistance = 0 )

Move to the target in a point route "smoothly" using route and switch route goals.

Uses AiFunc::FollowPath. Use pathing to move towards a spherical sector defined by the parameters. See MoveToSomewhere_SwitchRouteMove, MoveToSomewhere_RouteMove

Parameters
moveTargetorigin of the sphere
directionFromTargetdirection from the target's front with which the spherical sector is aligned, width is 180?
stopDistradius of the sphere
turnTargettarget to turn to
walkis walk or run
directionalDistance

◆ MoveToSomewhereSmoothFly()

void MoveToSomewhereSmoothFly ( )

Undefined.

◆ MoveToSomewhereSmoothFly_Circling()

void MoveToSomewhereSmoothFly_Circling ( )

Undefined.

◆ MoveToWaitandSee()

void MoveToWaitandSee ( float stopDist = 0,
TARGET turnTarget = TARGET_ENE_0,
bool walk = false,
float pathCheckInterval = 0,
float unused_5,
float unused_6,
float unused_7,
bool xzDistanceOnly = false )

Move to POINT_WaitAndSee and inbetween check for a path. Uniquely, finding a path is a goal failure.

guard_on_failed_path.lua

Parameters
stopDistreach this distance from POINT_WaitAndSee
turnTargettarget to turn to
walkis walk or run
pathCheckIntervalinterval in seconds between looking for path
unused_5
unused_6
unused_7
xzDistanceOnlyshould use xz distance only to calculate distance (no vertical part)

◆ NonBattleAct()

void NonBattleAct ( float enemyReactDist = 0,
bool reactToEnemy = false,
bool run = false,
TARGET turnTarget = TARGET_ENE_0,
float homeStopDist = 0,
int standbyGoalId = 0,
bool forceBattleGoalOnHit = false )

Every entity either has a battle goal active, or this "non" battle goal active (handles routing, and other idle behaviors).

non_battle_act.lua - Update is in exe (the one in the lua file is overridden)

Parameters
enemyReactDisttargets within this distance can be reacted to
reactToEnemyshould react to enemies
runis run or walk
turnTargettarget to turn to
homeStopDiststop when at this distance from home
standbyGoalIdgoal to use when on standbyt (no params)
forceBattleGoalOnHitis forced to enter battle goal when hit

◆ NonspinningAttack()

void NonspinningAttack ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Execute the animation. Used as a standalone attack. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, 0, 180, false, true, false, true, upAngleThreshold, downAngleThreshold, true)

nonspinning_attack.lua

Parameters
animationIdanimation to execute
targettarget to attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ NonspinningComboAttack()

void NonspinningComboAttack ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Execute the animation. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, 0, 180, true, true, false, true, upAngleThreshold, downAngleThreshold, true)

nonspinning_combo_attack.lua

Parameters
animationIdanimation to execute
targettarget to attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ NonspinningComboFinal()

void NonspinningComboFinal ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Execute the animation. Used as the final attack. Has ENABLE_COMBO_ATK_CANCEL. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, 0, 180, false, true, false, true, upAngleThreshold, downAngleThreshold, true)

nonspinning_combo_final.lua

Parameters
animationIdanimation to execute
targettarget to attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ NonspinningComboRepeat()

void NonspinningComboRepeat ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Execute the animation. Used after the starting attack. Has ENABLE_COMBO_ATK_CANCEL. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, 0, 180, true, true, false, true, upAngleThreshold, downAngleThreshold, true)

nonspinning_combo_repeat.lua

Parameters
animationIdanimation to execute
targettarget to attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ Normal()

void Normal ( )

A very basic "default" battle goal.

normal.lua

◆ NpcComboAttack_WithMove()

void NpcComboAttack_WithMove ( int animationId1 = 0,
int animationId2 = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
AI_DIR_TYPE spaceCheckDir1 = AI_DIR_TYPE_CENTER,
AI_DIR_TYPE spaceCheckDir2 = AI_DIR_TYPE_CENTER,
int comboLength = 1,
float spaceCheckDist = 0,
float turnTime = 0,
float turnFaceAngle = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Combos attack 1 and 2, choosing the valid one based on a space check, if both are valid randomly choose 50/50.

npc_comboattack_withmove.lua

Parameters
animationId1animation 1 to execute
animationId2animation 2 to execute
targettarget to turn to and attack
successDistgoal fails if target is beyond this distance on attack goal's end
spaceCheckDir1direction to check for space for attack 1
spaceCheckDir2direction to check for space for attack 2
comboLengthlength of combo
spaceCheckDistfree space needed in meters for attacks
turnTimetime to turn to the target before executing the animation
turnFaceAngleif target is within this angle width from self's front finish turning early
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ NpcStanceAttack_WithMove()

void NpcStanceAttack_WithMove ( TARGET target = TARGET_ENE_0,
int stanceStartButton = 0,
float spaceCheckDist = 0,
float turnTime = 0,
float turnFaceAngle = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Start moving to a random direction based on the target's distance and enter a stance. If target is closer than 5 meters or farther than 15 goal fails.

npc_stanceattack_withmove.lua

Parameters
targettarget to turn to move around and attack
stanceStartButtonEzStateID for starting stance attack
spaceCheckDistfree space needed in meters for attack
turnTimetime to turn to the target before executing the animation
turnFaceAngleif target is within this angle width from self's front finish turning early
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ NPCStepAttack()

void NPCStepAttack ( TARGET target_Unused,
float lightAttackRange = 0,
float heavyAttackRange = 0,
int lightOdds = 0,
bool isLightDualWield = false )

Attack TARGET_ENE_0 using logic to determine whether to R1 or R2. Uses AttackTunableSpin.

npc_step_attack.lua

Parameters
target_Unusedtarget to attack ignored, always TARGET_ENE_0
lightAttackRangemaximum distance allowed for light attack
heavyAttackRangemaximum distance allowed for heavy attack
lightOddsif both light and heavy are within range, this is the percentage chance to use light attack
isLightDualWieldshould light attack be a dual wield attack

◆ ObjActTest()

void ObjActTest ( )

Attempts to act on a nearby object such as a door or lever only if AiFunc::IsExistReqObjAct is true.

obj_act.lua

◆ Parry()

void Parry ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0 )

Execute the animation. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, 1.5, 10, true, true, true, false, 0, 0, true)

Parameters
animationIdanimation to execute
targettarget to turn to and attack
successDistgoal fails if target is beyond this distance on goal's end

◆ Pursuit()

void Pursuit ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float successDist = 0,
float upAngleThreshold = 0,
float downAngleThreshold = 0 )

Execute the animation. Specifics in CommonAttack.

CommonAttack(animationId, target, successDist, 180, 0, 90, false, true, false, false, upAngleThreshold, downAngleThreshold, true)

pursuit.lua

Parameters
animationIdanimation to execute
targettarget to attack
successDistgoal fails if target is beyond this distance on goal's end
upAngleThresholdif above 0: if target is above this angle add 1000 to the animationId
downAngleThresholdif above 0: if target is below this angle add 1100 to the animationId

◆ SetNumberRealtime()

void SetNumberRealtime ( int numberIndex = 0,
float value = 0 )

Sets number.

set_number_realtime.lua

Parameters
numberIndexnumber to set
valueset the number to this

◆ SetTimerRealtime()

void SetTimerRealtime ( int timerIndex = 0,
float value = 0 )

Sets timer.

set_timer_realtime.lua

Parameters
timerIndextimer to set
valueset the timer to this

◆ SideWay_For_Fear_Of_Fire()

void SideWay_For_Fear_Of_Fire ( float stopDist = 0,
int guardStateId = 0,
bool canGoSideways = false )

Handles when TARGET_ENE_0 is holding beast repellent torch, resulting in making distance and then idling if remaining undamaged.

sideway_for_fear_of_fire.lua

Parameters
stopDiststopDist for the leave target subgoal, can't be lower than 4 and 2 is added
guardStateIdguard EZStateId
canGoSidewaysafter leaving, if false waits, if true sideway move

◆ SideWay_On_FailedPath()

void SideWay_On_FailedPath ( float pathCheckInterval = 0,
int giveupAction = 0,
int giveupAttackLife = 0,
float giveupAttackCooldown = 0,
float giveUpTime = 0,
bool isGuard = false,
bool determineSuccessOnHome = false )

Idling when failing a path based on a large number of variables, occasionally attacking.

Used in common logic.

sideway_on_failed_path.lua

Parameters
pathCheckIntervalinterval in seconds between looking for path
giveupAction-1 is none, 1 is waiting, otherwise it's an animation id
giveupAttackLifegoal life for giveup attack
giveupAttackCooldowncooldown between give up attacks
giveUpTimetime until giving up forcing idling
isGuardis guard
determineSuccessOnHomedetermine success of goal based on distance from home

◆ SideWay_On_FailedPath_WhiteGhost()

void SideWay_On_FailedPath_WhiteGhost ( float pathCheckInterval = 0)

Idle sideways until in battle or has path to host.

sideway_on_failed_path_white_ghost.lua

Parameters
pathCheckIntervalinterval in seconds between looking for path

◆ SidewayMove()

void SidewayMove ( TARGET moveTarget = TARGET_ENE_0,
bool right = false,
float angleThreshold = 0,
bool walk = false,
bool successOnEnd = true,
int guardStateId = 0,
GUARD_GOAL_DESIRE_RET onGuardResult = GUARD_GOAL_DESIRE_RET_Continue )

Circle the target until the AI rotated enough to have their original look direction within their current direction view as given by angleThreshold.

Confusing, sets ReferenceDirection on start and checks AiFunc::CheckTurnAngleDiff until success.

Parameters
moveTargettarget to move around
rightmove right or left
angleThresholdangle to cross
walkis walk or run
successOnEnddoes the goal succeed on life end
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack

◆ SidewayMoveAng()

void SidewayMoveAng ( TARGET moveTarget = TARGET_ENE_0,
float moveAngle = 0,
float angleThreshold = 0,
bool walk = false,
bool successOnEnd = true,
int guardStateId = 0,
GUARD_GOAL_DESIRE_RET onGuardResult = GUARD_GOAL_DESIRE_RET_Continue )

Circle the target until the AI rotated enough to have their original look direction within their current direction view as given by angleThreshold.

Confusing, sets ReferenceDirection on start and checks AiFunc::CheckTurnAngleDiff until success.

moveAngle replaces right/left.

Parameters
moveTargettarget to move around
moveAnglewhich angle to move to
angleThresholdangle to cross
walkis walk or run
successOnEnddoes the goal succeed on life end
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack

◆ SidewayMoveAvoidChr()

void SidewayMoveAvoidChr ( TARGET moveTarget = TARGET_ENE_0,
bool right = false,
float angleThreshold = 0,
bool walk = false,
bool successOnEnd = true,
int guardStateId = 0,
GUARD_GOAL_DESIRE_RET onGuardResult = GUARD_GOAL_DESIRE_RET_Continue )

Circle the target until the AI rotated enough to have their original look direction within their current direction view as given by angleThreshold.

Confusing, sets ReferenceDirection on start and checks AiFunc::CheckTurnAngleDiff until success.

Identical to SidewayMove.

Parameters
moveTargettarget to move around
rightmove right or left
angleThresholdangle to cross
walkis walk or run
successOnEnddoes the goal succeed on life end
guardStateIdguard EZStateId
onGuardResultgoal state on successfully guarding an attack

◆ SpecialTurn()

void SpecialTurn ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float stopAngleWidth = 0 )

If the target is not within the angle width turn using the animation. Uses AttackTunableSpin.

specialTurn.lua

Parameters
animationIdanimation to execute
targettarget to turn to and attack
stopAngleWidthangle for target to be within for the goal to succeed

◆ SpinStep()

void SpinStep ( int animationId = 0,
TARGET target = TARGET_ENE_0,
float turnTime = 0,
AI_DIR_TYPE dirSpaceCheck = AI_DIR_TYPE_CENTER,
float distSpaceCheck = 0 )

Turns to the target and then tests if there's space for the character to step/hop in the position they expect, and if so, executes the animation.

Goal succeeds when one of: AiFunc::IsFinishAttack, AiFunc::IsEnableComboAttack, AiFunc::IsEnableCancelMove, AiFunc::IsEnableCancelStep is true.

Step animations (6000-6003) can cancel other animations when AiFunc::IsEnableCancelStep is true.

Parameters
animationIdanimation to execute
targettarget to turn to and attack
turnTimemaximum turning time
dirSpaceCheckdirection of where to check for space, normally aligned with step direction
distSpaceCheckfree space needed in meters

◆ Stay()

void Stay ( float enemyReactDist = 0,
TARGET turnTarget = TARGET_ENE_0 )

Goal used for waiting when not battling, such as an enemy that has no route (wait goal with the ability to spot targets).

Parameters
enemyReactDisttargets within this distance can be reacted to
turnTargettarget to turn to

◆ StepSafety()

void StepSafety ( int frontPriority = 0,
int backPriority = 0,
int leftPriority = 0,
int rightPriority = 0,
TARGET target = TARGET_ENE_0,
float distSpaceCheck = 0,
float turnTime = 0,
bool alwaysSuccess = false )

Decide which direction to step/hop to using space checks, the highest priority valid direction is cohsen. Negative priority makes the direction invalid. Uses SpinStep.

step_safety.lua

Parameters
frontPriorityleft sideway move priority
backPriorityleft sideway move priority
leftPriorityleft sideway move priority
rightPriorityright sideway move priority
targettarget to turn to and attack
distSpaceCheckfree space in meters needed
turnTimemaximum turning time
alwaysSuccessif true the goal still succeeds without stepping if there are no valid directions

◆ TargetStateBehavior()

void TargetStateBehavior ( int behaviorType = 0,
int goalOrAction )

If behaviorType is 0 does nothing, if 3 adds goalOrAction as goal, otherwise ExecAction(goalOrAction).

Parameters
behaviorTypewhat to do
goalOrActiongoal id or action

◆ TeamCallHelp()

void TeamCallHelp ( TARGET turnTarget = TARGET_ENE_0)

Turn to the target and use the call help action animation (callHelp_CallActionId) as defined by NpcThinkParam. Also call for help at the end of the goal using AiFunc::TeamHelp_Call.

team_call_help.lua

Parameters
turnTargettarget to turn to

◆ TeamCommand()

void TeamCommand ( )

Undefined.

◆ TeamCommandManager()

void TeamCommandManager ( )

Undefined.

◆ TeamReplyHelp()

void TeamReplyHelp ( )

Goal to use when replying to a call of help. All parameters are in NpcThinkParam.

team_reply_help.lua

◆ TopGoal()

void TopGoal ( )

The first goal, this goal has no parent. Always active.

◆ ToTargetWarp()

void ToTargetWarp ( TARGET warpTarget = TARGET_ENE_0,
AI_DIR_TYPE directionFromTarget = AI_DIR_TYPE_CENTER,
float distanceFromTarget = 0,
TARGET turnTarget = TARGET_ENE_0,
float lowHeightOffset = 0,
float highHeightOffset = 0,
float warpPosMinDist = 0 )

Teleports around the target's position if possible as defined by the parameters.

Parameters
warpTargettarget to warp to
directionFromTargetdirection from target's front to end up in
distanceFromTargetdistance from target to end up in
turnTargettarget to turn to
lowHeightOffsetthe maximum amount of vertical distance allowed to teleport below the target; the bigger, the more leeway (needed for stairs and such)
highHeightOffsetthe maximum amount of vertical distance allowed to teleport above the target; the bigger, the more leeway (needed for stairs and such)
warpPosMinDistwarp position must be at least this far away from target to be valid

◆ Turn()

void Turn ( TARGET turnTarget = TARGET_ENE_0,
float stopAngleWidth = 15,
int guardStateId = 0,
GOAL_RESULT onGuardResult = GOAL_RESULT_Continue,
bool guardSuccessOnEnd_Unused = true )

Turn to target until target is within the specified angle.

Life of guard is always 4 seconds due to a mistake in Turn_Activate.

guardSuccessOnEnd_Unused is always true due to a mistake (in lua, number 0 like all numbers is equivalent to true).

turn.lua

Parameters
turnTargettarget to turn to
stopAngleWidthangle for target to be within for the goal to succeed
guardStateIdguard EZStateId
onGuardResultgoal state successfully guarded an attack
guardSuccessOnEnd_Unuseddoes the goal succeed on life end, broken

◆ TurnAround()

void TurnAround ( TARGET moveTarget = TARGET_ENE_0,
AI_DIR_TYPE directionStart = AI_DIR_TYPE_CENTER,
float stopAngleWidth = 0,
bool walk = false,
bool successOnEnd = false,
int guardStateId = 0 )

Move around target, keeping yourself within the circle sector defined by the target as the center, starting angle with the direction type from directionDesire, and angle width from stopAngleWidth.

This goal does not work properly because in TurnAround_Update the check for if the target is in the circular sector uses an undefined global "targetType" (so nil) instead of param 0, in DSR (where you can see the original variable names) "targetType" is what a local with param 0 is called so presumably they just forgot to define it in the Update function.

turnaround.lua

Parameters
moveTargettarget to move around
directionStartstarting direction of the circular sector
stopAngleWidthangle width of the circular sector
walkis walk or run
successOnEndis goal success on life end
guardStateIdguard EZStateId

◆ UndefinedGoalNotification()

void UndefinedGoalNotification ( )

Does nothing.

◆ UseItem()

void UseItem ( int itemIndex = 0)

Use item in the given slot in items shortcut section.

use_item.lua

Parameters
itemIndexitem index to use

◆ Wait()

void Wait ( TARGET turnTarget = TARGET_ENE_0)

Do nothing besides turning until life end.

Parameters
turnTargettarget to turn to

◆ Wait_On_FailedPath()

void Wait_On_FailedPath ( float pathCheckInterval = 0)

Check for a path and if one isn't found then wait and repeat.

wait_on_failed_path.lua

Parameters
pathCheckIntervalinterval in seconds between looking for path

◆ WaitCancelTiming()

void WaitCancelTiming ( )

Do nothing besides turning to TARGET_ENE_0 until life end or one of the animation cancels is satisfied (AiFunc::IsEnableComboAttack, AiFunc::IsEnableCancelMove, AiFunc::IsEnableCancelStep, AiFunc::IsEnableCancelAttack).

Example: When HKS applies a stagger/throw/phase transition animation, this goal will run until the end to prevent the enemy from having unexpected behavior.

◆ WaitWithAnime()

void WaitWithAnime ( int animationId = 0,
TARGET target = TARGET_ENE_0 )

Executes an animation, no actual waiting (equivalent to AttackNonCancel(animationId, turnTarget, 9999, 0, -1)).

wait_with_anime.lua

Parameters
animationIdanimation to execute
targettarget to turn to and attack

◆ WalkAround()

void WalkAround ( float radius = 0,
bool walk = false,
float enemyReactDist = 0,
bool isWalkAroundFreePoint = false )

Walk around.

walk_around.lua

Parameters
radiusradius of moving circle
walkis walk or run
enemyReactDisttargets within this distance can be reacted to
isWalkAroundFreePoint

◆ WalkAround_Anywhere()

void WalkAround_Anywhere ( float stopDist = 0,
float moveLife = 0,
bool walk = false,
int lookAroundAnimId = 0,
float lookAroundLife = 0,
int lookAroundAmount = 0,
bool lookAroundBeforeMove = false,
bool resetMovementPoints = false,
bool waitWithLookAround = false )

Walk around then look around, repeat.

walk_around_anywhere.lua

Parameters
stopDiststop walking when this far from the current moving point
moveLifelife for move around goal
walkis walk or run
lookAroundAnimIdlook around animation, if -1 then just wait
lookAroundLifelook around goal life
lookAroundAmountamount of times to repeat walk->lookAround cycle
lookAroundBeforeMoveis start with looking around
resetMovementPointsreset free movement point each cycle
waitWithLookAroundis use WaitWithAnime or AttackTunableSpin

◆ WalkAround_On_FailedPath()

void WalkAround_On_FailedPath ( float pathCheckInterval = 0)

Walk around freely and inbetween check for a path.

walk_around_on_failed_path.lua

Parameters
pathCheckIntervalinterval in seconds between looking for path

◆ WaypointAct()

void WaypointAct ( )

Undefined.

◆ WaypointAnimTrial()

void WaypointAnimTrial ( float waypointAttribute = 0)

Uses non existent functions.

waypoint_anim_trial.lua

Parameters
waypointAttribute

◆ WeaponChange()

void WeaponChange ( int index = 0)

Doesn't work. Use NPC_ATK_ArrowKeyRight and NPC_ATK_ArrowKeyLeft instead.

weapon_change.lua

Parameters
indexweapon change