/
LIB3/
LIB3/D/ADMIN/
LIB3/D/ADMIN/OBJ/
LIB3/D/ADMIN/ROOM/W/
LIB3/D/HOME/
LIB3/D/HOME/CITY/ARENA/
LIB3/D/HOME/CITY/ITEMS/
LIB3/D/HOME/CITY/POSTOFFI/
LIB3/DOC/
LIB3/GLOBAL/SPECIAL/
LIB3/GLOBAL/VIRTUAL/
LIB3/NET/
LIB3/NET/CONFIG/
LIB3/NET/DAEMON/CHARS/
LIB3/NET/GOPHER/
LIB3/NET/INHERIT/
LIB3/NET/OBJ/
LIB3/NET/SAVE/
LIB3/NET/VIRTUAL/
LIB3/OBJ/B_DAY/
LIB3/OBJ/HANDLERS/TERM_TYP/
LIB3/PLAYERS/B/
LIB3/PLAYERS/N/
LIB3/ROOM/
LIB3/SAVE/
LIB3/SAVE/BOARDS/
LIB3/SAVE/ENVIRON/
LIB3/SAVE/POST/
LIB3/STD/COMMANDS/SHADOWS/
LIB3/STD/CREATOR/
LIB3/STD/DOM/
LIB3/STD/EFFECTS/
LIB3/STD/EFFECTS/HEALING/
LIB3/STD/EFFECTS/OTHER/
LIB3/STD/EFFECTS/POISONS/
LIB3/STD/ENVIRON/
LIB3/STD/GUILDS/
LIB3/STD/LIQUIDS/
LIB3/STD/ROOM/
LIB3/STD/TRIGGER/SHADOW/
LIB3/W/
LIB3/W/BANNOR/
LIB3/W/NEWSTYLE/
#include "/d/home/city/monsters/path.h"
inherit DEFMONSTER;
#define COST 200
#include "money.h"
#define SELL_CHANCE 20
 
 
setup()
{
set_level(25+random(10));
set_name("Dewilt");
set_short("Dewilt the wandering sales-person");
set_long("Dewilt is a young man, new to the world of selling, but he tries "+
"very hard to make his living, by doing the thing he does best, sell.\n");
        set_race("Dwarf");
set_main_plural("Dewilts");
        set_class("fighter");
add_alias("dewilt");
add_plural("dewilts");
set_al(10);
        set_gender(1);
        set_aggressive(0);
adjust_money(random(3), "silver");
        add_move_zone("mid");
add_move_zone("park");
add_move_zone("beach");
add_move_zone("docks");
add_move_zone("yaigo");
        add_move_zone("trader");
        add_move_zone("newbie");
clone_object(ARMOURS+"tunic.arm")->move(this_object());
clone_object(WEAPONS+"dagger.wep")->move(this_object());
init_equip();
load_chat(50, ({
     1, ":looks at you, deciding whether you would be a good sell.\n",
     1, ":holds out a sample of carpets he has.\n",
     1, ":shows you a set of watches.\n",
     1, "'Go on, buy, it is a once in a life time chance.\n",
     1, "'You will never see such a bargin ever again.\n",
     1, ":wonders why you won't buy.\n",
     1, ":decides that you have no money.\n",
      }));
load_a_chat(50, ({
     1, "'What have I ever done to you?\n",
     1, ":tries to run away, but he can't get away with all the goods he has "+
        "with him.\n",
     1, "'I will give you all of this free if you don't kill me.\n",
     1, "'I am young, I still have everything to live for, please don't kill "+
        "me\n",
        1, "'Aaaargh!\n",
      }));
}
 
 
void heart_beat()
{
 ::heart_beat();
  if(random(SELL_CHANCE)==0)
   {
    call_out("choose_victim",1);
   }
}
 
choose_victim()
{
 object *things;
 int number;
 object victim;
  object toothbrush;
 mixed m_array;
 
 things=all_inventory(environment(this_object()));
 things=filter_non_player(things);
 number=random(sizeof(things));
 victim=things[number];
 
 if( COST > (int)victim->query_value() )
   {
    tell_object(victim,"Dewilt sneers at you: You haven't enough money for one of my "+
     "selected items of the day.\n");
    tell_room(environment(victim),"Dewilt sneers at "+victim->query_cap_name()+".\n",
    ({victim}));
    return;
   }
 
 
 
 m_array = MONEY_HAND->create_money_array( COST );
 victim->pay_money( m_array );
 
toothbrush = clone_object("/d/home/city/items/misc/toothb.c");
 toothbrush->choose_colour();
  toothbrush->move(victim);
 
 tell_object(victim,"Dewilt hastily takes money from you, handing you a "+
 toothbrush->query_short()+".\n");
 tell_room(environment(victim),"There is a quick flurry of action as Dewilt and "+
  victim->query_cap_name()+" exchange items.\n",({victim}));
}
 
mixed filter_non_player(object *objcts)
{
 int i;
 
 while(i<sizeof(objcts))
   {
    if(!objcts[i]->query_property("player"))
      {
       objcts=delete(objcts,i,1);
       continue;
      }
     i++;
    }
 return objcts;
}