ldmud-3.2.9/doc/
ldmud-3.2.9/doc/efun/
ldmud-3.2.9/mud/
ldmud-3.2.9/mud/heaven7/
ldmud-3.2.9/mud/heaven7/lib/
ldmud-3.2.9/mud/lp-245/
ldmud-3.2.9/mud/lp-245/banish/
ldmud-3.2.9/mud/lp-245/doc/
ldmud-3.2.9/mud/lp-245/doc/examples/
ldmud-3.2.9/mud/lp-245/doc/sefun/
ldmud-3.2.9/mud/lp-245/log/
ldmud-3.2.9/mud/lp-245/obj/Go/
ldmud-3.2.9/mud/lp-245/players/lars/
ldmud-3.2.9/mud/lp-245/room/death/
ldmud-3.2.9/mud/lp-245/room/maze1/
ldmud-3.2.9/mud/lp-245/room/sub/
ldmud-3.2.9/mud/lp-245/secure/
ldmud-3.2.9/mud/morgengrauen/
ldmud-3.2.9/mud/morgengrauen/lib/
ldmud-3.2.9/mud/sticklib/
ldmud-3.2.9/mud/sticklib/src/
ldmud-3.2.9/mudlib/uni-crasher/
ldmud-3.2.9/pkg/
ldmud-3.2.9/pkg/debugger/
ldmud-3.2.9/pkg/diff/
ldmud-3.2.9/pkg/misc/
ldmud-3.2.9/src/autoconf/
ldmud-3.2.9/src/bugs/
ldmud-3.2.9/src/bugs/MudCompress/
ldmud-3.2.9/src/bugs/b-020916-files/
ldmud-3.2.9/src/bugs/doomdark/
ldmud-3.2.9/src/bugs/ferrycode/ferry/
ldmud-3.2.9/src/bugs/ferrycode/obj/
ldmud-3.2.9/src/bugs/psql/
ldmud-3.2.9/src/done/
ldmud-3.2.9/src/done/order_alist/
ldmud-3.2.9/src/done/order_alist/obj/
ldmud-3.2.9/src/done/order_alist/room/
ldmud-3.2.9/src/gcc/
ldmud-3.2.9/src/gcc/2.7.0/
ldmud-3.2.9/src/gcc/2.7.1/
ldmud-3.2.9/src/hosts/
ldmud-3.2.9/src/hosts/GnuWin32/
ldmud-3.2.9/src/hosts/amiga/NetIncl/
ldmud-3.2.9/src/hosts/amiga/NetIncl/netinet/
ldmud-3.2.9/src/hosts/amiga/NetIncl/sys/
ldmud-3.2.9/src/hosts/i386/
ldmud-3.2.9/src/hosts/msdos/byacc/
ldmud-3.2.9/src/hosts/msdos/doc/
ldmud-3.2.9/src/hosts/os2/
ldmud-3.2.9/src/hosts/win32/
ldmud-3.2.9/src/util/
ldmud-3.2.9/src/util/erq/
ldmud-3.2.9/src/util/indent/hosts/next/
ldmud-3.2.9/src/util/xerq/
ldmud-3.2.9/src/util/xerq/lpc/
ldmud-3.2.9/src/util/xerq/lpc/www/
#include "room.h"
#include "tune.h"

ONE_EXIT("room/wiz_hall", "south",
	 "Room of quests",
"This is the room of quests. Every wizard can make at most one quest.\n" +
"When he has made a quest, he should have it approved by an arch wizard.\n" +
"When it is approved, put a permanent object in this room, wich has as\n"+
"short description the name of the wizard. All objects in this room will be\n"+
"checked when a player wants to become a wizard. The player must have\n"+
"solved ALL quests. To mark that a quest is solved, call 'set_quest(\"name\")'\n"+
"in the player object. The objects must all accept the id 'quest' and the\n"+
"name of the wizard. The objects must also define a function hint(),\n"+
"that should return a message giving a hint of where to start the quest.\n"+
"Note that players never can come here. set_quest(str) will return 1 if\n"+
"this is the first time it was solved by this player, otherwise 0.\n", 1)

count(silently) {
    object ob;
    int i;

    ob = first_inventory(this_object());
    while(ob) {
	if (ob->id("quest")) {
	    string str;
	    str = ob->short();
	    if (!this_player()->query_quests(str))
		i += 1;
	}
	ob = next_inventory(ob);
    }
    if (!silently) {
	if (i == 0)
	    write("You have solved all quests!\n");
	else {
	    write("You have " + i + " quests unsolved.\n");
	    if (i - FREE_QUESTS <= 0)
		write("You don't have to solve any more quests.\n");
	    else
		write("You must solve " + (i - FREE_QUESTS) + " of these.\n");
	}
    }
    if (i - FREE_QUESTS < 0)
	return 0;
    return i - FREE_QUESTS;
}

list(i) {
    object ob;

    ob = first_inventory(this_object());
    while(ob) {
	if (ob->id("quest")) {
	    string str;
	    str = ob->short();
	    if (!this_player()->query_quests(str))
		i -= 1;
	    if (i == 0) {
		write(ob->hint() + "\n");
		return;
	    }
	}
	ob = next_inventory(ob);
    }
}