Object ActionsThese are similar to mob actions, but, as you might expect, objects can't exactly use commands. Therefore, everything an object script contains is an object command, and doesn't need to be prefixed with object. With one exception (TRIGGER) - the target of the action is the person doing to command that triggered the action. Some objactions don't have an actor, and are unable to use actor-based commands. Tech notes: Object actions are more risky than mobactions, as, objects don't normally do anything. There is no pre-defined flow control with them. For this reason:
Object Triggers
Object ConditionsLike with mob conditions, these are grouped. If no items in a group are selected, the actions assume that group is irrelevant and treat it as if all are selected. The groupings are separated with a space below.
PhraseThis is just like with a mob action. Not all triggers use this.ChanceThis is just like with a mob action, a percent chanceActionThis is just like with a mob action. The set of possible commands is listed below. Any line ending with a / will be continued on the next line; in this way, commands longer than the line-wrapper allows can be entered.LML tags can be used withing the body of an action, but, there are definate problems with this. First, the first and last lines of the action have to be <LML> and </LML>. Secondly, LML auto-wraps the resulting text. As object action processing uses line breaks to designate different commands, you will have to work very hard to make sure that the wrapped line breaks fall where needed. Finally, tags only work in actions where there is a character triggering the action. Update, Init, Zone Reset, and other non-actor actions won't process LML tags. Actions
allecho textThe text is sent to the everyone in the room, including the actor. A $p is replaced with the item name.charecho textThe text is sent to the character. A $p is replaced with the item name.consume room/char all/itemAn item found on the character, or in the room, is extracted. Can be used with 'all' to get all a characters possessions, or everything in the room.deduct amountRemoves (amount) of silver from the actor, up to the amount they have.extractRemoves the object from the game.freeze secondsFreezes (input lags) the actor for n seconds, defaulting to 3.IF - detailed at bottom.interpret commandForces the actor to use a command.loadmob vnumLoads mob with vnum to the room the item is in.loadobj vnumLoads an item with vnum. If there is an actor, and the item can be held, the actor gets it, otherwise it goes to the room.peaceStops all fighting in the room.popTeleports the item to a random room in the zone it is currently in. Items won't pop out of containers, but will pop from within people's inventories.restore / restore roomRestores the actor/ restores everyone in the room.roomecho textSends text to the room. $p is replaced with the items name. $n is the actor's name, $e (he/she), $s(his/her), $m (him/her) also work. If there is an actor, they won't receive this message, they need to be sent a charecho too.sendtext textSends the specified text to the actor, with no code replacement or capitalization.set timer minutesSets the item's timer. An item is extracted when the timer hits 0.set spec spec_funSets the item's spec_fun.slayInstantly slays the actor.trans vnum (unseen) (all)Trans to a specified vnum. If unseen is specified, they don't see that they've moved. If all is specified, all people in the room are moved.trigger messageSends a mobact trigger to the room, with the actor as the target, and the message as the phrase.zonequest prior state new stateSets the actor's zonequest state, like the mobaction.wearForces the actor to wear the item.drop (always)Forces the actor to drop the item. Always means the item is dropped even if normally nodrop.removeForces the actor to remove the item.run vnum argumentThe object runs the specified lensc program.signal vnum argumentThe argument is sent to the running program with the specified vnum.cast 'spell name' any extra parametersAn object can't really cast a spell. So, the actor actually is treated as the caster. For spells with a target that is a mob/player, the caster is the target too. For spells with an item target, the object is the target. Standard checks for magic resistance, are checked, but, it isn't the object actually casting it per se.IFIf is extremely similiar to mobact if for mobactions, with the following differences.
The best way to get data about the 'actor' (if there is one) is to use the [N] expression, which is set up to be the actor. @$.name is less likely to give you what you want. Likewise, [p] for the item is your best bet to get the info you need on the object. So, if the sword only turns to a snake for bob, your action would be: if ([N].name == "bob") loadmob 14001 if ([N].name == "bob") roomecho $p turns into a snake. if ([N].name == "bob") charecho $p turns into a snake. if ([N].name == "bob") extractYes, you have to put the IF on each line, you can't nest object triggers, so there is no way to get a whole block. OLIFOLIF is lile LIF in mob actions, with a couple of differences. The syntax is: olif [debug] (<lensc expression>) <obj action> [else <obj action>]obj actions are the same commands found on this page. The following variables are set up for you:
Commands related (these should all be self explanatory):
|