Skip to content

Fenia Triggers

Kit Oliynyk edited this page Nov 3, 2026 · 4 revisions

TL;DR: Every event a Fenia script can hook, by entity: mobs, items, rooms, affect handlers, areas, global events, AI decisions, and the functions the engine calls by name. Tables are generated from the C++ call sites. Triggers named on... run inside the command, post... runs after it in its own thread. Use when: you choose which trigger to bind, need its arguments or return value, or wonder how often it fires. Source of truth: dreamland_code/src/core/fenia/wrappertarget.h (FENIA_*_CALL), plug-ins/system/fenia_utils.cpp (fenia_trigger, gprog), plug-ins/loadsave/behavior_utils.cpp, plug-ins/updates/update.cpp, and the mprog_*, oprog_*, rprog_* functions across plug-ins/. Templates in dreamland_world/fenia.examples Verified: 2026-11-02 against dreamland_code a7c4fd10, dreamland_world a35c62ce. Private script repositories were read for behaviour only.

The tables below were produced by scanning every FENIA_CALL, FENIA_NDX_CALL, FENIA_VOID_CALL, FENIA_STR_CALL, FENIA_NUM_CALL, gprog, gprog_nocatch and ai_trigger site in src/ and plug-ins/, then reading the call sites. They list what the C++ engine fires. Scripts can fire more through x.trigger("Name", ...), see Fired by command scripts. Argument names come from the C++ variables and from the templates in fenia.examples. In Fenia you may name parameters freely.

How a trigger fires

A trigger is a function stored in a field named on<Event> or post<Event>. You can set it in three places:

.get_mob_index(3090).onGreet = function(mob, ch) { ... };   // prototype: every instance
.Behavior("fido").onGreet = function(mob, ch) { ... };      // behavior: every prototype that carries it
some_mob.onGreet = function(ch) { ... };                    // one instance
  • Argument convention. An instance trigger gets the arguments without the entity. A prototype or behavior trigger gets the entity first. The tables show the prototype form. Drop the first argument for the instance form. Rooms have no separate prototype, so a trigger set on the room itself never has the extra argument. A room behavior does get the room first.
  • on versus post. on<Event> runs synchronously inside the command or update that raised the event. Its result can change what happens. post<Event> is queued whether or not the on handler returned true, and starts in its own thread right after the command finishes. It may call .scheduler.sleep. Its result is ignored. When a script fires an event with x.trigger(...), the post handler is queued even before the on handler runs. .scheduler.sleep inside an on handler throws (yielding allowed from fenia process only or yielding not allowed from native code), so put pauses in post handlers.
  • Order. For most events the engine asks, in turn, the area quest handlers (when the actor is a player), the Fenia behaviors, the instance, the prototype and the built-in C++ behavior class. The first true ends the chain. Not every event reaches every layer: see the dispatch table on Fenia-Behaviors.
  • Result column.
    • bool: the handler's result is read as a boolean. true means handled. The C++ site decides what that stops. Cant... triggers veto the action. A handler that returns a non-empty string or a non-zero number also counts as true. One that returns an object throws and is treated as false.
    • string: the first non-empty string returned wins.
    • number: a returned number replaces a value (damage or a saving throw). Any other result means "not handled".
    • ignored: the result is not used.
  • Errors. An exception inside a handler is logged (Exception calling Fenia prog ...), shown to online immortals, and the handler counts as false.

Cadence

Periodic triggers, with the default timing in the CI sample config (pulsePerSecond 4, pulseMobile 16, pulseViolence 12, pulseTick 240). A running server may use other values. One pulse is a quarter of a second.

Trigger Interval Driver in update.cpp
mob onSpec 4 s mobile_update. A behavior onSpec is skipped for mobs in an area marked empty (no player has entered since its last reset). A prototype onSpec is not gated.
item onSpec 4 s water_float_update, offset from the mobile pulse
room onSpec, onDiveUpdate 4 s diving_update. Only rooms in a responder registry are visited. The registry is rebuilt about every 10 minutes, so a room trigger posted live can take that long to start firing.
mob and item onArea 60 s once per tick
onFight (mob, item) 3 s every combat round, violence_update
room onTime 60 s once per tick, inside the sunlight update. One game hour is one tick.
room onReset on zone reset after the area has been repopulated
area onUpdate 110 s area_update, for every area, whether or not it resets this time
affect onUpdateChar, onUpdateObj 60 s tick, only while the affect has a positive duration
affect onUpdateRoom 49 pulses (12.25 s) its own pulse (PULSE_RAFFECT)
affect onSpecChar, onSpecObj, onSpecRoom 4 s onSpecChar runs over all characters in the world, onSpecRoom over all rooms with a live affect
global onSpec 4 s players only (mobs use their own triggers)

onSpec on a mob also runs after affect handlers: a mob whose affect onSpec returned true does nothing else that pulse.

Mob triggers

Fired for the mob the trigger sits on. The first argument is that mob (mob). Some of these also fire on a player's wrapper, in the instance form only (onInput and onSpec for example).

Trigger Arguments Result Fires when
onArea mob bool Once per tick (60 s) for every mob in a room.
onAttack mob, ch, victim bool ch attacks victim in the mob's room. Ranged attacks fire it in each room along the path.
onBribe mob, giver, gold, silver bool giver handed the mob money.
onCantLeave mob, ch bool ch tries to leave the mob's room. true blocks the exit.
onCantMove mob, to_room, movetype bool The mob tries to enter to_room. true forbids the move.
onCantOrder mob, master, cmdName, cmdArgs bool master orders the mob to run a command. true refuses silently.
onCast mob, caster, sname ignored A spell is cast near the mob. sname is the English spell name.
onCheckAssist mob, fch, victim bool fch fights victim next to the mob. true makes the mob join fch. Mobs only.
onCommand mob, actor, cmdName, cmdArgs bool actor tries a command in the mob's room. true blocks the command.
onDeath mob, killer bool The mob is about to die. true cancels the standard death handling.
onEditorSave ch, text ignored A web editor save is passed to Fenia for the character. Instance form on a player's wrapper.
onEmote mob, ch, txt ignored ch emoted in the mob's room.
onEntry mob bool The mob entered a room.
onExtract mob, count bool The mob is about to be removed from the world. count is always 1 in the current code.
onFight mob, victim bool Each combat round while the mob fights. Every 3 s with the default config.
onGive mob, ch, obj bool ch gave obj to the mob.
onGreet mob, walker bool walker entered the mob's room.
onHit mob, ch, dam, damType, wield bool ch damaged the mob. wield is null for bare hands.
onImmune mob, ch, dam, damType, wield, dam_flag, skillName number Before the standard resist and vulnerability maths. Return a number to replace the damage and skip the standard maths.
onInput mob, line bool A command line is about to be interpreted for this character. true drops the line.
onInvisible mob, looker bool looker checks whether it can see the mob. true makes the mob invisible to looker.
onKill mob, victim bool The mob killed victim.
onLeave mob, ch, to_room, movetype ignored ch left the mob's room towards to_room.
onLook mob, looker, victim ignored Fires for both looker and the character being looked at. The mob may be either.
onMakeLove mob, victim bool The mob is the initiator of the make-love command with victim. true cancels it.
onOrder mob, master, cmdName, cmdArgs ignored The mob has just run a command ordered by master.
onPut self, ch, obj, container bool The mob put obj into container. ch is the mob itself.
onQuest mob, client, cmd, args ignored client ran quest cmd args near a questor mob.
onReturn mob bool The return command of a mob that a character has switched into. true cancels the return.
onSafe mob, ch, victim, v bool Asks whether victim is protected from ch. Fires for both sides. true means protected.
onSeize self, ch, victim, obj ignored ch took obj from victim. The mob may be ch or victim.
onSkill mob, actor, skill, success, victim ignored actor used a skill near the mob. success is 1 or 0.
onSmell mob, ch, argument bool ch smells the mob.
onSocial mob, actor, victim, social bool actor used a social near the mob, victim may be null.
onSpec mob bool Every 4 s for each character in the world. Players have no prototype, so they get only the instance form and the global onSpec. See Cadence.
onSpeech mob, talker, msg bool talker said msg near the mob. Also fires for a tell sent to the mob (mob is then the listener).
onSpell mob, caster, sname, before bool A spell is aimed at the mob. before is 1 before the cast resolves and 0 after.
onStopfol mob, master bool The mob stopped following master.
onTell mob, talker, msg bool talker told msg to the mob.
onWake mob, waker bool waker woke the mob.

Notes:

  • onSpeech also fires for a private tell sent to a mob in the same room, after onTell if that returned nothing.
  • Triggers that only older documentation mentions, such as onStealItem, are fired neither by the engine nor by the game scripts.
  • onSafe is asked for both sides of an attack: once on the attacker and once on the victim.

Item triggers

The first argument is the item the trigger sits on (obj), or the container for the container triggers (container). self marks places where the item can be either role.

Trigger Arguments Result Fires when
onArea obj bool Once per tick (60 s). true skips the standard timer handling.
onCanDress obj, ch, victim bool ch asks to dress victim with this item. true forbids it.
onCantEquip obj, ch bool ch tries to wear or wield this item. true forbids it.
onCantFetch container, ch, obj, pocket bool ch tries to take obj out of this container (from pocket). true forbids it.
onCantGet obj, ch bool ch tries to pick the item up. true forbids it.
onCantOpen obj, ch bool ch tries to open the item. true forbids it.
onCantPut container, ch, obj, pocket, verbose bool ch tries to put obj into this container (into pocket). true forbids it.
onClose obj, ch bool ch closed the item.
onCommand obj, actor, cmdName, cmdArgs bool actor ran a command in the room where the item lies, or carries it. true blocks the command.
onDeath obj, victim, killer bool The wearer victim is about to die. true cancels the standard death handling.
onDress obj, ch, victim ignored ch has dressed victim with this item.
onDrop obj, ch bool ch dropped the item. Return true if the item was destroyed or must not sink or crumble.
onEat obj, ch bool ch ate the item. Return true if you destroyed it.
onEmpty obj, ch, liqname, amount bool ch emptied the container, pouring liqname away.
onEntry obj bool The carrier of the item entered a room.
onEquip obj, ch bool The item is now on the body: after wear, and again after login. Hang affects here.
onExamine obj, ch, arg bool ch examines the item. true replaces the standard output. Not dispatched to behaviors.
onExtraDescr obj, ch, arg string ch looks at keyword arg near the item. Return the text to show, or an empty string to carry on searching. Carried items are asked before the room.
onExtract obj, count bool The item is being destroyed. count tells whether the removal decrements the prototype instance count.
onFetch container, ch, obj bool ch took obj out of this container.
onFight obj, ch bool Every combat round for an item the fighter wears in a meaningful slot. Every 3 s with the default config.
onFightCarry obj, ch bool Every combat round for an item the fighter carries but does not wear in a meaningful slot (inventory, hair, tail and so on).
onGet obj, ch bool The item entered ch's inventory.
onGive obj, ch, victim bool ch handed the item to victim. true skips the receiver's own Give trigger and Get.
onGreet obj, walker bool walker entered the room where the item lies or is carried.
onInvisible obj, ch bool ch checks the item's visibility. true makes it invisible to ch.
onKill obj, killer, victim, label ignored The carrier killed victim. label tags the kind of kill.
onListen obj, ch, argument bool ch listens to the item.
onLook obj, ch, keyword bool ch just saw an extra description with keyword on the item. Append-only.
onOpen obj, ch bool ch opened the item.
onOpenMsg obj, ch bool ch opened the item. Print your own messages and return true to replace the standard ones.
onPortalLocation obj, ch string ch enters a portal. Return a vnum string to send ch elsewhere, or an empty string for the portal's own target.
onPourGround obj, ch, liqname, amount ignored ch pours liqname from this container onto the ground.
onPresent obj, ch, victim bool ch presents the item to victim.
onPut self, ch, obj, container / container, ch, obj, container bool ch puts obj into container. Fires for ch, obj and container.
onPutMoney container, ch, gold, silver bool ch puts coins into this container.
onPutMoneyMsg container, ch, gold, silver bool ch puts coins into this container. Print messages and return true to replace the standard ones.
onPutMsg container, ch, obj, container / self, ch, obj, container bool ch puts obj into container. Print messages and return true to replace the standard ones.
onQuaff obj, ch bool ch quaffed the item.
onQuit obj, ch, count bool ch, who carries the item, quits. count is 0 for a quit and 1 for a delete.
onRemove obj, ch bool ch took the item off.
onSac obj, ch bool ch sacrificed the item.
onSeize self, ch, victim ignored ch took the item from victim.
onShowEnd obj, ch, looker string A furniture item. ch sits on it, looker looks at ch. Return text appended at the end.
onShowWhere obj, ch, looker string A furniture item. ch sits on it, looker looks at ch. Return text to replace the "sits on ..." part.
onSmell obj, ch, argument bool ch smells the item.
onSocial obj, actor, victim, social bool actor used a social near the item.
onSpec obj bool Every 4 s (water-float update). See Cadence.
onSpeech obj, talker, msg bool talker said msg near the item.
onTrack obj, ch, target, door bool ch, who carries the item, tracks target. The trail leaves by door.
onUse obj, ch, argument bool ch used the item with use. Return false and the player fiddles with it.
onWear obj, ch bool ch wore the item with the wear command. Hang affects in Equip.

Notes:

  • onExtraDescr is polled for every item in a character's inventory before the room is looked at. A handler that answers any word steals look sword from another item. Answer only your own keywords.
  • onLook fires after the text was chosen and printed, so it can only add.
  • A furniture item can override the messages of stand, rest, sit and sleep by setting string fields on the item or its prototype. Each message has a Char and a Room form: msgStandChar/msgStandRoom, msgWakeStandChar/msgWakeStandRoom, msgRestChar/msgRestRoom, msgWakeRestChar/msgWakeRestRoom, msgSitRestChar/msgSitRestRoom, msgSitChar/msgSitRoom, msgWakeSitChar/msgWakeSitRoom, msgSleepChar/msgSleepRoom. The format receives the furniture as argument 1 and the character as argument 2.

Room triggers

Rooms have no prototype wrapper: the trigger sits on the room itself and this is the room.

Trigger Arguments Result Fires when
onCantMove walker, targetRoom, moveType bool walker tries to leave towards targetRoom. true forbids it.
onCantWalk walker, extraExit bool walker tries the extra exit named extraExit. true forbids it.
onCommand actor, cmdName, cmdArgs bool actor ran a command in the room. true blocks it.
onDescr ch, description string The room description is being built for ch. Return the whole new description. Returning only a fragment wipes the room text.
onDive walker, danger bool walker entered and the other entry triggers have run. Time for a trap. danger comes from the move type.
onDiveUpdate `` ignored Same cadence as onSpec. Historical name.
onEntryLocation walker, sourceRoom, door string walker enters this room from sourceRoom through door. Return a vnum to redirect.
onEntryNear walker, moveType bool walker is about to enter this room from a neighbour. true vetoes the step.
onExitLocation walker, targetRoom, door string walker leaves through door towards targetRoom. Return a vnum to redirect.
onExtraExitDescr eexitKeyword, ch, eexitDescription string The room look lists an extra exit with keyword eexitKeyword. Return its description.
onGreet walker, fromRoom, moveType ignored walker came in from fromRoom.
onLeave walker, toRoom, moveType ignored walker left towards toRoom.
onLook ch, keyword bool ch looked at extra description keyword in the room.
onReset `` ignored The area reset has finished repopulating the room.
onShowEnd ch, looker string Text appended at the end of what looker sees of the room.
onSkill actor, skill, success, victim ignored actor used a skill in the room. success is 1 or 0.
onSmell ch, arg bool ch smelled the air. true replaces the standard output.
onSocial actor, victim, social, arg bool actor used a social in the room.
onSpec `` ignored Every 4 s (dive update).
onSpeech ch, msg ignored ch spoke msg in the room.
onTime newTime ignored Every game hour (one tick, 60 s) for every room. newTime is the English phase name (dark, sunrise, light, sunset) when the phase changed this hour, otherwise empty.
onWhere ch, arg bool ch ran where arg. true stops the standard command.

onEntryNear is the only room trigger that fires on the room being entered while the walker is still in the neighbouring room, before the step. It fires for walking, fleeing, portals and recall alike. true cancels the step and prints nothing, so the handler must say why.

Affect handler triggers

An affect handler belongs to a skill or spell name: .AffectHandler("poison").onUpdateChar = function(ch, af) { ... }. The triggers run for affects hanging on a character, an item or a room.

  • Inside an affect trigger this is the affect handler itself, not the character, item or room.
  • A handler that returns false lets the built-in C++ handler for that affect run next. Return true to replace it.
  • Several affects of the same type with the same remaining duration in a row fire the handler once, not once per affect. This applies to every affect trigger.
  • onDescr replaces the room description. It gets the viewer, not the room (use ch.in_room). Return the old text plus your addition. An empty result means "no change".
  • Room onDescr handlers run first, then each affect's onDescr over the accumulated text.
Trigger Arguments Result Fires when
onDescr ch, af, roomDescription string A room affect. The room description is being shown to ch. Return the old description plus your addition. Returning less wipes the text.
onDispel ch, af bool An attempt to dispel the affect from ch.
onEntryChar ch, af bool The character carrying the affect entered a room.
onEntryRoom room, af, walker, movetype, danger bool walker entered the room that carries the affect.
onFightChar ch, af, victim bool Every combat round while ch fights victim.
onGet obj, af, ch bool ch picked up the item that carries the affect.
onGive obj, af, ch, victim bool ch is about to hand the item that carries the affect to victim.
onHit ch, af, attacker, dam, dam_type, wield bool attacker damaged ch.
onImmune ch, af, attacker, dam, dam_type, wield, dam_flag, skillName number Before the standard resist maths for ch. Return a number to replace the damage.
onLeave room, ch, af bool ch left the room that carries the affect.
onLook ch, af, looker bool looker looked at ch.
onPourOut obj, af, actor, container, liqname, amount bool actor poured liqname from container over the item that carries the affect.
onRefresh ch, verbose bool Called when the affects of ch are re-applied, for example at login. verbose tells whether to print messages.
onRemoveChar ch, af bool The affect is being removed from ch.
onRemoveObj obj, af bool The affect is being removed from an item.
onRemoveRoom room, af bool The affect is being removed from a room.
onSaves ch, af, victim, saves, damtype number A saving throw of ch is computed for damage type damtype. Return a number to replace the result.
onShow obj, af, looker string looker looks at the item that carries the affect. Return a string to add to the item line.
onSmellChar ch, af, sniffer bool sniffer smelled ch.
onSmellObj obj, af, sniffer bool sniffer smelled the item.
onSmellRoom room, af, sniffer bool sniffer smelled the room.
onSpecChar ch, af bool Every 4 s, for every character in the world.
onSpecObj obj, af bool Every 4 s.
onSpecRoom room, af bool Every 4 s, for every room in the world.
onStopfol ch, af bool ch stopped following its master.
onUpdateChar ch, af bool Once per tick (60 s) while the affect has a positive duration.
onUpdateHit ch, af bool Start of each health regeneration step for ch. true skips the standard regeneration.
onUpdateObj obj, af bool Once per tick (60 s) while the affect has a positive duration.
onUpdateRoom room, af bool About every 12 s (49 pulses) while the affect has a positive duration.

Area triggers

Trigger Arguments Fires when
onUpdate none On the area prototype, every 110 s. The prototype is .get_area_index("midgaard.are"), with the file name form.

Channel triggers

The area-wide channels call a trigger named after the channel on every character, every mob prototype and every carried item in the area. The channel yell is meant to call onYell(ch, text) and the immortal zecho to call onZecho(ch, text). For prototypes the first argument is the mob or item. Because this walks the whole area, keep these handlers cheap.

Known engine bug: the trigger name is built once, from whichever area channel is used first after the plugin loads, and then reused by every area channel. If yell is used first, zecho calls onYell too, and the reverse. Do not rely on onZecho and onYell being told apart until this is fixed.

Fired by command scripts

Some commands are written in Fenia, and they fire triggers by calling x.trigger("Name", args...). The instance handler gets the arguments verbatim. The prototype handler gets the entity first. The names and arguments below are what the shop, train, practice, repair, services, drink, fill, pour and vomit scripts pass. The templates in fenia.examples show the shape for several of them.

Trigger Arguments (instance form) Fired on
onTrain ch, stat the teacher mob, after train
onCantTrain ch the teacher mob. true refuses.
onTeach ch, skillName the teacher mob, after practice. skillName is empty for the plain practice here call.
onCantTeach ch, skillName the teacher mob. true refuses.
onSell ch, obj, cost, number the shopkeeper mob after a sale
onRepair client, obj, price the repair mob after a repair service
onQuest ch, cmd, args the questor mob (also fired from C++)
onCantScavenge obj (prototype form: mob, obj) a mob that is about to pick up a weapon or shield from the floor, called directly by the mob AI script. true forbids it.
onFill ch, amount the container being filled
onEmpty actor, liqname, amount the container being emptied. true stops the standard handling.
onPourOn actor, container, liqname, amount an item that is poured on
onPourOut ch, container, liqname, amount the character or item that gets the liquid
onPourVict ch, victim, liqname, amount the container poured over a character
onPourGround pourer, liqname, amount the container poured on the ground
onDrink ch, liqname, amount the container drunk from
onDrinkNear drink, ch, liqname, amount items carried by someone who is near a drinker
onVomit ch the character and items they carry
onHeal ch, argument the healer mob, when a client lists services (argument is empty) or when it starts praying for any service that casts a spell, bless and mana included, before the spell lands (argument is the service name)

trigger("Get"), trigger("Give") and trigger("Drop") on an item run the engine chain instead of just the field lookup. Give runs all of it: area quests, behaviors, instance and prototype handlers, affects. Drop has no area quests and no affects. A call such as obj.trigger("Empty", obj, ...) with a leading obj shifts every argument by one on the instance handler. Only Get, Give and Drop expect the item as first argument.

Global triggers

A global trigger is called by the engine with gprog(name, args). The engine looks up the function .tmp.trigger_handler and calls it with the trigger name and a list of arguments. The shipped handler runs every function registered under .tmp.gtrig[name][label] and returns true if any of them did. A server without that handler ignores global triggers. gprog_registered(name) lets C++ skip work when nobody registered a handler.

To register one, store a function: .tmp.gtrig["onDeath"]["my label"] = function(victim, killer, part, label, damtype) { ... }. The fenia add <trigger> <label> command opens an editor with a template. Several labels can listen to the same name. fenia del <trigger> <label> removes one.

Trigger Arguments Fires when
onAccountEnter ch a character enters the world through an account
onAchievement ch, id an achievement is awarded
onCharDelete name a player file is deleted
onCharRename oldName, newName a player is renamed (lower-case names)
onConnect ch a player's connection reaches the playing state
onDeath victim, killer, part, label, damtype after the mob onDeath. true interrupts the death. part is -1 in the current code.
onElementalEffect element, source, victim, power an elemental effect hits a character
onElementalEffectRoom element, source, room, power an elemental effect hits a room
onEquipWornBuff obj, ch an item with a wornbuff property was worn
onGangChefLoot ch, killer the gang chef's bounty is created
onInit mob a mob instance was just created
onLeaveWorld ch, reason a player leaves. reason is quit, switch, reboot or extract. The first three fire before the save, extract after it.
onObjBreak obj an item with a stones property is destroyed by combat damage or desert melt
onObjDecay obj the decay timer of an item with a stones property ran out
onPanicYell ch, victim, msgBlind, msg, label a panicked character calls for help
onPetGrowth pet, key, delta a charmed pet grew a parameter on a kill
onPortalEnter ch, portal, toRoom a character steps into a portal
onPortalRandomRoom ch, portal, room a random-destination portal picked a room
onQuestStart, onQuestComplete, onQuestCooldown ch, quest area quest events
onQuestStepEnd ch, quest, step an area quest step ended
onSpec ch every 4 s for each player
onSpeech ch, msg a character spoke with say
onUnseenEntry ch, walker, movetype a player in the room cannot see the walker who came in
onWeaponCrit ch, victim, wield, dam a critical slash or pierce landed
onWeaponEffect ch, victim, wield, dam, skillName a weapon with a special effect hit

onWeaponEffect, onWeaponCrit, onElementalEffect, onElementalEffectRoom and onUnseenEntry are called on combat paths and let a death exception travel up to the fight round. A handler that kills its target must not wrap the kill in try.

AI decisions

The mob AI hands decisions to Fenia through global triggers with an AI suffix. C++ keeps the cheap gates that decide when a mob should think. The handler decides what to do and checks every state itself. The handler returns true if it acted. If nothing is registered for a name, the mob makes no decision at all: there is no C++ fallback, with two exceptions. With no onRecallAI handler the mob is teleported home by the engine. With no onCastAI handler a mob that is not a class caster falls back to its C++ fight spec. A handler that throws counts as false. A handler that extracts the mob ends the pulse for it.

Trigger Arguments
onAggressAI ch, victim, kind where kind is lastFought, memorized or normal
onAggressRangedAI ch, victim, door, range
onAssistAI ch, helper, victim, kind where kind is offense, master or group
onAttackAI ch, victim
onCallHelpAI, onCastAI, onFightAI, onHealAI, onPickWeaponAI, onQuaffAI, onScavengeAI, onVampireAI, onWanderAI, onWimpyAI ch
onInvisAI ch, flags
onRecallAI ch, home
onTrackAI ch, target (check ch.in_room, the update does not skip mobs without a room)
onGangBribeAI, onGangChefFightAI, onGangFightAI, onGangGreetAI, onGangSpecAI specific to the gangsters scenario

Script slots the engine calls by name

These are not triggers. The engine looks up a function at a fixed path in .tmp and calls it. Missing slots are skipped and the C++ default runs.

Path Called from
.tmp.trigger_handler every global trigger, see above
.tmp.language.onOutcome, .onEcho, .onCheck the ancient-language commands: no-effect words, echoes, pronunciation checks
.tmp.nanny.onConnect, .onInput and .tmp.intro (new-client flow) character creation
.tmp.corpse.make corpse creation on death
.tmp.gquest.info, .progress, .notify the global quest command
.tmp.quest.<subcommand>, .tmp.quest.requestHint the quest command and questor requests
.tmp.questreward.modifier personal quest rewards
.tmp.autobuff.<name> the autobuff button and the buff command
.tmp.webconfig.<name> the web client settings page
.tmp.achievements.profile, .hideBlocker, .charRows, .boardRows the web profile and boards
.tmp.pve.worthLine the score command

Area quest hooks

Quest-level hooks sit on the quest wrapper .AreaQuest(vnum):

Hook Arguments Result
onCanEverStart ch string. A non-empty string means the quest is closed for ch for this life (for example the single craft slot is taken). Do not refuse for passing reasons here.
onCanStart ch string. A non-empty string refuses the start now (time of day, too many followers).
onCancel ch ignored
onInfo ch string. A non-empty result replaces the info text configured for the current step.

Step handlers follow the pattern q<quest>_step<N>_<begin|end>_<trigger>. See Area-Quests.

See also

Clone this wiki locally