This material can be used to manage a 'killquest'. This is a simple quest that involves finding and killing the object and receiving its treasure. Once killed, the quest is over and the object will decay and be erased forever.
Please don't put this material on a wimpy object worth 1 penny or with no weapon or items. Also, since the victor gets all that is wielded, worn, carried, or given, be sure the items supplied are hosted in the right way. Also remember to gender the object before you use it (which sets up the quest).
Example: spawn robber from passive4 material it as _killquest_ gender it as him
Then work on making some decent items. For example, create a dagger and visit the blacksmith called Stan at the Smithy so you can put it on the forge to make it more deadly. Visit the Talisman of Cold (or Heat) to give it some enchanted attacks. Then force your killquest object to wield it. If you can code, then consider creating something unique and interesting as treasure. And if it is really worth the trouble, then consider setting the healthmax of your killquest object to something formidable, perhaps with the ability to gradually heal. Don't make it impossible. There's no fun in that. You can hint of the unique treasure by customizing the rumor and news (see below).
Reactions: use: This does a number of things. - a newsflash is created and published in the daily cow - a rumour is created and recorded in the book of rumours - the material's killquest values (qname, rumour, and lasthit) are set Note: be sure to gender your object before you use it.
arrives: As long as the object is alive, this sets the lasthit value to whomever arrived. If the killquest object is alive it will also attack.
tickloc: This detects when health reaches 0 (or less) and does a number of things: - Any object hosted to the killquest object with hosthow of 'wielded', 'worn', or 'carried' is unhosted and locked and owned to lasthit object. - Same with anything in the inventory. - The worth of the killquest object is transfered to the victor. - The initial rumour is removed from the book of rumours and erased. - An obituary is created and published in the daily cow, declaring lasthit as the victor. - _killquest_ is removed and _decaymeat_ is added, which causes it to rot away and erase itself. read the material called decaymeat
Customizing the quest name and story We tried to make the default name and story work well enough, but you may want something better. Some simple scripting can be used to customize the setup of your quest. Just script the object that has _killquest_ material on it, add a block named killquestdata. This will override the killquestdata block defined in the material object. The purpose of this block is to set up $questname which becomes part of some rumour and news object names, as well as $queststory which becomes the info of those objects. Don't put things like [$init_obj] in $queststory since it is not sent as a message but put in the info.
Note: you must do this before you use your killquest object, since this sets up the news and rumour.
Some variables are already available: $myclass = The class of the killquest object. $locclass = The class of the killquest object's location. $heshe, $himher, $hisher = Make sure you gender {object} so these will hold something besides 'it'. $myworth = How much your killquest object is worth (especially if you create {objectclass} worth {numberofpennies}.
Example: ##killquestdata: $questname = "A robber runs loose"; $queststory = "A robber has been spotted roaming about the old town. The $myclass was last seen lurking at $locclass and has stolen at least $myworth pennies. $heshe is armed and dangerous. We just want $himher killed, so you may take whatever $heshe carries.";
note: double quotes appear as " when you examine this, so you will need to fix the above example in your code
Customizing the attack You can also use simple scripting to add something to the object's behavior before it attacks a player who arrives at its location. Just script the killquest object and make a block called whyattack where you can have it say something before attacking and even set a delay (in seconds) before it strikes.
Some variables available: $init_obj = the object id of the player that just arrived. $actor = the object id of the killquest object.
Example:
##whyattack: print "[$init_obj] recognizes [$actor] and exclaims, 'So you are the robber that has been looting this town!'"; print "[$actor] glares at [$initobj] and fumes, 'So I am, but you will never escape to tell! Prepare to die!'"; $attackdelay = 10;
note: double quotes appear as " when you examine this, so you will need to fix the above example in your code