DEWILT.C

LIB3/D/HOME/CITY/MONSTERS/DEWILT.C · 3.0 KB

From the archive nm4dos.zip

Download the archive   « Back to the archive contents

#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;
}
 

Site Stats

Snippets: 1791
Codebases: 571