PST Script Triggers

0x0001 Acquired(S:ResRef*)
NT Returns true only if the current CRE obtained the specified item in the last script round.
Trigger appears to be broken?

0x0002 AttackedBy(O:Object*,I:Style*AStyles)
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).

0x0003 Help(O:Object*)
Returns true if the specified object shouted for help (using the Help() action?) in the last script round.

0x0004 Joins(O:Object*)
Returns true if the specified object has joined the party in the last script round. This trigger is only sent to player characters.

0x0005 Leaves(O:Object*)
Returns true if the specified object has left the party in the last script round. This trigger is only sent to player characters.

0x0006 ReceivedOrder(O:Object*,I:Order ID*)
NT 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.

0x0007 Said(O:Object*,I:Dialog ID*)
NT

0x0008 TurnedBy(O:Object*)
NT Returns true only if the active CRE was turned by the specified priest or paladin.

0x0009 Unusable(S:ResRef*)
NT Returns true only if the specified item is unusable by the active CRE.

0x400A Alignment(O:Object*,I:Alignment*Align)
Returns true only if the alignment of the specified object matches that in the second parameter.

0x400B Allegiance(O:Object*,I:Allegience*EA)
Returns true only if the Enemy/Ally status of the specified object matches that in the second parameter.

0x400C Class(O:Object*,I:Class*Class)
Returns true only if the Class of the specified object matches that in the second parameter.

0x400D Exists(O:Object*)
NT Returns true only if the specified object exists.

0x400E General(O:Object*,I:General*General)
Returns true only if the General category of the specified object matches that in the second parameter.

0x400F Global(S:Name*,S:Area*,I:Value*)
Returns true only if the variable with name 1st parameter of type 2nd parameter has value 3rd parameter.

0x4010 HP(O:Object*,I:Hit Points*)
Returns true only if the current hitpoints of the specified object are equal to the 2nd parameter.

0x4011 HPGT(O:Object*,I:Hit Points*)
Returns true only if the current hitpoints of the specified object are greater than the 2nd parameter.

0x4012 HPLT(O:Object*,I:Hit Points*)
Returns true only if the current hitpoints of the specified object are less than the 2nd parameter.

0x4013 LOS(O:Object*,I:Range*)
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 (see below).

0x4014 Morale(O:Object*,I:Morale*)
Returns true only if the morale of the specified object is equal to the second parameter.

0x4015 MoraleGT(O:Object*,I:Morale*)
Returns true only if the morale of the specified object is greater than the second parameter.

0x4016 MoraleLT(O:Object*,I:Morale*)
Returns true only if the morale of the specified object is less than the second parameter.

0x4017 Race(O:Object*,I:Race*Race)
Returns true only if the Race of the specified object is the same as that specified by the 2nd parameter.

0x4018 Range(O:Object*,I:Range*)
Returns true only if the specified object is within distance given (in feet) of the active CRE.

0x4019 Reputation(O:Object*,I:Reputation*)
Returns true only if the reputation of the specified object is equal to the second parameter.

0x401A ReputationGT(O:Object*,I:Reputation*)
Returns true only if the reputation of the specified object is greater than the second parameter.

0x401B ReputationLT(O:Object*,I:Reputation*)
Returns true only if the reputation of the specified object is greater than the second parameter.

0x401C See(O:Object*)
Returns true only if the active CRE can see the specified object which must not be hidden or invisible.

0x401D Specifics(O:Object*,I:Specifics*Specific)
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.

0x401E Time(I:Time*Time)
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.

0x401F TimeOfDay(I:Time Of Day*TimeODay)
As above but less specific and uses TimeODay.ids.

0x0020 HitBy(O:Object*,I:DameType*Damages)
Returns true only if the active CRE was hit by the specifed 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.

0x0021 HotKey(I:Key*HotKey)
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.

0x0022 TimerExpired(I:ID*)
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.

0x4023 True()
Always returns true.

0x0024 Trigger(I:TriggerNum*)
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.

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

0x0026 TargetUnreachable(O:Object*)
NT Returns true only if the object specified cannot be reached by normal walking by the active CRE.

0x4027 Delay(I:Delay*)
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.

0x4028 NumCreature(O:Object*,I:Number*)
Returns true only if the number of creatures of the type specified in sight of the active CRE are equal to the 2nd parameter.

0x4029 NumCreatureLT(O:Object*,I:Number*)
As above except for less than.

0x402A NumCreatureGT(O:Object*,I:Number*)
As above except for greater than.

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

0x402C HPPercent(O:Object*,I:Hit Points*)
See HP(O:Object*,I:Hit Points*) except this is for a percentage.

0x402D HPPercentLT(O:Object*,I:Hit Points*)
See HPLT(O:Object*,I:Hit Points*) except this is for a percentage.

0x402E HPPercentGT(O:Object*,I:Hit Points*)
See HPGT(O:Object*,I:Hit Points*) except this is for a percentage.

0x002F Heard(O:Object*,I:ID*SHOUTIDS)
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.

0x4030 False()
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.

0x4031 HaveSpell(I:Spell*Spell)
Returns true only if the active CRE has the specified spell memorised.

0x4032 HaveAnySpells()
Returns true if the active CRE has at least one spell memorised.

0x0033 BecameVisible()
NT Returns true only if the active CRE turned visible in the last script round.

0x4034 GlobalGT(S:Name*,S:Area*,I:Value*)
See Global(S:Name*,S:Area*,I:Value*) except the variable must be greater than the value specified to be true.

0x4035 GlobalLT(S:Name*,S:Area*,I:Value*)
As above except for less than.

0x0036 OnCreation()
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).

0x4037 StateCheck(O:Object*,I:State*State)
Returns true only if the specified object is in the state specified.

0x4038 NotStateCheck(O:Object*,I:State*State)
Exact opposite of above.

0x4039 NumTimesTalkedTo(I:Num*)
Returns true only if the player's party has spoken to the active CRE the exact number of times specified.
NB. NumTimesTalkedTo seems to increment when a PCinitiates conversion 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.

0x403A NumTimesTalkedToGT(I:Num*)
Returns true only if the player's party has spoken to the active CRE more than the number of times specified.

0x403B NumTimesTalkedToLT(I:Num*)
Returns true only if the player's party has spoken to the active CRE less than the number of times specified.

0x403C Reaction(O:Object*,I:Value*Reaction)
Returns true only if the reaction of the object specified (on the friendly-hostile scale) to the player was as specified.
NB. Reaction = 10 + rmodchr + rmodrep (see rmodchr.2da and rmodrep.2da).

0x403D ReactionGT(O:Object*,I:Value*Reaction)
Returns true if the reaction of the object specified (on the friendly-hostile scale) to the player was greater than specified.
NB. Reaction = 10 + rmodchr + rmodrep (see rmodchr.2da and rmodrep.2da).

0x403E ReactionLT(O:Object*,I:Value*Reaction)
Returns true if the reaction of the object specified (on the friendly-hostile scale) to the player was lower than specified.
NB. Reaction = 10 + rmodchr + rmodrep (see rmodchr.2da and rmodrep.2da).

0x403F GlobalTimerExact(S:Name*,S:Area*)
NT

0x4040 GlobalTimerExpired(S:Name*,S:Area*)
Returns true only if the timer with the name specified and of the type in the 2nd parameter has run and expired.

0x4041 GlobalTimerNotExpired(S:Name*,S:Area*)
Returns true only if the timer with the name specified and of the type in the 2nd parameter is still running. Note that 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 :) .

0x4042 PartyHasItem(S:Item*)
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).

0x4043 InParty(O:Object*)
Returns true only if the specifed object is in the player's party.

0x4044 CheckStat(O:Object*,I:Value*,I:StatNum*Stats)
Returns true only if the specified object has the statistic in the 3rd parameter at the value of the 2nd parameter.

0x4045 CheckStatGT(O:Object*,I:Value*,I:StatNum*Stats)
Returns true only if the specified object has the statistic in the 3rd parameter greater than the value of the 2nd parameter.

0x4046 CheckStatLT(O:Object*,I:Value*,I:StatNum*Stats)
Returns true only if the specified object has the statistic in the 3rd parameter less than the value of the 2nd parameter.

0x4047 RandomNum(I:Range*,I:Value*)
Generates a random number between 1 and Range. Returns true only if the random number equals the 2nd parameter.

0x4048 RandomNumGT(I:Range*,I:Value*)
NT As above except returns true only if the random number is greater than the 2nd parameter.

0x4049 RandomNumLT(I:Range*,I:Value*)
NT As above except returns true only if the random number is less than the 2nd parameter.

0x004A Died(O:Object*)
Returns true only if the specifed object died in the last script round.

0x004B Killed(O:Object*)
NT Returns true if the active CRE killed the specified object in the last script round.

0x004C Entered(O:Object*)
Only for trigger regions in areas. Returns true only if the specified object entered the trigger region in the last script round.

0x404D Gender(O:Object*,I:Sex*Gender)
Returns true only if the gender of the specified object is that given in the 2nd parameter.

0x404E PartyGold(I:Amount*)
Returns true only if the player's party has the amount of gold specified in the 2nd parameter.

0x404F PartyGoldGT(I:Amount*)
Returns true only if the player's party has more gold than specified in the 2nd parameter.

0x4050 PartyGoldLT(I:Amount*)
Returns true only if the player's party has less gold than specified in the 2nd parameter.

0x4051 Dead(S:Name*)
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.

0x0052 Opened(O:Object*)
Only for door scripts. Returns true only if the specified object opened the active door in the last script round.

0x0053 Closed(O:Object*)
Only for door scripts. Returns true only if the specified object closed the active door in the last script round.

0x0054 Detected(O:Object*)
Only for trap scripts. Returns true only if the specified object detected this trap in the last script round.

0x0055 Reset(O:Object*)
NT Only for trap scripts? Returns true only if this trap or trigger was reset in the last script round by the object specified.

0x0056 Disarmed(O:Object*)
Only for trap/trigger region scripts. Returns true only if the specified object disarmed this trap in the last script round.

0x0057 Unlocked(O:Object*)
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.

0x4058 OutOfAmmo()
NT Returns true only if the active CRE has no ammunition for the current ranged weapon.

0x4059 NumTimesInteracted(I:NPC*NPC,I:Num*)
NT Returns true only if the specified NPC has interacted with the party a number of times equal to the 2nd parameter.

0x405A NumTimesInteractedGT(I:NPC*NPC,I:Num*)
NT Returns true only if the specified NPC has interacted with the party a number of times greater than the 2nd parameter.

0x405B NumTimesInteractedLT(I:NPC*NPC,I:Num*)
NT Returns true only if the specified NPC has interacted with the party a number of times less than the 2nd parameter.

0x005C BreakingPoint()
NT Returns true only if the active CRE is at its morale breaking point.

0x005D PickPocketFailed(O:Object*)
Seems to be broken. Not used in any existing scripts.

0x005E StealFailed(O:Object*)
For shopkeepers. Returns true if the specified object failed to steal from the shop in the last script round.

0x005F DisarmFailed(O:Object*)
NT Not used in any existing scripts.

0x0060 PickLockFailed(O:Object*)
NT Not used in any existing scripts.

0x4061 HasItem(S:ResRef*,O:Object*)
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).

0x4062 InteractingWith(O:Object*)
NT Returns true only if the active CRE is interacting (dialogue?) with the specified object.

0x4068 TimeGT(I:Time*Time)
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.

0x4069 TimeLT(I:Time*Time)
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.

0x4075 NearLocation(O:Object*,P:Point*,I:Range*)
NT 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.

0x4076 NearSavedLocation(I:Range*)
NT Returns true if the active creature is within the range of its home location.

0x4077 InView(O:Object*,I:Eyesight*)
NT

0x4078 OwnsFloaterMessage(O:Object*)
NT

0x4079 TriggerClick()
NT

0x407a AssaltedBy(O:Object*,I:Style*AStyles)
NT

0x407b RandomStatCheck(O:Object*,I:StatNum*Stats,I:CheckType*Delta,I:CheckValue*Bones)
NT

0x407c TimerActive(I:ID*)
NT Returns true only if the local timer with the specified ID has not yet expired.

0x407d PCCanSeePoint(P:Point*)
NT

0x407e CreatureInArea(S:AreaName*)
NT Returns true only if the active CRE is in the area specified.

0x407f BitCheck(S:Name*,S:Area*,I:Bit*Bits)
NT Returns true if at least one bit from the given variable is in common with the bits defined in the third parameter.

0x4080 GlobalBAND(S:Name*,S:Area*,I:Value*)
NT

0x4081 BitCheckExact(S:Name*,S:Area*,I:Bit*Bits)
NT

0x4082 GlobalEqualsGlobal(S:Name1*,S:Area1*,S:Name2*,S:Area2*)
NT

0x4083 GlobalLTGlobal(S:Name1*,S:Area1*,S:Name2*,S:Area2*)
NT

0x4084 GlobalGTGlobal(S:Name1*,S:Area1*,S:Name2*,S:Area2*)
NT

0x4085 GlobalANDGlobal(S:Name1*,S:Area1*,S:Name2*,S:Area2*)
NT

0x4086 GlobalORGlobal(S:Name1*,S:Area1*,S:Name2*,S:Area2*)
NT

0x4087 GlobalBANDGlobal(S:Name1*,S:Area1*,S:Name2*,S:Area2*)
NT

0x4088 GlobalBANDGlobalExact(S:Name1*,S:Area1*,S:Name2*,S:Area2*)
NT

0x4089 PartyCountEQ(I:Count*)
NT

0x408a PartyCountLT(I:Count*)
NT

0x408b PartyCountGT(I:Count*)
NT

0x408c ObjItemCountEQ(S:Item*,O:Object*,I:Count)
NT

0x408d ObjItemCountLT(S:Item*,O:Object*,I:Count)
NT

0x408e ObjItemCountGT(S:Item*,O:Object*,I:Count)
NT

0x408e PartyItemCountEQ(S:Item*,I:Count)
NT

0x4090 PartyItemCountLT(S:Item*,I:Count)
NT

0x4091 PartyItemCountGT(S:Item*,I:Count)
NT

0x4092 WatchMe(I:Mode*)
NT

0x4093 NearbyDialog(S:DialogFile*)
NT Returns true only if a creature with the specified dialog file is within visual range of the active CRE.

0x0094 Vacant()
NT Returns true only if the current area is a non-master area and is about to be unloaded because no player characters were present in the last script round.

0x4095 Xor(S:Name*,S:Area*,I:Value*)
NT

0x4096 IsAClown(O:Object*)
NT

0x4097 Proficiency(O:Object*,I:Slot*WProf,I:Value*)
NT

0x4098 ProficiencyLT(O:Object*,I:Slot*WProf,I:Value*)
NT

0x4099 ProficiencyGT(O:Object*,I:Slot*WProf,I:Value*)
NT

0x409a Faction(O:Object*,I:Value*Faction)
NT Returns true only if the Faction of the specified object is the same as that specified by the 2nd parameter.

0x409b Team(O:Object*,I:Value*Team)
NT Returns true only if the Team of the specified object is the same as that specified by the 2nd parameter.

0x409c StuffGlobalRandom(S:Name*,S:Area*,I:Range*)
NT This trigger acts as a hybrid action/trigger. It generates a random integer between [0, 'Range'] inclusive, and sets the variable 'Name' under the given 'Scope'. This trigger always returns true.

0x009d HarmlessOpened(O:Object*)
NT Only for container and door scripts. Returns true only if the specified object opened the container or door in the last script round, given there was no trap active.

0x009e HarmlessClosed(O:Object*)
NT Only for door scripts. Returns true only if the specified object closed the door in the last script round, given there was no trap active.

0x009f HarmlessEntered(O:Object*)
NT Only for trigger regions. Returns true only if the specified object entered the region in the last script round, given there was no trap active.

0x40a0 CalledByName(O:Object*,S:Scriptname*)
NT

0x40a1 Internal(O:Object*,I:Index*Internal,I:Value*)
NT

0x40a2 InternalLT(O:Object*,I:Index*Internal,I:Value*)
NT

0x40a3 InternalGT(O:Object*,I:Index*Internal,I:Value*)
NT

0x00a4 NullDialog(O:Object*)
NT Returns true for one script round if the specified object attempts to talk to the active CRE which has an empty ("") dialog file set.

0x00a5 WasInDialog()
NT Returns true only if the active CRE was in dialog mode in the last script round.

0x40a6 IsLocked(O:Object*)
NT Returns true only if the specified door is locked.

0x40a7 AnimState(O:Object*,I:Sequence*Animstat)
NT

0x40a8 ExtraProficiency(O:Object*,I:Value*)
NT Returns true only if the specified object has the same number of unspent proficiency points as in the 2nd parameter.

0x40a9 ExtraProficiencyLT(O:Object*,I:Value*)
NT Returns true only if the specified object has less unspent proficiency points as in the 2nd parameter.

0x40aa ExtraProficiencyGT(O:Object*,I:Value*)
NT Returns true only if the specified object has more unspent proficiency points as in the 2nd parameter.

0x00ab NamelessBitTheDust()
NT Returns only true if TNO died in the last script round.

0x40ac ClassLevel(O:Object*,I:Value*Class,I:Value*)
NT

0x40ad ClassLevelGT(O:Object*,I:Value*Class,I:Value*)
NT

0x40ae ClassLevelLT(O:Object*,I:Value*Class,I:Value*)
NT

0x00af FailedToOpen(O:Object*)
NT Returns true if the current CRE failed to open a door or container in the last script round.

0x40b1 LastPersonTalkedTo(O:Object*)
NT Returns true only if the active CRE's LastTalkedToBy object equals the 'Object' parameter.

0x40b2 IsInGuardianMantle(O:Object*)
NT