BG(2)EE Script Triggers

NT Returns true only if the current CRE obtained the specified item in the last script round.
Trigger appears to be broken?

Returns true only if the active CRE was attacked in the style specified (not necessarily hit) or had an offensive spell cast on it by the specified object in the last script round. The style parameter is non functional - this trigger is triggered by any attack style.
Note that the LastAttacker object is only set for physical attacks (i.e. spell and script damage does not set LastAttacker).

Returns true if the specified object shouted for Help() in the two script rounds. Help() has a range of approximately 40.

Returns true if the specified object has joined the party in the last script round. This trigger is only sent to player characters.

Returns true if the specified object has left the party in the last script round. This trigger is only sent to player characters.

This trigger is used in conjunction with the GiveOrder() action, and works in a similar way to the Heard() trigger. Only one creature at a time responds to an order, and creatures do not detect their own orders. The creature must be in visual range for this trigger to work.

NT

NT Returns true only if the active CRE was turned by the specified priest or paladin.

NT Returns true only if the specified item is unusable by the active CRE.

Returns true only if the alignment of the specified object matches that in the second parameter.

Returns true only if the Enemy/Ally status of the specified object matches that in the second parameter.

Returns true only if the Class of the specified object matches that in the second parameter.

Returns true only if the specified object exists in the current area (note that dead creatures can still be counted as existing).

Returns true only if the General category of the specified object matches that in the second parameter.

Returns true only if the variable with name 1st parameter of type 2nd parameter has value 3rd parameter.

Returns true only if the current hitpoints of the specified object are equal to the 2nd parameter.

Returns true only if the current hitpoints of the specified object are greater than the 2nd parameter.

Returns true only if the current hitpoints of the specified object are less than the 2nd parameter.

Returns true only if the object specified is in the line of sight of the active CRE and within the given range. This seems to be a combination of the Range() and See() triggers. Range seems limited to the default visual range (30).

Returns true only if the morale of the specified object is equal to the 2nd parameter.

Returns true only if the morale of the specified object is greater than the 2nd parameter.

Returns true only if the morale of the specified object is less than the 2nd parameter.

Returns true only if the Race of the specified object is the same as that specified by the 2nd parameter.

Returns true only if the specified object is within distance given (in feet) of the active CRE. Range seems limited to the default visual range (30), and does not bypass objects. Range is affected by foot circle size (e.g. the minimum range for a huge foot circle creature (Dragon) is 8). Melee range is 4.

Returns true only if the reputation of the specified object is equal to the 2nd parameter.

Returns true only if the reputation of the specified object is greater than the 2nd parameter.

Returns true only if the reputation of the specified object is less than the 2nd parameter.

Returns true only if the active CRE can see the specified object which must not be hidden or invisible.

Returns true only if the specifics (as set in the CRE file or by the ChangeSpecifics() action) of the specified object is equal to the 2nd parameter.

Returns true only if the period of day matches the period in the 2nd parameter (taken from TIME.IDS). Hours are offset by 30 minutes, e.g. Time(1) is true between 00:30 and 01:29.

As above but less specific and uses TIMEODAY.IDS.

Returns true only if the active CRE was hit by the specified object by the specified damage type in the last script round.
If the damage type is CRUSHING or 0, then this will return true for ANY damage type.
!HitBy() returns true when the script is first activated (e.g. initial area load) and when hit by any damage type.

Returns true only if the specified key was pressed in the last script round. Hotkeys defined in keymap.ini take precedence over hotkeys expected by this trigger.

Returns true only if the local timer with the specified ID has expired. This action does not work as a state or response trigger in dialogs.

Always returns true.

Used as a form of script communication, in conjunction with the SendTrigger() action. Seems to have the same range as GiveOrder(), and affects only one creature at once. The LastTrigger object does not get set after receiving a trigger.

Returns true if the active CRE has died in the last script round.
Note: When a block returns true to this trigger, this will be the final block executed in the script, unless it is Continue()‘d.

NT Returns true only if the object specified cannot be reached by normal walking by the active CRE.

Delays the next check of the block of triggers where this trigger is, by the number of seconds specified. This value is not stored when the game is saved.

Returns true only if the number of creatures of the type specified in sight of the active CRE are equal to the 2nd parameter.

As above except for less than.

As above except for greater than.

Returns true only if the active CRE has no actions waiting to be performed, i.e. is idle.

See HP() except this is for a percentage.

See HPLT() except this is for a percentage.

See HPGT() except this is for a percentage.

Returns true only if the active CRE was within 30 feet of the specified object and the specified object shouted the specified number (which does not have to be in SHOUTIDS.IDS) in the last script round.
Note: If the object is specified as a death variable, the trigger will only return true if the corresponding object shouting also has an Enemy-Ally flag of NEUTRAL.

Never returns true, i.e. is always false. A block of triggers containing this will never return true regardless of the other triggers in the block. The corresponding actions will never take place.

Returns true only if the active CRE has the specified spell (either as symbolic value or resource string) memorised.

Returns true if the active CRE has at least one spell memorised.

NT Returns true only if the active CRE turned visible in the last script round.

See Global() except the variable must be greater than the value specified to be true.

As above except for less than.

Returns true if the script is processed for the first time this session, e.g. when a creature is created (for CRE scripts) or when the player enters an area (for ARE scripts).

Returns true only if the specified object is in the state specified.

Exact opposite of above.

Returns true only if the player's party has spoken to the active CRE the exact number of times specified.
Note: NumTimesTalkedTo() seems to increment when a PC initiates conversation with an NPC, or an NPC initiates conversation with a PC. NumTimesTalkedTo() does not seem to increment for force-talks, interactions, interjections and self-talking.

Returns true only if the player's party has spoken to the active CRE more than the number of times specified.

Returns true only if the player's party has spoken to the active CRE less than the number of times specified.

Returns true only if the reaction of the object specified (on the friendly-hostile scale) to the player was as specified.
Note: Reaction = 10 + rmodchr + rmodrep (see rmodchr.2da and rmodrep.2da).

Returns true only if the reaction of the object specified (on the friendly-hostile scale) to the player was greater than specified.
Note: Reaction = 10 + rmodchr + rmodrep (see rmodchr.2da and rmodrep.2da).

Returns true only if the reaction of the object specified (on the friendly-hostile scale) to the player was lower than specified.
Note: Reaction = 10 + rmodchr + rmodrep (see rmodchr.2da and rmodrep.2da).

NT.

Returns true only if the timer with the name specified and of the type in the 2nd parameter has run and expired.

Returns true only if the timer with the name specified and of the type in the 2nd parameter is still running.
Note: If we use !GlobalTimerNotExpired(S:Name*,S:Area*), this will return true if the timer has never been set OR if it has already expired — very useful… most useful of all the GlobalTimer triggers :).

Returns true if any of the party members have the specified item in their inventory. This trigger also checks with container items (e.g. Bags of Holding).

Returns true only if the specifed object is in the player's party.

Returns true only if the specifed object has the statistic in the 3rd parameter at the value of the 2nd parameter.
Info: This trigger looks at the entire value of any STAT (16 or 32 bits, depending on the STAT).

Returns true only if the specifed object has the statistic in the 3rd parameter greater than the value of the 2nd parameter.
Info: This trigger looks at the entire value of any STAT (16 or 32 bits, depending on the STAT).

Returns true only if the specifed object has the statistic in the 3rd parameter less than the value of the 2nd parameter.
Info: This trigger looks at the entire value of any STAT (16 or 32 bits, depending on the STAT).

Generates a random number between 1 and Range. Returns true only if the random number equals the 2nd parameter.
Note: Scripting uses the same random value to seed all RandomNum() triggers across a single tick; if you have multiple RandomNum() calls with the same parameters, they will all generate the same result.

NT As above except returns true only if the random number is greater than the 2nd parameter.

NT As above except returns true only if the random number is less than the 2nd parameter.

Returns true only if the specified object died in the last script round.

NT Returns true if the active CRE killed the specified object in the last script round.

Only for trigger regions in areas. Returns true only if the specified object entered the trigger region in the last script round.

Returns true only if the gender of the specified object is that given in the 2nd parameter.

Returns true only if the player's party has the amount of gold specified in the 2nd parameter.

Returns true only if the player's party has more gold than specified in the 2nd parameter.

Returns true only if the player's party has less gold than specified in the 2nd parameter.

Returns only true if the creature with the specified script name has its death variable set to 1. Not every form of death sets this, but most do. So it's an almost complete test for death. The creature must have existed for this to be true. Note that SPRITE_IS_DEAD variables are not set if the creaure is killed by a neutral creature.

Only for door scripts. Returns true only if the specified object opened the active door in the last script round.

Only for door scripts. Returns true only if the specified object closed the active door in the last script round.

Only for door scripts. Returns true only if the specified object detected this trap in the last script round.

NT Only for trap scripts? Returns true only if this trap or trigger was reset in the last script round by the object specified.

Only for trap/trigger region scripts. Returns true only if the specified object disarmed this trap in the last script round.

Only for door scripts — returns true only if this door was unlocked by the specified object in the last script round.
Appears to be broken.

Seems to be broken. Returns true only if the active CRE has no ammunition for the current ranged weapon.

NT Returns true only if the specified NPC has interacted with the party a number of times equal to the 2nd parameter.

NT Returns true only if the specified NPC has interacted with the party a number of times greater than the 2nd parameter.

NT Returns true only if the specified NPC has interacted with the party a number of times less than the 2nd parameter.

Checks the current creature's happiness value. Note that this trigger is only evaluated when the happiness value is checked (at all other times this trigger returns false).

Checks if a pickpocket attempt on the specified creature has failed in the last script round.

For shopkeepers. Returns true if the specified object failed to steal from the shop in the last script round.

NT Not used in any existing scripts.

NT Not used in any existing scripts.

Returns true only if the specified object has the specified item in its inventory. This trigger also checks with container items (e.g. Bags of Holding).

NT Returns true only if the active CRE is interacting (dialogue?) with the specified object.

Returns true only if the specified object is within the range of the active CRE's currently equipped weapon.

Returns true only if the specified object has a weapon in a quickslot.

NT Returns true only if the specified object has the specified happiness value.

NT Returns true only if the happiness of the specified object is greater than the specified value.

NT Returns true only if the happiness of the specified object is less than the specified value.

Returns true only if the current time is greater than that specified. Hours are offset by 30 minutes, e.g. TimeGT(1) is true between 01:30 and 02:29.

Returns true only if the current time is less than that specified. Hours are offset by 30 minutes, e.g. TimeLT(1) is true between 23:30 and 00:29.

Returns true only if the number of party members (dead ones also count) is equal to the number specified.

Returns true only if the number of party members (dead ones also count) is greater than the number specified.

Returns true only if the number of party members (dead ones also count) is less than the number specified.

Returns true only if the active creature is for exactly the specified number of ticks (115th seconds) left under the effect of the script action MakeUnselectable() or opcode #365.
Note: By default in BG2EE creatures stop processing scripts while under effect of the script action MakeUnselectable().

Returns true only if the active creature is for more than the specified number of ticks (115th seconds) left under the effect of the script action MakeUnselectable() or opcode #365.
Note: By default in BG2EE creatures stop processing scripts while under effect of the script action MakeUnselectable().

Returns true only if the active creature is for less than the specified number of ticks (115th seconds) left under the effect of the script action MakeUnselectable() or opcode #365.
Note: By default in BG2EE creatures stop processing scripts while under effect of the script action MakeUnselectable().

Only for trigger regions. Returns true if the specified object clicked on the trigger region running this script.

Returns true only if the number of creatures with script name "Name" that have been killed is equal to the 2nd parameter.

Returns true only if the number of creatures with script name "Name" that have been killed is greater than the 2nd parameter.

Returns true only if the number of creatures with script name "Name" that have been killed is less than the 2nd parameter.

Returns true if the the specified object is detected by the active CRE in any way (hearing or sight). Neither Move Silently nor Hide in Shadows prevent creatures from being detected via Detect(). Detect ignores Protection from Creature Type effects for static objects.

Returns true only if the item specified in parameter 1 is in the container specified in parameter 2.

NT Returns true only if the open state of the specified door matches the state specified in the 2nd parameter.

Returns true only if the specified object has the number of items in the 3rd parameter of the type specified in the 1st parameter in its inventory.

Returns true only if the specified object has more than the number of items in the 3rd parameter of the type specified in the 1st parameter in its inventory.

Returns true only if the specified object has fewer than the number of items in the 3rd parameter of the type specified in the 1st parameter in its inventory.

Returns true only if the party has a total number of items of the type specified equal to the 2nd parameter.

Returns true only if the party has a total number of items of the type specified greater than the 2nd parameter.

Returns true only if the party has a total number of items of the type specified less than the 2nd parameter.

Only for trigger regions. Returns true only if the specified object is over the trigger running the script.

Returns true only if the active CRE is in the area specified.

Returns true if the specified object has the specified item outside the general inventory slots (does not check for equipped status). This trigger does not work for Melf's Minute Meteors or other magically created weapons.

Returns true if the number of hostile creatures of the type specified in the 1st parameter that are currently in fighting range of the party, minus the number of party members, is equal to the 2nd parameter.

Returns true if the number of hostile creatures of the type specified in the 1st parameter that are currently in fighting range of the party, minus the number of party members, is less than the 2nd parameter.

Returns true if the number of hostile creatures of the type specified in the 1st parameter that are currently in fighting range of the party, minus the number of party members, is greater than the 2nd parameter.

This trigger may not work as expected.
Returns true only if the combat counter (counts down from 150 after each attack) is of the value specified. CombatCounter(0) returns true only if there is no combat in the active area at the moment. CombatCounter() can give false results after dialog has been completed or after a Hide in Shadows check has been failed.

Returns true only if the combat counter (counts down from 150 after each attack) is less than the value specified.

This trigger does not work as expected.
Returns true only if the combat counter (counts down from 150 after each attack) is greater than the value specified. CombatCounterGT(0) returns true if there is any combat going on in the active area.

Returns true only if the area in which the active CRE is, has the specified type flag set. Note that the value is OR'd. This trigger can cause a crash if it evaluates to true and is used as the first trigger in a dead NPCs dream script.

NT Only for trigger regions/traps. Returns true if this trap was triggered by the object specified.

NT Returns true only if the party member specified died in the last script round.

Returns true if any (i.e., at least one) of the next 'OrCount' triggers returns true.

Returns true only if the specified object is in the party and in the slot specified (slots are 0-5). Party slots are based on join order; Player1 is in slot 0, Player2 in slot 1 etc.

Returns true only if the specified object cast the spell in the 2nd paramater in the last script round. If the Spell parameter is 0, then this will return true for ANY spell cast.

Seems to have no effect.
InLine(O:Object*) returns true if the active creature can see the target creature.

Returns true if the party has just finished resting.

Returns true only if the experience level of the specified object equals the 2nd parameter.

Returns true only if the experience level of the specified object is greater than the 2nd parameter.

Returns true only if the experience level of the specified object is less than the 2nd parameter.

NT Returns true only if the active CRE summoned the specified object in the last script round.

Returns true only if the 2 global variables specified have equal values.

Returns true only if the 1st global variable has a value greater than the 2nd one.

Returns true only if the 1st global variable has a value less than the 2nd one.

Returns true only if the 2 local variables specified have equal values.

Returns true only if the 1st local variable has a value greater than the 2nd one.

Returns true only if the 1st local variable has a value less than the 2nd one.

Returns true only if the specified object has no actions waiting to be performed.

Returns true only if the specified object is on the screen.

Returns true only if specified object is in the active area. The active area is that in which Player1 is. This trigger will crash the game if the specified creature is not in the active area and is not a global object.

Returns true only if the specified object cast the specified spell on the active CRE in the last script round. If the Spell parameter is 0 (or "" for the RES version), then this will return true for ANY spell cast. Returns false for spells whose Ability target is 4 (Any point within range).

NT Returns true only if the current day is the day specified.

NT Returns true only if the current day is after the day specified.

NT Returns true only if the current day is before the day specified.

Returns true only if the object in the 2nd parameter has the script name specified.

Returns true only if the specified object cast the specified priest spell in the last script round.

Returns true only if the specified object cast the specified innate spell in the last script round.
Note: The spell level must match the spell’s definition (in SPELL.IDS) for the trigger to return true.

Returns true only if that specifed party member can take part in party dialogue.

Returns true only if the party has the item specified and it is identified.



NT Returns true only if the specified object has an item in the specified slot. This trigger does not work for items created by opcode #111 (such as Melf's Minute Meteors).

NT Returns true if the specified object is exactly as far away from the active CRE as the 2nd parameter specifies.
Info: This trigger is Range() reduced by the creatures’ circle sizes.

Returns true only if the specifics value of the specified object is the same as that of the active CRE.

NT

NT Returns true only if the timer with the specified name of the specified area has been set at least once and has now expired.

NT Returns true only if the timer with the specified name of the specified area has been set and has not yet expired.

Returns true only if the number of party members alive is equal to the number specified.

Returns true only if the number of party members alive is greater than the number specified.

Returns true only if the number of party members alive is less than the number specified.

NT Returns true only if the specified object is of the kit specified.

Returns true only if the specified object is the current speaker (in a dialog).

Returns true if the specified creature is active and false if it is deactivated. A creature will continue to execute script blocks even while deactivated — this trigger can be used to restrict this behaviour.

NT Returns true only if the specified object has the character name.

NT Returns true only if the specified object is a fallen ranger.

NT Returns true only if the specified object is a fallen paladin.

Returns true only if the specified object can carry no more items.

Returns true if the specified object has the specified item outside the general inventory slots. Unlike H asItemEquiped it only checks the equipped weapon slot, not all of them. This trigger does not work for items created by opcode #111 (such as Melf's Minute Meteors).

Returns true if the specified object has experience points equal to the number specified.

Returns true if the specified object has experience points greater than the number specified.

Returns true if the specified object has experience points less than the number specified.

This trigger acts as a shortcut for Global(). The trigger can only check global variables.

This trigger acts as a shortcut for GlobalGT(). The trigger can only check global variables.

This trigger acts as a shortcut for GlobalLT(). The trigger can only check global variables.

Returns true only if the active CRE is in the state/mode specified. e.g. detecting traps.

Returns true only if the specified object is in the same area as the active CRE.

Returns true if some type of damage was caused to the active CRE (and HP were lost) in the last script round.

Returns true if the total damage taken by the active CRE is of the amount specified. Think of this as the reverse of testing for HP. See HP().

See above and HPGT().
Note: This trigger may not act correctly until the active creature has dropped below their maximum base HP (i.e. without CON bonus taken into account).

See above and HPLT().

NT Returns true only if the game difficulty setting is of the level specified. Values are taken from difflev.ids.

NT Returns true only if the game difficulty setting is greater than the level specified. Values are taken from difflev.ids.

NT Returns true only if the game difficulty setting is less than the level specified. Values are taken from difflev.ids.

NT Returns true if the specified object which can be dead or alive is in the party.

Returns true if the specified object is in the area specified.

Returns true if combat counter is greater than 0.
Confirmed as working in SoA.

NT Only for trigger regions. Returns true if the specified object has walked to this trigger.

Returns true only if the average level of the party is equal to the number specified. Only the highest level of dual/multi-class characters is taken into account.

Returns true only if the average level of the party is greater than the number specified. Only the highest level of dual/multi-class characters is taken into account.

Returns true only if the average level of the party is less than the number specified. Only the highest level of dual/multi-class characters is taken into account.

Returns true if any of the party members have the specified spell memorised. Values are taken from spell.ids.

Returns true only if the active CRE is in a Watcher's Keep (i.e. the current area begins with AR30).

Returns true only if the active CRE is in a Watcher's Keep (i.e. the current area begins with AR30).

This trigger will check if any creatures of the specified allegiance are present in the current area. Values are taken from ea.ids.

Returns true only if the current device has touch screen capability.

Returns true if the DLC specified by the DLCName parameter has been purchased.
Note: Returns true on PC/Mac/Linux as all DLCs are automatically available.

Returns true if the creature with the specified script name has joined the party at some point. More specifically, this trigger returns whether bit 15 of the creature flags has been set.

Defines the object that the next trigger will be evaluated in reference to. This trigger does not evaluate and does not count as a trigger in an OR() block. If the object cannot be found, the next trigger will evaluate to false. It will even break the OR() trigger if you don't put it in there last in the entire condition section. WeiDU adds a shorthand notation in the form of TriggerOverride(object, trigger) that merges this and the target trigger into a single line.

Returns true only if the specified object is in the state specified (uses extstate.ids).

Returns true only if the specified object is in the state specified (uses splstate.ids). Spell states can be set via opcode 328.

Returns true if the specified object is within the range of the specified point. Works similar to Range(), but with a point instead of an object.

Returns true if the object is near its home location (in case the specified variable doesn't exist) or near a point marked by a variable. The default home location for creatures is equal to their default position in the ARE file.

It causes the first RESPONSE with the given weight (pulled from the GLOBAL) to be selected The switch trigger can be used to change how the RESPONSE # sections are evaluated. Using this trigger causes the RESPONSE section to not be picked randomly according to their weights. Instead it selects the first section with the weight matching the evaluated global specified by the 1st parameter in the scope defined by the 2nd parameter.

Returns true if a ranged weapon (i.e. bow or thrown axe) is currently equipped and selected on the specified object.

Returns true if the specified interface button is disabled. Values are taken from button.ids.

Returns true if the target object has one or more items of the specified item category in their inventory. The 3rd parameter defines whether the item has to be equipped as well (values are taken from boolean.ids).

Returns true if Nightmare Mode is active (aka "Legacy of Bhaal" mode in BGEE/BG2EE or "Heart of Fury" mode in IWDEE).

Returns true if the original class of a dual-classed creature equals the class specified in the 2nd parameter.

Returns true if a breakable cutscene has been terminated by the user.

Returns true if the weapon equipped in the hand defined by the 2nd parameter of the active creature can hit the target object specified in the 1st parameter.

Returns true if baldur.lua contains the entry SetPrivateProfileString('Script','Name','Number'). 'Script' is the fixed section name. 'Name' and 'Number' are checked by the script trigger.

NT

NT

NT

Returns true only if the specified object is in the state/mode) specified. e.g. detecting traps.

Returns true if the weapon equipped in the hand defined by the 2nd parameter of the active creature can cause non-zero damage to the target object specified in the 1st parameter.

Returns true if the total count of killed creatures by the party equals the specified number.

Returns true if the total count of killed creatures by the party is greater than the specified number.

Returns true if the total count of killed creatures by the party is less than the specified number.

Returns true if the active CRE can turn the (undead) target object with a level difference equal to or greater than the value specified in the 2nd parameter.

Returns true if at least one bit from the given variable is in common with the bits defined in the third parameter.

Returns true only if the active creature can switch to a ranged weapon that is ready for use (e.g. a throwing weapon, such as darts, or a launcher with corresponding ammo, such as bow and arrow).

Returns true if the specified object is immune to spells of the level specified by the 2nd parameter.

Returns true if Story Mode is active.

Returns true only if a random encounter to the specified area has been initialized by a preceding call of ForceRandomEncounter() or ForceRandomEncounterEntry().

NT

Returns true only if the experience level of the specified object in the class denoted by the 2nd parameter equals the 3rd parameter.

Returns true only if the experience level of the specified object in the class denoted by the 2nd parameter is greater than the 3rd parameter.

Returns true only if the experience level of the specified object in the class denoted by the 2nd parameter is less than the 3rd parameter.

Returns true only if the hidden door specified by the 1st parameter has been detected, and its opened state equals the 2nd parameter.

NT

Returns true if the active CRE has the specified spell scribed in their spellbook. It does not have to be memorised.

Returns true only if the item specified in the 2nd parameter can be found in the inventory slot (taken from slots.ids) of the specified object.

Returns true only if the specified object has a ranged weapon with the ammo specified by ResRef equipped.

NT

NT

NT

NT

NT

Returns true only if the proficiency level of the specified object in the weapon denoted by the second parameter is equal to the third parameter.
Note: This trigger looks at just the first 3 bits (active proficiency) of stats 89 — 134 (see also opcode #233).

Returns true only if the proficiency level of the specified object in the weapon denoted by the second parameter is greater than the third parameter.
Note: This trigger looks at just the first 3 bits (active proficiency) of stats 89 — 134 (see also opcode #233).

Returns true only if the proficiency level of the specified object in the weapon denoted by the second parameter is less than the third parameter.
Note: This trigger looks at just the first 3 bits (active proficiency) of stats 89 — 134 (see also opcode #233).