Find
You are in a command called spawn
spawn {newname} from {template}
This creates a foe based on the desired template object.
just type spawn to get a list of templates
example: spawn orc from aggro1
Created by
thorn
, last updated 06 Jul 2009
Code
get $newname,'from',$target in 47749;
if $target > 0 then spawnit else showhint;
##spawnit:
$cost = $target's worth;
if $cost > $init_obj's worth then toopoor else transactit;
##toopoor:
sayto $init_obj,"You need more money to spawn anything like [$target]";
##transactit:
say 'msg',"[$init_obj] offers $cost pennies to the gods and in return... a mist appears.";
$wrth = $init_obj's worth;
sub $cost from $wrth;
set $init_obj's worth to $wrth;
copy $target;
set $target's worth to $cost;
set $new_id's worth to $cost;
set $new_id's class to $newname;
set $new_id's extra to '';
set $new_id's pose to '';
set $new_id's pwd to '';
set $new_id's loc to $loc;
set $new_id's owner to $init_obj;
set $new_id's health to $target's health;
set $new_id's healthmax to $target's healthmax;
set $new_id's skills to $target's skills;
set $new_id's skillvals to $target's skillvals;
$target = $new_id; rem make the new object the target;
say 'arrives',"[$new_id] appears from the mist.";
relook $loc;
##showhint:
var $myid to 47749;
sayto $init_obj,"synopsis: spawn {newname} from {template} where template is one of the following objects:";
$shown = 0;
foreach in $myid do showthem;
if $shown < 1 then saynone;
##showthem:
$cost = $for_id's worth;
$myw = $init_obj's worth;
if $cost > $myw then fail else showthem2;
##showthem2:
sayto $init_obj,"[$for_id] $ext (costs $cost pennies)";
$shown = 1;
##saynone:
sayto $init_obj,"You cannot afford any of the spawnable creatures.";
a passive1
the aggro1
the passive2
the aggro2
a passive3
an aggro3
a passive4
an aggro4