Find
You are in a button 1
This button spawns a fairly weak monster.
Created by
Chaotic Bob
, last updated 31 Jan 2015
Code
if target of push then spawnit;
if target of use then spawnit;
##spawnit:
$killit = $init_obj;
print "You here a deep voice boom '[$killit] .. your choice is made'";
find $actor, spawned1; // find an object inside the actor;
copy $found_id; // copy it;
$monst = $new_id; // remember it;
$nami = (goblin, kobold, imp); // choose a random name;
multiset $monst = "class='$nami',loc=$loc"; // update several fields in one go;
find $actor, greatclub; // now find a specific weapon;
// Im sure you could: find $actor, great club;
// or do the same trick as the monster:
// find $actor, weapon1;
// $wname = (great club,toothpick,bowl of rice);
// note: maybe the weapon should have showspecials material;
copy $found_id; // copy it;
$weap = $new_id; // rememer it;
set $weap's loc to $loc; // move it to current location;
print "[$monst] and [$weap] fall from the sky"; // inform the room;
$actor = $monst; // change control to the monster;
set $weap's owner to $monst;
$pwd = $monst's pwd;
set $weap's pwd to $pwd;
call "wield $weap"; // the monster wields the weapon;
call "attack $killit";
// --- our work here is done as the call to wield will do a relook $loc --
but if we want to auto-attack the init_obj we unrem this;
a roomy called spawn1
a spawned1