;"Thank you for installing this Object." ;"This installation file was created by debug(smithdm@metronet.com)" ;"Other Generics are availible at http://www.cmoo.com/moo/moogens.html" ;"This object was created by: Grand_Master of LambdaMOO" ;"*Please make sure that you have edited this script and replaced with the appropriate object number*" @prop ."locations" {} rc ;;.("locations") = {"head", "chest", "abdomen", "left arm", "right arm", "left leg", "right leg"} @prop ."istaff" 0 rc @prop ."ifire" 0 rc @prop ."islow" 0 rc @prop ."ikat" 0 rc @prop ."itime" 0 rc @prop ."ilife" 0 rc @prop ."iheal" 0 rc @prop ."doll" #-1 r @prop ."alive" 1 r @prop ."ifirebolt" 0 rc @prop ."imagic" 0 rc @prop ."ifree_will" 0 rc @prop ."idagger" 0 rc @prop ."iknives" 0 rc @prop ."iscim" 0 rc @prop ."body" #-1 r @prop ."ikat2" 0 rc @prop ."ikat1" 0 rc @prop ."animal" 0 rc @prop ."ishock" 0 rc @prop ."idodge" 0 rc @prop ."iteeth" 0 rc @prop ."islowness" 10 rc @prop ."iact" 0 rc @prop ."itenta" 0 rc @prop ."iswim" 0 rc @prop ."iclimb" 0 rc @prop ."iwclim" 0 rc @prop ."iclaw" 0 rc @prop ."inatweap" 0 rc @prop ."cemetery" #1131 rc @prop ."irap" 0 rc @prop ."iapp" 7 rc @prop ."ipcn" 10 rc @prop ."iemp" 1 rc @prop ."iint" 7 rc @prop ."idex" 10 rc @prop ."ithrow" 0 rc @prop ."ifurn" 0 rc @prop ."gestate" 1000 rc @prop ."die_words" 0 rc @prop ."nat_prot" 0 rc @prop ."iwil" 10 rc @prop ."isize" 10 rc @prop ."ikites" 0 rc @prop ."ishield" 0 rc @prop ."ibrswd" 0 rc @prop ."iohswd" 0 rc @prop ."itclub" 0 rc @prop ."ithhft" 0 rc @prop ."imelee" 0 rc @prop ."iagl" 10 rc @prop ."iend" 10 rc @prop ."istr" 10 rc @prop ."mine" {} r @prop ."dead" 0 r @prop ."mine_quality" 100 rc @prop ."corpse_msg" "A stinking pile of flesh and bone meal. Worms crawl in and out of the hollow orbits of %p naked skull, squirming in the goo that was once %p mind." rc @prop ."imagic_effects" {} rc ;;.("imagic_effects") = {#259} @prop ."magic_resist" 0 rc @prop ."generic_equipment" {} r @prop ."special_equipment" {} r @prop ."default_cast_msg" "%N % %p arms and % weird syllables." rc @prop ."icreo" 0 rc @prop ."iperdo" 0 rc @prop ."iintellego" 0 rc @prop ."ianimalem" 0 rc @prop ."iaquam" 0 rc @prop ."iherbam" 0 rc @prop ."iimagonem" 0 rc @prop ."iterram" 0 rc @prop ."imentem" 0 rc @prop ."icorporem" 0 rc @prop ."ivim" 0 rc @prop ."irego" 0 rc @prop ."imuto" 0 rc @prop ."imagic_theory" 0 rc @prop ."iignem" 0 rc @prop ."iauram" 0 rc @prop ."water_breather" 0 rc @prop ."isword" 0 rc @prop ."ihafted" 0 rc @prop ."iweap1" 0 rc @prop ."iweap2" 0 rc @prop ."initial_levels" {} r @prop ."initial_props" {} r @prop ."spell_deflection_msg" "%T % the spell with an occult gesture." rc ;;.("seek_failed_msg") = "%n bounces off a topographical barrier." ;;.("home2") = #175 ;;.("home") = #175 ;;.("brief") = 1 ;;.("simulating") = 0 ;;.("listen_actions") = {} ".("key") => E_PERM (Permission denied) ;;.("aliases") = {"generic monster", "monster"} ;;.("object_size") = {45097, 865021122} @verb :"act" this none this @program :act $local.rpg:secure(); if (this.alive) doll = this.doll; if ((typeof(doll.aggressor) == LIST) && doll.aggressor) return doll:hit_aggressor(); else return this:procrastinate(); endif endif "THX1138 15-Apr-1997 -- Upgraded security and saved a few ticks."; . @verb :"acceptable" this none this @program :acceptable return (args[1] in this.mine) || ((caller_perms() in $local.rpg.gms) && $object_utils:isa(args[1], $local.rpg.thing)); . @verb :"duty" this none none rxd @program :duty "Duty the monster."; "- check objects in minelist, returning unique ones and replacing others."; "- set condition of all weapons in the minelist."; "- wield any weapons and/or armour in the minelist."; "- dispose of the corpse (if any)."; "- send the monster to its home."; if (!$local.rpg:trusted((c = callers()) ? caller_perms() | player)) player:tell("I can't do that ... resurrections are tricky things."); return E_PERM; elseif (!$recycler:valid(doll = this.doll)) return E_NONE; endif this.alive = 1; doll.inj = doll.ins = doll.fat = 0; doll.aggressor = doll.wielding = doll.wearing = {}; fork (1) this:check_mine(); this:prime_mine(); this:equip_mine(); this:rot_corpse(); endfork this:go_home(); if (!c) player:tell($string_utils:nn(this), " on duty in ", $string_utils:nn(this.location), "."); endif "Quinn 27-SEP-93 1859: Hacked to account for clear-properties in the re-assignment of values to a replacement object; cleaned the code up a little."; "Quinn 30-NOV-93 0540: Added :check_mine, :equip_mine, and :go_home."; "Quinn 01-DEC-93 0256: Added :prime_mine and :rot_corpse."; "Quinn 02-DEC-93 0306: Added message if !callers()."; "Profane 20-AUG-96 0911PDT -- put some s_i_n checks in."; "StarDancer 5:12 19-Feb-1997 EST -- Put a fork around the verb-calls."; "Profane 24-MAR-97 1048PST - moved :go_home out of the fork."; . @verb :"birth" this none none rxd @program :birth ":birth() -- Make it live."; "If already alive, reset stats to intitial state."; rpg = $local.rpg; if (!rpg:trusted((c = callers()) ? caller_perms() | player)) return E_PERM; elseif (!(this.owner in rpg.gms)) return E_NACC; endif this.doll = doll = rpg:create_pc(this); doll.free_will = 0; mama = rpg.doll; this:cancel_rebirth(); $command_utils:suspend_if_needed(1); "fork (5)"; "forking off this task 'cause some monsters take a *long* time ta birth -- SD"; "The following loop requires !d for quick property check."; for att in (setremove(properties(mama), "character")) `doll.(att) = this.("i" + att) ! E_PROPNF => clear_property(doll, att)'; "if ((n = this.(\"i\" + att)) != E_PROPNF)"; " doll.(att) = n;"; "else"; " clear_property(doll, att);"; "endif"; "$command_utils:suspend_if_needed(5)"; endfor "endfork"; if (!doll.natural_weapons) doll.natural_weapons = {rpg.fists}; "Just in case a gm gives his critter an empty natural weapons list."; endif this:duty(); if (!c) player:tell($string_utils:nn(this), " has been reset with ", $string_utils:nn(doll), " as its doll."); endif return doll; "Quinn 11-OCT-95 1150: Made verb !d, removed $object_util:has_property() check in att reset loop."; "Profane 28-JUN-96 2247EDT -- No fork, suspend."; "Profane 24-MAR-97 1043PST -- 1.8ify and PUT BACK THE DAMN SUSPEND AND YOU BETTER LEAVE IT THAT WAY GODDAMN YOU."; . @verb :"look_self" this none this @program :look_self pass(@args); if (this.animal) this:look_health(); else this:tell_contents(this:contents()); this:look_health(); this:look_gear(); endif "DR 04-AUG-94 -- Change in order to make NPCs look more like players."; . @verb :"armour" this none this @program :armour ":armour(penetration, hit-location[, attacker, weapon-used, damage])"; return (this.nat_prot * args[1]) + this.doll:protection(@args); "THX1138 15-Apr-1997 -- Copied old verb to armour(old) and sped the thing up."; . @verb :"abort" this none none rxd @program :abort "abort -- Kill the monster's doll."; rpg = $local.rpg; cp = caller_perms(); who = (player != cp) ? rpg:trusted(cp) ? player | cp | player; if (((who != this.owner) || (!(who in rpg.gms))) && (!rpg:is_grandmaster(who))) return E_PERM; endif if (valid(doll = rpg:get_doll(this))) rpg.recycler:_recycle(doll); msg = $string_utils:nn(this) + " is no longer alive."; else msg = $string_utils:nn(this) + " is not alive."; endif if (!callers()) who:tell(msg); endif this.doll = $nothing; . @verb :"recycle" this none this @program :recycle "Abort a rebirth and recalculate list of monsters."; if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) return E_PERM; endif this:abort(); fork (0) rpg = $local.rpg; rpg.vacuum.monsters = $object_utils:descendants(rpg.monster); endfork return pass(@args); . @verb :"moveto" this none this @program :moveto these = {}; what = this; monster = (rpg = $local.rpg).monster; while (what != monster) these = listappend(these, what.owner); what = parent(what); endwhile return rpg:trust(@these) ? pass(@args) | E_PERM; . @verb :"procrastinate" this none this @program :procrastinate if ($local.rpg:trust() && valid(doll = this.doll)) doll.act = 0; endif return $nothing; . @verb :"look_gear" this none this @program :look_gear if (!this.animal) $local.rpg:look_gear(this, @args); endif . @verb :"initialize" this none this @program :initialize ":initialize() -- Update the monster population in ~vacuum."; if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) return E_PERM; endif rpg = $local.rpg; if (this.owner in rpg.gms) fork (0) rpg.vacuum.monsters = $object_utils:descendants(rpg.monster); endfork endif this.doll = $nothing; "this.rebirth_task = 0;"; return pass(@args); "Profane 17-APR-97 -- ensure .doll is invalid"; . @verb :"notify_attack notify_aggression notify_death notify_arrival notify_exit notify_hit notify_miss notify_dodge notify_parry" this none this @program :notify_attack ":notify_attack(OBJ attacker, OBJ defender[, OBJ weapon])"; "-- Whenever someone is attacked."; ":notify_aggression(OBJ attacker, OBJ defender[, OBJ weapon])"; "-- The first time someone is attacked."; ":notify_death(OBJ victim[, OBJ killer])"; "-- When someone is killed."; ""; ":notify_arrival(OBJ who, OBJ exit)"; ":notify_exit(OBJ who, OBJ exit)"; "-- When someone enters or leaves the room. If they teleported, `exit' will be $nothing."; ""; ":notify_payment(OBJ from, NUM amount, STR denomination, NUM worth)"; "-- When someone gives money to your monster. `worth' is the unit worth of the given denomination. Multiple that value by `amount' to get the full worth of the transaction."; ""; "notify_hit(OBJ attacker, OBJ defender, OBJ weapon, STR location, NUM|STR severity, NUM damage)"; "notify_miss(OBJ attacker, OBJ defender[, OBJ weapon])"; "notify_dodge(OBJ attacker, OBJ defender[, OBJ weapon])"; "notify_parry(OBJ attacker, OBJ defender[, OBJ weapon])"; "notify this monster that one of the above has occurred."; return; . @verb :"location" this none this @program :location return this.location; . @verb :"sub_mine" this none this @program :sub_mine "HACKED by Quinn (a little too late) 22-APR-93. No longer needs wizperms."; if ((caller_perms() == #259.owner) && (p = args[1] in (mine = this.mine))) this:set_mine(listset(mine, args[2], p)); endif . @verb :"is_controllable_by" this none this @program :is_controllable_by ":is_controllable_by(caller_perms())"; return $perm_utils:controls(p = args[1], this) || $local.rpg:is_grandmaster(p); . @verb :"tell_contents" this none this @program :tell_contents ":tell_contents(list)"; "Called from :look_self()"; c = args[1]; if ($recycler:valid(doll = this.doll)) "These things have already been shown by 'look_gear'"; for each_thing in ({@doll:wielding(), @doll.wearing}) c = setremove(c, each_thing); endfor endif if (c) longear = gear = {}; width = player:linelen(); half = width / 2; player:tell("Carrying:"); for thing in (c) cx = tostr(" ", thing:title()); if (length(cx) > half) longear = {@longear, cx}; else gear = {@gear, cx}; endif endfor player:tell_lines($string_utils:columnize(gear, 2, width)); player:tell_lines(longear); endif "Profane 26-APR-97 1248PDT -- s/valid/$recycler:valid"; . @verb :"get_body_area_name" this none this rx @program :get_body_area_name ":get_body_area_name(OBJ body_area)"; if ((names = this.locations) == $local.rpg.monster.locations) return E_NONE; elseif (i = args[1] in this.doll.body_areas) return names[i]; else return E_NONE; endif . @verb :"go_home" this none this @program :go_home ":go_home() -- Send the monster home."; "If the home's an exit, :move it through. Else just move it into the room."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; elseif (!valid(home = this.home)) this.owner:tell(this.name, " (", this, " ) is homeless."); elseif (this.location == this.home) "It's *already* home, no need to do anything."; return; elseif ($object_utils:isa(home, $exit)) home:move(this); else this:moveto(home); endif . @verb :"equip_mine" this none this @program :equip_mine ":equip_mine()"; "Loop through the monster's mine list, wearing and wielding what it can."; rpg = $local.rpg; if (!rpg:trusted(caller_perms())) return E_PERM; endif doll = this.doll; hands = doll.hands; weapon = rpg.weapon; armour = rpg.armour; hand_and_a_half = rpg.hand_and_a_half; natural_weapon = rpg.natural_weapon; for foo in (this.mine) if (!$recycler:valid(foo)) this.mine = setremove(this.mine, foo); else if (foo.location != this) foo:moveto(this); endif anc = $object_utils:ancestors(foo); if (hand_and_a_half in anc) foo:((hands == 1) ? "one" | "two")(); elseif ((natural_weapon in anc) && (!$object_utils:has_property(this, "inatural_weapons"))) this.doll.natural_weapons = setremove(this.doll.natural_weapons, rpg.fists); this.doll.natural_weapons = setadd(this.doll.natural_weapons, foo); endif if ((weapon in anc) && (hands >= foo.hands)) hands = hands - foo.hands; doll.wielding = setadd(doll.wielding, foo); foo:do_wield(this); elseif (armour in anc) doll.wearing = setadd(doll.wearing, foo); foo:do_wear(this); endif rpg:time_stop(); endif endfor "Quinn 30-NOV-93 0516: Added."; "StarDancer 5-AUG-96 -- put natural weapons in doll.natural_weapons."; "Profane 9-MAY-97 1842PDT -- add calls to do_wear and do_wield."; "Profane 9-MAY-97 1845PDT -- remove invalid objects from .mine"; . @verb :"prime_mine" this none this rx @program :prime_mine ":prime_mine()"; "Prepare this monster's equipment to be readied. Right now, this just means setting the `condition' of everything to `mine_quality'."; qual = this.mine_quality; for foo in (this.mine) if (((typeof(old = foo.condition) == NUM) && (old != qual)) && (!(foo.unique && (foo in this.generic_equipment)))) foo:set_condition(qual); endif endfor "Quinn 01-DEC-93 0244: Added."; "Profane 2-AUG-96 1557PDT -- changed to use :set_condition"; "Profane 3-AUG-96 2000PDT -- s/!foo.unique/!(foo.unique && foo in this.generic_equipment)/5"; . @verb :"rot_corpse" this none this rx @program :rot_corpse ":rot_corpse() -- Rot this monster's corpse, if it exists and is a child of $local.rpg.corpse."; rpg = $local.rpg; if (!rpg:trusted(caller_perms())) return E_PERM; endif body = this.body; if (!body.is_corpse) this:set_body(valid(body) ? 1 | #-1); return E_NONE; else body:rot(); this:set_body($recycler:valid(body) ? body | 1); endif "Quinn 01-DEC-93 0244: Added."; "Quinn 03-DEC-93 0114: Added :set_body call so you get a corpse more than just once."; "StarDancer 16-DEC-95 added 'nother :set_body call so's a swept corpse 'll get put back too."; . @verb :"announce_death" this none this @program :announce_death ":announce_death([killer])"; "Announce the die words of this beast to its location."; "Sub %N for dead monster and %D for killer (if given)."; if (msg = this.die_words) {?killer = $nothing} = args; msg = $string_utils:pronoun_sub(msg, this, this, where = this.location, killer); for line in ((typeof(msg) == LIST) ? msg | {msg}) $local.rpg:rpg_announce_all_but(where, {this}, line); endfor endif "THX1138 15-Apr-1997 -- Scatter assignment, and saved a few ticks."; . @verb :"corpse_msg" this none this @program :corpse_msg ":corpse_msg()"; "-> What this monster's spawn of generic corpse should look like."; return $string_utils:pronoun_sub(this.corpse_msg, this); . @verb :"get_corpse" this none this rx @program :get_corpse ":get_corpse([killer])"; "Get a corpse for this monster, dependant on the value of `body'."; "If body == #x and #x is valid and a child of $local.rpg.corpse, use that custom corpse."; "If body == 1 (or any true value), create a new corpse and describe it as `corpse_msg'."; "If a corpse is found, return {#corpse}. Else, return false."; "`killer' is who killed the beast. Provided for future customization."; rpg = $local.rpg; if (!rpg:trusted(caller_perms())) return E_PERM; endif body = this.body; mama_corpse = rpg.corpse; if (body.is_corpse) body.time_of_death = time(); return {body}; elseif (!body) return E_NONE; elseif (typeof(body = rpg.recycler:_create(mama_corpse)) != OBJ) return E_QUOTA; endif body:set_name(name = "corpse of " + this.name); body:set_aliases({name, "corpse", this.name}); body:set_description(this:corpse_msg()); body.victim = this; body.time_of_death = time(); body.encumbrance = this.isize * 10; return {this.body = body}; . @verb :"deposit_remains" this none this @program :deposit_remains ":deposit_remains([killer])"; "If a corpse exists; get it, move all our loot inside it, and move it to this location."; "If no corpse; move this loot to this location."; "`killer' is who killed the beast, passed for the benefit of :deposit_loot."; $local.rpg:secure(); if (corpse = this:get_corpse()) corpse = corpse[1]; corpse:moveto(this.location); return this:deposit_loot(corpse, @args); endif return this:deposit_loot(this.location, @args); "THX1138 15-Apr-1997 -- Copied old code to #259:deposit_remains(old) and rewrote with faster security and layout."; . @verb :"deposit_loot" this none this rx @program :deposit_loot ":deposit_loot([location[, killer]])"; "Move all equipment (except those with a false .:keep_at_death) to the given location, which defaults to the monster's location."; "`killer' is who killed the beast. Provided for special occasions where, for example, you may want to deprive a dishonorable killer of the post-mortem prize. Similiarly passed to :keep_at_death."; $local.rpg:secure(); {?where = this.location, ?killer = $nothing} = args; for loot in (this:contents()) if (!loot:keep_at_death(killer)) loot:moveto(where); endif endfor "THX1138 - 15-Apr-1997 -- Upgraded security. Scatter assignment. Copied old verb to #259:deposit_loot(old)."; . @verb :"set_body set_corpse" this none this rx @program :set_body ":set_body(OBJ corpse)"; "Set the corpse to be deposited when this creature dies."; "#xxxxx -- If a caller-controlled kid of $local.rpg.corpse, use that object."; "1 -- Create a generic corpse described as this.corpse_msg."; "Any other False -- No corpse."; rpg = $local.rpg; cp = caller_perms(); if ((caller != this) && (!this:is_controllable_by(cp))) return E_PERM; elseif (typeof(corpse = args[1]) != OBJ) return this.body = !(!corpse); elseif (!corpse.is_corpse) return E_INVARG; elseif (corpse.owner != cp) return E_NACC; else return this.body = corpse; endif . @verb :"description" this none this @program :description "Copied from Almost Human Bastard (#6475):description by Quinn (#19845) Wed Mar 16 16:55:06 1994 PST"; "Runs the description through pronoun_sub."; return $string_utils:pronoun_sub(this.description, this, this, this.location, player); . @verb :"enterfunc exitfunc" this none this rx @program :enterfunc "Copied from Almost Human Bastard (#6475):enterfunc by Quinn (#19845) Wed Mar 16 17:11:59 1994 PST"; "Just so pass(@args) doesn't return E_VERBNF on descendants."; return pass(@args); . @verb :"magic_effect" this none this rx @program :magic_effect ":magic_effect(OBJ caster doll, OBJ target doll, NUM spell quality, OBJ spell skill) => NUM number directly SUBTRACTED from spell quality. i.e. magic resistance."; "A simple hack to replace the old direct property ref.."; return args[2].character.magic_resist || 0; . @verb :"die" this none this rx @program :die ":die([killer]) -- KILL THE BEAST"; "- schedule a task to rebirth"; "- remove monster from aggressors list of all in vicinity"; "- clear monster's doll's wielding, wearing and aggressor lists"; "- announce the death to the corpse location"; "- deposit remains (corpse, loot, burial)"; (rpg = $local.rpg):secure(); if ((!this.alive) && (this.location == this.cemetery)) return E_NONE; endif this.alive = 0; if (this.gestate > 0) rpg.clock:add_death(this); endif for who in (this.location:contents()) if (valid(doll = rpg:get_doll(who))) doll.aggressor = setremove(doll.aggressor, this); endif endfor doll = this.doll; doll.wielding = doll.wearing = doll.aggressor = doll.misc_notes = doll.combat_effects = doll.magic_effects = doll.schedule = {}; fork (5) for item in (doll.claimed_objects) "Remove claim data from objects."; rpg:time_stop(3); if (valid(item) && $object_utils:isa(item, #517)) item.claimed_by = $nothing; endif endfor doll.claimed_objects = {}; endfork {?killer = $nothing} = args; this:deposit_remains(killer); this:announce_death(killer); this:moveto(this.cemetery); "Profane 17-MAR-95 13:28 -- Added (Well, changed from old :die() to use new resurrection queue)"; "Slither 29-JUN-95 00:16 -- Added erasing of claimed objects."; "THX1138 15-Apr-1997 -- Upgraded security, scatter assignment, and saved a few ticks."; . @verb :"cancel_rebirth" this none this rx @program :cancel_rebirth ":cancel_rebirth() -- Kill this monster's rebirth task."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif $local.rpg.clock:remove_death(this); "Profane 17-MAR-95 13:30EST - Changed from old :cancel_rebirth to use new resurrection queue"; . @verb :"set_generic_equipment" this none this @program :set_generic_equipment ":set_generic_equipment(LIST objects)"; "Set the generic equipment list to a list of objects"; "Each object should be a RPG generic"; "Returns a list of created objects."; if (!((caller == this) || this:is_controllable_by(caller_perms()))) return E_PERM; endif newequip = args[1]; "Rampant paranoia. But even paranoids get E_TYPE errors."; if (typeof(newequip) != LIST) return E_INVARG; endif for item in (newequip) if (typeof(item) != OBJ) return E_INVARG; endif "Seven's a nice number"; $command_utils:suspend_if_needed(7); endfor this.generic_equipment = newequip; return newequip; "5/28/95 Slither -- first version"; . @verb :"make_generic_equipment" this none this @program :make_generic_equipment ":make_generic_equipment()"; "Creates clones of generic items based upon the contents of"; "this.generic_equipment. The items are moved into this, and"; "the list of created items is returned."; "See the comments in :set_generic_equipment for the data format"; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif ad = $local.rpg; recycler = ad.recycler; stuff = {}; for parent in (this.generic_equipment) if ($recycler:valid(parent)) "new = recycler:_create(parent);"; new = $local.rpg.dispenser:grab(parent); if ((typeof(new) == OBJ) && valid(new)) new.name = parent.name; new:moveto(this); stuff = {@stuff, new}; endif endif $command_utils:suspend_if_needed(6); endfor return stuff; "5/28/95 Slither -- first version"; "Profane 22-JUL-96 2040EDT - make it use the dispenser, dammit."; . @verb :"set_special_equipment" this none this @program :set_special_equipment ":set_special_equipment(LIST objects)"; "Set the special equipment list to a list of objects"; if (!((caller == this) || this:is_controllable_by(caller_perms()))) return E_PERM; endif newequip = args[1]; "make sure its really a list of objects."; if (typeof(newequip) != LIST) return E_INVARG; endif for item in (newequip) if (typeof(item) != OBJ) return E_INVARG; endif $command_utils:suspend_if_needed(5); endfor this.special_equipment = newequip; return newequip; "5/28/95 Slither -- first version"; . @verb :"make_special_equipment" this none this rx @program :make_special_equipment ":make_special_equipment()"; "Prepares the special equipment that the monster needs, based upon"; "the content's of the monster's .special_equipment property."; "This amounts to making sure that the equipment exists, and moving"; "it to the monster if necessary."; "The verb returns a list of the special equipment that was successfully gotten."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif stuff = {}; rpg = $local.rpg; for item in (this.special_equipment) if ($recycler:valid(item)) "Good, still exists"; loc = item.location; if ((loc != this) && (!children(item))) "Stupid thing has escaped!"; item:moveto(this); if (item.location == this) loc:tell(((("The " + item.name) + " taken from ") + this.name) + " disappears."); endif elseif (children(item) && (item.owner == rpg.owner)) item = rpg.recycler:_create(item); item:moveto(this); endif if (item.location == this) stuff = {@stuff, item}; endif endif $command_utils:suspend_if_needed(5); endfor return stuff; "5/28/95 Slither -- first version"; "Made the verb !d in case the obj's original location's #-1. - StarDancer 10/20/95"; "StarDancer 11-DEC-95 added test ta make sure the item's not a generic"; . @verb :"set_mine" this none this @program :set_mine ":set_mine(LIST objects)"; "Set the RPG equipment this monster will be dutied with."; "In its present form mainly for compatibility with old code."; if (!((caller == this) || this:is_controllable_by(caller_perms()))) return E_PERM; endif return this.mine = args[1]; "5/28/95 Slither -- rewrote entirely"; . @verb :"check_mine" this none this rx @program :check_mine ":check_mine()"; "Construct the monster's mine list from its components."; "Basically, mainly here for compatibility with old code."; "Returns new mine list."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif mine = {@this:make_generic_equipment(), @this:make_special_equipment()}; return this:set_mine(mine); "5/28/95 Slither -- rewrote entirely."; "StarDancer 21-NOV-95 -- put :make_special after :make_generic."; . @verb :"birth(d)" this none none rxd @program :birth(d) ":birth() -- Make it live."; "If already alive, reset stats to intitial state."; rpg = $local.rpg; if (!rpg:trusted((c = callers()) ? caller_perms() | player)) return E_PERM; elseif (!(this.owner in rpg.gms)) return E_NACC; endif this:cancel_rebirth(); this.doll = doll = rpg:create_pc(this); doll.free_will = 0; mama = rpg.doll; for att in (setremove(properties(mama), "character")) if ($object_utils:has_property(this, "i" + att)) doll.(att) = this.("i" + att); else clear_property(doll, att); endif endfor this:duty(); if (!c) player:tell($string_utils:nn(this), " has been reset with ", $string_utils:nn(doll), " as its doll."); endif return doll; . @verb :"look_health" this none this @program :look_health $local.rpg:(verb)(this, @args); . @verb :"add_ivalue addilevel" this none this rx @program :add_ivalue ":add_ivalue(, ) => Adds to the list of ivalues on the monster. These are stored in a list, rather than individual properties, to save db space. Returns old value, if existed, 0 if none, or E_PROPNF if not on the doll."; $local.rpg:secure(); if (caller_perms() != this.owner) return E_PERM; endif rpg = $local.rpg; doll = rpg.doll; prop = args[1]; value = args[2]; if (doll.(property) != E_PROPNF) if (x = prop in this.initial_props) old = this.initial_levels[x]; this.intial_levels[x] = value; return old; else this.initial_levels = {@this.initial_levels, value}; this.initial_props = {@this.initial_props, prop}; return 0; endif else return E_PROPNF; endif . @verb :"remove_ivalue" this none this @program :remove_ivalue ":remove_ivalue() => removes prop from the list of initial values for the monster's doll. Returns value of item deleted, or E_PROPNF, if it wasn't found."; if (caller_perms() != this.owner) return E_PERM; endif prop = args[1]; if (x = prop in this.initial_props) old = this.initial_levels[x]; this.initial_props = listdelete(this.initial_props, x); this.initial_levels = listdelete(this.initial_levels, x); return old; else return E_PROPNF; endif . @verb :"init*ial_levels" this none none @program :initial_levels rpg = $local.rpg; if ((player != caller) || (!rpg:trusted(player))) return player:tell("Permission denied."); endif items = {}; for n in [1..length(this.initial_props)] items = {@items, (this.initial_props[n] + ": ") + $string_utils:from_value(this.initial_levels[n], 1, 10)}; endfor l = $string_utils:columnize(items, 2, 76); player:tell($string_utils:center((tostr(this) + " ") + this.name, 76, "_")); for x in (l) player:tell(x); endfor player:tell($string_utils:space(76, "-")); . @verb :"armour(old)" this none this @program :armour(old) ":armour(penetration, hit-location[, attacker, weapon-used, damage])"; doll = $local.rpg:get_doll(this); pen = args[1]; return (this.nat_prot * pen) + doll:protection(@args); . @verb :"procrastinate(old)" this none this @program :procrastinate(old) if ($local.rpg:trust() && valid(doll = $local.rpg:get_doll(this))) doll:set_att("act", 0); endif . @verb :"deposit_remains(old)" this none this @program :deposit_remains(old) ":deposit_remains([killer])"; "If a corpse exists; get it, move all our loot inside it, and move it to this location."; "If no corpse; move this loot to this location."; "`killer' is who killed the beast, passed for the benefit of :deposit_loot."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; elseif (!(corpse = this:get_corpse())) return this:deposit_loot(this.location, @args); endif corpse = corpse[1]; corpse:moveto(this.location); return this:deposit_loot(corpse, @args); . @verb :"deposit_loot(old)" this none this rx @program :deposit_loot(old) ":deposit_loot([location[, killer]])"; "Move all equipment (except those with a false .:keep_at_death) to the given location, which defaults to the monster's location."; "`killer' is who killed the beast. Provided for special occasions where, for example, you may want to deprive a dishonorable killer of the post-mortem prize. Similiarly passed to :keep_at_death."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; endif where = args ? args[1] | this.location; killer = (length(args) > 1) ? args[2] | $nothing; for loot in (this:contents()) if (!loot:keep_at_death(killer)) loot:moveto(where); endif endfor . @verb :"announce_death(old)" this none this @program :announce_death(old) ":announce_death([killer])"; "Announce the die words of this beast to its location."; "Sub %N for dead monster and %D for killer (if given)."; if (!(msg = this.die_words)) return; endif killer = args ? args[1] | $nothing; where = this.location; msg = $string_utils:pronoun_sub(msg, this, this, where, killer); for line in ((typeof(msg) == LIST) ? msg | {msg}) $local.rpg:rpg_announce_all_but(where, {this}, line); endfor . @verb :"tell_contents(old)" this none this @program :tell_contents(old) ":tell_contents(list)"; "Called from :look_self()"; c = args[1]; if (valid($local.rpg:get_doll(this))) "These things have already been shown by 'look_gear'"; stuff = $local.rpg:get_doll(this):wielding(); for each_thing in (stuff) c = setremove(c, each_thing); endfor stuff = $local.rpg:get_doll(this):get_att("wearing"); for each_thing in (stuff) c = setremove(c, each_thing); endfor endif if (c) longear = {}; gear = {}; width = player:linelen(); half = width / 2; player:tell("Carrying:"); for thing in (c) cx = tostr(" ", thing:title()); if (length(cx) > half) longear = {@longear, cx}; else gear = {@gear, cx}; endif endfor player:tell_lines($string_utils:columnize(gear, 2, width)); player:tell_lines(longear); endif . @verb :"flatline" this none this @program :flatline $local.rpg:secure(); this.alive = 0; "THX1138 - 23-Apr-1997 -- Added so gms can directly kill their critters at the beginning of the monster:die() that they write."; . @verb :"pick_aggressor" this none this @program :pick_aggressor return $nothing; . @verb :"spell_deflection_msg" this none this @program :spell_deflection_msg {?targ = this, ?by = player} = args; return $string_utils:pronoun_sub(this.(verb), by, targ); . @verb :"whereare" this none none @program :whereare "Copied from Generic Anklebiter (#8872):whereare by THX1138 (#105941) Wed Apr 9 16:43:57 1997 PDT"; sorted = {}; for t in ($set_utils:intersection(children(this), $local.rpg.pcs)) sorted = {@sorted, {t, t.name}}; endfor sorted = $list_utils:sort_alist(sorted, 2); s_u = $string_utils; for t in (sorted) {critnum, critter} = t; player:tell(s_u:left(tostr(critter, " (", critnum, ")"), 32, " "), s_u:left(s_u:nn(critnum.location), 47)); endfor player:tell("Living monsters: ", length(sorted), " ... ", this.name, ":", verb, " complete."); . ;"Your object should now be installed."