ERAiAPI
Loading...
Searching...
No Matches
AiFunc Class Reference

Represents the AI of a character. More...

#include <AiFunc.hpp>

Public Member Functions

void AddFriendAttackedTarget ()
 Notifies targeting system that someone in the team attacked target.
 
void AddNPCActProb (int npcAiBehaviorParam)
 Add the probabilities in the given NpcAiBehaviorProbability param to the NPC's probabilities array.
 
void AddObserveArea (int observeSlot, TARGET targetOrigin, TARGET targetObserved, AI_DIR_TYPE directionStart, float angleWidth, float distance)
 Adds an observer to the area observers. The area is a spherical sector defined by the parameters.
 
void AddObserveAreaCustom (int observeSlot, TARGET targetOrigin, TARGET targetObserved, AI_DIR_TYPE directionStart, float angleWidth, float angleHeight, float distance)
 Adds an observer to the area observers. The area is a spherical sector defined by the parameters.
 
void AddObserveChrDmySphere (int observeSlot, TARGET targetObserved, int dummyPolyId, float radius)
 Adds an observer to the area observers. The area is a sphere whose origin is the dummy poly on the character with the specified radius.
 
void AddObserveObjBreak (unsigned int observeObjectId)
 Observes an object, interrupts when it is broken. There can be only 4 of these at once. This is not an area observer.
 
void AddObserveRegion (int observeSlot, int targetObserved, unsigned int regionId)
 Adds an observer to the area observers. This area is defined by the given event region.
 
void AddObserveSpecialEffectAttribute (TARGET targetObserved, int specialEffectId)
 Adds an observer to the special effect observers. Interrupts the AI when the given special effect is applied to the target and when it is cleared (INTERUPT_ActivateSpecialEffect and INTERUPT_DeActivateSpecialEffect respectively).
 
void AddTeamRecord (int recordId, TARGET target, float distance)
 
void AddTeamTimeRecord (int recordId, TARGET target, float distance)
 
GoalFuncAddTopGoal (int goalId, float life, float goalParam0=0, float goalParam1=0, float goalParam2=0, float goalParam3=0, float goalParam4=0, float goalParam5=0, float goalParam6=0, float goalParam7=0, float goalParam8=0, float goalParam9=0)
 Adds subgoal to the top goal directly.
 
void BeginWalkAroundFree ()
 
int CalcGetNearestLadderActDmyIdByLadder ()
 Returns 192 if the bottom of the ladder is closer than the top, otherwise 191.
 
int CalcNearMovePointOnRoute (int p1, int p2, float p3, float p4)
 Does nothing.
 
bool CalcSetPointWaitAndSee ()
 Calcs the info for the target POINT_WaitAndSee?
 
bool CanLadderGoalEnd ()
 Returns true if not on a ladder.
 
bool CanShootMagicByType (int equipWeaponParam, int magicType)
 Returns true if the weapon can cast the specified magic type. See GetMagicCategory(int) for magic type.
 
bool CanStartLadderAttach ()
 Returns true if the character can attach to ladders, which is true when the character is touching solid ground.
 
bool CanWeaponEnhance (int equipWeaponParam)
 Returns true if the specified weapon can be buffed.
 
bool CannotMove ()
 Returns true if the character determines it cannot move based on its hit capsule and position's proximity to objects, and if the navigate manager determines it so.
 
void ChangeEquipItem (int slot, ITEM_SLOTTYPE slotType)
 Changes current selected item to the given slot's item.
 
void ChangeEquipMagic (int slot)
 Changes current selected magic to the specified slot's magic.
 
void ChangeEquipMagicByMagicParamId (int magicParam)
 Changes the current selected magic to the specified magic by param.
 
void ChangeWalkAroundFreePoint ()
 Recalculate POINT_WalkAroundPosition_Free using randomness? But it adds to a list? Extremely unsure.
 
bool CheckDoesExistPath (TARGET moveTarget, AI_DIR_TYPE directionFromTarget, float stopDistance)
 Returns true if there is a path from the specified direction to the sphere around the target using the stop distance.
 
bool CheckTurnAngleDiff (TARGET target, bool isAntiClockwise, float angleThreshold)
 Check if the target is within the circular sector (with infinite radius) defined by the character as the origin, starting direction is set by SetTurnReferenceDirection(TARGET) and the perimeter is the given angle to 180. Additionally TARGET_ENE_0 (regardless of the target argument) must be in the character's 30 degree view (IsInsideTarget(TARGET_SELF, TARGET_ENE_0, AI_DIR_TYPE_F, 30)).
 
bool ChkNearCorpsePos (float maxAlertDistance)
 Returns true if there is a teammate within the given distance that is dead.
 
bool ChkNearLowHpFriend (float maxHpRate, float maxAlertDifference)
 Returns true if there is a teammate within the given distance that has less than or equal hprate to the one given.
 
void ClearEnableEndureCancel_forGoal ()
 Used in DS3/Sekiro for StabCounterAttack/EndureAttack, effect unknown. Unused in ER.
 
void ClearEnableStabCounterCancel_forGoal ()
 Used in DS3/Sekiro for StabCounterAttack/EndureAttack, effect unknown. Unused in ER.
 
void ClearFinishObjAct ()
 Set finish obj act.
 
void ClearForceBattleGoal ()
 Sets IsForceBattleGoal() to false. Used in common_logic_func.lua to clear IsForceBattleGoal after handing its logic.
 
void ClearMoveRequest ()
 Stop moving. Must not be on a ladder or moving to a jumping point (mid jump).
 
void ClearMoveToSomewhereSmoothMemory ()
 Clears GoalMoveToSomewhere_SwitchRouteMove's memory (e.g point positions).
 
void ClearTeam_Support ()
 Clear request for team support. See ReqTeam_Support(float).
 
float DbgAutoRemo_GetWaitCommandTime ()
 Does nothing.
 
bool DbgAutoRemo_IsWaitCommand ()
 Does nothing.
 
void DbgAutoRemo_ResetWaitCommand ()
 Does nothing.
 
int DbgGetForceActIdx ()
 Returns the force act index, used in common_battle_func.lua -> Common_Battle_Activate to force enemies to repeat an act. No set function (original use is through Debug Menu), but still functions properly.
 
void DbgSetLastActIdx (int actIndex)
 Sets the last act index, used in common_battle_func.lua -> Common_Battle_Activate. No get function, but still functions properly.
 
void DecideWalkAroundPos ()
 Recalculate POINT_WalkAroundPosition_Home using randomness? But it adds to a list? Extremely unsure.
 
void DeleteObserve (int observeSlot)
 Deletes the area observer in the given slot.
 
void DeleteObserveObjBreak (unsigned int objectId)
 Stop observing the given object.
 
void DeleteObserveSpecialEffectAttribute (TARGET targetObserved, int specialEffectId)
 Delete the given special effect observer.
 
void DeleteTeamReacor (int recordId)
 Delete the given team record.
 
bool DoAdmirer_ThinkAttr ()
 Returns the NpcThinkParam's thinkAttr_doAdmirer. Usually used to determine whether the character should behave in a different way when fighting with a team.
 
unsigned char DoAdmirer_ThinkAttr_ ()
 Returns the NpcThinkParam's thinkAttr_doAdmirer. Usually used to determine whether the character should behave in a different way when fighting with a team.
 
void DoEzAction (float actionLife, int ezActionId)
 Request the given action for the given amount of time.
 
void EnableUnfavorableAttackCheck (unsigned int animationIdOffset, unsigned int animationId)
 Adds the given attack to the unfavorable attacks list, interrupting the AI when used under certain conditions.
 
void EndDash ()
 Stops forcing run. See StartDash().
 
void EndGuard ()
 Does nothing.
 
void EndWalkAroundFree ()
 Clears WalkAroundFree list?
 
float EvaluateAttackDist ()
 Does nothing.
 
float EvaluateAttackRangeH ()
 Does nothing.
 
bool FollowPath (TARGET moveTarget, AI_DIR_TYPE directionFromTarget, float stopDistance, bool isWalk, float directionalDistance, bool xzDistanceOnly, bool defaultOrientationAndDirDist, bool closeProximityMode)
 Use pathing to move towards a spherical sector defined by the following parameters. The sector's angle width depends on the direction from the target: AI_DIR_TYPE_CENTER = 360 (full sphere) otherwise 180.
 
bool FollowPath (TARGET moveTarget, AI_DIR_TYPE directionFromTarget, float stopDistance, bool isWalk, float directionalDistance)
 Use pathing to move towards a spherical sector defined by the following parameters. See <see cref="FollowPath(TARGET, AI_DIR_TYPE, float, bool, float, bool, bool, bool)" xzDistanceOnly = false defaultOrientationAndDirDist = false closeProximityMode = false.
 
bool FollowPathToPoint (TARGET moveTarget, int directionFromTarget, float stopDistance, bool isWalk)
 Use pathing to move towards a spherical sector defined by the following parameters. See <see cref="FollowPath(TARGET, AI_DIR_TYPE, float, bool, float, bool, bool, bool)" directionalDistance = 0 xzDistanceOnly = false defaultOrientationAndStopDist = false closeProximityMode = false.
 
void ForceClanFormationMove ()
 Does nothing.
 
int GetAIUsageParam (int paramUsageType, int rowId)
 Returns the ai usage judgement id (aiUsageId or aiUseJudgeId) of the given param. paramUsageType: 0 = Magic 1 = EquipParamGoods 2 = SwordArtsParam.
 
float GetAbsoluteAngleFromTarget (TARGET target)
 Returns the angle from the character's left to the target, clockwise.
 
int GetActTypeOnFailedPathEnd ()
 Returns the NpcThinkParam's actTypeOnFailedPath. Used to determine what to do on battle act pathing failure.
 
int GetActTypeOnNonBattleFailedPathEnd ()
 Returns the NpcThinkParam's actTypeOnNonBtlFailedPath. Used to determine what to do on non battle act pathing failure.
 
int GetAnimIdOffset ()
 Returns the character's animation id offset.
 
int GetAreaHour ()
 Returns the world's hour in the current day.
 
int GetAreaMinute ()
 Returns the world's minute in the current hour.
 
int GetAreaObserveSlot (int areaObserveInterruptState, int matchingObservesCount)
 Returns the nth observe slot that matches the area observe interrupt state (No change, inside, outside). For example if there are 2 area observers that check if the target is inside the front of the character, the first with a distance of 10 in the 7th slot and the second with a distance of 5 in the 12th slot. Walking from behind to the front will (for that frame) mean that GetAreaObserveSlot(AI_AREAOBSERVE_INTERRUPT__INSIDE, 0) will return 7, and GetAreaObserveSlot(AI_AREAOBSERVE_INTERRUPT__INSIDE, 1) will return 12. Walking forwards towards a distance of 5 will (for that frame) mean that GetAreaObserveSlot(AI_AREAOBSERVE_INTERRUPT__INSIDE, 0) will return 12, and GetAreaObserveSlot(AI_AREAOBSERVE_INTERRUPT__INSIDE, 1) will return -1.
 
int GetAreaObserveSlotNum (int areaObserveInterruptState)
 Returns the amount of area observes that match the given interrupt state.
 
int GetAreaSecond ()
 Returns the world's second in the current minute.
 
int GetArtsID (ARM arm)
 Returns the SwordArtsParam id of the weapon in the given arm.
 
float GetAttackPassedTime (int animationId)
 Returns the time passed since the last time the character started the given animation.
 
int GetBehaviorStateId (PLAN_IDX_AINOTE planIndex)
 Returns the current plan style/state based on the given plan index. Either PLAN_IDX_AINOTE_STYLE to get guard related behaviors or PLAN_IDX_AINOTE_STATETYPE for attack related behaviors.
 
float GetBuddyActiveRange ()
 Returns the NpcThinkParam's overwriteReturnRange if it's non negative, otherwise the activateRange.
 
int GetBuddyFollowType ()
 Returns the character's pcFollowType (defined in BuddyParam). Used to determine how and if a summon should follow the player.
 
int GetChangeBattleStateCount ()
 Returns the amount of times the AI went into battle goal (going into battle goal adds 1, going into non battle goal doesn't add).
 
int GetChangeStateActionParam ()
 Does nothing.
 
int GetChangeStateActionType ()
 Does nothing.
 
float GetChrHitRadius (int target)
 Returns the target's chr hit radius.
 
int GetClanMemberNum ()
 Does nothing.
 
int GetCurrEquipMagicID (int target)
 Returns the target's currently selected magic.
 
AI_TARGET_STATE GetCurrTargetState ()
 Returns the AI's current target-state. In what state is the AI in in regards to targeting/searching for target.
 
AI_TARGET_TYPE GetCurrTargetType ()
 Returns the AI's current target-type. What type is the target the AI is currently looking for/found.
 
int GetCurrentEquipWeaponId (ARM arm)
 Returns the character's current equipped weapon id in the given arm.
 
float GetDamageLastFrame ()
 Returns the damage taken by the character in the last frame.
 
float GetDist (TARGET target)
 Returns the distance between the character and the target, taking into account the hit capsules.
 
float GetDistAtoB (TARGET targetA, TARGET targetB)
 Returns the distance between targetA and targetB, taking into account the hit capsules.
 
float GetDistParam (DIST distanceType)
 Converts distance type into distance. DIST_Near = 3 DIST_Middle = 6 DIST_Far = 15 DIST_Out = 999 DIST_None = 3.402823e+38 (MAX FLOAT) else = -1.
 
float GetDistXZ (TARGET target)
 Returns the strictly horizontal distance between the character and the target, taking into account the hit capsules.
 
float GetDistY (TARGET target)
 Returns the strictly vertical distance between the character and the target.
 
float GetDistYSigned (TARGET target)
 Returns the strictly vertical distance between the character and the target, signed as such (targetY - characterY)
 
int GetEquipArrowBoltId (TARGET target, ARROW_OR_BOLT arrowOrBolt, int slot)
 Returns the arrow or bolt equipment id in the given target and slot.
 
int GetEquipItemId (TARGET target, int slot, ITEM_SLOTTYPE slotType)
 Returns the item equipment id in the given target and slot.
 
int GetEquipMagicId (TARGET target, int slot)
 Returns the magic id in the given target and slot.
 
int GetEquipMagicIndex ()
 Returns the character's currently selected magic slot.
 
int GetEquipWeaponId (TARGET target, ARM arm, int slot)
 Returns the weapon equipment id in the given target and slot.
 
int GetEquipWeaponIndex (ARM arm)
 Returns the currently active weapon slot index in the characterar's given arm.
 
int GetEventRequest (int slot)
 Returns the event request value in the given slot. Slots are 0-3. This is used to let events communicate with the AI via INTERUPT_EventRequest.
 
int GetEventRequest ()
 Returns the event request value in slot 0. This is used to let events communicate with the AI via INTERUPT_EventRequest.
 
int GetExcelParam (AI_EXCEL_THINK_PARAM_TYPE excelParam)
 Returns the first active SpecialEffect's overwitten excel param if there is one, otherwise NpcThinkParam's given excel param value.
 
float GetExistMeshOnLineDist (TARGET target, AI_DIR_TYPE directionFromTarget, float maxDistance)
 Returns the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1. Equivalent to GetExistMeshOnLineDistEx(target, directionFromTarget, maxDistance, GetHitRadius(), 0).
 
float GetExistMeshOnLineDistEx (TARGET target, AI_DIR_TYPE directionFromTarget, float lineEndDistance, float lineWidth, float lineStartDist)
 Returns the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1.
 
float GetExistMeshOnLineDistSpecifyAngle (TARGET target, float angle, float maxDistance, AI_SPA_DIR_TYPE spatialDirectionStart)
 Returns the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1. Equivalent to GetExistMeshOnLineDistSpecifyAngleEx(target, angle, maxDistance, spatialDirectionStart, GetHitRadius(), 0)
 
float GetExistMeshOnLineDistSpecifyAngleEx (TARGET target, float angle, float lineEndDistance, AI_SPA_DIR_TYPE spatialDirectionStart, float lineWidth, float lineStartDist)
 Returns the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1.
 
int GetFlyRouteState ()
 Does nothing.
 
int GetHp (TARGET target)
 Returns the target's hp.
 
float GetHpRate (TARGET target)
 Returns the target's hp to max hp ratio.
 
float GetIdTimer (int timerId)
 Returns the timer's elapsed time since last accessed. Sets the timer to its starting offset (0 by default).
 
int GetInitStayId ()
 Returns the character's event defined idle animation.
 
int GetInsidePlatoonMemberNum (float p1, float p2, float p3, float p4)
 Does nothing.
 
AI_AREAOBSERVE_INTERRUPT GetInterruptStatus (int observeSlot)
 Returns the interrupt status of the given area observer.
 
int GetInvadeTriggerRegionCategory (int p1)
 Does nothing.
 
int GetInvadeTriggerRegionCategoryNum ()
 Does nothing.
 
int GetLadderActState (TARGET target)
 Returns the target's ladder state.
-1 = Not on
0 = Enter from bottom 1 = Enter from top 2 = Climbing, left hand from bottom to top 3 = Climbing, right hand from bottom to top 4 = Descending, right hand from top to bottom 5 = Descending, left hand from top to bottom 6 = Leave from top 7 = Leave from bottom 8 = Idling on ladder, right hand on top 9 = Idling on ladder, left hand on top 10 = Attack up, right hand on top 11 = Attack up, left hand on top 12 = Attack down, right hand on top 13 = Attack down, left hand on top 14 = Sliding start 16 = Sliding stop 18 = Sliding 20 = Sliding reached bottom 21 = Hit flinch 22 = Hit hanging on.
 
int GetLadderDirMove (int p1)
 Retruns 1 if the ladder path is upwards, -1 if downwards.
 
int GetLatestAttackedDir ()
 Returns the atkDir_forSfx value of the last attack the AI detected.
 
int GetLatestSoundBehaviorID ()
 Returns the last detected sound's (AiSoundParam) soundBehaviorId if its rank is "behavior" (7).
 
int GetLatestSoundTargetID ()
 Returns the last detected sound's param id.
 
AI_SOUND_RANK GetLatestSoundTargetRank ()
 Returns the last detected sound's rank.
 
int GetLeaveTriggerRegionCategory (int p1)
 Does nothing.
 
int GetLeaveTriggerRegionCategoryNum ()
 Does nothing.
 
int GetMagicCategory (int magicId)
 Returns the given magic's ezStateBehaviorType (0 = sorcery, 1 = incantation, 2 = pyromancy, 3 = vow type).
 
int GetMapHitRadius (int target)
 Returns the target's map hit radius (often simply called hitRadius in places like DSMS).
 
float GetMeshHeight (TARGET target, AI_DIR_TYPE directionFromTarget, float maxDistance)
 Returns 99999 if the given line doesn't end on a nav mesh, otherwise global y pos of the mesh.
 
float GetMeshHeightSpecifyAngle (TARGET target, float angle, float maxDistance, AI_SPA_DIR_TYPE spatialDirectionStart)
 Returns 99999 if the given line doesn't end on a nav mesh, otherwise global y pos of the mesh.
 
int GetMovePointActionId (int pointIndex)
 
float GetMovePointEffectRange ()
 
int GetMovePointNumber ()
 
int GetMovePointType ()
 
int GetMp (TARGET target)
 Returns the target's fp.
 
int GetMsbPartsIdx ()
 Does nothing.
 
int GetMyBlockID ()
 Does nothing.
 
float GetNPCActProb (int actId)
 Returns the probability of the given act.
 
int GetNpcThinkParamID ()
 Returns the character's NpcThinkParam id.
 
int GetNumFriend (float distance)
 Returns the number of characters with friendly team type towards the character within the given distance.
 
float GetNumber (int index)
 Returns the number stored at the given index (0-63)
 
float GetObjBreakRate (unsigned int objId)
 
float GetOffsetY (TARGET target)
 Returns the target's hitYOffset, the offset between the position (on the ground) and the character's actual position usually used for flying characters but not always (for example bats have 0.8).
 
float GetOriginDist (TARGET target)
 Returns the distance to the target without taking into account hit capsule, meaning the distance to their exact physics position.
 
int GetPartsDmg (int p1)
 Does nothing.
 
int GetPathResult ()
 Returns 0 if mid pathing, otherwise -1.
 
AiPlatoonCommandGetPlatoonCommand ()
 Returns the AI's platoon command object, if there is none return a default empty platoon command object.
 
int GetPlatoonMemberNum ()
 Returns the amount of members/ais in the AI's platoon.
 
int GetPlatoonRanking ()
 Does nothing.
 
PLATOON_STATE GetPlatoonState ()
 Returns AI's platoon's state, if there is none then -1.
 
int GetPrevMovePointNumber ()
 
AI_TARGET_STATE GetPrevTargetState ()
 Returns the AI's previous target-state. In what state is the AI in in regards to targeting/searching for target.
 
float GetRandam_Float (float min, float max)
 Returns a random float between the given bounds, uniform distribution, min inclusive max exclusive. = [0-1) * (max - min) + min.
 
int GetRandam_Int (int min, int max)
 Returns a random integer between the given bounds, inclusive. If min > max or min < 0 then behavior is poorly defined. = (int)([0-1) * (max - min + 1.0) + min) The casting to int as opposed to floor will make negative floats round upwards.
 
float GetRelativeAngleFromTarget (TARGET target)
 Returns the angle from the target's front to the character, clockwise.
 
float GetRemainingAttackCoolTime (int animationId)
 Returns the difference between the cooldown time set for the given animation and the time lapsed since its last usage, if it hasn't been used yet then 0. Animation ID offset is automatically added and does count as a different animation for cooldowns.
 
int GetReplanningGoalAction ()
 Returns NpcThinkParam's goalAction_ToCautionImportant if AI targeting search is currently "important", otherwise goalAction_ToCaution. Unused in ER where they instead directly get the params with GetExcelParam.
 
int GetReplanningGoalID ()
 Returns NpcThinkParam's goalAction_ToCautionImportant if AI targeting search is currently "important", otherwise goalAction_ToCaution. Unused in ER where they instead directly get the params with GetExcelParam.
 
unsigned int GetRideObjEntityID ()
 Returns map object that entity rides?
 
float GetSA (TARGET target)
 Returns the target's poise rounded down.
 
int GetSp (TARGET target)
 Returns the target's stamina.
 
bool GetSpecialEffectActivateInterruptId (int specialEffectId)
 Returns true if the given special effect has been applied on any target that is being observed for the given special effect id, meaning this has been observed this frame. If the AI observes the same special effect on multiple targets, this will be true on activation regardless of the target.
 
int GetSpecialEffectActivateInterruptNum ()
 Returns the amount of special effect observes that are in interrupt activate state. Meaning the amount of special effect observes that have been activated this frame. the amount of special effect observes that are in interrupt activate state.
 
int GetSpecialEffectActivateInterruptType (int interruptsActivatedUntilReturn)
 Returns the special effect id of the nth special effect observe that is in interrupt activate state. I would not recommend using this method as the order of the special effect observe nodes depends on the order you added them which on many cases can be subject to change over development.
 
bool GetSpecialEffectDeActivateInterruptId (int specialEffectId)
 Returns true if the given special effect has worn off on any target that is being observed for the given special effect id, meaning this has been observed this frame.
 
int GetSpecialEffectInactivateInterruptNum ()
 Returns the amount of special effect observes that are in interrupt deactivate state. Meaning the amount of special effect observes that have been deactivated this frame.
 
int GetSpecialEffectInactivateInterruptType (int interruptsDeactivatedUntilReturn)
 Returns the special effect id of the nth special effect observe that is in interrupt deactivate state. I would not recommend using this method as the order of the special effect observe nodes depends on the order you added them which on many cases can be subject to change over development.
 
float GetStringIndexedArray (char *arrayName, int index)
 Returns the number that is stored in the given array's given index. The structure of these is questionable, having 1 big (1024) float array buffer where each "array" is a pointer to somewhere in this buffer.
 
float GetStringIndexedNumber (char *variableName)
 Returns the number that has been set for the given string.
 
float GetTargetApproachSpeed ()
 Does nothing.
 
float GetTargetSARate (TARGET target)
 Returns the target's poise to max poise ratio.
 
int GetTeamCommand ()
 Does nothing.
 
unsigned int GetTeamDefeatEntityId ()
 
float GetTeamIdTimer (int p1)
 Does nothing.
 
int GetTeamInterruptCommand ()
 Does nothing.
 
float GetTeamNumber (int p1)
 Does nothing.
 
float GetTeamOrder (ORDER_TYPE orderType)
 Returns the AI's role type/call help type (?).
 
int GetTeamRecordCount (int p1, TARGET target, float p3)
 
TEAM_TYPE GetTeamType (TARGET target)
 Returns the target's team type.
 
float GetTimer (int index)
 Returns the given timer's remaining time.
 
float GetToTargetAngle (TARGET target)
 Returns the angle (-180, 180) from the character's front to the target, clockwise.
 
GoalFuncGetTopGoal ()
 Returns the AI's top goal.
 
int GetTouchBreakableObjectDefense ()
 Returns the defense/health of the object the AI is touching, used to determine if the AI is strong enough to break the object (see top_goal.lua).
 
AI_DIR_TYPE GetTurnAroundOptimizedDirection (TARGET target, AI_DIR_TYPE direction)
 Returns AI_DIR_TYPE_L if the given direction from the target is pointing beyond the AI, otherwise AI_DIR_TYPE_R. Let the AI be at (0, 0, 0) If the vector "targetPos + directionFromTargetForwardsNormal * 10" is closer to "selfNormalForwards" than "selfNormalBackwards" then the direction is right, otherwise left.
 
int GetWeaponBehaviorVarID (int equipWeaponId)
 Returns the behaviorVariationId of the given EquipParamWeapon.
 
int GetWeaponBothHandState (TARGET target)
 If the target is 2 handing return the arm that is doing so, otherwise return -1.
 
AI_TARGET_WEIGHT_TYPE GetWeightType (TARGET target)
 Returns the weight type of the target.
 
WEP_CATE GetWepCateLeft (TARGET target)
 Returns the left hand's AI weapon's category. 1 = Torch 2 = Bow 3 = Crossbow 4 = Staff 0 = Other.
 
WEP_CATE GetWepCateRight (TARGET target)
 Returns the right hand's AI weapon's category. 1 = Torch 2 = Bow 3 = Crossbow 4 = Staff 0 = Other.
 
int GetWepCategoryNo (ARM arm)
 Returns the wepmotionCategory of the weapon in the character's given arm.
 
int GetWepSpAtkCategoryNo (ARM arm)
 Returns the spAtkcategory of the weapon in the character's given arm.
 
bool HasConnectionReserve ()
 Does nothing.
 
bool HasGoal (int goalId)
 Returns true if the AI has the given goal in queue (regardless of child depth), otherwise false.
 
bool HasParalysis (TARGET target)
 Returns true if the target has a special effect with stateInfo 32 (Middle of Paralysis).
 
bool HasPathResult ()
 Returns true if the AI has results for the current pathing attempt, otherwise false.
 
bool HasSpecialEffectAttribute (TARGET target, int stateInfo)
 Returns true if the target has a special effect with the given stateInfo, otherwise false.
 
bool HasSpecialEffectCategory (TARGET target, int category)
 Returns true if the target has a special effect with the given category, otherwise false.
 
bool HasSpecialEffectId (TARGET target, int specialEffectId)
 Returns true if the target has a special effect with the given id, otherwise false.
 
bool HasTopSubgoal ()
 Returns true if the top goal has a subgoal, otherwise false.
 
bool IsActiveGoal (int goalId)
 Returns true if the given goal is currently active/running, otherwise false.
 
bool IsAiJumpProcessing ()
 Returns true if the character is: about to start/mid/ending a jump, otherwise false.
 
bool IsAiJumping ()
 Returns true if the character is mid/ending a jump, otherwise false.
 
bool IsApparentAnyFriend ()
 Returns true if the AI has a friend in its targeting system (TARGET_FRI_0 has a target), otherwise false.
 
bool IsApparentDeath ()
 Returns true if the character is dead/dying (player only?), otherwise false.
 
bool IsArrived ()
 Returns true if arrived to the position specified by current pathing, otherwise false.
 
bool IsBattleState ()
 Returns true if in battle state (usually battle goals). Equivalent to GetCurrTargetState() == AI_TARGET_STATE__BATTLE.
 
bool IsBothHandMode (TARGET target)
 Returns true if the target is two handing, otherwise false.
 
bool IsCautionState ()
 Returns true if in caution state (usually represented by slowly walking around a sound/last remembered target's position). Equivalent to GetCurrTargetState() == AI_TARGET_STATE__CAUTION.
 
bool IsChangeState ()
 Returns true if the previous state is different from the current state.
 
bool IsChrAroundLadderEdge (float distance, int ladderDmyId)
 Returns true if the character is within the given distance to the given ladder edge, otherwise false.
 
bool IsClanLeader ()
 Does nothing.
 
bool IsEnableCancelAttack ()
 Returns true if the character has EnableCancelAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 86 known as "End if AI Attack Queued", otherwise false.
 
bool IsEnableCancelAttack_CheckAttackNo (int actionRequestId)
 Returns true if the AI's current request equals the given request id and the character has EnableCancelAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 86 known as "End if AI Attack Queued", otherwise false.
 
bool IsEnableCancelMove ()
 Returns true if the character has EnableCancelMove enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 78 known as "Cancel - AI Move", otherwise false.
 
bool IsEnableCancelMove_CheckAttackNo (int actionRequestId)
 Returns true if the AI's current request equals the given request id and the character has EnableCancelMove enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 78 known as "Cancel - AI Move", otherwise false.
 
bool IsEnableCancelStep ()
 Returns true if the character has EnableCancelStep enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 79 known as "Cancel - AI Step", otherwise false.
 
bool IsEnableCancelStep_CheckAttackNo (int actionRequestId)
 Returns true if the AI's current request equals the given request id and the character has EnableCancelStep enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 79 known as "Cancel - AI Step", otherwise false.
 
bool IsEnableComboAttack ()
 Returns true if the character has EnableComboAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 23 known as "Cancel - AI ComboAttack", otherwise false.
 
bool IsEnableComboAttack_CheckAttackNo (int actionRequestId)
 Returns true if the AI's current request equals the given request id and the character has EnableComboAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 23 known as "Cancel - AI ComboAttack", otherwise false.
 
bool IsEnableNewLadderAct ()
 Does nothing.
 
bool IsEventFlag (unsigned int eventFlagId)
 Returns the given event flag's value.
 
bool IsEventRequestReceived (int slot)
 Returns true if there is an event request in the given slot, otherwise false. See GetEventRequest(int)
 
bool IsExecChangeStateAction ()
 Returns ttrue if the current state isn't AI_TARGET_STATE__CAUTION or if the last state is AI_TARGET_STATE__NONE.
 
bool IsExistChrOnLineSpecifyAngle (TARGET target, float angle, float maxDistance, AI_SPA_DIR_TYPE spatialDirectionStart)
 Returns true if there exists a character on the given line besides the target, otherwise false. Width is hit radius of the target.
 
bool IsExistChrSelfToTarget (TARGET target)
 Returns true if there exists a character on the line between self and the target, otherwise false.
 
bool IsExistMeshOnLine (TARGET target, AI_DIR_TYPE directionFromTarget, float maxDistance)
 Returns true if there exists a nav mesh that collides with the given line, otherwise false. Width is hit radius of the target.
 
bool IsExistReqObjAct ()
 
bool IsExistTargetTeamDefeat ()
 Equivalent to GetTeamDefeatEntityId() != -1.
 
bool IsExistTeamNumber ()
 Does nothing.
 
bool IsExistTeamRecord (int recordId)
 Returns true if the given team record exists, otherwise false.
 
bool IsFindState ()
 Does nothing.
 
bool IsFinishAttack ()
 Returns true if attack is over.
 
bool IsFinishAttackCoolTime (int animationId)
 Returns true if the cooldown time set for the given animation is smaller than the time lapsed since its last usage, otherwise false.
 
bool IsFinishAttack_CheckAttackNo (int actionRequestId)
 
bool IsFinishObjAct ()
 
bool IsFinishTimer (int index)
 Returns true if the given timer's remaining time is less than or equal to 0, otherwise false.
 
bool IsFlyState ()
 Returns the character's fly state.
 
bool IsForceBattleGoal ()
 Returns force battle goal. Set manually by AI functions. If true then battle goal will be priortized (see _COMMON_SetBattleActLogic in common_logic_func.lua)
 
bool IsForgettingMemoryTarget ()
 Returns true if the AI's targeting system's memory target is being forgotten, otherwise false. For example the time until forgetting an enemy memory is 30 seconds from losing your target.
 
bool IsForgettingSoundTarget ()
 Returns true if the AI's targeting system's sound target is being forgotten, otherwise false. For example the time until forgetting an enemy sound is 30 seconds from hearing it.
 
bool IsForgettingTopSearchTarget ()
 
bool IsGotHome ()
 Returns true if the AI arrived to its home location using the path described by BackToHome goal, otherwise false. This value starts as false, but once true it stays so until the AI is no longer doing regular route actions.
 
bool IsHitAttack ()
 Returns true if the character hit an attack within the current goal, otherwise false. Does not matter which character the AI hits, iframes prevent this from activating.
 
bool IsHoleFlag (TARGET target, AI_DIR_TYPE directionFromTarget, float distance)
 
bool IsHorseCall ()
 Returns true if the local player has SpEffect 3039, otherwise false.
 
bool IsHoverType ()
 
bool IsHugeEnemy ()
 Returns true if the character's NpcParam's chrHitGroupAndNavimesh is 5, otherwise false.
 
bool IsInsideBattleArea ()
 
bool IsInsideMovePoint ()
 Returns true if the character is near its move point, otherwise false. Default distance is 0.5, can vary based on MsbPoint data?
 
bool IsInsideMsbRegion (TARGET target, AI_DIR_TYPE direction, float length, unsigned int regionId)
 Returns true if the position defined by the given parameters is within the given region, otherwise false.
 
bool IsInsideObserve (int observeSlot)
 Returns true if the given observer's target is inside the observer's area, otherwise false.
 
bool IsInsideTarget (TARGET target, AI_DIR_TYPE directionStart, float angleWidth)
 Returns true if the given target is within the given circular sector, otherwise false. The origin of the circular sector is the character. The radius of the circular sector is infinite.
 
bool IsInsideTarget (TARGET target, AI_DIR_TYPE directionStart, float angleWidth, float angleHeight)
 Returns true if the given target is within the given spherical sector, otherwise false. The origin of the spherical sector is the character. The radius of the spherical sector is infinite.
 
bool IsInsideTargetCustom (TARGET targetOrigin, TARGET target, AI_DIR_TYPE directionStart, float angleWidth, float angleHeight, float distance)
 Returns true if the given target is within the given spherical sector, otherwise false.
 
bool IsInsideTargetEx (TARGET targetOrigin, TARGET target, AI_DIR_TYPE directionStart, float angleWidth, float distance)
 Returns true if the given target is within the given circular sector, otherwise false.
 
bool IsInsideTargetRegion (TARGET target, unsigned int regionId)
 Returns true if the given target is within the given region, otherwise false.
 
bool IsInterupt (INTERUPT interruptType)
 Returns true if the given interrupt type is currently active. List of the interrupt types and their activation conditions: INTERUPT_FindEnemy - Activates INTERUPT_FindAttack - Activates when a target attacks, called through HKS script, act(143, 0). INTERUPT_Damaged - Activates when hit by a typical attack / hitbox(e.g not poison). INTERUPT_Damaged_Stranger - Activates when hit by a typical attack / hitbox(e.g not poison) whose source isn't in the AI's targeting system. INTERUPT_SuccessGuard - Activates when hit by a typical attack / hitbox(e.g not poison) that caused a successful guard(not guard broken, while guarding in general ? ). Exclusive with INTERUPT_Damaged, INTERUPT_AIGuardBroken. INTERUPT_MissSwing - Activates when a target missed a swing(DS1 only with its unique miss animations). INTERUPT_GuardBegin - Activates when a target begins guarding. INTERUPT_GuardFinish - Activates when a target finishes guarding. INTERUPT_GuardBreak - Activates when a target is guard broken. INTERUPT_Shoot - Activates when a target shoots a bullet, bullets with no damage that have isAiInterruptShootNoDamageBullet row disabled will not activate this interrupt. INTERUPT_UseItem - Activates when a target uses an item, called through HKS script, act(143, 1). INTERUPT_EventRequest - Activates when "RequestCharacterAICommand" (2004[17]) is called in an event script(EMEVD).Interrupt info functions: GetEventRequest. INTERUPT_AIGuardBroken - Activates when hit by a typical attack / hitbox(e.g not poison) that caused a guard break (while guard broken in general ? ).Exclusive with INTERUPT_Damaged, INTERUPT_SuccessGuard, INTERUPT_AIReboundByOpponentGuard. INTERUPT_AIReboundByOpponentGuard - Activates when hit by a typical attack / hitbox(e.g not poison) that caused a successful guard(not guard broken, while guarding in general ? ) and caused the opponent to "rebound" (weapon / arm recoiled back).Exclusive with INTERUPT_Damaged, INTERUPT_AIGuardBroken. INTERUPT_CANNOT_MOVE_DisableInterupt - Activates INTERUPT_UnfavorableAttack - Activates at the end of an attacking goal if the animation is marked as UnfavorableAttack by EnableUnfavorableAttackCheck and the path from the ai to the target is obstructed.This happens in CSGoalCommonAttack::Update.
 
bool IsLadderAct (TARGET target)
 Returns true if the given target is on a ladder, otherwise false. Equivalent to GetLadderActState(TARGET) != -1.
 
bool IsLand ()
 Returns true if the character is touching the ground, otherwise false.
 
bool IsLocalPlayer ()
 Returns true if the character is the local player (main player), otherwise false.
 
bool IsLookToTarget (TARGET target, float angleWidth)
 Returns true if the given target is within the given circular sector, otherwise false. The origin of the circular sector is the character. The radius of the circular sector is infinite. The starting direction of the circular sector is the character's front. Meaning of angle width to each side: (180 = full circle, 90 = semicircle, etc.)
 
bool IsLookToTarget (float angleWidth)
 Returns true if the turning target is within the given circular sector, otherwise false. The origin of the circular sector is the character. The radius of the circular sector is infinite. The starting direction of the circular sector is the character's front. Meaning of angle width to each side: (180 = full circle, 90 = semicircle, etc.) Turning target can be seen as the "main target", it is referenced/set with many of the goals (using TurnTo(TARGET)).
 
bool IsLookToTarget ()
 Returns true if the turning target is within the given circular sector, otherwise false. The origin of the circular sector is the character. The radius of the circular sector is infinite. The starting direction of the circular sector is the character's front. Meaning of angle width to each side: (180 = full circle, 90 = semicircle, etc.). Turning target can be seen as the "main target", it is referenced/set with many of the goals (using TurnTo(TARGET)). Equivalent to IsLookToTarget(10)
 
bool IsMemoryState ()
 Returns true if in memory state, otherwise false. Equivalent to GetCurrTargetState() == AI_TARGET_STATE__MEMORY.
 
bool IsNpcPlayer ()
 Returns true if the character is a player npc, otherwise false.
 
bool IsOmissionLevel30 ()
 Returns true if the character is at omission level 30. Used to determine how much effort the AI should make in certain calculations and operations, as the character is far/offscreen for this omission level.
 
bool IsOnGround_FlyRoute ()
 Does nothing.
 
bool IsOnNearMesh (TARGET target, AI_DIR_TYPE directionFromTarget, float maxDistance, int p4)
 Returns true if the character is pathing on the nav mesh found from the given line?
 
bool IsOnNearMeshByPos (TARGET target, AI_DIR_TYPE directionFromTarget, float maxDistance)
 Returns true if the character is pathing on the nav mesh found from the given line?
 
bool IsOnPath (TARGET target, AI_DIR_TYPE directionFromTarget, float maxDistance)
 Returns true if the character is pathing on the nav mesh found from the given line? Identical to IsOnNearMeshByPos(TARGET, AI_DIR_TYPE, float).
 
bool IsOnRideCostMesh ()
 
bool IsOptimalAttackDist ()
 Does nothing.
 
bool IsOptimalAttackRangeH ()
 Does nothing.
 
bool IsOptimalAttackRangeV ()
 Does nothing.
 
bool IsPlatoonLeader ()
 Retruns true if the AI is the leader of its team, otherwise false.
 
bool IsProcessingFadeWarpToInitPos ()
 Returns true if the character is currently fade warping, otherwise false. Set by RequestFadeWarpToInitPos and used in the similary named goal.
 
bool IsRideEdgeFlag (TARGET target)
 
bool IsRideLargeSpaceFlag (TARGET target)
 
bool IsRiding (TARGET target)
 Returns true if the target is riding, otherwise false.
 
bool IsRouteEnd ()
 Returns true if the AI finished its route, otherwise false. This stays true until the AI reaches the start of its route cycle again. If the AI has no route this returns true.
 
bool IsSearchHighState ()
 Returns true if in search high state, also known as "search2". Equivalent to GetCurrTargetState() == AI_TARGET_STATE__SEARCH2.
 
bool IsSearchLowState ()
 Returns true if in search low state, also known as "search". Equivalent to GetCurrTargetState() == AI_TARGET_STATE__SEARCH.
 
bool IsSearchState ()
 Returns true if in search low state, also known as "search". Equivalent to GetCurrTargetState() == AI_TARGET_STATE__SEARCH Equivalent to IsSearchLowState()
 
bool IsSearchTarget (TARGET target)
 Returns true if the given target can be accessed, otherwise false. For example if IsSearchTarget(TARGET_ENE_0) returns false, then the AI has no knowledge of TARGET_ENE_0.
 
bool IsSleepSpecialEffectId (TARGET target, int specialEffectId)
 Returns true if the given target has the given special effect id but the effect is incompatible via vow type, otherwise false.
 
bool IsStartAttack ()
 Returns true if currently executing an animation requested by the AI, otherwise false. (Read the name as "Has started the attack yet?" instead of "Is at the beginning of an attack?").
 
bool IsStartAttack_CheckAttackNo (int actionRequestId)
 Returns true if currently executing the given animation as requested by the AI, otherwise false. (Read the name as "Has started the attack yet?" instead of "Is at the beginning of an attack?").
 
bool IsTargetGuard (TARGET target)
 Returns true if the given target is guarding, otherwise false. Given from ChrActionFlagModule.
 
bool IsTargetOutOfAngleInterruptSlot (int angleObserveSlot)
 Dose nothing in ER. Previously used along with GoalFunc function SetTargetAngle to determine whether the target is out of the angle width.
 
bool IsTargetOutOfRangeInterruptSlot (int rangeObserveSlot)
 Does nothing in ER. Previously used along with GoalFunc function SetTargetRange to determine whether the target is out of the distance range.
 
bool IsTargetWeakSoulCoin (int p1)
 Does nothing.
 
bool IsTeamCommandExist ()
 Does nothing.
 
bool IsTeamLeader ()
 Does nothing.
 
bool IsThrowing ()
 Returns true if the character is in the middle of a throw (e.g grab, riposte, etc.)
 
bool IsTouchBreakableObject ()
 Returns true if the character is touching a breakable object, otherwise false. Used to determine if the enemy needs to break an object around them to get free.
 
bool IsTrueLand ()
 Returns true if the character is standing on even, non sloped ground, otherwise false.
 
bool IsUpdateFirstAnimation ()
 
bool IsValidPlatoon ()
 Returns true if the AI is part of a team/platoon, otherwise false.
 
bool IsUseFlyRoute ()
 Does nothing.
 
bool IsVisibleCurrTarget ()
 Returns true if the current target (as referenced by the AI's target search system) is visible to the AI (that is, in the visibility cone, unobstructed), otherwise false. It seems sound targets are always visible?
 
bool IsVisibleTarget (TARGET target)
 Returns true if the current target is visible to the AI, or the given target is one of the speicifed options, otherwise false. This function is identical to IsVisibleCurrTarget() beyond the following target exceptions that always return true: TARGET_NONE, TARGET_SELF, TARGET_EVENT, TARGET_LOCALPLAYER, TARGET_LowHp_Friend, TARGET_HOSTPLAYER, target > 133.
 
void KickEvent (int eventIndex)
 
bool KickLuaCall (int p1, int p2, int p3)
 Does nothing.
 
bool LastPathFindingIsFailed ()
 Does nothing.
 
bool MemoryRelativeTarget (TARGET target, float angleStart, float angle, AI_SPA_DIR_TYPE spatialDirectionStart)
 Updates the position of "TARGET_MEMORIED_RELATIVE_TARGET" based on the given parameters, If we center and align our axes with the target the resulting position would be: result = direction vector from "self+angleStart" to "target" result = (result.x * cos(angle), result.y * sin(angle), result.z * -cos(angle))
 
int Mod (int dividend, int divisor)
 Returns dividend % divisor.
 
bool MoveTo (TARGET moveTarget, AI_DIR_TYPE directionFromTarget, float stopDistance, bool isWalk, float directionalDistance)
 Use pathing to move towards a point defined by the given parameters.
 
bool MoveToEventPoint (unsigned int regionId, int p2, float p3, bool isWalk)
 Use pathing to move towards the given event region.
 
void NotifyBuddyUnsummon ()
 
void OnEndLadderGoal ()
 Used on the termination of the LadderMove goal to clear some data. Does nothing by itself.
 
void OnStartLadderGoal ()
 Used on the activation of the LadderMove goal to clear some data. Does nothing by itself.
 
void OnUpdateLadderGoal ()
 Used on the update of the LadderMove goal to update both ladder specific and pathing data.
 
void PrintText (char *p1)
 Does nothing.
 
float RegistAttackTimeInterval (int animationId, float cooldown)
 Registers a cooldown to the given animationId. Animation offset is automatically added and does count as a different animation for cooldowns.
 
bool RegisterBoidsUnit (int p1)
 Does nothing.
 
bool RegisterTriggerRegion (int p1, int p2, float p3, float p4, int p5, int p6, float p7)
 Does nothing.
 
bool RegisterTriggerRegionCylinder (int p1, int p2, float p3, float p4, float p5, int p6, int p7, float p8)
 Does nothing.
 
bool RegisterTriggerRegionObserver (int p1)
 Does nothing.
 
void RemoveBoidsUnit (int p1)
 Does nothing.
 
void RemoveTriggerRegionObserver (int p1)
 Does nothing.
 
void Replaning ()
 Resets/clears/reintializes a signifcant amount of data from the AI (e.g all observers, goals (with termination), walking type, re-executing goal logic funcs).
 
void ReqPlatoonState (PLATOON_STATE platoonState)
 Attempt to set platoon state?
 
void ReqTeam_Support (float maxDistance)
 Call for help for teammates within range.
 
void RequestChangeFlyState (bool enable)
 Set fly state.
 
void RequestEmergencyQuickTurn ()
 Requests emergency turn, possibly forcing a turn animation that otherwise wouldn't have happened because the turn angle was too small. See usage in c9997.hks, env(330).
 
void RequestFadeWarpToInitPos (float fadeTime, float p2)
 Requests to warp to init pos while fading.
 
void RequestLadderWait ()
 Requests LadderWait, triggering the same named interrupt which is used in top_goal.lua.
 
void RequestParallelMove ()
 Requests parallel move type. See usage in c9997.hks, env(327).
 
bool ReserveObjAct (int objActIndex)
 
bool ReserveRide (float maxDistance)
 Attempts to find and reserve a ride target within the given distance.
 
void ResetInitialPosition ()
 Sets the character's initial position to their current position.
 
void ResetInitialPositionByEventRegion (unsigned int regionId)
 Sets the character's initial position to the given event region position.
 
void ResetNPCActProb ()
 Resets all NPC act probabilities to 0.
 
int SearchGetEnemyNumAround (TARGET target, float maxDistance)
 Returns the number of enemies (of the AI, not the target) around the given target within the given distance.
 
void SendTeamMemberMessage (int p1)
 Does nothing.
 
void SetAIFixedMoveTarget (TARGET targetOrigin, AI_DIR_TYPE directionFromTarget, float lineLength)
 Sets the AI's fixed target pos (POINT_AI_FIXED_POS) to the given position, as defined by the end point of the given line.
 
void SetAIFixedMoveTargetSpecifyAngle (TARGET targetOrigin, float angle, float lineLength, AI_SPA_DIR_TYPE spatialDirectionStart)
 Sets the AI's fixed target pos (POINT_AI_FIXED_POS) to the given position, as defined by the end point of the given line.
 
void SetAIPredictionMoveTargetSpecifyAngle (float p1, float angle, float lineLength)
 SetAIPredictionMoveTargetSpecifyAngle(p1, angle, lineLength, 0)
 
void SetAIPredictionMoveTargetSpecifyAngle (float p1, float angle, float lineLength, float p4)
 
void SetAIPredictionMoveTargetSpecifyTargetDir (float predictionFactor, int directionFromEnemy, float lineLength, float p5)
 
void SetAllowTriggerNearObjAct ()
 Does nothing.
 
void SetAttackRequest (unsigned int ezStateId)
 Request action. Animation offset is included automatically in this function.
 
void SetBoidsCohesionRange (float p1)
 Does nothing.
 
void SetBoidsSearchConnectorRange (float p1)
 Does nothing.
 
void SetBoidsSeparateRange (float p1)
 Does nothing.
 
void SetBoidsSpeedRateRange (float p1, float p2)
 Does nothing.
 
void SetCurrentMovePointIndex (int pointIndex)
 Sets the point to move to to the one in the given index.
 
void SetEnableEndureCancel_forGoal ()
 
void SetEnableInterrupt_LookedTarget (bool enable)
 Enables/disables the interrupt "INTERUPT_LookedTarget".
 
void SetEnableStabCounterCancel_forGoal ()
 
void SetEnableUsePath (bool enable)
 Use map patrol path?
 
void SetEventFlag (unsigned int eventFlagId, bool value)
 Sets the given flag to the given value.
 
void SetEventMoveTarget (unsigned int regionId)
 Set POINT_EVENT to the given region.
 
void SetIsForceBattleGoal ()
 Sets IsForceBattleGoal() to true.
 
void SetMoveAllDirection_LegWalk2And4 (bool enable)
 Allows the character to use all movement directions when moving. Overwritten by move left right only and move back to home.
 
void SetMoveLROnly (bool enable)
 Forces the AI to only use left/right movement directions when moving.
 
void SetNumber (int index, float value)
 Store the given number in the given index.
 
void SetPassiveMoveModifier (float modifier)
 Sets a root motion factor in all directions for all animations.
 
bool SetPosAngBy1stNearLadderDmyId (int p1)
 
void SetRouteInfoByEntityId (unsigned int p1)
 Does nothing.
 
void SetStringIndexedArray (char *arrayName, int index, float value)
 Sets the given number in the given array's given index. The structure of these is questionable, having 1 big (1024) float array buffer where each "array" is a pointer to somewhere in this buffer.
 
void SetStringIndexedNumber (char *variableName, float value)
 Sets the given variable to the given value.
 
void SetSuperClimbingMode (bool enable)
 Enables super climbing mode for the character, increasing their ability to step up inclines. Character must be categorized as huge enemy and have a hit radius smaller than 5 to have an effect.
 
void SetTeamNumber (int p1, float p2)
 Does nothing.
 
void SetTeamNumber (int p1, float p2, float p3)
 Does nothing.
 
void SetTimer (int index, float value)
 Sets the given timer to the given value. Timers constantly tick down until they reach 0.
 
void SetTurnReferenceDirection (TARGET target)
 Store the direction to the given target's current position as the turn reference. The turn reference direction is used at the beginning of SidewayMove storing the target's position, to know when to end the goal.
 
void SetUserInterupt (unsigned int p1)
 Does nothing.
 
void ShiftCurrTargetBattleState ()
 
void StartAttackPassedTimer (int animationId, float time)
 Sets the animation cooldown timer for the given animation to the given time. Animation offset is included automatically in this function.
 
void StartDash ()
 Forces run.
 
void StartGuard ()
 Does nothing.
 
void StartIdTimer (int index)
 Starts id timer.
 
void StartIdTimerSpecifyTime (int index, float startingTime)
 Starts id timer with the given time.
 
void StartTeamIdTimer (int p1)
 Does nothing.
 
void StepNextMovePoint ()
 Cycle to the next point on your path. Used in the common pathing goals' Terminate function when the move target is a move point.
 
void TeamHelp_Call ()
 Call for help from team. The distance is taken from NpcThinkParam's "callHelp_CallValidRange".
 
float TeamHelp_GetMaxWaitTime ()
 Returns NPCThinkParam's "callHelp_MaxWaitTime" * 0.1.
 
float TeamHelp_GetMinWaitTime ()
 Returns NPCThinkParam's "callHelp_MinWaitTime" * 0.1.
 
bool TeamHelp_IsValidCall ()
 Returns true if there are any valid teammates that can respond to your call, otherwise false. Based on NPCThinkParam.
 
bool TeamHelp_IsValidReply ()
 Returns true if there are any valid teammates that you can reply to, otherwise false. Based on NPCThinkParam. Used to end GoalNonBattleAct in case a teammate calls.
 
void TeamHelp_Reply ()
 Handles answering call logic, including setting as target?
 
void TeamHelp_ReserveCall ()
 
void TeamHelp_ValidateCall ()
 
void TeamHelp_ValidateReply ()
 
void TurnTo (TARGET target)
 Sets the given target as the turn target/target to turn to. The turn target can be considered the "main target" of the AI in many cases.
 

Detailed Description

Represents the AI of a character.

This is for Elden Ring, while most functions retain their implementation over games, some functions are "emptied" becasue they are no longer used. "character"/"the character" = the AI's character (ChrIns)

Definition at line 37 of file AiFunc.hpp.

Member Function Documentation

◆ AddFriendAttackedTarget()

void AiFunc::AddFriendAttackedTarget ( )

Notifies targeting system that someone in the team attacked target.

◆ AddNPCActProb()

void AiFunc::AddNPCActProb ( int npcAiBehaviorParam)

Add the probabilities in the given NpcAiBehaviorProbability param to the NPC's probabilities array.

Parameters
npcAiBehaviorParamai behavior param id

◆ AddObserveArea()

void AiFunc::AddObserveArea ( int observeSlot,
TARGET targetOrigin,
TARGET targetObserved,
AI_DIR_TYPE directionStart,
float angleWidth,
float distance )

Adds an observer to the area observers. The area is a spherical sector defined by the parameters.

Each "observer" in the "area observers" observes some region and interrupts the AI via "INTERUPT_Inside_ObserveArea" and "INTERUPT_Outside_ObserveArea". In the technical sense each observer contiuously checks some condition/s and returns true or false, all fromsoft made observers using this list are ofcourse tied to checking regions/areas on some "observed target". There is no meaningful limit to the amount of observers you can make.

Parameters
observeSlotarea observer slot
targetOriginorigin of the spherical sector
targetObservedtarget to observe
directionStartdirection from the origin with which the spherical sector is aligned
angleWidthangle width of the spherical sector
distanceradius of the spherical sector

◆ AddObserveAreaCustom()

void AiFunc::AddObserveAreaCustom ( int observeSlot,
TARGET targetOrigin,
TARGET targetObserved,
AI_DIR_TYPE directionStart,
float angleWidth,
float angleHeight,
float distance )

Adds an observer to the area observers. The area is a spherical sector defined by the parameters.

Each "observer" in the "area observers" observes some region and interrupts the AI via "INTERUPT_Inside_ObserveArea" and "INTERUPT_Outside_ObserveArea". In the technical sense each observer contiuously checks some condition/s and returns true or false, all fromsoft made observers using this list are ofcourse tied to checking regions/areas on some "observed target". There is no meaningful limit to the amount of observers you can make.

Parameters
observeSlotarea observer slot
targetOriginorigin of the spherical sector
targetObservedtarget to observe
directionStartdirection from the origin with which the spherical sector is aligned
angleWidthangle width of the spherical sector
angleHeightangle height of the spherical sector
distanceradius of the spherical sector

◆ AddObserveChrDmySphere()

void AiFunc::AddObserveChrDmySphere ( int observeSlot,
TARGET targetObserved,
int dummyPolyId,
float radius )

Adds an observer to the area observers. The area is a sphere whose origin is the dummy poly on the character with the specified radius.

Each "observer" in the "area observers" observes some region and interrupts the AI via "INTERUPT_Inside_ObserveArea" and "INTERUPT_Outside_ObserveArea". In the technical sense each observer contiuously checks some condition/s and returns true or false, all fromsoft made observers using this list are ofcourse tied to checking regions/areas on some "observed target". There is no meaningful limit to the amount of observers you can make.

Parameters
observeSlotarea observer slot
targetObservedtarget to observe
dummyPolyIdpoly origin
radiusradius of the sphere

◆ AddObserveObjBreak()

void AiFunc::AddObserveObjBreak ( unsigned int observeObjectId)

Observes an object, interrupts when it is broken. There can be only 4 of these at once. This is not an area observer.

Parameters
observeObjectIdobject id to observe

◆ AddObserveRegion()

void AiFunc::AddObserveRegion ( int observeSlot,
int targetObserved,
unsigned int regionId )

Adds an observer to the area observers. This area is defined by the given event region.

Each "observer" in the "area observers" observes some region and interrupts the AI via "INTERUPT_Inside_ObserveArea" and "INTERUPT_Outside_ObserveArea". In the technical sense each observer contiuously checks some condition/s and returns true or false, all fromsoft made observers using this list are ofcourse tied to checking regions/areas on some "observed target". There is no meaningful limit to the amount of observers you can make.

Parameters
observeSlotarea observer slot
targetObservedtarget to observe
regionIdevent region id

◆ AddObserveSpecialEffectAttribute()

void AiFunc::AddObserveSpecialEffectAttribute ( TARGET targetObserved,
int specialEffectId )

Adds an observer to the special effect observers. Interrupts the AI when the given special effect is applied to the target and when it is cleared (INTERUPT_ActivateSpecialEffect and INTERUPT_DeActivateSpecialEffect respectively).

Each "observer" in the "area observers" observes some region and interrupts the AI via "INTERUPT_Inside_ObserveArea" and "INTERUPT_Outside_ObserveArea". In the technical sense each observer contiuously checks some condition/s and returns true or false, all fromsoft made observers using this list are ofcourse tied to checking regions/areas on some "observed target". There is no meaningful limit to the amount of observers you can make.

Parameters
targetObservedtarget to observe
specialEffectIdspecial effect to observe for

◆ AddTeamRecord()

void AiFunc::AddTeamRecord ( int recordId,
TARGET target,
float distance )
Parameters
recordId
target
distancenotify distance

◆ AddTeamTimeRecord()

void AiFunc::AddTeamTimeRecord ( int recordId,
TARGET target,
float distance )
Parameters
recordId
target
distancenotify distance

◆ AddTopGoal()

GoalFunc * AiFunc::AddTopGoal ( int goalId,
float life,
float goalParam0 = 0,
float goalParam1 = 0,
float goalParam2 = 0,
float goalParam3 = 0,
float goalParam4 = 0,
float goalParam5 = 0,
float goalParam6 = 0,
float goalParam7 = 0,
float goalParam8 = 0,
float goalParam9 = 0 )

Adds subgoal to the top goal directly.

Parameters
goalIdgoal to add
lifelife of goal in seconds
goalParam00th goal param
goalParam11st goal param
goalParam22nd goal param
goalParam33rd goal param
goalParam44th goal param
goalParam55th goal param
goalParam66th goal param
goalParam77th goal param
goalParam88th goal param
goalParam99th goal param
Returns
the created subgoal

◆ BeginWalkAroundFree()

void AiFunc::BeginWalkAroundFree ( )

◆ CalcGetNearestLadderActDmyIdByLadder()

int AiFunc::CalcGetNearestLadderActDmyIdByLadder ( )

Returns 192 if the bottom of the ladder is closer than the top, otherwise 191.

Returns
192 if the bottom of the ladder is closer than the top, otherwise 191

◆ CalcNearMovePointOnRoute()

int AiFunc::CalcNearMovePointOnRoute ( int p1,
int p2,
float p3,
float p4 )

Does nothing.

Parameters
p1
p2
p3
p4
Returns
0

◆ CalcSetPointWaitAndSee()

bool AiFunc::CalcSetPointWaitAndSee ( )

Calcs the info for the target POINT_WaitAndSee?

Returns

◆ CanLadderGoalEnd()

bool AiFunc::CanLadderGoalEnd ( )

Returns true if not on a ladder.

Returns
true if the ladder state is -1 (off the ladder), otherwise false

◆ CannotMove()

bool AiFunc::CannotMove ( )

Returns true if the character determines it cannot move based on its hit capsule and position's proximity to objects, and if the navigate manager determines it so.

Returns
true if the character determines it cannot move, otherwise false

◆ CanShootMagicByType()

bool AiFunc::CanShootMagicByType ( int equipWeaponParam,
int magicType )

Returns true if the weapon can cast the specified magic type. See GetMagicCategory(int) for magic type.

Parameters
equipWeaponParamequipWeaponParam weapon param id
magicTypemagicType magic type (ezStateBehaviorType)
Returns
true if the specified weapon can cast the specified magic type, otherwise false

◆ CanStartLadderAttach()

bool AiFunc::CanStartLadderAttach ( )

Returns true if the character can attach to ladders, which is true when the character is touching solid ground.

Returns
true if the character is touching solid ground and has more than 0 health, otherwise false

◆ CanWeaponEnhance()

bool AiFunc::CanWeaponEnhance ( int equipWeaponParam)

Returns true if the specified weapon can be buffed.

Parameters
equipWeaponParamequipWeaponParam weapon param id
Returns
true if the specified weapon can be buffed

◆ ChangeEquipItem()

void AiFunc::ChangeEquipItem ( int slot,
ITEM_SLOTTYPE slotType )

Changes current selected item to the given slot's item.

Parameters
slotslot index
slotTypeitem slot type

◆ ChangeEquipMagic()

void AiFunc::ChangeEquipMagic ( int slot)

Changes current selected magic to the specified slot's magic.

Parameters
slotmagic equip slot

◆ ChangeEquipMagicByMagicParamId()

void AiFunc::ChangeEquipMagicByMagicParamId ( int magicParam)

Changes the current selected magic to the specified magic by param.

Parameters
magicParammagic param id

◆ ChangeWalkAroundFreePoint()

void AiFunc::ChangeWalkAroundFreePoint ( )

Recalculate POINT_WalkAroundPosition_Free using randomness? But it adds to a list? Extremely unsure.

◆ CheckDoesExistPath()

bool AiFunc::CheckDoesExistPath ( TARGET moveTarget,
AI_DIR_TYPE directionFromTarget,
float stopDistance )

Returns true if there is a path from the specified direction to the sphere around the target using the stop distance.

Parameters
moveTargettarget to move to
directionFromTargetdirection from the target's front to approach to
stopDistancedistance from target at which to stop moving
Returns
true if there is a path from the specified direction to the sphere around the target using the stop distance, otherwise false

◆ CheckTurnAngleDiff()

bool AiFunc::CheckTurnAngleDiff ( TARGET target,
bool isAntiClockwise,
float angleThreshold )

Check if the target is within the circular sector (with infinite radius) defined by the character as the origin, starting direction is set by SetTurnReferenceDirection(TARGET) and the perimeter is the given angle to 180. Additionally TARGET_ENE_0 (regardless of the target argument) must be in the character's 30 degree view (IsInsideTarget(TARGET_SELF, TARGET_ENE_0, AI_DIR_TYPE_F, 30)).

Parameters
targettarget to check
isAntiClockwisewhether to measure from front to the right or left
angleThresholdangle to cross
Returns
true if the target is within the circular sector defined by the, the character's position, the stored direction and the given angle; as well as TARGET_ENE_0 being within 30 degrees of TARGET_SELF, otherwise false

◆ ChkNearCorpsePos()

bool AiFunc::ChkNearCorpsePos ( float maxAlertDistance)

Returns true if there is a teammate within the given distance that is dead.

Parameters
maxAlertDistancemaximum valid distance from teammate
Returns
true if there is a teammate within the given distance is that dead, otherwise false

◆ ChkNearLowHpFriend()

bool AiFunc::ChkNearLowHpFriend ( float maxHpRate,
float maxAlertDifference )

Returns true if there is a teammate within the given distance that has less than or equal hprate to the one given.

Parameters
maxHpRatehp ratio upper bound on what is defined as low hp
maxAlertDifferencemaximum valid distance from teammate
Returns
true if there is a teammate within the given distance that has less than or equal hprate to the one given, otherwise false

◆ ClearEnableEndureCancel_forGoal()

void AiFunc::ClearEnableEndureCancel_forGoal ( )

Used in DS3/Sekiro for StabCounterAttack/EndureAttack, effect unknown. Unused in ER.

◆ ClearEnableStabCounterCancel_forGoal()

void AiFunc::ClearEnableStabCounterCancel_forGoal ( )

Used in DS3/Sekiro for StabCounterAttack/EndureAttack, effect unknown. Unused in ER.

◆ ClearFinishObjAct()

void AiFunc::ClearFinishObjAct ( )

Set finish obj act.

◆ ClearForceBattleGoal()

void AiFunc::ClearForceBattleGoal ( )

Sets IsForceBattleGoal() to false. Used in common_logic_func.lua to clear IsForceBattleGoal after handing its logic.

◆ ClearMoveRequest()

void AiFunc::ClearMoveRequest ( )

Stop moving. Must not be on a ladder or moving to a jumping point (mid jump).

◆ ClearMoveToSomewhereSmoothMemory()

void AiFunc::ClearMoveToSomewhereSmoothMemory ( )

Clears GoalMoveToSomewhere_SwitchRouteMove's memory (e.g point positions).

◆ ClearTeam_Support()

void AiFunc::ClearTeam_Support ( )

Clear request for team support. See ReqTeam_Support(float).

◆ DbgAutoRemo_GetWaitCommandTime()

float AiFunc::DbgAutoRemo_GetWaitCommandTime ( )

Does nothing.

Returns
0

◆ DbgAutoRemo_IsWaitCommand()

bool AiFunc::DbgAutoRemo_IsWaitCommand ( )

Does nothing.

Returns
false

◆ DbgAutoRemo_ResetWaitCommand()

void AiFunc::DbgAutoRemo_ResetWaitCommand ( )

Does nothing.

◆ DbgGetForceActIdx()

int AiFunc::DbgGetForceActIdx ( )

Returns the force act index, used in common_battle_func.lua -> Common_Battle_Activate to force enemies to repeat an act. No set function (original use is through Debug Menu), but still functions properly.

Returns
the force act index

◆ DbgSetLastActIdx()

void AiFunc::DbgSetLastActIdx ( int actIndex)

Sets the last act index, used in common_battle_func.lua -> Common_Battle_Activate. No get function, but still functions properly.

Parameters
actIndexactIndex last act index

◆ DecideWalkAroundPos()

void AiFunc::DecideWalkAroundPos ( )

Recalculate POINT_WalkAroundPosition_Home using randomness? But it adds to a list? Extremely unsure.

◆ DeleteObserve()

void AiFunc::DeleteObserve ( int observeSlot)

Deletes the area observer in the given slot.

Parameters
observeSlotarea observer to delete

◆ DeleteObserveObjBreak()

void AiFunc::DeleteObserveObjBreak ( unsigned int objectId)

Stop observing the given object.

Parameters
objectIdobject to stop observing

◆ DeleteObserveSpecialEffectAttribute()

void AiFunc::DeleteObserveSpecialEffectAttribute ( TARGET targetObserved,
int specialEffectId )

Delete the given special effect observer.

Parameters
targetObservedtarget being observed
specialEffectIdspecial effect being observed

◆ DeleteTeamReacor()

void AiFunc::DeleteTeamReacor ( int recordId)

Delete the given team record.

Parameters
recordIdteam record to delete

◆ DoAdmirer_ThinkAttr()

bool AiFunc::DoAdmirer_ThinkAttr ( )

Returns the NpcThinkParam's thinkAttr_doAdmirer. Usually used to determine whether the character should behave in a different way when fighting with a team.

Returns
the NpcThinkParam's thinkAttr_doAdmirer

◆ DoAdmirer_ThinkAttr_()

unsigned char AiFunc::DoAdmirer_ThinkAttr_ ( )

Returns the NpcThinkParam's thinkAttr_doAdmirer. Usually used to determine whether the character should behave in a different way when fighting with a team.

Returns
1 when the NpcThinkParam's thinkAttr_doAdmirer is true, otherwise 0

◆ DoEzAction()

void AiFunc::DoEzAction ( float actionLife,
int ezActionId )

Request the given action for the given amount of time.

Parameters
actionLifeamount of time to do action
ezActionIdaction to do

◆ EnableUnfavorableAttackCheck()

void AiFunc::EnableUnfavorableAttackCheck ( unsigned int animationIdOffset,
unsigned int animationId )

Adds the given attack to the unfavorable attacks list, interrupting the AI when used under certain conditions.

Parameters
animationIdOffsetoffset to add to the animation id
animationIdanimation id to enable unfavorable attack check on

◆ EndDash()

void AiFunc::EndDash ( )

Stops forcing run. See StartDash().

◆ EndGuard()

void AiFunc::EndGuard ( )

Does nothing.

◆ EndWalkAroundFree()

void AiFunc::EndWalkAroundFree ( )

Clears WalkAroundFree list?

◆ EvaluateAttackDist()

float AiFunc::EvaluateAttackDist ( )

Does nothing.

Returns
0

◆ EvaluateAttackRangeH()

float AiFunc::EvaluateAttackRangeH ( )

Does nothing.

Returns
0

◆ FollowPath() [1/2]

bool AiFunc::FollowPath ( TARGET moveTarget,
AI_DIR_TYPE directionFromTarget,
float stopDistance,
bool isWalk,
float directionalDistance )

Use pathing to move towards a spherical sector defined by the following parameters. See <see cref="FollowPath(TARGET, AI_DIR_TYPE, float, bool, float, bool, bool, bool)" xzDistanceOnly = false defaultOrientationAndDirDist = false closeProximityMode = false.

Parameters
moveTargetorigin of the sphere
directionFromTargetdirection from the target's front with which the spherical sector is aligned
stopDistanceradius of the sphere
isWalkis walk or run
directionalDistanceunknown, used for IsArrived?
Returns
true

◆ FollowPath() [2/2]

bool AiFunc::FollowPath ( TARGET moveTarget,
AI_DIR_TYPE directionFromTarget,
float stopDistance,
bool isWalk,
float directionalDistance,
bool xzDistanceOnly,
bool defaultOrientationAndDirDist,
bool closeProximityMode )

Use pathing to move towards a spherical sector defined by the following parameters. The sector's angle width depends on the direction from the target: AI_DIR_TYPE_CENTER = 360 (full sphere) otherwise 180.

Parameters
moveTargetorigin of the sphere
directionFromTargetdirection from the target's front with which the spherical sector is aligned
stopDistanceradius of the sphere
isWalkis walk or run
directionalDistanceunknown, used for IsArrived?
xzDistanceOnlyshould the sphere be a circle instead (ignore vertical distance)
defaultOrientationAndDirDistdefault orientation is center and default stop distance is 0,
closeProximityModeunknown
Returns
true

◆ FollowPathToPoint()

bool AiFunc::FollowPathToPoint ( TARGET moveTarget,
int directionFromTarget,
float stopDistance,
bool isWalk )

Use pathing to move towards a spherical sector defined by the following parameters. See <see cref="FollowPath(TARGET, AI_DIR_TYPE, float, bool, float, bool, bool, bool)" directionalDistance = 0 xzDistanceOnly = false defaultOrientationAndStopDist = false closeProximityMode = false.

Parameters
moveTarget
directionFromTarget
stopDistance
isWalk
Returns

◆ ForceClanFormationMove()

void AiFunc::ForceClanFormationMove ( )

Does nothing.

◆ GetAbsoluteAngleFromTarget()

float AiFunc::GetAbsoluteAngleFromTarget ( TARGET target)

Returns the angle from the character's left to the target, clockwise.

Parameters
targettarget to measure to
Returns
the angle from the character's left to the target, clockwise

◆ GetActTypeOnFailedPathEnd()

int AiFunc::GetActTypeOnFailedPathEnd ( )

Returns the NpcThinkParam's actTypeOnFailedPath. Used to determine what to do on battle act pathing failure.

Returns
the NpcThinkParam's actTypeOnFailedPath

◆ GetActTypeOnNonBattleFailedPathEnd()

int AiFunc::GetActTypeOnNonBattleFailedPathEnd ( )

Returns the NpcThinkParam's actTypeOnNonBtlFailedPath. Used to determine what to do on non battle act pathing failure.

Returns
the NpcThinkParam's actTypeOnNonBtlFailedPath

◆ GetAIUsageParam()

int AiFunc::GetAIUsageParam ( int paramUsageType,
int rowId )

Returns the ai usage judgement id (aiUsageId or aiUseJudgeId) of the given param. paramUsageType: 0 = Magic 1 = EquipParamGoods 2 = SwordArtsParam.

Parameters
paramUsageTypeparam type
rowIdrow id
Returns

◆ GetAnimIdOffset()

int AiFunc::GetAnimIdOffset ( )

Returns the character's animation id offset.

Returns
the character's animation id offset

◆ GetAreaHour()

int AiFunc::GetAreaHour ( )

Returns the world's hour in the current day.

Returns
the world's hour in the current day

◆ GetAreaMinute()

int AiFunc::GetAreaMinute ( )

Returns the world's minute in the current hour.

Returns
the world's minute in the current hour

◆ GetAreaObserveSlot()

int AiFunc::GetAreaObserveSlot ( int areaObserveInterruptState,
int matchingObservesCount )

Returns the nth observe slot that matches the area observe interrupt state (No change, inside, outside). For example if there are 2 area observers that check if the target is inside the front of the character, the first with a distance of 10 in the 7th slot and the second with a distance of 5 in the 12th slot. Walking from behind to the front will (for that frame) mean that GetAreaObserveSlot(AI_AREAOBSERVE_INTERRUPT__INSIDE, 0) will return 7, and GetAreaObserveSlot(AI_AREAOBSERVE_INTERRUPT__INSIDE, 1) will return 12. Walking forwards towards a distance of 5 will (for that frame) mean that GetAreaObserveSlot(AI_AREAOBSERVE_INTERRUPT__INSIDE, 0) will return 12, and GetAreaObserveSlot(AI_AREAOBSERVE_INTERRUPT__INSIDE, 1) will return -1.

Parameters
areaObserveInterruptStatethe area observe interrupt state to check for
matchingObservesCountmatchingObservesCount number of observes that match the given state until you return the observe slot
Returns
the nth area observe slot that matches the given interrupt state

◆ GetAreaObserveSlotNum()

int AiFunc::GetAreaObserveSlotNum ( int areaObserveInterruptState)

Returns the amount of area observes that match the given interrupt state.

Parameters
areaObserveInterruptStatethe area observe interrupt state to check for
Returns
the amount of area observes that match the given interrupt state

◆ GetAreaSecond()

int AiFunc::GetAreaSecond ( )

Returns the world's second in the current minute.

Returns
the world's second in the current minute

◆ GetArtsID()

int AiFunc::GetArtsID ( ARM arm)

Returns the SwordArtsParam id of the weapon in the given arm.

Parameters
armarm to get the weapon from
Returns
the SwordArtsParam id of the weapon in the given arm

◆ GetAttackPassedTime()

float AiFunc::GetAttackPassedTime ( int animationId)

Returns the time passed since the last time the character started the given animation.

Parameters
animationIdanimation to check the passed time for
Returns
the time passed since the last time the character started the given animation

◆ GetBehaviorStateId()

int AiFunc::GetBehaviorStateId ( PLAN_IDX_AINOTE planIndex)

Returns the current plan style/state based on the given plan index. Either PLAN_IDX_AINOTE_STYLE to get guard related behaviors or PLAN_IDX_AINOTE_STATETYPE for attack related behaviors.

Parameters
planIndexplan index to get the behavior for
Returns
the current plan style/state based on the given plan index

◆ GetBuddyActiveRange()

float AiFunc::GetBuddyActiveRange ( )

Returns the NpcThinkParam's overwriteReturnRange if it's non negative, otherwise the activateRange.

Returns
the NpcThinkParam's overwriteReturnRange if it's non negative, otherwise the activateRange

◆ GetBuddyFollowType()

int AiFunc::GetBuddyFollowType ( )

Returns the character's pcFollowType (defined in BuddyParam). Used to determine how and if a summon should follow the player.

Returns
the character's pcFollowType (defined in BuddyParam)

◆ GetChangeBattleStateCount()

int AiFunc::GetChangeBattleStateCount ( )

Returns the amount of times the AI went into battle goal (going into battle goal adds 1, going into non battle goal doesn't add).

Returns
the amount of times the AI went into battle goal

◆ GetChangeStateActionParam()

int AiFunc::GetChangeStateActionParam ( )

Does nothing.

Returns
0

◆ GetChangeStateActionType()

int AiFunc::GetChangeStateActionType ( )

Does nothing.

Returns
0

◆ GetChrHitRadius()

float AiFunc::GetChrHitRadius ( int target)

Returns the target's chr hit radius.

Parameters
targettarget
Returns
the target's chr hit radius

◆ GetClanMemberNum()

int AiFunc::GetClanMemberNum ( )

Does nothing.

Returns
0

◆ GetCurrentEquipWeaponId()

int AiFunc::GetCurrentEquipWeaponId ( ARM arm)

Returns the character's current equipped weapon id in the given arm.

Parameters
armarm to get the weapon from
Returns
the character's current equipped weapon id

◆ GetCurrEquipMagicID()

int AiFunc::GetCurrEquipMagicID ( int target)

Returns the target's currently selected magic.

Parameters
target
Returns
the target's currently selected magic

◆ GetCurrTargetState()

AI_TARGET_STATE AiFunc::GetCurrTargetState ( )

Returns the AI's current target-state. In what state is the AI in in regards to targeting/searching for target.

Returns
the AI's current target-state

◆ GetCurrTargetType()

AI_TARGET_TYPE AiFunc::GetCurrTargetType ( )

Returns the AI's current target-type. What type is the target the AI is currently looking for/found.

Returns
the AI's current target-type

◆ GetDamageLastFrame()

float AiFunc::GetDamageLastFrame ( )

Returns the damage taken by the character in the last frame.

Returns
the damage taken by the character in the last frame

◆ GetDist()

float AiFunc::GetDist ( TARGET target)

Returns the distance between the character and the target, taking into account the hit capsules.

Parameters
targettarget to measure distance to
Returns
the distance between the character and the target, taking into account the hit capsules

◆ GetDistAtoB()

float AiFunc::GetDistAtoB ( TARGET targetA,
TARGET targetB )

Returns the distance between targetA and targetB, taking into account the hit capsules.

Parameters
targetApoint 1
targetBpoint 2
Returns
the distance between targetA and targetB, taking into account the hit capsules

◆ GetDistParam()

float AiFunc::GetDistParam ( DIST distanceType)

Converts distance type into distance. DIST_Near = 3 DIST_Middle = 6 DIST_Far = 15 DIST_Out = 999 DIST_None = 3.402823e+38 (MAX FLOAT) else = -1.

Parameters
distanceTypedistance type to convert into distance
Returns
the distance from the given distance type

◆ GetDistXZ()

float AiFunc::GetDistXZ ( TARGET target)

Returns the strictly horizontal distance between the character and the target, taking into account the hit capsules.

Parameters
targettarget to measure distance to
Returns
the strictly horizontal distance between the character and the target, taking into account the hit capsules

◆ GetDistY()

float AiFunc::GetDistY ( TARGET target)

Returns the strictly vertical distance between the character and the target.

Parameters
targetthe strictly vertical distance between the character and the target
Returns

◆ GetDistYSigned()

float AiFunc::GetDistYSigned ( TARGET target)

Returns the strictly vertical distance between the character and the target, signed as such (targetY - characterY)

Parameters
target
Returns
the strictly vertical distance between the character and the target, signed as such (targetY - characterY)

◆ GetEquipArrowBoltId()

int AiFunc::GetEquipArrowBoltId ( TARGET target,
ARROW_OR_BOLT arrowOrBolt,
int slot )

Returns the arrow or bolt equipment id in the given target and slot.

Parameters
targettarget to get equip data from
arrowOrBoltarrow or bolt slot type
slotslot index
Returns
the arrow or bolt equipment id in the given target and slot

◆ GetEquipItemId()

int AiFunc::GetEquipItemId ( TARGET target,
int slot,
ITEM_SLOTTYPE slotType )

Returns the item equipment id in the given target and slot.

Parameters
targettarget to get equip data from
slotslot index
slotTypeitem slot type
Returns
the item equipment id in the given target and slot

◆ GetEquipMagicId()

int AiFunc::GetEquipMagicId ( TARGET target,
int slot )

Returns the magic id in the given target and slot.

Parameters
targettarget target to get equip data from
slotslot slot index
Returns
the magic id in the given target and slot

◆ GetEquipMagicIndex()

int AiFunc::GetEquipMagicIndex ( )

Returns the character's currently selected magic slot.

Returns
the character's currently selected magic slot

◆ GetEquipWeaponId()

int AiFunc::GetEquipWeaponId ( TARGET target,
ARM arm,
int slot )

Returns the weapon equipment id in the given target and slot.

Parameters
target
armtarget to get equip data from
slotarm to get weapon from
Returns
the weapon equipment id in the given target and slot

◆ GetEquipWeaponIndex()

int AiFunc::GetEquipWeaponIndex ( ARM arm)

Returns the currently active weapon slot index in the characterar's given arm.

Parameters
armarm to get the currently active weapon index from
Returns
the currently active weapon slot index in the characterar's given arm

◆ GetEventRequest() [1/2]

int AiFunc::GetEventRequest ( )

Returns the event request value in slot 0. This is used to let events communicate with the AI via INTERUPT_EventRequest.

Returns
the event request value in slot 0

◆ GetEventRequest() [2/2]

int AiFunc::GetEventRequest ( int slot)

Returns the event request value in the given slot. Slots are 0-3. This is used to let events communicate with the AI via INTERUPT_EventRequest.

Parameters
slotslot
Returns
the event request value in the given slot

◆ GetExcelParam()

int AiFunc::GetExcelParam ( AI_EXCEL_THINK_PARAM_TYPE excelParam)

Returns the first active SpecialEffect's overwitten excel param if there is one, otherwise NpcThinkParam's given excel param value.

Parameters
excelParamexcel param to get from NpcThinkParam
Returns
the first active SpecialEffect's overwitten excel param if there is one, otherwise NpcThinkParam's given excel param value

◆ GetExistMeshOnLineDist()

float AiFunc::GetExistMeshOnLineDist ( TARGET target,
AI_DIR_TYPE directionFromTarget,
float maxDistance )

Returns the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1. Equivalent to GetExistMeshOnLineDistEx(target, directionFromTarget, maxDistance, GetHitRadius(), 0).

Parameters
targetline origin
directionFromTargetline direction
maxDistanceline length
Returns
the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1

◆ GetExistMeshOnLineDistEx()

float AiFunc::GetExistMeshOnLineDistEx ( TARGET target,
AI_DIR_TYPE directionFromTarget,
float lineEndDistance,
float lineWidth,
float lineStartDist )

Returns the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1.

Parameters
targetline origin
directionFromTargetline direction
lineEndDistancedistance until the line ends
lineWidthwidth (3D) of the line
lineStartDistdistance until the line begins
Returns
the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1

◆ GetExistMeshOnLineDistSpecifyAngle()

float AiFunc::GetExistMeshOnLineDistSpecifyAngle ( TARGET target,
float angle,
float maxDistance,
AI_SPA_DIR_TYPE spatialDirectionStart )

Returns the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1. Equivalent to GetExistMeshOnLineDistSpecifyAngleEx(target, angle, maxDistance, spatialDirectionStart, GetHitRadius(), 0)

Parameters
targetline origin
angleline direction offset, clockwise
maxDistancedistance until the line ends
spatialDirectionStartline starting direction
Returns
the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1

◆ GetExistMeshOnLineDistSpecifyAngleEx()

float AiFunc::GetExistMeshOnLineDistSpecifyAngleEx ( TARGET target,
float angle,
float lineEndDistance,
AI_SPA_DIR_TYPE spatialDirectionStart,
float lineWidth,
float lineStartDist )

Returns the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1.

Parameters
targetline origin
angleline direction offset, clockwise
lineEndDistancedistance until the line ends
spatialDirectionStartline starting direction
lineWidthwidth (3D) of the line
lineStartDistdistance until the line begins
Returns
the distance between the given target and the furthest nav mesh that collides with the given line. If none are found returns -1

◆ GetFlyRouteState()

int AiFunc::GetFlyRouteState ( )

Does nothing.

Returns
-1

◆ GetHp()

int AiFunc::GetHp ( TARGET target)

Returns the target's hp.

Parameters
targettarget
Returns
the target's hp

◆ GetHpRate()

float AiFunc::GetHpRate ( TARGET target)

Returns the target's hp to max hp ratio.

Parameters
targettarget
Returns
the target's hp to max hp ratio

◆ GetIdTimer()

float AiFunc::GetIdTimer ( int timerId)

Returns the timer's elapsed time since last accessed. Sets the timer to its starting offset (0 by default).

Parameters
timerIdid-timer's id
Returns
the timer's elapsed time since last accessed

◆ GetInitStayId()

int AiFunc::GetInitStayId ( )

Returns the character's event defined idle animation.

Returns
the character's event defined idle animation

◆ GetInsidePlatoonMemberNum()

int AiFunc::GetInsidePlatoonMemberNum ( float p1,
float p2,
float p3,
float p4 )

Does nothing.

Parameters
p1
p2
p3
p4
Returns
0

◆ GetInterruptStatus()

AI_AREAOBSERVE_INTERRUPT AiFunc::GetInterruptStatus ( int observeSlot)

Returns the interrupt status of the given area observer.

Parameters
observeSlotarea observer
Returns
the interrupt status of the given area observer

◆ GetInvadeTriggerRegionCategory()

int AiFunc::GetInvadeTriggerRegionCategory ( int p1)

Does nothing.

Parameters
p1
Returns
0

◆ GetInvadeTriggerRegionCategoryNum()

int AiFunc::GetInvadeTriggerRegionCategoryNum ( )

Does nothing.

Returns
0

◆ GetLadderActState()

int AiFunc::GetLadderActState ( TARGET target)

Returns the target's ladder state.
-1 = Not on
0 = Enter from bottom 1 = Enter from top 2 = Climbing, left hand from bottom to top 3 = Climbing, right hand from bottom to top 4 = Descending, right hand from top to bottom 5 = Descending, left hand from top to bottom 6 = Leave from top 7 = Leave from bottom 8 = Idling on ladder, right hand on top 9 = Idling on ladder, left hand on top 10 = Attack up, right hand on top 11 = Attack up, left hand on top 12 = Attack down, right hand on top 13 = Attack down, left hand on top 14 = Sliding start 16 = Sliding stop 18 = Sliding 20 = Sliding reached bottom 21 = Hit flinch 22 = Hit hanging on.

Parameters
targettarget
Returns
the target's ladder state

◆ GetLadderDirMove()

int AiFunc::GetLadderDirMove ( int p1)

Retruns 1 if the ladder path is upwards, -1 if downwards.

Parameters
p1unused
Returns
1 if the ladder path is upwards, -1 if downwards

◆ GetLatestAttackedDir()

int AiFunc::GetLatestAttackedDir ( )

Returns the atkDir_forSfx value of the last attack the AI detected.

Returns
the atkDir_forSfx value of the last attack the AI detected

◆ GetLatestSoundBehaviorID()

int AiFunc::GetLatestSoundBehaviorID ( )

Returns the last detected sound's (AiSoundParam) soundBehaviorId if its rank is "behavior" (7).

Returns
the last detected sound's (AiSoundParam) soundBehaviorId if its rank is "behavior" (7)

◆ GetLatestSoundTargetID()

int AiFunc::GetLatestSoundTargetID ( )

Returns the last detected sound's param id.

Returns
the last detected sound's param id

◆ GetLatestSoundTargetRank()

AI_SOUND_RANK AiFunc::GetLatestSoundTargetRank ( )

Returns the last detected sound's rank.

Returns
the last detected sound's rank

◆ GetLeaveTriggerRegionCategory()

int AiFunc::GetLeaveTriggerRegionCategory ( int p1)

Does nothing.

Parameters
p1
Returns
0

◆ GetLeaveTriggerRegionCategoryNum()

int AiFunc::GetLeaveTriggerRegionCategoryNum ( )

Does nothing.

Returns
0

◆ GetMagicCategory()

int AiFunc::GetMagicCategory ( int magicId)

Returns the given magic's ezStateBehaviorType (0 = sorcery, 1 = incantation, 2 = pyromancy, 3 = vow type).

Parameters
magicIdmagic param id
Returns
the given magic's ezStateBehaviorType

◆ GetMapHitRadius()

int AiFunc::GetMapHitRadius ( int target)

Returns the target's map hit radius (often simply called hitRadius in places like DSMS).

Parameters
targettarget
Returns
the target's map hit radius

◆ GetMeshHeight()

float AiFunc::GetMeshHeight ( TARGET target,
AI_DIR_TYPE directionFromTarget,
float maxDistance )

Returns 99999 if the given line doesn't end on a nav mesh, otherwise global y pos of the mesh.

Parameters
targetline origin
directionFromTargetline direction
maxDistanceline length
Returns
99999 if the given line doesn't end on a nav mesh, otherwise global y pos of the mesh

◆ GetMeshHeightSpecifyAngle()

float AiFunc::GetMeshHeightSpecifyAngle ( TARGET target,
float angle,
float maxDistance,
AI_SPA_DIR_TYPE spatialDirectionStart )

Returns 99999 if the given line doesn't end on a nav mesh, otherwise global y pos of the mesh.

Parameters
targetline origin
angleline direction offset, clockwise
maxDistancedistance until the line ends
spatialDirectionStartline starting direction
Returns
99999 if the given line doesn't end on a nav mesh, otherwise global y pos of the mesh

◆ GetMovePointActionId()

int AiFunc::GetMovePointActionId ( int pointIndex)
Parameters
pointIndex
Returns

◆ GetMovePointEffectRange()

float AiFunc::GetMovePointEffectRange ( )
Returns

◆ GetMovePointNumber()

int AiFunc::GetMovePointNumber ( )
Returns

◆ GetMovePointType()

int AiFunc::GetMovePointType ( )
Returns

◆ GetMp()

int AiFunc::GetMp ( TARGET target)

Returns the target's fp.

Parameters
targettarget
Returns
the target's fp

◆ GetMsbPartsIdx()

int AiFunc::GetMsbPartsIdx ( )

Does nothing.

Returns
0

◆ GetMyBlockID()

int AiFunc::GetMyBlockID ( )

Does nothing.

Returns
-1

◆ GetNPCActProb()

float AiFunc::GetNPCActProb ( int actId)

Returns the probability of the given act.

Parameters
actIdact id as defined by row 1 in NpcAiBehaviorProbability
Returns
the probability of the given act

◆ GetNpcThinkParamID()

int AiFunc::GetNpcThinkParamID ( )

Returns the character's NpcThinkParam id.

Returns
the character's NpcThinkParam id

◆ GetNumber()

float AiFunc::GetNumber ( int index)

Returns the number stored at the given index (0-63)

Parameters
indexindex
Returns
the number stored at the given index (0-63)

◆ GetNumFriend()

int AiFunc::GetNumFriend ( float distance)

Returns the number of characters with friendly team type towards the character within the given distance.

Parameters
distancemax search distance
Returns
the number of characters with friendly team type towards the character within the given distance

◆ GetObjBreakRate()

float AiFunc::GetObjBreakRate ( unsigned int objId)
Parameters
objId
Returns

◆ GetOffsetY()

float AiFunc::GetOffsetY ( TARGET target)

Returns the target's hitYOffset, the offset between the position (on the ground) and the character's actual position usually used for flying characters but not always (for example bats have 0.8).

Parameters
targettarget
Returns
the target's hitYOffset

◆ GetOriginDist()

float AiFunc::GetOriginDist ( TARGET target)

Returns the distance to the target without taking into account hit capsule, meaning the distance to their exact physics position.

Parameters
targettarget
Returns
the distance to the target without taking into account hit capsule

◆ GetPartsDmg()

int AiFunc::GetPartsDmg ( int p1)

Does nothing.

Parameters
p1
Returns
0

◆ GetPathResult()

int AiFunc::GetPathResult ( )

Returns 0 if mid pathing, otherwise -1.

Returns
0 if mid pathing, otherwise -1

◆ GetPlatoonCommand()

AiPlatoonCommand * AiFunc::GetPlatoonCommand ( )

Returns the AI's platoon command object, if there is none return a default empty platoon command object.

Returns
the AI's platoon command object, if there is none return a default empty platoon command object

◆ GetPlatoonMemberNum()

int AiFunc::GetPlatoonMemberNum ( )

Returns the amount of members/ais in the AI's platoon.

Returns
the amount of members/ais in the AI's platoon

◆ GetPlatoonRanking()

int AiFunc::GetPlatoonRanking ( )

Does nothing.

Returns
-1

◆ GetPlatoonState()

PLATOON_STATE AiFunc::GetPlatoonState ( )

Returns AI's platoon's state, if there is none then -1.

Returns
AI's platoon's state, if there is none then -1

◆ GetPrevMovePointNumber()

int AiFunc::GetPrevMovePointNumber ( )
Returns

◆ GetPrevTargetState()

AI_TARGET_STATE AiFunc::GetPrevTargetState ( )

Returns the AI's previous target-state. In what state is the AI in in regards to targeting/searching for target.

Returns
the AI's previous target-state

◆ GetRandam_Float()

float AiFunc::GetRandam_Float ( float min,
float max )

Returns a random float between the given bounds, uniform distribution, min inclusive max exclusive. = [0-1) * (max - min) + min.

Parameters
minlower bound
maxupper bound
Returns
a random float between the given bounds, uniform distribution, min inclusive max exclusive

◆ GetRandam_Int()

int AiFunc::GetRandam_Int ( int min,
int max )

Returns a random integer between the given bounds, inclusive. If min > max or min < 0 then behavior is poorly defined. = (int)([0-1) * (max - min + 1.0) + min) The casting to int as opposed to floor will make negative floats round upwards.

Parameters
minlower bound
maxupper bound
Returns
a random integer between the given bounds, inclusive

◆ GetRelativeAngleFromTarget()

float AiFunc::GetRelativeAngleFromTarget ( TARGET target)

Returns the angle from the target's front to the character, clockwise.

Parameters
targettarget to measure from
Returns
the angle from the target's front to the character, clockwise

◆ GetRemainingAttackCoolTime()

float AiFunc::GetRemainingAttackCoolTime ( int animationId)

Returns the difference between the cooldown time set for the given animation and the time lapsed since its last usage, if it hasn't been used yet then 0. Animation ID offset is automatically added and does count as a different animation for cooldowns.

Parameters
animationIdanimation to check
Returns
the difference between the cooldown time set for the given animation and the time lapsed since its last usage, if it hasn't been used yet then 0

◆ GetReplanningGoalAction()

int AiFunc::GetReplanningGoalAction ( )

Returns NpcThinkParam's goalAction_ToCautionImportant if AI targeting search is currently "important", otherwise goalAction_ToCaution. Unused in ER where they instead directly get the params with GetExcelParam.

Returns
NpcThinkParam's goalAction_ToCautionImportant if AI targeting search is currently "important", otherwise goalAction_ToCaution

◆ GetReplanningGoalID()

int AiFunc::GetReplanningGoalID ( )

Returns NpcThinkParam's goalAction_ToCautionImportant if AI targeting search is currently "important", otherwise goalAction_ToCaution. Unused in ER where they instead directly get the params with GetExcelParam.

Returns
NpcThinkParam's goalAction_ToCautionImportant if AI targeting search is currently "important", otherwise goalAction_ToCaution

◆ GetRideObjEntityID()

unsigned int AiFunc::GetRideObjEntityID ( )

Returns map object that entity rides?

Returns

◆ GetSA()

float AiFunc::GetSA ( TARGET target)

Returns the target's poise rounded down.

Parameters
targettarget
Returns
the target's poise rounded down

◆ GetSp()

int AiFunc::GetSp ( TARGET target)

Returns the target's stamina.

Parameters
targettarget
Returns
the target's stamina

◆ GetSpecialEffectActivateInterruptId()

bool AiFunc::GetSpecialEffectActivateInterruptId ( int specialEffectId)

Returns true if the given special effect has been applied on any target that is being observed for the given special effect id, meaning this has been observed this frame. If the AI observes the same special effect on multiple targets, this will be true on activation regardless of the target.

Parameters
specialEffectIdspecial effect id to check
Returns
true if the given special effect has been applied on any target that is being observed for the given special effect id, otherwise false

◆ GetSpecialEffectActivateInterruptNum()

int AiFunc::GetSpecialEffectActivateInterruptNum ( )

Returns the amount of special effect observes that are in interrupt activate state. Meaning the amount of special effect observes that have been activated this frame. the amount of special effect observes that are in interrupt activate state.

Returns

◆ GetSpecialEffectActivateInterruptType()

int AiFunc::GetSpecialEffectActivateInterruptType ( int interruptsActivatedUntilReturn)

Returns the special effect id of the nth special effect observe that is in interrupt activate state. I would not recommend using this method as the order of the special effect observe nodes depends on the order you added them which on many cases can be subject to change over development.

Parameters
interruptsActivatedUntilReturnthe number of special effect observes in an activated state to skip before returning the observe's special effect id
Returns
the special effect id of the nth special effect observe that is in interrupt activate state

◆ GetSpecialEffectDeActivateInterruptId()

bool AiFunc::GetSpecialEffectDeActivateInterruptId ( int specialEffectId)

Returns true if the given special effect has worn off on any target that is being observed for the given special effect id, meaning this has been observed this frame.

Parameters
specialEffectIdspecial effect id to check
Returns
true if the given special effect has worn off on any target that is being observed for the given special effect id, otherwise false

◆ GetSpecialEffectInactivateInterruptNum()

int AiFunc::GetSpecialEffectInactivateInterruptNum ( )

Returns the amount of special effect observes that are in interrupt deactivate state. Meaning the amount of special effect observes that have been deactivated this frame.

Returns
the amount of special effect observes that are in interrupt deactivate state

◆ GetSpecialEffectInactivateInterruptType()

int AiFunc::GetSpecialEffectInactivateInterruptType ( int interruptsDeactivatedUntilReturn)

Returns the special effect id of the nth special effect observe that is in interrupt deactivate state. I would not recommend using this method as the order of the special effect observe nodes depends on the order you added them which on many cases can be subject to change over development.

Parameters
interruptsDeactivatedUntilReturnthe number of special effect observes in a deactivated state to skip before returning the observe's special effect id
Returns
the special effect id of the nth special effect observe that is in interrupt deactivate state

◆ GetStringIndexedArray()

float AiFunc::GetStringIndexedArray ( char * arrayName,
int index )

Returns the number that is stored in the given array's given index. The structure of these is questionable, having 1 big (1024) float array buffer where each "array" is a pointer to somewhere in this buffer.

Parameters
arrayNamearrayName array to use
indexindex in array
Returns
the number that is stored in the given array's given index

◆ GetStringIndexedNumber()

float AiFunc::GetStringIndexedNumber ( char * variableName)

Returns the number that has been set for the given string.

Parameters
variableNamevariable name whose value to return
Returns
the number that has been set for the given string

◆ GetTargetApproachSpeed()

float AiFunc::GetTargetApproachSpeed ( )

Does nothing.

Returns
0

◆ GetTargetSARate()

float AiFunc::GetTargetSARate ( TARGET target)

Returns the target's poise to max poise ratio.

Parameters
targettarget
Returns
the target's poise to max poise ratio

◆ GetTeamCommand()

int AiFunc::GetTeamCommand ( )

Does nothing.

Returns
0

◆ GetTeamDefeatEntityId()

unsigned int AiFunc::GetTeamDefeatEntityId ( )
Returns

◆ GetTeamIdTimer()

float AiFunc::GetTeamIdTimer ( int p1)

Does nothing.

Parameters
p1
Returns
0

◆ GetTeamInterruptCommand()

int AiFunc::GetTeamInterruptCommand ( )

Does nothing.

Returns
0

◆ GetTeamNumber()

float AiFunc::GetTeamNumber ( int p1)

Does nothing.

Parameters
p10
Returns

◆ GetTeamOrder()

float AiFunc::GetTeamOrder ( ORDER_TYPE orderType)

Returns the AI's role type/call help type (?).

Parameters
orderTypeorderType get Role or CallHelp
Returns
the AI's role type/call help type (?)

◆ GetTeamRecordCount()

int AiFunc::GetTeamRecordCount ( int p1,
TARGET target,
float p3 )
Parameters
p1
target
p3
Returns

◆ GetTeamType()

TEAM_TYPE AiFunc::GetTeamType ( TARGET target)

Returns the target's team type.

Parameters
targettarget
Returns
the target's team type

◆ GetTimer()

float AiFunc::GetTimer ( int index)

Returns the given timer's remaining time.

Parameters
indextimer index
Returns
the given timer's remaining time

◆ GetTopGoal()

GoalFunc * AiFunc::GetTopGoal ( )

Returns the AI's top goal.

Returns
the AI's top goal

◆ GetToTargetAngle()

float AiFunc::GetToTargetAngle ( TARGET target)

Returns the angle (-180, 180) from the character's front to the target, clockwise.

Parameters
targettarget
Returns
the angle (-180, 180) from the character's front to the target, clockwise

◆ GetTouchBreakableObjectDefense()

int AiFunc::GetTouchBreakableObjectDefense ( )

Returns the defense/health of the object the AI is touching, used to determine if the AI is strong enough to break the object (see top_goal.lua).

Returns
the defense/health of the object the AI is touching

◆ GetTurnAroundOptimizedDirection()

AI_DIR_TYPE AiFunc::GetTurnAroundOptimizedDirection ( TARGET target,
AI_DIR_TYPE direction )

Returns AI_DIR_TYPE_L if the given direction from the target is pointing beyond the AI, otherwise AI_DIR_TYPE_R. Let the AI be at (0, 0, 0) If the vector "targetPos + directionFromTargetForwardsNormal * 10" is closer to "selfNormalForwards" than "selfNormalBackwards" then the direction is right, otherwise left.

Parameters
targettarget
directiondirection
Returns
AI_DIR_TYPE_L if the given direction from the target is pointing beyond the AI, otherwise AI_DIR_TYPE_R

◆ GetWeaponBehaviorVarID()

int AiFunc::GetWeaponBehaviorVarID ( int equipWeaponId)

Returns the behaviorVariationId of the given EquipParamWeapon.

Parameters
equipWeaponIdEquipParamWeapon id
Returns
the behaviorVariationId of the given EquipParamWeapon

◆ GetWeaponBothHandState()

int AiFunc::GetWeaponBothHandState ( TARGET target)

If the target is 2 handing return the arm that is doing so, otherwise return -1.

Parameters
targettarget
Returns
the arm that is 2 handing if it exists, otherwise -1

◆ GetWeightType()

AI_TARGET_WEIGHT_TYPE AiFunc::GetWeightType ( TARGET target)

Returns the weight type of the target.

Parameters
targettarget
Returns
the weight type of the target

◆ GetWepCategoryNo()

int AiFunc::GetWepCategoryNo ( ARM arm)

Returns the wepmotionCategory of the weapon in the character's given arm.

Parameters
armarm
Returns
the wepmotionCategory of the weapon in the character's given arm

◆ GetWepCateLeft()

WEP_CATE AiFunc::GetWepCateLeft ( TARGET target)

Returns the left hand's AI weapon's category. 1 = Torch 2 = Bow 3 = Crossbow 4 = Staff 0 = Other.

Parameters
targettarget
Returns
the left hand's AI weapon's category

◆ GetWepCateRight()

WEP_CATE AiFunc::GetWepCateRight ( TARGET target)

Returns the right hand's AI weapon's category. 1 = Torch 2 = Bow 3 = Crossbow 4 = Staff 0 = Other.

Parameters
targettarget
Returns
the right hand's AI weapon's category

◆ GetWepSpAtkCategoryNo()

int AiFunc::GetWepSpAtkCategoryNo ( ARM arm)

Returns the spAtkcategory of the weapon in the character's given arm.

Parameters
armarm
Returns
the spAtkcategory of the weapon in the character's given arm

◆ HasConnectionReserve()

bool AiFunc::HasConnectionReserve ( )

Does nothing.

Returns
false

◆ HasGoal()

bool AiFunc::HasGoal ( int goalId)

Returns true if the AI has the given goal in queue (regardless of child depth), otherwise false.

Parameters
goalIdgoal to check for
Returns
true if the AI has the given goal in queue, otherwise false

◆ HasParalysis()

bool AiFunc::HasParalysis ( TARGET target)

Returns true if the target has a special effect with stateInfo 32 (Middle of Paralysis).

Parameters
targettarget
Returns
true if the target has a special effect with stateInfo 32

◆ HasPathResult()

bool AiFunc::HasPathResult ( )

Returns true if the AI has results for the current pathing attempt, otherwise false.

Returns
true if the AI has results for the current pathing attempt, otherwise false

◆ HasSpecialEffectAttribute()

bool AiFunc::HasSpecialEffectAttribute ( TARGET target,
int stateInfo )

Returns true if the target has a special effect with the given stateInfo, otherwise false.

Parameters
targettarget
stateInfostate info to check for
Returns
true if the target has a special effect with the given stateInfo, otherwise false

◆ HasSpecialEffectCategory()

bool AiFunc::HasSpecialEffectCategory ( TARGET target,
int category )

Returns true if the target has a special effect with the given category, otherwise false.

Parameters
targettarget
categorycategory to check for
Returns
true if the target has a special effect with the given category, otherwise false

◆ HasSpecialEffectId()

bool AiFunc::HasSpecialEffectId ( TARGET target,
int specialEffectId )

Returns true if the target has a special effect with the given id, otherwise false.

Parameters
targettarget
specialEffectIdspecial effect id to check for
Returns
true if the target has a special effect with the given id, otherwise false

◆ HasTopSubgoal()

bool AiFunc::HasTopSubgoal ( )

Returns true if the top goal has a subgoal, otherwise false.

Returns
true if the top goal has a subgoal, otherwise false

◆ IsActiveGoal()

bool AiFunc::IsActiveGoal ( int goalId)

Returns true if the given goal is currently active/running, otherwise false.

Parameters
goalIdgoalId goal to check for
Returns
true if the given goal is currently active/running, otherwise false.

◆ IsAiJumping()

bool AiFunc::IsAiJumping ( )

Returns true if the character is mid/ending a jump, otherwise false.

Returns
true if the character is mid/ending a jump, otherwise false

◆ IsAiJumpProcessing()

bool AiFunc::IsAiJumpProcessing ( )

Returns true if the character is: about to start/mid/ending a jump, otherwise false.

Returns
true if the character is: about to start/mid/ending a jump, otherwise false

◆ IsApparentAnyFriend()

bool AiFunc::IsApparentAnyFriend ( )

Returns true if the AI has a friend in its targeting system (TARGET_FRI_0 has a target), otherwise false.

Returns
true if the AI has a friend in its targeting system, otherwise false

◆ IsApparentDeath()

bool AiFunc::IsApparentDeath ( )

Returns true if the character is dead/dying (player only?), otherwise false.

Returns
true if the character is dead/dying (player only?), otherwise false

◆ IsArrived()

bool AiFunc::IsArrived ( )

Returns true if arrived to the position specified by current pathing, otherwise false.

Returns
true if arrived to the position specified by current pathing, otherwise false

◆ IsBattleState()

bool AiFunc::IsBattleState ( )

Returns true if in battle state (usually battle goals). Equivalent to GetCurrTargetState() == AI_TARGET_STATE__BATTLE.

Returns
true if in battle state, otherwise false

◆ IsBothHandMode()

bool AiFunc::IsBothHandMode ( TARGET target)

Returns true if the target is two handing, otherwise false.

Parameters
targettarget
Returns
true if the target is two handing, otherwise false

◆ IsCautionState()

bool AiFunc::IsCautionState ( )

Returns true if in caution state (usually represented by slowly walking around a sound/last remembered target's position). Equivalent to GetCurrTargetState() == AI_TARGET_STATE__CAUTION.

Returns
true if in caution state, otherwise false

◆ IsChangeState()

bool AiFunc::IsChangeState ( )

Returns true if the previous state is different from the current state.

Returns
true if the previous state is different from the current state

◆ IsChrAroundLadderEdge()

bool AiFunc::IsChrAroundLadderEdge ( float distance,
int ladderDmyId )

Returns true if the character is within the given distance to the given ladder edge, otherwise false.

Parameters
distancemax distance
ladderDmyId191 for top of ladder, 192 for bottom
Returns
true if the character is within the given distance to the given ladder edge, otherwise false

◆ IsClanLeader()

bool AiFunc::IsClanLeader ( )

Does nothing.

Returns
false

◆ IsEnableCancelAttack()

bool AiFunc::IsEnableCancelAttack ( )

Returns true if the character has EnableCancelAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 86 known as "End if AI Attack Queued", otherwise false.

Returns
true if the character has EnableCancelAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 86 known as "End if AI Attack Queued", otherwise false

◆ IsEnableCancelAttack_CheckAttackNo()

bool AiFunc::IsEnableCancelAttack_CheckAttackNo ( int actionRequestId)

Returns true if the AI's current request equals the given request id and the character has EnableCancelAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 86 known as "End if AI Attack Queued", otherwise false.

Parameters
actionRequestIdez action request id that the current request id must match
Returns
true if the AI's current request equals the given request id and the character has EnableCancelAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 86 known as "End if AI Attack Queued", otherwise false

◆ IsEnableCancelMove()

bool AiFunc::IsEnableCancelMove ( )

Returns true if the character has EnableCancelMove enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 78 known as "Cancel - AI Move", otherwise false.

Returns
true if the character has EnableCancelMove enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 78 known as "Cancel - AI Move", otherwise false

◆ IsEnableCancelMove_CheckAttackNo()

bool AiFunc::IsEnableCancelMove_CheckAttackNo ( int actionRequestId)

Returns true if the AI's current request equals the given request id and the character has EnableCancelMove enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 78 known as "Cancel - AI Move", otherwise false.

Parameters
actionRequestIdez action request id that the current request id must match
Returns
true if the AI's current request equals the given request id and the character has EnableCancelMove enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 78 known as "Cancel - AI Move", otherwise false

◆ IsEnableCancelStep()

bool AiFunc::IsEnableCancelStep ( )

Returns true if the character has EnableCancelStep enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 79 known as "Cancel - AI Step", otherwise false.

Returns
true if the character has EnableCancelStep enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 79 known as "Cancel - AI Step", otherwise false

◆ IsEnableCancelStep_CheckAttackNo()

bool AiFunc::IsEnableCancelStep_CheckAttackNo ( int actionRequestId)

Returns true if the AI's current request equals the given request id and the character has EnableCancelStep enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 79 known as "Cancel - AI Step", otherwise false.

Parameters
actionRequestIdez action request id that the current request id must match
Returns
true if the AI's current request equals the given request id and the character has EnableCancelStep enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 79 known as "Cancel - AI Step", otherwise false

◆ IsEnableComboAttack()

bool AiFunc::IsEnableComboAttack ( )

Returns true if the character has EnableComboAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 23 known as "Cancel - AI ComboAttack", otherwise false.

Returns
true if the character has EnableComboAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 23 known as "Cancel - AI ComboAttack", otherwise false

◆ IsEnableComboAttack_CheckAttackNo()

bool AiFunc::IsEnableComboAttack_CheckAttackNo ( int actionRequestId)

Returns true if the AI's current request equals the given request id and the character has EnableComboAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 23 known as "Cancel - AI ComboAttack", otherwise false.

Parameters
actionRequestIdez action request id that the current request id must match
Returns
true if the AI's current request equals the given request id and the character has EnableComboAttack enabled, enabled through TAE 0 "ChrActionFlag"/"JumpTable" 23 known as "Cancel - AI ComboAttack", otherwise false

◆ IsEnableNewLadderAct()

bool AiFunc::IsEnableNewLadderAct ( )

Does nothing.

Returns
true

◆ IsEventFlag()

bool AiFunc::IsEventFlag ( unsigned int eventFlagId)

Returns the given event flag's value.

Parameters
eventFlagIdeventFlagId event flag to check
Returns
the given event flag's value

◆ IsEventRequestReceived()

bool AiFunc::IsEventRequestReceived ( int slot)

Returns true if there is an event request in the given slot, otherwise false. See GetEventRequest(int)

Parameters
slotslot
Returns
true if there is an event request in the given slot, otherwise false

◆ IsExecChangeStateAction()

bool AiFunc::IsExecChangeStateAction ( )

Returns ttrue if the current state isn't AI_TARGET_STATE__CAUTION or if the last state is AI_TARGET_STATE__NONE.

Returns
true if the current state isn't AI_TARGET_STATE__CAUTION or if the last state is AI_TARGET_STATE__NONE

◆ IsExistChrOnLineSpecifyAngle()

bool AiFunc::IsExistChrOnLineSpecifyAngle ( TARGET target,
float angle,
float maxDistance,
AI_SPA_DIR_TYPE spatialDirectionStart )

Returns true if there exists a character on the given line besides the target, otherwise false. Width is hit radius of the target.

Parameters
targetline origin and width
angleline direction offset, clockwise
maxDistanceline length
spatialDirectionStartline starting direction
Returns
true if there exists a character on the given line besides the target, otherwise false

◆ IsExistChrSelfToTarget()

bool AiFunc::IsExistChrSelfToTarget ( TARGET target)

Returns true if there exists a character on the line between self and the target, otherwise false.

Parameters
targettarget to measure to
Returns
true if there exists a character on the line between self and the target, otherwise false

◆ IsExistMeshOnLine()

bool AiFunc::IsExistMeshOnLine ( TARGET target,
AI_DIR_TYPE directionFromTarget,
float maxDistance )

Returns true if there exists a nav mesh that collides with the given line, otherwise false. Width is hit radius of the target.

Parameters
targetline origin and width
directionFromTargetline direction
maxDistanceline length
Returns
true if there exists a nav mesh that collides with the given line, otherwise false

◆ IsExistReqObjAct()

bool AiFunc::IsExistReqObjAct ( )
Returns

◆ IsExistTargetTeamDefeat()

bool AiFunc::IsExistTargetTeamDefeat ( )

Equivalent to GetTeamDefeatEntityId() != -1.

Returns

◆ IsExistTeamNumber()

bool AiFunc::IsExistTeamNumber ( )

Does nothing.

Returns
false

◆ IsExistTeamRecord()

bool AiFunc::IsExistTeamRecord ( int recordId)

Returns true if the given team record exists, otherwise false.

Parameters
recordIdrecordId
Returns
true if the given team record exists, otherwise false

◆ IsFindState()

bool AiFunc::IsFindState ( )

Does nothing.

Returns
false

◆ IsFinishAttack()

bool AiFunc::IsFinishAttack ( )

Returns true if attack is over.

Returns
true if attack is over

◆ IsFinishAttack_CheckAttackNo()

bool AiFunc::IsFinishAttack_CheckAttackNo ( int actionRequestId)
Parameters
actionRequestIdez action request id that the current request id must match
Returns

◆ IsFinishAttackCoolTime()

bool AiFunc::IsFinishAttackCoolTime ( int animationId)

Returns true if the cooldown time set for the given animation is smaller than the time lapsed since its last usage, otherwise false.

Parameters
animationIdanimation to check
Returns
true if the cooldown time set for the given animation is smaller than the time lapsed since its last usage, otherwise false

◆ IsFinishObjAct()

bool AiFunc::IsFinishObjAct ( )
Returns

◆ IsFinishTimer()

bool AiFunc::IsFinishTimer ( int index)

Returns true if the given timer's remaining time is less than or equal to 0, otherwise false.

Parameters
indextimer index
Returns
true if the given timer's remaining time is less than or equal to 0, otherwise false

◆ IsFlyState()

bool AiFunc::IsFlyState ( )

Returns the character's fly state.

Returns
the character's fly state

◆ IsForceBattleGoal()

bool AiFunc::IsForceBattleGoal ( )

Returns force battle goal. Set manually by AI functions. If true then battle goal will be priortized (see _COMMON_SetBattleActLogic in common_logic_func.lua)

Returns
force battle goal

◆ IsForgettingMemoryTarget()

bool AiFunc::IsForgettingMemoryTarget ( )

Returns true if the AI's targeting system's memory target is being forgotten, otherwise false. For example the time until forgetting an enemy memory is 30 seconds from losing your target.

Returns
true if the AI's targeting system's memory target is being forgotten, otherwise false

◆ IsForgettingSoundTarget()

bool AiFunc::IsForgettingSoundTarget ( )

Returns true if the AI's targeting system's sound target is being forgotten, otherwise false. For example the time until forgetting an enemy sound is 30 seconds from hearing it.

Returns
true if the AI's targeting system's sound target is being forgotten, otherwise false

◆ IsForgettingTopSearchTarget()

bool AiFunc::IsForgettingTopSearchTarget ( )
Returns

◆ IsGotHome()

bool AiFunc::IsGotHome ( )

Returns true if the AI arrived to its home location using the path described by BackToHome goal, otherwise false. This value starts as false, but once true it stays so until the AI is no longer doing regular route actions.

Returns
true if the AI arrived to its home location using the path described by BackToHome goal, otherwise false

◆ IsHitAttack()

bool AiFunc::IsHitAttack ( )

Returns true if the character hit an attack within the current goal, otherwise false. Does not matter which character the AI hits, iframes prevent this from activating.

Returns
true if the character hit an attack within the current goal, otherwise false

◆ IsHoleFlag()

bool AiFunc::IsHoleFlag ( TARGET target,
AI_DIR_TYPE directionFromTarget,
float distance )
Parameters
targetline origin
directionFromTargetline direction
distanceline length
Returns

◆ IsHorseCall()

bool AiFunc::IsHorseCall ( )

Returns true if the local player has SpEffect 3039, otherwise false.

Returns
true if the local player has SpEffect 3039, otherwise false

◆ IsHoverType()

bool AiFunc::IsHoverType ( )
Returns

◆ IsHugeEnemy()

bool AiFunc::IsHugeEnemy ( )

Returns true if the character's NpcParam's chrHitGroupAndNavimesh is 5, otherwise false.

Returns
true if the character's NpcParam's chrHitGroupAndNavimesh is 5, otherwise false

◆ IsInsideBattleArea()

bool AiFunc::IsInsideBattleArea ( )
Returns

◆ IsInsideMovePoint()

bool AiFunc::IsInsideMovePoint ( )

Returns true if the character is near its move point, otherwise false. Default distance is 0.5, can vary based on MsbPoint data?

Returns
true if the character is near its move point, otherwise false.

◆ IsInsideMsbRegion()

bool AiFunc::IsInsideMsbRegion ( TARGET target,
AI_DIR_TYPE direction,
float length,
unsigned int regionId )

Returns true if the position defined by the given parameters is within the given region, otherwise false.

Parameters
targetline origin
directionline direction
lengthline length
regionIdevent region id
Returns
true if the position defined by the given parameters is within the given region, otherwise false

◆ IsInsideObserve()

bool AiFunc::IsInsideObserve ( int observeSlot)

Returns true if the given observer's target is inside the observer's area, otherwise false.

Parameters
observeSlotarea observer slot
Returns
true if the given observer's target is inside the observer's area, otherwise false

◆ IsInsideTarget() [1/2]

bool AiFunc::IsInsideTarget ( TARGET target,
AI_DIR_TYPE directionStart,
float angleWidth )

Returns true if the given target is within the given circular sector, otherwise false. The origin of the circular sector is the character. The radius of the circular sector is infinite.

Parameters
targettarget to check
directionStartdirection from the character's front with which the circular sector is aligned
angleWidthangle width of the circular sector
Returns
true if the given target is within the given circular sector, otherwise false

◆ IsInsideTarget() [2/2]

bool AiFunc::IsInsideTarget ( TARGET target,
AI_DIR_TYPE directionStart,
float angleWidth,
float angleHeight )

Returns true if the given target is within the given spherical sector, otherwise false. The origin of the spherical sector is the character. The radius of the spherical sector is infinite.

Parameters
targettarget to check
directionStartdirection from the character's front with which the spherical sector is aligned
angleWidthangle width of the spherical sector
angleHeightangle height of the spherical sector
Returns
true if the given target is within the given spherical sector, otherwise false

◆ IsInsideTargetCustom()

bool AiFunc::IsInsideTargetCustom ( TARGET targetOrigin,
TARGET target,
AI_DIR_TYPE directionStart,
float angleWidth,
float angleHeight,
float distance )

Returns true if the given target is within the given spherical sector, otherwise false.

Parameters
targetOriginorigin of the spherical sector
targettarget to check
directionStartdirection from the character's front with which the spherical sector is aligned
angleWidthangle width of the spherical sector
angleHeightangle height of the spherical sector
distanceradius of the spherical sector
Returns
true if the given target is within the given spherical sector, otherwise false

◆ IsInsideTargetEx()

bool AiFunc::IsInsideTargetEx ( TARGET targetOrigin,
TARGET target,
AI_DIR_TYPE directionStart,
float angleWidth,
float distance )

Returns true if the given target is within the given circular sector, otherwise false.

Parameters
targetOrigintargetOrigin origin of the circular sector
targettarget to check
directionStartdirection from the character's front with which the circular sector is aligned
angleWidthangle width of the circular sector
distanceradius of the circular sector
Returns
true if the given target is within the given circular sector, otherwise false

◆ IsInsideTargetRegion()

bool AiFunc::IsInsideTargetRegion ( TARGET target,
unsigned int regionId )

Returns true if the given target is within the given region, otherwise false.

Parameters
targettarget to check
regionIdevent region id
Returns
true if the given target is within the given region, otherwise false

◆ IsInterupt()

bool AiFunc::IsInterupt ( INTERUPT interruptType)

Returns true if the given interrupt type is currently active. List of the interrupt types and their activation conditions: INTERUPT_FindEnemy - Activates INTERUPT_FindAttack - Activates when a target attacks, called through HKS script, act(143, 0). INTERUPT_Damaged - Activates when hit by a typical attack / hitbox(e.g not poison). INTERUPT_Damaged_Stranger - Activates when hit by a typical attack / hitbox(e.g not poison) whose source isn't in the AI's targeting system. INTERUPT_SuccessGuard - Activates when hit by a typical attack / hitbox(e.g not poison) that caused a successful guard(not guard broken, while guarding in general ? ). Exclusive with INTERUPT_Damaged, INTERUPT_AIGuardBroken. INTERUPT_MissSwing - Activates when a target missed a swing(DS1 only with its unique miss animations). INTERUPT_GuardBegin - Activates when a target begins guarding. INTERUPT_GuardFinish - Activates when a target finishes guarding. INTERUPT_GuardBreak - Activates when a target is guard broken. INTERUPT_Shoot - Activates when a target shoots a bullet, bullets with no damage that have isAiInterruptShootNoDamageBullet row disabled will not activate this interrupt. INTERUPT_UseItem - Activates when a target uses an item, called through HKS script, act(143, 1). INTERUPT_EventRequest - Activates when "RequestCharacterAICommand" (2004[17]) is called in an event script(EMEVD).Interrupt info functions: GetEventRequest. INTERUPT_AIGuardBroken - Activates when hit by a typical attack / hitbox(e.g not poison) that caused a guard break (while guard broken in general ? ).Exclusive with INTERUPT_Damaged, INTERUPT_SuccessGuard, INTERUPT_AIReboundByOpponentGuard. INTERUPT_AIReboundByOpponentGuard - Activates when hit by a typical attack / hitbox(e.g not poison) that caused a successful guard(not guard broken, while guarding in general ? ) and caused the opponent to "rebound" (weapon / arm recoiled back).Exclusive with INTERUPT_Damaged, INTERUPT_AIGuardBroken. INTERUPT_CANNOT_MOVE_DisableInterupt - Activates INTERUPT_UnfavorableAttack - Activates at the end of an attacking goal if the animation is marked as UnfavorableAttack by EnableUnfavorableAttackCheck and the path from the ai to the target is obstructed.This happens in CSGoalCommonAttack::Update.

Parameters
interruptTypeinterruptType interrupt type to check for
Returns
true if the given interrupt type is currently active, otherwise false

◆ IsLadderAct()

bool AiFunc::IsLadderAct ( TARGET target)

Returns true if the given target is on a ladder, otherwise false. Equivalent to GetLadderActState(TARGET) != -1.

Parameters
targettarget
Returns
true if the given target is on a ladder, otherwise false

◆ IsLand()

bool AiFunc::IsLand ( )

Returns true if the character is touching the ground, otherwise false.

Returns
true if the character is touching the ground, otherwise false

◆ IsLocalPlayer()

bool AiFunc::IsLocalPlayer ( )

Returns true if the character is the local player (main player), otherwise false.

Returns
true if the character is the local player, otherwise false

◆ IsLookToTarget() [1/3]

bool AiFunc::IsLookToTarget ( )

Returns true if the turning target is within the given circular sector, otherwise false. The origin of the circular sector is the character. The radius of the circular sector is infinite. The starting direction of the circular sector is the character's front. Meaning of angle width to each side: (180 = full circle, 90 = semicircle, etc.). Turning target can be seen as the "main target", it is referenced/set with many of the goals (using TurnTo(TARGET)). Equivalent to IsLookToTarget(10)

Returns
true if the turning target is within the given circular sector, otherwise false

◆ IsLookToTarget() [2/3]

bool AiFunc::IsLookToTarget ( float angleWidth)

Returns true if the turning target is within the given circular sector, otherwise false. The origin of the circular sector is the character. The radius of the circular sector is infinite. The starting direction of the circular sector is the character's front. Meaning of angle width to each side: (180 = full circle, 90 = semicircle, etc.) Turning target can be seen as the "main target", it is referenced/set with many of the goals (using TurnTo(TARGET)).

Parameters
angleWidthangle width of the circular sector, to each side
Returns
true if the turning target is within the given circular sector, otherwise false

◆ IsLookToTarget() [3/3]

bool AiFunc::IsLookToTarget ( TARGET target,
float angleWidth )

Returns true if the given target is within the given circular sector, otherwise false. The origin of the circular sector is the character. The radius of the circular sector is infinite. The starting direction of the circular sector is the character's front. Meaning of angle width to each side: (180 = full circle, 90 = semicircle, etc.)

Parameters
targettarget
angleWidthangle width of the circular sector, to each side
Returns
true if the given target is within the given circular sector, otherwise false

◆ IsMemoryState()

bool AiFunc::IsMemoryState ( )

Returns true if in memory state, otherwise false. Equivalent to GetCurrTargetState() == AI_TARGET_STATE__MEMORY.

Returns
true if in memory state, otherwise false

◆ IsNpcPlayer()

bool AiFunc::IsNpcPlayer ( )

Returns true if the character is a player npc, otherwise false.

Returns
true if the character is a player npc, otherwise false

◆ IsOmissionLevel30()

bool AiFunc::IsOmissionLevel30 ( )

Returns true if the character is at omission level 30. Used to determine how much effort the AI should make in certain calculations and operations, as the character is far/offscreen for this omission level.

Returns
true if the character is at omission level 30, AKA low level of detail, otherwise false

◆ IsOnGround_FlyRoute()

bool AiFunc::IsOnGround_FlyRoute ( )

Does nothing.

Returns
false

◆ IsOnNearMesh()

bool AiFunc::IsOnNearMesh ( TARGET target,
AI_DIR_TYPE directionFromTarget,
float maxDistance,
int p4 )

Returns true if the character is pathing on the nav mesh found from the given line?

Parameters
targetline origin
directionFromTargetline direction
maxDistanceline length
p4unknown
Returns
true if the character is pathing on the nav mesh found from the given line?

◆ IsOnNearMeshByPos()

bool AiFunc::IsOnNearMeshByPos ( TARGET target,
AI_DIR_TYPE directionFromTarget,
float maxDistance )

Returns true if the character is pathing on the nav mesh found from the given line?

Parameters
targetline origin
directionFromTargetline direction
maxDistanceline length
Returns
true if the character is pathing on the nav mesh found from the given line?

◆ IsOnPath()

bool AiFunc::IsOnPath ( TARGET target,
AI_DIR_TYPE directionFromTarget,
float maxDistance )

Returns true if the character is pathing on the nav mesh found from the given line? Identical to IsOnNearMeshByPos(TARGET, AI_DIR_TYPE, float).

Parameters
target
directionFromTarget
maxDistance
Returns
true if the character is pathing on the nav mesh found from the given line?

◆ IsOnRideCostMesh()

bool AiFunc::IsOnRideCostMesh ( )
Returns

◆ IsOptimalAttackDist()

bool AiFunc::IsOptimalAttackDist ( )

Does nothing.

Returns
false

◆ IsOptimalAttackRangeH()

bool AiFunc::IsOptimalAttackRangeH ( )

Does nothing.

Returns
false

◆ IsOptimalAttackRangeV()

bool AiFunc::IsOptimalAttackRangeV ( )

Does nothing.

Returns
false

◆ IsPlatoonLeader()

bool AiFunc::IsPlatoonLeader ( )

Retruns true if the AI is the leader of its team, otherwise false.

Returns
true if the AI is the leader of its team, otherwise false

◆ IsProcessingFadeWarpToInitPos()

bool AiFunc::IsProcessingFadeWarpToInitPos ( )

Returns true if the character is currently fade warping, otherwise false. Set by RequestFadeWarpToInitPos and used in the similary named goal.

Returns
true if the character is currently fade warping, otherwise false

◆ IsRideEdgeFlag()

bool AiFunc::IsRideEdgeFlag ( TARGET target)
Parameters
target
Returns

◆ IsRideLargeSpaceFlag()

bool AiFunc::IsRideLargeSpaceFlag ( TARGET target)
Parameters
target
Returns

◆ IsRiding()

bool AiFunc::IsRiding ( TARGET target)

Returns true if the target is riding, otherwise false.

Parameters
targettarget
Returns
true if the target is riding, otherwise false

◆ IsRouteEnd()

bool AiFunc::IsRouteEnd ( )

Returns true if the AI finished its route, otherwise false. This stays true until the AI reaches the start of its route cycle again. If the AI has no route this returns true.

Returns
true if the AI finished its route, otherwise false

◆ IsSearchHighState()

bool AiFunc::IsSearchHighState ( )

Returns true if in search high state, also known as "search2". Equivalent to GetCurrTargetState() == AI_TARGET_STATE__SEARCH2.

Returns
true if in search high state, otherwise false

◆ IsSearchLowState()

bool AiFunc::IsSearchLowState ( )

Returns true if in search low state, also known as "search". Equivalent to GetCurrTargetState() == AI_TARGET_STATE__SEARCH.

Returns
true if in search low state, otherwise false

◆ IsSearchState()

bool AiFunc::IsSearchState ( )

Returns true if in search low state, also known as "search". Equivalent to GetCurrTargetState() == AI_TARGET_STATE__SEARCH Equivalent to IsSearchLowState()

Returns
true if in search low state, otherwise false

◆ IsSearchTarget()

bool AiFunc::IsSearchTarget ( TARGET target)

Returns true if the given target can be accessed, otherwise false. For example if IsSearchTarget(TARGET_ENE_0) returns false, then the AI has no knowledge of TARGET_ENE_0.

Parameters
targettarget
Returns
true if the given target can be accessed, otherwise false

◆ IsSleepSpecialEffectId()

bool AiFunc::IsSleepSpecialEffectId ( TARGET target,
int specialEffectId )

Returns true if the given target has the given special effect id but the effect is incompatible via vow type, otherwise false.

Parameters
targettarget
specialEffectIdspecial effect id to check
Returns
true if the given target has the given special effect id but the effect is incompatible via vow type, otherwise false

◆ IsStartAttack()

bool AiFunc::IsStartAttack ( )

Returns true if currently executing an animation requested by the AI, otherwise false. (Read the name as "Has started the attack yet?" instead of "Is at the beginning of an attack?").

Returns
true if currently executing an animation requested by the AI, otherwise false

◆ IsStartAttack_CheckAttackNo()

bool AiFunc::IsStartAttack_CheckAttackNo ( int actionRequestId)

Returns true if currently executing the given animation as requested by the AI, otherwise false. (Read the name as "Has started the attack yet?" instead of "Is at the beginning of an attack?").

Parameters
actionRequestIdez action request id that the current request id must match
Returns
true if currently executing the given animation as requested by the AI, otherwise false

◆ IsTargetGuard()

bool AiFunc::IsTargetGuard ( TARGET target)

Returns true if the given target is guarding, otherwise false. Given from ChrActionFlagModule.

Parameters
targettarget
Returns
true if the given target is guarding, otherwise false

◆ IsTargetOutOfAngleInterruptSlot()

bool AiFunc::IsTargetOutOfAngleInterruptSlot ( int angleObserveSlot)

Dose nothing in ER. Previously used along with GoalFunc function SetTargetAngle to determine whether the target is out of the angle width.

Parameters
angleObserveSlotangle observer slot
Returns
false

◆ IsTargetOutOfRangeInterruptSlot()

bool AiFunc::IsTargetOutOfRangeInterruptSlot ( int rangeObserveSlot)

Does nothing in ER. Previously used along with GoalFunc function SetTargetRange to determine whether the target is out of the distance range.

Parameters
rangeObserveSlotrange observer slot
Returns
false

◆ IsTargetWeakSoulCoin()

bool AiFunc::IsTargetWeakSoulCoin ( int p1)

Does nothing.

Parameters
p1
Returns
false

◆ IsTeamCommandExist()

bool AiFunc::IsTeamCommandExist ( )

Does nothing.

Returns
false

◆ IsTeamLeader()

bool AiFunc::IsTeamLeader ( )

Does nothing.

Returns
false

◆ IsThrowing()

bool AiFunc::IsThrowing ( )

Returns true if the character is in the middle of a throw (e.g grab, riposte, etc.)

Returns
true if the character is in the middle of a throw, otherwise false

◆ IsTouchBreakableObject()

bool AiFunc::IsTouchBreakableObject ( )

Returns true if the character is touching a breakable object, otherwise false. Used to determine if the enemy needs to break an object around them to get free.

Returns
true if the character is touching a breakable object, otherwise false

◆ IsTrueLand()

bool AiFunc::IsTrueLand ( )

Returns true if the character is standing on even, non sloped ground, otherwise false.

Returns
true if the character is standing on even, non sloped ground, otherwise false

◆ IsUpdateFirstAnimation()

bool AiFunc::IsUpdateFirstAnimation ( )
Returns

◆ IsUseFlyRoute()

bool AiFunc::IsUseFlyRoute ( )

Does nothing.

Returns
false

◆ IsValidPlatoon()

bool AiFunc::IsValidPlatoon ( )

Returns true if the AI is part of a team/platoon, otherwise false.

Returns
true if the AI is part of a team/platoon, otherwise false

◆ IsVisibleCurrTarget()

bool AiFunc::IsVisibleCurrTarget ( )

Returns true if the current target (as referenced by the AI's target search system) is visible to the AI (that is, in the visibility cone, unobstructed), otherwise false. It seems sound targets are always visible?

Returns
true if the current target is visible to the AI, otherwise false

◆ IsVisibleTarget()

bool AiFunc::IsVisibleTarget ( TARGET target)

Returns true if the current target is visible to the AI, or the given target is one of the speicifed options, otherwise false. This function is identical to IsVisibleCurrTarget() beyond the following target exceptions that always return true: TARGET_NONE, TARGET_SELF, TARGET_EVENT, TARGET_LOCALPLAYER, TARGET_LowHp_Friend, TARGET_HOSTPLAYER, target > 133.

Parameters
target
Returns

◆ KickEvent()

void AiFunc::KickEvent ( int eventIndex)
Parameters
eventIndexdoor 0, lever 1?

◆ KickLuaCall()

bool AiFunc::KickLuaCall ( int p1,
int p2,
int p3 )

Does nothing.

Parameters
p1
p2
p3
Returns
false

◆ LastPathFindingIsFailed()

bool AiFunc::LastPathFindingIsFailed ( )

Does nothing.

Returns
false

◆ MemoryRelativeTarget()

bool AiFunc::MemoryRelativeTarget ( TARGET target,
float angleStart,
float angle,
AI_SPA_DIR_TYPE spatialDirectionStart )

Updates the position of "TARGET_MEMORIED_RELATIVE_TARGET" based on the given parameters, If we center and align our axes with the target the resulting position would be: result = direction vector from "self+angleStart" to "target" result = (result.x * cos(angle), result.y * sin(angle), result.z * -cos(angle))

Parameters
targettarget
angleStartdirection offset
angleangle direction offset, clockwise
spatialDirectionStartstarting direction
Returns
true if the target is found, otherwise false

◆ Mod()

int AiFunc::Mod ( int dividend,
int divisor )

Returns dividend % divisor.

Parameters
dividend
divisor
Returns
dividend % divisor

◆ MoveTo()

bool AiFunc::MoveTo ( TARGET moveTarget,
AI_DIR_TYPE directionFromTarget,
float stopDistance,
bool isWalk,
float directionalDistance )

Use pathing to move towards a point defined by the given parameters.

Parameters
moveTargetinitial position origin and direction alignment
directionFromTargetdirection from the target's front with which the spherical sector is aligned
stopDistancelength from the origin
isWalkis walk or run
directionalDistance
Returns
true

◆ MoveToEventPoint()

bool AiFunc::MoveToEventPoint ( unsigned int regionId,
int p2,
float p3,
bool isWalk )

Use pathing to move towards the given event region.

Parameters
regionIdpoint to move to
p2unused
p3unused
isWalkis walk or run
Returns
true if the event region exists, otherwise false

◆ NotifyBuddyUnsummon()

void AiFunc::NotifyBuddyUnsummon ( )

◆ OnEndLadderGoal()

void AiFunc::OnEndLadderGoal ( )

Used on the termination of the LadderMove goal to clear some data. Does nothing by itself.

◆ OnStartLadderGoal()

void AiFunc::OnStartLadderGoal ( )

Used on the activation of the LadderMove goal to clear some data. Does nothing by itself.

◆ OnUpdateLadderGoal()

void AiFunc::OnUpdateLadderGoal ( )

Used on the update of the LadderMove goal to update both ladder specific and pathing data.

◆ PrintText()

void AiFunc::PrintText ( char * p1)

Does nothing.

Parameters
p1

◆ RegistAttackTimeInterval()

float AiFunc::RegistAttackTimeInterval ( int animationId,
float cooldown )

Registers a cooldown to the given animationId. Animation offset is automatically added and does count as a different animation for cooldowns.

Parameters
animationIdanimation to register cooldown to
cooldownthe cooldown in seconds
Returns
-1 if the animation has not yet been used, otherwise the animation's current cooldown

◆ RegisterBoidsUnit()

bool AiFunc::RegisterBoidsUnit ( int p1)

Does nothing.

Parameters
p1
Returns
false

◆ RegisterTriggerRegion()

bool AiFunc::RegisterTriggerRegion ( int p1,
int p2,
float p3,
float p4,
int p5,
int p6,
float p7 )

Does nothing.

Parameters
p1
p2
p3
p4
p5
p6
p7
Returns
true

◆ RegisterTriggerRegionCylinder()

bool AiFunc::RegisterTriggerRegionCylinder ( int p1,
int p2,
float p3,
float p4,
float p5,
int p6,
int p7,
float p8 )

Does nothing.

Parameters
p1
p2
p3
p4
p5
p6
p7
p8
Returns
true

◆ RegisterTriggerRegionObserver()

bool AiFunc::RegisterTriggerRegionObserver ( int p1)

Does nothing.

Parameters
p1
Returns
false

◆ RemoveBoidsUnit()

void AiFunc::RemoveBoidsUnit ( int p1)

Does nothing.

Parameters
p1

◆ RemoveTriggerRegionObserver()

void AiFunc::RemoveTriggerRegionObserver ( int p1)

Does nothing.

Parameters
p1

◆ Replaning()

void AiFunc::Replaning ( )

Resets/clears/reintializes a signifcant amount of data from the AI (e.g all observers, goals (with termination), walking type, re-executing goal logic funcs).

◆ ReqPlatoonState()

void AiFunc::ReqPlatoonState ( PLATOON_STATE platoonState)

Attempt to set platoon state?

Parameters
platoonState

◆ ReqTeam_Support()

void AiFunc::ReqTeam_Support ( float maxDistance)

Call for help for teammates within range.

Parameters
maxDistancemaximum distance for allies search

◆ RequestChangeFlyState()

void AiFunc::RequestChangeFlyState ( bool enable)

Set fly state.

Parameters
enableenable

◆ RequestEmergencyQuickTurn()

void AiFunc::RequestEmergencyQuickTurn ( )

Requests emergency turn, possibly forcing a turn animation that otherwise wouldn't have happened because the turn angle was too small. See usage in c9997.hks, env(330).

◆ RequestFadeWarpToInitPos()

void AiFunc::RequestFadeWarpToInitPos ( float fadeTime,
float p2 )

Requests to warp to init pos while fading.

Parameters
fadeTimetime to fully fade
p2unknown, common_logic_func.lua uses 4

◆ RequestLadderWait()

void AiFunc::RequestLadderWait ( )

Requests LadderWait, triggering the same named interrupt which is used in top_goal.lua.

◆ RequestParallelMove()

void AiFunc::RequestParallelMove ( )

Requests parallel move type. See usage in c9997.hks, env(327).

◆ ReserveObjAct()

bool AiFunc::ReserveObjAct ( int objActIndex)
Parameters
objActIndex
Returns

◆ ReserveRide()

bool AiFunc::ReserveRide ( float maxDistance)

Attempts to find and reserve a ride target within the given distance.

Parameters
maxDistancemax valid distance between the character and a potential riding target
Returns
true if successfuly found and reserved a valid ride target, otherwise false

◆ ResetInitialPosition()

void AiFunc::ResetInitialPosition ( )

Sets the character's initial position to their current position.

◆ ResetInitialPositionByEventRegion()

void AiFunc::ResetInitialPositionByEventRegion ( unsigned int regionId)

Sets the character's initial position to the given event region position.

Parameters
regionIdevent region id

◆ ResetNPCActProb()

void AiFunc::ResetNPCActProb ( )

Resets all NPC act probabilities to 0.

◆ SearchGetEnemyNumAround()

int AiFunc::SearchGetEnemyNumAround ( TARGET target,
float maxDistance )

Returns the number of enemies (of the AI, not the target) around the given target within the given distance.

Parameters
targettarget location
maxDistancecircle radius
Returns
the number of enemies around the given target within the given distance

◆ SendTeamMemberMessage()

void AiFunc::SendTeamMemberMessage ( int p1)

Does nothing.

Parameters
p1

◆ SetAIFixedMoveTarget()

void AiFunc::SetAIFixedMoveTarget ( TARGET targetOrigin,
AI_DIR_TYPE directionFromTarget,
float lineLength )

Sets the AI's fixed target pos (POINT_AI_FIXED_POS) to the given position, as defined by the end point of the given line.

Parameters
targetOriginline origin
directionFromTargetline direction
lineLengthline length

◆ SetAIFixedMoveTargetSpecifyAngle()

void AiFunc::SetAIFixedMoveTargetSpecifyAngle ( TARGET targetOrigin,
float angle,
float lineLength,
AI_SPA_DIR_TYPE spatialDirectionStart )

Sets the AI's fixed target pos (POINT_AI_FIXED_POS) to the given position, as defined by the end point of the given line.

Parameters
targetOriginline origin
angleline direction offset, clockwise
lineLengthline length
spatialDirectionStartline starting direction

◆ SetAIPredictionMoveTargetSpecifyAngle() [1/2]

void AiFunc::SetAIPredictionMoveTargetSpecifyAngle ( float p1,
float angle,
float lineLength )

SetAIPredictionMoveTargetSpecifyAngle(p1, angle, lineLength, 0)

Parameters
p1
angle
lineLength

◆ SetAIPredictionMoveTargetSpecifyAngle() [2/2]

void AiFunc::SetAIPredictionMoveTargetSpecifyAngle ( float p1,
float angle,
float lineLength,
float p4 )
Parameters
p1
angle
lineLength
p4

◆ SetAIPredictionMoveTargetSpecifyTargetDir()

void AiFunc::SetAIPredictionMoveTargetSpecifyTargetDir ( float predictionFactor,
int directionFromEnemy,
float lineLength,
float p5 )
Parameters
predictionFactor
directionFromEnemy
lineLength
p5

◆ SetAllowTriggerNearObjAct()

void AiFunc::SetAllowTriggerNearObjAct ( )

Does nothing.

◆ SetAttackRequest()

void AiFunc::SetAttackRequest ( unsigned int ezStateId)

Request action. Animation offset is included automatically in this function.

Parameters
ezStateIdezStateId action/animation id

◆ SetBoidsCohesionRange()

void AiFunc::SetBoidsCohesionRange ( float p1)

Does nothing.

Parameters
p1

◆ SetBoidsSearchConnectorRange()

void AiFunc::SetBoidsSearchConnectorRange ( float p1)

Does nothing.

Parameters
p1

◆ SetBoidsSeparateRange()

void AiFunc::SetBoidsSeparateRange ( float p1)

Does nothing.

Parameters
p1

◆ SetBoidsSpeedRateRange()

void AiFunc::SetBoidsSpeedRateRange ( float p1,
float p2 )

Does nothing.

Parameters
p1
p2

◆ SetCurrentMovePointIndex()

void AiFunc::SetCurrentMovePointIndex ( int pointIndex)

Sets the point to move to to the one in the given index.

Parameters
pointIndexpoint index

◆ SetEnableEndureCancel_forGoal()

void AiFunc::SetEnableEndureCancel_forGoal ( )

◆ SetEnableInterrupt_LookedTarget()

void AiFunc::SetEnableInterrupt_LookedTarget ( bool enable)

Enables/disables the interrupt "INTERUPT_LookedTarget".

Parameters
enableenable

◆ SetEnableStabCounterCancel_forGoal()

void AiFunc::SetEnableStabCounterCancel_forGoal ( )

◆ SetEnableUsePath()

void AiFunc::SetEnableUsePath ( bool enable)

Use map patrol path?

Parameters
enableenable

◆ SetEventFlag()

void AiFunc::SetEventFlag ( unsigned int eventFlagId,
bool value )

Sets the given flag to the given value.

Parameters
eventFlagIdevent flag
valuevalue to set flag to

◆ SetEventMoveTarget()

void AiFunc::SetEventMoveTarget ( unsigned int regionId)

Set POINT_EVENT to the given region.

Parameters
regionIdregion to set POINT_EVENT to

◆ SetIsForceBattleGoal()

void AiFunc::SetIsForceBattleGoal ( )

Sets IsForceBattleGoal() to true.

◆ SetMoveAllDirection_LegWalk2And4()

void AiFunc::SetMoveAllDirection_LegWalk2And4 ( bool enable)

Allows the character to use all movement directions when moving. Overwritten by move left right only and move back to home.

Parameters
enableenable

◆ SetMoveLROnly()

void AiFunc::SetMoveLROnly ( bool enable)

Forces the AI to only use left/right movement directions when moving.

Parameters
enableenable

◆ SetNumber()

void AiFunc::SetNumber ( int index,
float value )

Store the given number in the given index.

Parameters
indexnumber index
valuevalue

◆ SetPassiveMoveModifier()

void AiFunc::SetPassiveMoveModifier ( float modifier)

Sets a root motion factor in all directions for all animations.

Parameters
modifier

◆ SetPosAngBy1stNearLadderDmyId()

bool AiFunc::SetPosAngBy1stNearLadderDmyId ( int p1)
Parameters
p1
Returns

◆ SetRouteInfoByEntityId()

void AiFunc::SetRouteInfoByEntityId ( unsigned int p1)

Does nothing.

Parameters
p1

◆ SetStringIndexedArray()

void AiFunc::SetStringIndexedArray ( char * arrayName,
int index,
float value )

Sets the given number in the given array's given index. The structure of these is questionable, having 1 big (1024) float array buffer where each "array" is a pointer to somewhere in this buffer.

Parameters
arrayNamearray to use
indexindex in array
valuevalue

◆ SetStringIndexedNumber()

void AiFunc::SetStringIndexedNumber ( char * variableName,
float value )

Sets the given variable to the given value.

Parameters
variableNamevariable to set
valuevalue

◆ SetSuperClimbingMode()

void AiFunc::SetSuperClimbingMode ( bool enable)

Enables super climbing mode for the character, increasing their ability to step up inclines. Character must be categorized as huge enemy and have a hit radius smaller than 5 to have an effect.

Parameters
enableenable

◆ SetTeamNumber() [1/2]

void AiFunc::SetTeamNumber ( int p1,
float p2 )

Does nothing.

Parameters
p1
p2

◆ SetTeamNumber() [2/2]

void AiFunc::SetTeamNumber ( int p1,
float p2,
float p3 )

Does nothing.

Parameters
p1
p2
p3

◆ SetTimer()

void AiFunc::SetTimer ( int index,
float value )

Sets the given timer to the given value. Timers constantly tick down until they reach 0.

Parameters
indextimer index (0-15)
valuetime [seconds]

◆ SetTurnReferenceDirection()

void AiFunc::SetTurnReferenceDirection ( TARGET target)

Store the direction to the given target's current position as the turn reference. The turn reference direction is used at the beginning of SidewayMove storing the target's position, to know when to end the goal.

Parameters
targetturn reference target

◆ SetUserInterupt()

void AiFunc::SetUserInterupt ( unsigned int p1)

Does nothing.

Parameters
p1

◆ ShiftCurrTargetBattleState()

void AiFunc::ShiftCurrTargetBattleState ( )

◆ StartAttackPassedTimer()

void AiFunc::StartAttackPassedTimer ( int animationId,
float time )

Sets the animation cooldown timer for the given animation to the given time. Animation offset is included automatically in this function.

Parameters
animationIdanimationId animation to set timer for
timetime [seconds]

◆ StartDash()

void AiFunc::StartDash ( )

Forces run.

◆ StartGuard()

void AiFunc::StartGuard ( )

Does nothing.

◆ StartIdTimer()

void AiFunc::StartIdTimer ( int index)

Starts id timer.

Parameters
indexid timer index (0-127)

◆ StartIdTimerSpecifyTime()

void AiFunc::StartIdTimerSpecifyTime ( int index,
float startingTime )

Starts id timer with the given time.

Parameters
indexid timer index (0-127)
startingTimetime to start at [seconds]

◆ StartTeamIdTimer()

void AiFunc::StartTeamIdTimer ( int p1)

Does nothing.

Parameters
p1

◆ StepNextMovePoint()

void AiFunc::StepNextMovePoint ( )

Cycle to the next point on your path. Used in the common pathing goals' Terminate function when the move target is a move point.

◆ TeamHelp_Call()

void AiFunc::TeamHelp_Call ( )

Call for help from team. The distance is taken from NpcThinkParam's "callHelp_CallValidRange".

◆ TeamHelp_GetMaxWaitTime()

float AiFunc::TeamHelp_GetMaxWaitTime ( )

Returns NPCThinkParam's "callHelp_MaxWaitTime" * 0.1.

Returns
NPCThinkParam's "callHelp_MaxWaitTime" * 0.1

◆ TeamHelp_GetMinWaitTime()

float AiFunc::TeamHelp_GetMinWaitTime ( )

Returns NPCThinkParam's "callHelp_MinWaitTime" * 0.1.

Returns
NPCThinkParam's "callHelp_MinWaitTime" * 0.1

◆ TeamHelp_IsValidCall()

bool AiFunc::TeamHelp_IsValidCall ( )

Returns true if there are any valid teammates that can respond to your call, otherwise false. Based on NPCThinkParam.

Returns
true if there are any valid teammates that can respond to your call, otherwise false

◆ TeamHelp_IsValidReply()

bool AiFunc::TeamHelp_IsValidReply ( )

Returns true if there are any valid teammates that you can reply to, otherwise false. Based on NPCThinkParam. Used to end GoalNonBattleAct in case a teammate calls.

Returns
true if there are any valid teammates that you can reply to, otherwise false

◆ TeamHelp_Reply()

void AiFunc::TeamHelp_Reply ( )

Handles answering call logic, including setting as target?

◆ TeamHelp_ReserveCall()

void AiFunc::TeamHelp_ReserveCall ( )

◆ TeamHelp_ValidateCall()

void AiFunc::TeamHelp_ValidateCall ( )

◆ TeamHelp_ValidateReply()

void AiFunc::TeamHelp_ValidateReply ( )

◆ TurnTo()

void AiFunc::TurnTo ( TARGET target)

Sets the given target as the turn target/target to turn to. The turn target can be considered the "main target" of the AI in many cases.

Parameters
targettarget

The documentation for this class was generated from the following file: