|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
TCL-Programs Reference ManualContents
Trigger CommandsObjTrigger CommandThe objtrigger command is defined as a separate command.
Adds a trigger to the object. Use <name> to give the trigger an unique name. Non-unique names will be rejected. Also numbers are allowed names. This name can be used to delete the trigger later. Type is the trigger type, like "drop", "eat", "zap", etc. Trigger types are described later. <call> is an TCL-script that should be executed. Normally this will be the name of a procedure to execute. The <trigger> gives the trigger condition. This should be a TCL command (or script) that returns a boolean. If the boolean is true, the <call> script will be executed. If no trigger condition is given, the call script will always be executed. The <trigger>-script may generate variables that then can be used in the <call> script. The <trigger> script has also access to all other functionality you would normally have in a TCL-mobprog. Trigger TypesTriggers are fairly easy to add, but this basic list should hold for most needs. Their names, argument list syntaxes, and translation into more articulate English are given below. Some triggers generate a trigger value. This value can be accessed with the [trig] command or trough the $::t variable. The trig command has a lot of routines for easy access to these trigger values. Object Triggers Command Reference
trigger pre_closeTrigger value:-Default character:Person or mob going to close the object Called before the object is closed. If it returns a FALSE, the object will not be be closed. trigger closeTrigger value:-Default character:Person or mob who closes the object Called when the object has been closed.
trigger pre_drinkTrigger value:-Default character:Person or mob going to drink the object Called before the object is drank. If it returns a FALSE, the object will not be be drunk. trigger drinkTrigger value:-Default character:Person or mob who drinks the object Called when the object has been drank.
trigger pre_dropTrigger value:-Default character:Person or mob going to drop the object Called before the object is dropped. If it returns a FALSE, the object will not be be dropped. trigger dropTrigger value:-Default character:Person or mob who drops the object Called when the object has been dropped.
trigger pre_eatTrigger value:-Default character:Person or mob going to eat the object Called before the object is eaten. If it returns a FALSE, the object will not be be eaten. trigger eatTrigger value:-Default character:Person or mob who ate the object Called when the object has been eaten.
trigger pre_enterTrigger value:-Default character:Person or mob going to enter the object Called before a mob/char have entered the object. If it returns a FALSE, the object will not be entered. trigger enterTrigger value:-Default character:Person or mob which entered the object Called when a mob/player have entered an object.
trigger pre_getTrigger value:-Default character:Person or mob going to get the object Called before the object is taken. If it returns a FALSE, the object will not be taken. trigger getTrigger value:-Default character:Person or mob who got the object Called when the object has been taken. trigger pre_getoutTrigger value:-Default character:Person or mob going to get an object out of the container Called before an object is taken out of the container. If it returns a FALSE, the object will not be taken. trigger getoutTrigger value:-Default character:Person or mob who got an object out of the container Called when an object has been taken out of the container.
trigger pre_giveTrigger value:-Default character:Person or mob going to give the object Called before the object is given to somebody. If it returns a FALSE, the object will not be given away. trigger giveTrigger value:-Default character:Person or mob who gives the object Called when the object has been given.
trigger pre_hitTrigger value:-Default character:Char wielding the obj Called before the object has damaged a player. If it returns a FALSE, the attack with this object will not happen. The weapon can be used again in the same round in haste/second/third attack. trigger hitTrigger value:-Default character:Char wielding the obj Called when the object has hit somebody. trigger nohitTrigger value:miss|parry|dodge|blockDefault character:Char wielding the obj Called when the obj failed to hit the opponent. Reason for it is in [trig value]. This trigger is NOT preceded by a pre_hit action.
trigger interpret_unknownTrigger value:The command given by the player.Default character:The person who gave the command. This trigger is tested every time a character has entered a command which wasn't recognized as a valid command.
NOTE: Both mobs and players can trigger this trigger.
trigger pre_interpretTrigger value:The command given by the player.Default character:The person who gave the command. This trigger is tested when a character is going to execute a valid command but the command hasn't been executed yet. If the procedure returns a TRUE, the command is blocked.
NOTE: Both mobs and players can trigger this trigger.
trigger post_interpretTrigger value:The command given by the player.Default character:The person who gave the command. This trigger is tested every time a character a valid command is executed.
NOTE: Both mobs and players can trigger this trigger.
trigger loadTrigger value:-Default character:- Happens when an object is loaded and placed into a room, inventory or in another object. Note that this trigger doesn't go off for treasures and objects created during the loading of the player.
trigger canlockTrigger value:-Default character:Person or mob going to lock the object Called before the object is locked. If it returns a FALSE, the object will not be be locked. This trigger REPLACES the check for a valid key. trigger pre_lockTrigger value:-Default character:Person or mob going to lock the object Called before the object is locked. If it returns a FALSE, the object will not be be locked. trigger lockTrigger value:-Default character:Person or mob who locks the object Called when the object has been locked.
trigger pre_lookatTrigger value:-Default character:Person or mob going to look at the object Called before the object is looked at. If it returns a FALSE, the object will not be be looked at. Because of POLA this trigger will also fire when looking at extra-descriptions and the object has no pre_lookat_ed trigger. trigger pre_lookat_edTrigger value:Extra description keywordDefault character:Person or mob going to look at the extra-description of an object Called before the object is looked at. If it returns a FALSE, the object will not be be looked at. trigger lookatTrigger value:-Default character:Person or mob who looked at the object Called when the object has been looked at. trigger lookat_edTrigger value:Extra description keywordDefault character:Person or mob who looked at the objects extra-description Called when the objects extra-description has been looked at. Because of POLA this trigger will also fire when looking at extra-descriptions and the object has no lookat_ed trigger.
trigger pre_lookinTrigger value:-Default character:Person or mob going to look in the object Called before the object is looked in. If it returns a FALSE, the object will not be be looked in. trigger lookinTrigger value:-Default character:Person or mob who looked in the object Called when the object has been looked in.
trigger pre_openTrigger value:-Default character:Person or mob going to open the object Called before the object is opened. If it returns a FALSE, the object will not be be opened. trigger openTrigger value:-Default character:Person or mob who opens the object Called when the object has been opened.
trigger playfilterTrigger value:full name of the songDefault character:Person or mob fidling with the jukebox Called when showing the list of songs in the jukebox. Once for each song. If the trigger returns false the song is hidden from view. Also called before the pre_play trigger. If this trigger returns false the jukebox behaves as if the song doesn't exist. trigger pre_playTrigger value:full name of the songDefault character:Person or mob fidling with the jukebox Called before the jukebox starts a song. If the trigger returns FALSE the song is never started. trigger playTrigger value:full name of the songDefault character:Person or mob fidling with the jukebox Called when a song is started in a jukebox. The first line of the song appears some time after this trigger.
trigger pre_sleeptrigger pre_resttrigger pre_sittrigger pre_standTrigger value:-Default character:Person or mob using the obj Called before the mob starts to sleep/rest/sit/stand on the obj. If it returns a FALSE, the mob won't move to the new position. trigger sleeptrigger resttrigger sittrigger standTrigger value:-Default character:Person or mob using the obj Called after the mob went to sleep/rest/sit/stand on the obj.
trigger pre_attackTrigger value:means of starting the fight. Currently one of: bash, dirtkick, trip, tail, kill, murder, backstab, rescue, attack, eyepok e, magicDefault character:Person initiating the attack This trigger is called when a mob start combat without using magic. (eg. kill/eyepoke/trip/backstab/....) The second char [char -second] is the mob being attacked.
trigger pre_putTrigger value:-Default character:Person or mob going to put the object Called before the object is put into something. If it returns a FALSE, the object will not be be put into it. trigger putTrigger value:-Default character:Person or mob who puts the object Called when the object has been putted. trigger pre_putinTrigger value:-Default character:Person or mob going to put an object in the container Called before something is put in the container. If it returns a FALSE, the object will not be be put into it. trigger putinTrigger value:-Default character:Person or mob who puts an object into the container Called when an object has been put into the container.
trigger pre_quaffTrigger value:-Default character:Person or mob going to quaff the object Called before the object is quaffed. If it returns a FALSE, the object will not be be quaffed. trigger quaffTrigger value:-Default character:Person or mob who quaffs the object Called when the object has been quaffed.
trigger pre_reciteTrigger value:-Default character:Person or mob going to zap the object/mob Called before the object is recite. If it returns a FALSE, the scroll will not be be recited. Target of the scroll is stored in -second (either obj or char) trigger reciteTrigger value:-Default character:Person or mob who recited the scroll Called when the scroll has been recited. Target of the scroll is stored in -second (either obj or char)
trigger pre_removeTrigger value:-Default character:Person or mob going to remove object. Called before the object is removed. If it returns a FALSE, the object will not be removed. trigger removeTrigger value:-Default character:Person or mob which removed the object. Called when the object has been removed.
trigger pre_sellTrigger value:-Default character:Person or mob going to sell the object, and the shopkeeper Called before the object is sold. If it returns a FALSE, the selling of this object will not be done. trigger sellTrigger value:-Default character:Person or mob selling the object, and the shopkeeper Called when the object has been sold. trigger buyTrigger value:-Default character:Person or mob selling the object, and the shopkeeper Called when the object has been bought.
trigger pre_speechTrigger value:The words saidDefault character:Person or mob going to say the words Called before the words are said. If it returns a FALSE, the words will not be be said.
This only goes for the objects in your inventory, in your
equipment and in the room. Not for objects in objects.
trigger speechTrigger value:The words saidDefault character:Person or mob who said the words Called when the words have been said.
This only goes for the objects in your inventory, in your
equipment and in the room. Not for objects in objects.
trigger sunsetTrigger value:-Default character:- Happens after the message "the sun disappears in the west". trigger sunriseTrigger value:-Default character:- Happens after the message "the sun rises in the east". trigger end_dayTrigger value:-Default character:- Happens after the message "the night has begun." trigger start_dayTrigger value:-Default character:- Happens after the message "the day has begun."
trigger timerTrigger value:-Default character:- Every object has a timer, this timer can be started with the obj timer command. Normally you issue an obj timer 0 command to let the timer start counting from 0. Every PULSE_TICK the timer trigger is called. You can use trig compare to check the trigger value. trigger hourTrigger value:time of dayDefault character:- This trigger is tested every hour in MUD time. trigger randomTrigger value:-Default character:- NOTE: This trigger is checked each PULSE_TICK, even if there are no players in the room but there are in the area. If you want this event to be triggered always, you must set the ACT_UPDATE_ALWAYS flag of the mobile. trigger delayTrigger value:-Default character:- NOTE: This trigger is checked every PULSE_TICK and activates when the delay of a object (set with the obj delay command) expires. This trigger can be used to create staged object behavior. See also obj remember. An object can have several delay triggers, but every time the delay timer expires, all the triggers are checked and the first successful one executed.
trigger pre_trapTrigger value:-Default character:Person or mob triggering the trap Called before the trap is sprung. If it returns a FALSE, the trap will not function. The mud will not report this, the progs need to take care of this if desired. trigger trapTrigger value:-Default character:Person or mob who triggered the trap Called when the trap has sprung.
trigger canunlockTrigger value:-Default character:Person or mob going to unlock the object Called before the object is unlocked. If it returns a FALSE, the object will not be be locked. This trigger REPLACES the check for a valid key. trigger pre_unlockTrigger value:-Default character:Person or mob going to unlock the object Called before the object is unlocked. If it returns a FALSE, the object will not be be unlocked. trigger unlockTrigger value:-Default character:Person or mob who unlocks the object Called when the object has been unlocked.
trigger pre_useTrigger value:whatever came behind 'use <obj>'Default character:Person or mob going to use the object Called before the object is used. If it returns a FALSE, the object will not be used. trigger useTrigger value:whatever came behind 'use <obj>'Default character:Person or mob who uses the object Called when the object is used. The normal use command doesn't output anything, it completly relies on these triggers for output.
trigger pre_wearTrigger value:-Default character:Person or mob going to wear the object Called before the object is being worn. If it returns a FALSE, the object will not be be worn. trigger wearTrigger value:-Default character:Person or mob wearing the object Called when the object has been worn.
trigger weatherTrigger value:new_stateTrips every time the weather changes. State is one of 'cloudless', 'cloudy', 'raining', 'lightning'.
trigger pre_zapTrigger value:-Default character:Person or mob going to zap the object/mob Called before the object is zapped. If it returns a FALSE, the object will not be be zapped. Target of the zap is stored in -second (either obj or char) trigger zapTrigger value:-Default character:Person or mob who zapped the object/mob Called when the object has been zapped. Target of the zap is stored in -second (either obj or char) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||