Find
You are in a shop owner
Created by
Josh
, last updated 13 Apr 2008
Code
##sell:runsub sellchk;
##sellchk:
if $second eq $actor then sellit else end;
##sellit:
set $target's loc to $actor;
var $aworth to $init_obj's worth;
var $tworth to $target's worth;
add $tworth to $aworth;
set $init_obj's worth to $aworth;
msg $loc,$actor,0,0,'say',"[$actor] buys [$target] from [$init_obj] for $tworth $coinage";
rem look $loc;
msg $loc,$init_obj,$init_obj,0,'force',"force:look $loc";
##buyfail:runsub chkitsme;
##chkitsme:
if $second eq $actor then listitems else fail;
##buy:runsub buychk;
##buychk:
if $second eq $actor then buyitemchk else end1;
##end1:msg $loc,$actor,0,0,'think',". o 0 ( what is [$second] trading? ) ";
##tickloc:runsub randomechatter;
##randomechatter: runsub introitems/20;
##talk:runsub talkchk;
##talkchk:
if $target eq $actor then introitems else nottalkingtome;
##buyitemchk:
if $target's loc eq $actor then buychkworth else introitems;
##introitems:msg $loc,$actor,0,0,'say',"[$actor] says 'These telephones don't sell themselves you know'";
runsub listitems;
##listitems:
var $click_cmd to "buy";
var $click_mid to "from $actor";
var $desc_intro to '
Items for sale:
';
rem look $actor,trade;
msg $loc,$init_obj,$init_obj,0,'force',"force:look $actor,trade,worth>0";
##buychkworth:
var $aworth to $init_obj's worth;
var $tworth to $target's worth;
if $aworth > $tworth then buyit else buynocando;
##buyit:
set $target's loc to $init_obj;
take $tworth from $aworth;
set $init_obj's worth to $aworth;
msg $loc,$actor,0,0,'say',"[$init_obj] buys [$target] for $tworth $coinage from [$actor]";
rem look $loc;
msg $loc,$init_obj,$init_obj,0,'force',"force:look $loc";
##buynocando:
say 'say',"[$this_actor] can not afford [$target]";
the toffee apple
the Candy-cane which is cherry flavoured
the redskin
a guard