/*
 * Obiekt zielarza.
 * 5 Maja 2003 by Lord Simon
 */

#pragma strict types

inherit "/std/monster";
inherit "/lib/shop";

#include <macros.h>
#include <stdproperties.h>
#include <ss_types.h>
#include <language.h>
#include <money.h>
#include <pl.h>
#include <formulas.h>
#include <std.h>
#include <money.h>

#define TP       this_player()
#define TO       this_object()
#define NF(x)	 notify_fail(x)

string *imie;
static object *przedstawieni = ({ });

void return_introduce(string imie);

void
create_monster()
{
  imie=({"arren","arrena","arrenowi","arrena","arrenem","arrenie"});
  ustaw_imie(imie,PL_MESKI_OS);    
  set_gender(G_MALE);
  dodaj_nazwy(PL_MEZCZYZNA);
  ustaw_odmiane_rasy(PL_CZLOWIEK);		   
  dodaj_przym("garbaty","garbaci");
  dodaj_przym("stary","starzy");
  
  add_prop(CONT_I_WEIGHT, 50000); //50 kg
  add_prop(CONT_I_VOLUME, 45000); //45 litrow
  add_prop(CONT_I_HEIGHT, 159);//1m 59cm
  set_stats ( ({ 10, 10, 10, 10, 10, 10 }) );    
  set_title("Lebannen, uczen mistrz Thanisa z Hortu");

  config_default_trade();
    
  set_store_room("/d/Podziemie/amorion/npc/zielarzsr"); 
}

void
add_introduced(string imie_mia, string imie_bie)
{
  set_alarm(2.0, 0.0, "return_introduce", find_player(imie_mia));
}

void
return_introduce(object ob)
{
  if (ob && environment(ob) == environment())
    if (member_array(ob, przedstawieni -= ({0})) != -1)
      {
	command("powiedz Witaj ponownie, " + ob->query_wolacz() + ".");
	command("emote Odwraca twarz w twoja strone");
        }
    else
      {
	przedstawieni += ({ob});
	command("przedstaw sie " + OB_NAME(ob));
	command("uklon sie " + OB_NAME(ob) + " z godnoscia");
      }
}

int
shop_hook_allow_sell(object ob)
{
  if(function_exists("create_object", ob) == "/std/herb")
    {
      return 1;
    }
   else return 0;
}

void
init_living()
{
    ::init_living();
  
    add_action(do_buy,   "kup");
    add_action(do_sell,  "sprzedaj");
    add_action(do_list,  "przejrzyj");    
}
