ldmud-3.3.719/
ldmud-3.3.719/doc/
ldmud-3.3.719/doc/efun.de/
ldmud-3.3.719/doc/efun/
ldmud-3.3.719/doc/man/
ldmud-3.3.719/doc/other/
ldmud-3.3.719/mud/
ldmud-3.3.719/mud/heaven7/
ldmud-3.3.719/mud/lp-245/
ldmud-3.3.719/mud/lp-245/banish/
ldmud-3.3.719/mud/lp-245/doc/
ldmud-3.3.719/mud/lp-245/doc/examples/
ldmud-3.3.719/mud/lp-245/doc/sefun/
ldmud-3.3.719/mud/lp-245/log/
ldmud-3.3.719/mud/lp-245/obj/Go/
ldmud-3.3.719/mud/lp-245/players/lars/
ldmud-3.3.719/mud/lp-245/room/death/
ldmud-3.3.719/mud/lp-245/room/maze1/
ldmud-3.3.719/mud/lp-245/room/sub/
ldmud-3.3.719/mud/lp-245/secure/
ldmud-3.3.719/mud/sticklib/
ldmud-3.3.719/mud/sticklib/src/
ldmud-3.3.719/mudlib/deprecated/
ldmud-3.3.719/mudlib/uni-crasher/
ldmud-3.3.719/pkg/
ldmud-3.3.719/pkg/debugger/
ldmud-3.3.719/pkg/diff/
ldmud-3.3.719/pkg/misc/
ldmud-3.3.719/src/
ldmud-3.3.719/src/autoconf/
ldmud-3.3.719/src/ptmalloc/
ldmud-3.3.719/src/util/
ldmud-3.3.719/src/util/erq/
ldmud-3.3.719/src/util/indent/hosts/next/
ldmud-3.3.719/src/util/xerq/
ldmud-3.3.719/src/util/xerq/lpc/
ldmud-3.3.719/src/util/xerq/lpc/www/
ldmud-3.3.719/test/generic/
ldmud-3.3.719/test/inc/
ldmud-3.3.719/test/t-0000398/
ldmud-3.3.719/test/t-0000548/
ldmud-3.3.719/test/t-030925/
ldmud-3.3.719/test/t-040413/
ldmud-3.3.719/test/t-041124/
ldmud-3.3.719/test/t-language/
string short_desc, name, message;
int value, strength, heal;
int full;
int pub_drink;		/* Drinks from the pub can't be removed from pub */

int set_value(string str) {
    if (sscanf(str, "%s#%s#%s#%d#%d#%d", name, short_desc, message,
	heal, value, strength) != 6)
	    return 0;
    return 1;
}

void set_pub() {
    pub_drink = 1;
}

int id(string str) {
    if ((str == name || (str == "drk2" && pub_drink)) && full)
	return 1;
    return str == "bottle";
}

string short() {
    if (full)
	return short_desc;
    return "empty bottle";
}

/* The shop only buys empty bottles ! */

int query_value()
{
    if (!full) return 10;
    return 0;
}

void long() {
    write(short() + ".\n");
}

void reset(int arg) {
    if (arg)
        return;
    full = 1;
}

int drink(string str)
{
    int level, npc;
    string p_name;
    if (!str || !id(str))
	return 0;
    if (!full)
	return 0;
    level = this_player()->query_level();
    p_name = this_player()->query_name();
    npc = this_player()->query_npc();
    if (strength >= 12 && level < 10) {
	write("You sputter liquid all over the room.\n");
	say(p_name + " tries a " + name + " but coughs and sputters\n" +
	    "all over you.\n");
	full = 0;
	return 1;
    }
    if (strength >= 8 && level < 5) {
	write("You throw it all up.\n");
	say(p_name + " tries to drink a " + name + " but throws up.\n");
	full = 0;
	return 1;
    }
    if (!this_player()->drink_alcohol(strength) && !npc)
	return 1;
    this_player()->heal_self(heal);
    write(message + ".\n");
    say(this_player()->query_name() +
	" drinks " + name + ".\n");
    full = 0;
    return 1;
}

void init() {
    add_action("drink", "drink");
}

int get() {
    return 1;
}

int query_weight() {
    return 1;
}