X0 inc henai

From NWN Lexicon
Jump to: navigation, search


This is a wrapper overtop of the 'generic AI' system with custom behavior for Henchmen.<br /><br />


- Easier to isolate henchmen behavior.<br /> - Easier to debug COMBAT-AI because the advanced Henchmen behaviour won't be in those scripts.<br /><br />


- Code duplication. The two 'combat round' functions will share a lot of code because the old-AI still has to allow any legacy henchmen to work.<br /><br /> NOTE: This file includes x0_i0_henchman.


Name Value Brief Description
BK_AI_MODE_FOLLOW 9 Behavior constant. Default mode, moving after the player.
BK_AI_MODE_RUN_AWAY 19 Behavior constant. Something is causing AI to retreat.
BK_CURRENT_AI_MODE 20 Behavior constant. Can only be in one AI mode at a time.
BK_FOLLOW_THRESHOLD 15.0 Distance constant.
BK_HEALTHRESHOLD 5.0 Distance constant.
BK_HEALINMELEE 10 Behavior constant.
BK_NEVERFIGHT 30 Behavior constant.


Name Brief Description
AttemptKnockSpell Internal function. Attempts to cast knock to open the door.
bkAttemptToDisarmTrap Attempt to disarm given trap.
bkAttemptToOpenLock Attempt to open a given locked object.
bkCombatAttemptHeal Attempt to heal self then master.
bkCombatFollowMaster Attempts to follow master if outside range.
bkGetBehavior Get the behavior used by AI.
bkGetCosAngleBetween Get the cosine of the angle between two objects.
bkGetIsDoorInLineOfSight Returns TRUE if the target door is in line of sight.
bkGetIsInLineOfSight Returns TRUE if target in the line of sight of the seer.
bkManualPickNearestLock Manually pick the nearest locked object.
bkRespondToHenchmenShout Handles responses to henchmen commands, including both radial menu and voice commands.
bkSetBehavior Set the behavior used by AI.
bkSetListeningPatterns Sets up special additional listening patterns for associates.
HenchmenCombatRound Henchman/associate combat round wrapper.

Does special stuff for henchmen and familiars, then falls back to default generic combat code.
SendForHelp Signal to other party members to help me out.

  author: Mistress