tmi2_fluffos_v2/
tmi2_fluffos_v2/bin/
tmi2_fluffos_v2/etc/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/ChangeLog.old/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/Win32/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/compat/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/compat/simuls/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/include/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/clone/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/command/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/data/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/etc/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/include/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/inherit/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/inherit/master/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/log/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/compiler/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/efuns/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/operators/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/u/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/tmp/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/windows/
tmi2_fluffos_v2/lib/
tmi2_fluffos_v2/lib/adm/
tmi2_fluffos_v2/lib/adm/daemons/languages/
tmi2_fluffos_v2/lib/adm/daemons/network/I3/
tmi2_fluffos_v2/lib/adm/daemons/virtual/
tmi2_fluffos_v2/lib/adm/daemons/virtual/template/
tmi2_fluffos_v2/lib/adm/news/
tmi2_fluffos_v2/lib/adm/obj/
tmi2_fluffos_v2/lib/adm/obj/master/
tmi2_fluffos_v2/lib/adm/priv/
tmi2_fluffos_v2/lib/adm/shell/
tmi2_fluffos_v2/lib/adm/tmp/
tmi2_fluffos_v2/lib/cmds/
tmi2_fluffos_v2/lib/d/
tmi2_fluffos_v2/lib/d/Conf/
tmi2_fluffos_v2/lib/d/Conf/adm/
tmi2_fluffos_v2/lib/d/Conf/boards/
tmi2_fluffos_v2/lib/d/Conf/cmds/
tmi2_fluffos_v2/lib/d/Conf/data/
tmi2_fluffos_v2/lib/d/Conf/logs/
tmi2_fluffos_v2/lib/d/Conf/obj/
tmi2_fluffos_v2/lib/d/Conf/text/help/
tmi2_fluffos_v2/lib/d/Fooland/adm/
tmi2_fluffos_v2/lib/d/Fooland/data/
tmi2_fluffos_v2/lib/d/Fooland/data/attic/
tmi2_fluffos_v2/lib/d/Fooland/items/
tmi2_fluffos_v2/lib/d/TMI/
tmi2_fluffos_v2/lib/d/TMI/adm/
tmi2_fluffos_v2/lib/d/TMI/boards/
tmi2_fluffos_v2/lib/d/TMI/data/
tmi2_fluffos_v2/lib/d/TMI/rooms/
tmi2_fluffos_v2/lib/d/grid/
tmi2_fluffos_v2/lib/d/grid/adm/
tmi2_fluffos_v2/lib/d/grid/data/
tmi2_fluffos_v2/lib/d/std/
tmi2_fluffos_v2/lib/d/std/adm/
tmi2_fluffos_v2/lib/data/adm/
tmi2_fluffos_v2/lib/data/adm/daemons/
tmi2_fluffos_v2/lib/data/adm/daemons/doc_d/
tmi2_fluffos_v2/lib/data/adm/daemons/emoted/
tmi2_fluffos_v2/lib/data/adm/daemons/network/http/
tmi2_fluffos_v2/lib/data/adm/daemons/network/services/mail_q/
tmi2_fluffos_v2/lib/data/adm/daemons/network/smtp/
tmi2_fluffos_v2/lib/data/adm/daemons/news/archives/
tmi2_fluffos_v2/lib/data/attic/connection/
tmi2_fluffos_v2/lib/data/attic/user/
tmi2_fluffos_v2/lib/data/std/connection/b/
tmi2_fluffos_v2/lib/data/std/connection/l/
tmi2_fluffos_v2/lib/data/std/user/a/
tmi2_fluffos_v2/lib/data/std/user/b/
tmi2_fluffos_v2/lib/data/std/user/d/
tmi2_fluffos_v2/lib/data/std/user/f/
tmi2_fluffos_v2/lib/data/std/user/l/
tmi2_fluffos_v2/lib/data/std/user/x/
tmi2_fluffos_v2/lib/data/u/d/dm/working/doc_d/
tmi2_fluffos_v2/lib/data/u/l/leto/doc_d/
tmi2_fluffos_v2/lib/data/u/l/leto/smtp/
tmi2_fluffos_v2/lib/doc/
tmi2_fluffos_v2/lib/doc/driverdoc/applies/
tmi2_fluffos_v2/lib/doc/driverdoc/applies/interactive/
tmi2_fluffos_v2/lib/doc/driverdoc/concepts/
tmi2_fluffos_v2/lib/doc/driverdoc/driver/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/arrays/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/buffers/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/compile/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/ed/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/filesystem/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/floats/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/functions/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/general/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/mappings/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/numbers/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/parsing/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/constructs/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/preprocessor/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/types/
tmi2_fluffos_v2/lib/doc/driverdoc/platforms/
tmi2_fluffos_v2/lib/doc/mudlib/
tmi2_fluffos_v2/lib/ftp/
tmi2_fluffos_v2/lib/include/driver/
tmi2_fluffos_v2/lib/log/
tmi2_fluffos_v2/lib/log/driver/
tmi2_fluffos_v2/lib/obj/net/
tmi2_fluffos_v2/lib/obj/shells/
tmi2_fluffos_v2/lib/obj/tools/
tmi2_fluffos_v2/lib/std/adt/
tmi2_fluffos_v2/lib/std/board/
tmi2_fluffos_v2/lib/std/body/
tmi2_fluffos_v2/lib/std/fun/
tmi2_fluffos_v2/lib/std/living/
tmi2_fluffos_v2/lib/std/object/
tmi2_fluffos_v2/lib/std/shop/
tmi2_fluffos_v2/lib/std/socket/
tmi2_fluffos_v2/lib/std/user/
tmi2_fluffos_v2/lib/std/virtual/
tmi2_fluffos_v2/lib/student/
tmi2_fluffos_v2/lib/student/kalypso/
tmi2_fluffos_v2/lib/student/kalypso/armor/
tmi2_fluffos_v2/lib/student/kalypso/rooms/
tmi2_fluffos_v2/lib/student/kalypso/weapons/
tmi2_fluffos_v2/lib/u/l/leto/
tmi2_fluffos_v2/lib/u/l/leto/cmds/
tmi2_fluffos_v2/lib/www/errors/
tmi2_fluffos_v2/lib/www/gateways/
tmi2_fluffos_v2/lib/www/images/
tmi2_fluffos_v2/old/
tmi2_fluffos_v2/win32/
// hall2.c
// This room is where players come to be promoted to wizard. The function
// wizqual in this room is the one that determines what it takes to become
// a wizard. You probably want to alter it: we've set the standards rather
// low for our own purposes. More detail on it in the header.

#define NUM_QUESTS 1
#define MIN_SKILL 5
#define TOT_SKILL 100

#include <mudlib.h>
#include <daemons.h>

inherit ROOM ;

void create() {
	::create();
// This room needs EUID so it can load the promotion daemon.
	seteuid(getuid()) ;
	set("light", 1) ;
	set ("short", "The promotion room") ;
	set ("long",
"You are in a small back room of the Fooland adventurer's hall. There is\n"+
"a small gnome sitting behind a desk which is covered with papers. You can\n"+
"go back east to the main hall.\n") ;
	set ("item_desc", ([ "gnome" :
"This fellow is responsible for promoting players into the ranks of wizards.\n"+
"He has an aura of tremendous responsibility and power about him. If you\n"+
"believe you are worthy of promotion, type \"apply\". He can also tell you\n"+
"what the requirements for wizardhood are: if you wish to know them, type\n"+
"\"inquire\".\n",
	"desk" :
"It is a solid oak desk. Strangely, it contains no drawers, yet the gnome\n"+
"behind the desk seems to be pulling items out of it regularly.\n",
	"papers" :
"The papers are written in a strange language that you cannot read.\n"
	]) ) ;
	set ("exits", ([ "east" : "/d/Fooland/hall" ]) ) ;
}

void init() {
	add_action ("apply", "apply") ;
	add_action ("inquire", "inquire") ;
}

// This is the wizqual function which determines what it takes to get
// promoted to wizard. It comes with the following standards:
//   1. All quests completed.
//   2. No skill below 5.
//   3. Total skills above 100.
// If the player has met the requirements it returns 1, otherwise it
// returns 0.

int wizqual (object ob) {

	mapping solved, skills ;
	string *names ;
	int i, j, sum ;

        solved = ob->query("quest") ;
	if (!solved) return 0 ;
	j = sizeof(solved) ;
	if (j != NUM_QUESTS) return 0 ;
	skills = ob->query_skills() ;
	names = keys(skills) ;
	for (i=0;i<sizeof(skills);i++) {
		j = skills[names[i]] ;
		if (j<MIN_SKILL) return 0 ;
		sum = sum + j ;
	}
	if (sum<TOT_SKILL) return 0 ;
	return 1 ;
}

// This function checks whether a player has met the criteria. If so, it
// gives him the wizard command path, sets his wizard property, and calls
// enable_wizard() on him. Notably, it does NOT give him a directory. If
// you want that done, you'll have to add it.

int apply() {

	string str ;
	int res ;

	if (wizardp(this_player())) {
		notify_fail ("The gnome gives you a dirty look. You are already a wizard!\n") ;
		return 0 ;
	}
	if (wizqual(this_player())==1) {
		res = PROMOTION_D->promote_wiz(this_player()) ;
		if (res==0) {
			write ("Unable to promote you! See an admin.\n") ;
			return 1 ;
		}
		write (
"The old gnome looks you in the eye and says:\n"+
"  Congratulations! You have been promoted to wizard on this MUD. If you\n"+
"have never been a wizard before, the first thing you should do is type\n"+
"\"help new_wiz\" and read the whole thing through. It will give you some\n"+
"idea of what powers wizards have, and what responsibilities wizards must\n"+
"carry out in order to keep the MUD running smoothly. When you have done\n"+
"that, talk to one of the administrators of the MUD and ask them what you\n"+
"should do in order to become a full_fledged wizard.\n") ;
		shout ("A new wizard has been born.\n") ;
		str = this_player()->query("cap_name")+" "+ctime(time()) ;
		log_file ("NEW_WIZARDS", str) ;
		return 1 ;
	} else {
		write ("The gnome looks at you and shakes his head. \"I'm sorry,\" he says, \"but you\n"+
		"are not yet qualified to be promoted to wizard.\"\n") ;
		return 1 ;
	}
}

int inquire() {
	write (
"The old gnome looks at you and says:\n"+
"  To make wizard on this MUD you must meet three qualifications. First,\n"+
"you must complete all the the quests. The Book of Quests downstairs will\n"+
"describe them, and you can type \"quests\" to see how many you have left to\n"+
"do. Second, all of your skills must be 5 or higher. Third, the total of\n"+
"all your skills must be at least 100.\n"+
"\nThen he returns to his paperwork.\n") ;
	return 1 ;
}