Find
You are in a storeowner
Created by
Josh
, last updated 24 Dec 2006
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";
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 'xbuy';
var $click_mid to "from $actor";
var $desc_intro to '
Items for sale:
';
look $actor,trade;
##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]";
look $loc;
##buynocando:
say 'say',"[$this_actor] can not afford [$target]";
a jukebox which is useless broken machine whick only plays La Bamba