ACTION_* Constant Group

From NWN Lexicon
Revision as of 16:15, 5 July 2020 by Jasperre (talk | contribs)
Jump to: navigation, search

Constants representing standard actions that objects can perform.

Note there are several things that would be considered "actions" that cannot be detected by this, especially since ACTION_INVALID can be returned in a lot of cases.

For some stances (Parry, Defensive Casting, etc.) see relevant stance functions.


Constant Value Function Description
ACTION_ANIMALEMPATHY 16 ActionUseSkill(SKILL_ANIMAL_EMPATHY, oAnimal) When using the Animal Empathy skill
ACTION_ATTACKOBJECT 3 ActionAttack Attacking an object. Could be ranged, melee, or even potentially a special attack since hardly any are listed here (only Ki Damage and Smite Evil for some reason).
ACTION_CASTSPELL 4 ActionCastSpellAtObject or ActionCastSpellAtLocation or appropriate talent found. Given feat usage isn't categorised here it could also return for ActionUseFeat(). Needs further testing.
ACTION_CLOSEDOOR 6 ActionCloseDoor Closing a door
ACTION_COUNTERSPELL 31 ActionCounterSpell Counter spelling a target creature
ACTION_DIALOGOBJECT 7 ActionStartConversation This is when in a conversation. Note PC's can functionally move during these so unknown what they return if also moving to a point (in fact NPCs can do some actions during conversation too...).
ACTION_DISABLETRAP 8 ActionUseSkill(SKILL_DISABLE_TRAP, oTrap) Disabling a trap
ACTION_DROPITEM 2 ActionPutDownItem Putting down an item
ACTION_FOLLOW 35 ActionForceFollowObject This is usually present until cleared or interrupted.
ACTION_HEAL 33 ActionUseSkill(SKILL_HEAL, oToHeal, 0, oHealingKit) Healing using a healing kit
ACTION_INVALID 65535 Many! Most other actions. This fires for a lot of things, such as a player using WASD movement and possibly other actions not listed on this page.
ACTION_ITEMCASTSPELL 19 Appropriate talent that returns an item to use. Scrolls, wands, magical items which can cast spells.
ACTION_KIDAMAGE 41 ActionUseFeat(FEAT_KI_DAMAGE, oTarget) Ki Damage feat
ACTION_LOCK 14 ActionLockObject or ActionUseSkill(SKILL_OPEN_LOCK, oDoorOrPlaceable) The second one may not work, depending on the circumstance (while the skill is called Open Lock, it is also used for locking).
ACTION_MOVETOPOINT 0 ActionMoveToObject ActionMoveToLocation This is specifically moving to a clicked point it seems, since it uses ACTION_INVALID if the player is using WASD movement. No idea if ActionMoveAwayFromLocation or ActionMoveAwayFromObject trigger it.
ACTION_OPENDOOR 5 ActionOpenDoor Opening a door.
ACTION_OPENLOCK 13 ActionUseSkill(SKILL_OPEN_LOCK, oLockedObject) Opening a lock on a door or placeable.
ACTION_PICKPOCKET 34 ActionUseSkill(SKILL_PICK_POCKET, oPickPocketTarget) Picking someones pocket. Nice gems you have, shame if someone snatched them from you...
ACTION_PICKUPITEM 1 ActionPickUpItem Picking up an item (may include walking to it first)
ACTION_RANDOMWALK 43 ActionRandomWalk This was added in the Hordes sets of patches. It is the value associated with ActionRandomWalk(). Note: In pre-1.64 patches, it referenced the wrong line in the actions.2da file, but it has now been corrected.
ACTION_REST 17 ActionRest NB: Only Henchmen tends to "sit and rest" when this is called on them so very unlikely to find this outside of PCs and henchmen.
ACTION_SETTRAP 12 Currently no action functions. NPC's can't use ActionUseSkill but a future action to use item properties is coming. PCs can select this action from the radial menus.
ACTION_SIT 37 ActionSit Sitting on an object.
ACTION_SMITEGOOD 40 ActionUseFeat(FEAT_SMITE_GOOD) (and probably FEAT_SMITE_EVIL) Extra damage against certain alignments.
ACTION_TAUNT 18 SetActionMode(ACTION_MODE_PARRY is probably best here. If a creature is currently taunting. Can also be found using GetActionMode (which is probably more reliable).
ACTION_USEOBJECT 15 ActionUseObject "Use" and object, may include walking up to it first.
ACTION_WAIT 36 ActionWait Used purely on NPCs. This is the way to put a delay between two actions firing.

See Also

functions:  GetCurrentAction