ds2.4.1/bin/
ds2.4.1/extra/creremote/
ds2.4.1/extra/wolfpaw/
ds2.4.1/lib/cmds/admins/
ds2.4.1/lib/cmds/common/
ds2.4.1/lib/cmds/creators/include/
ds2.4.1/lib/cmds/creators/include/SCCS/
ds2.4.1/lib/daemon/services/
ds2.4.1/lib/doc/
ds2.4.1/lib/doc/efun/all/
ds2.4.1/lib/doc/efun/arrays/
ds2.4.1/lib/doc/efun/buffers/
ds2.4.1/lib/doc/efun/compile/
ds2.4.1/lib/doc/efun/floats/
ds2.4.1/lib/doc/efun/functions/
ds2.4.1/lib/doc/efun/general/
ds2.4.1/lib/doc/efun/mixed/
ds2.4.1/lib/doc/efun/numbers/
ds2.4.1/lib/doc/efun/parsing/
ds2.4.1/lib/doc/faq/
ds2.4.1/lib/doc/hbook/
ds2.4.1/lib/doc/help/classes/
ds2.4.1/lib/doc/help/races/
ds2.4.1/lib/doc/lfun/
ds2.4.1/lib/doc/lfun/all/
ds2.4.1/lib/doc/lfun/lib/abilities/
ds2.4.1/lib/doc/lfun/lib/armor/
ds2.4.1/lib/doc/lfun/lib/bot/
ds2.4.1/lib/doc/lfun/lib/clay/
ds2.4.1/lib/doc/lfun/lib/clean/
ds2.4.1/lib/doc/lfun/lib/client/
ds2.4.1/lib/doc/lfun/lib/combat/
ds2.4.1/lib/doc/lfun/lib/connect/
ds2.4.1/lib/doc/lfun/lib/corpse/
ds2.4.1/lib/doc/lfun/lib/creator/
ds2.4.1/lib/doc/lfun/lib/daemon/
ds2.4.1/lib/doc/lfun/lib/damage/
ds2.4.1/lib/doc/lfun/lib/deterioration/
ds2.4.1/lib/doc/lfun/lib/donate/
ds2.4.1/lib/doc/lfun/lib/door/
ds2.4.1/lib/doc/lfun/lib/equip/
ds2.4.1/lib/doc/lfun/lib/file/
ds2.4.1/lib/doc/lfun/lib/fish/
ds2.4.1/lib/doc/lfun/lib/flashlight/
ds2.4.1/lib/doc/lfun/lib/follow/
ds2.4.1/lib/doc/lfun/lib/ftp_client/
ds2.4.1/lib/doc/lfun/lib/ftp_data_connection/
ds2.4.1/lib/doc/lfun/lib/fuel/
ds2.4.1/lib/doc/lfun/lib/genetics/
ds2.4.1/lib/doc/lfun/lib/id/
ds2.4.1/lib/doc/lfun/lib/interactive/
ds2.4.1/lib/doc/lfun/lib/lamp/
ds2.4.1/lib/doc/lfun/lib/leader/
ds2.4.1/lib/doc/lfun/lib/light/
ds2.4.1/lib/doc/lfun/lib/limb/
ds2.4.1/lib/doc/lfun/lib/living/
ds2.4.1/lib/doc/lfun/lib/look/
ds2.4.1/lib/doc/lfun/lib/manipulate/
ds2.4.1/lib/doc/lfun/lib/meal/
ds2.4.1/lib/doc/lfun/lib/messages/
ds2.4.1/lib/doc/lfun/lib/npc/
ds2.4.1/lib/doc/lfun/lib/player/
ds2.4.1/lib/doc/lfun/lib/poison/
ds2.4.1/lib/doc/lfun/lib/position/
ds2.4.1/lib/doc/lfun/lib/potion/
ds2.4.1/lib/doc/lfun/lib/room/
ds2.4.1/lib/doc/lfun/lib/server/
ds2.4.1/lib/doc/lfun/lib/spell/
ds2.4.1/lib/doc/lfun/lib/torch/
ds2.4.1/lib/doc/lfun/lib/vendor/
ds2.4.1/lib/doc/lfun/lib/virt_sky/
ds2.4.1/lib/doc/lfun/lib/weapon/
ds2.4.1/lib/doc/lfun/lib/worn_storage/
ds2.4.1/lib/doc/lpc/basic/
ds2.4.1/lib/doc/lpc/concepts/
ds2.4.1/lib/doc/lpc/constructs/
ds2.4.1/lib/doc/lpc/etc/
ds2.4.1/lib/doc/lpc/intermediate/
ds2.4.1/lib/doc/lpc/types/
ds2.4.1/lib/doc/misc/
ds2.4.1/lib/doc/old/
ds2.4.1/lib/domains/Praxis/adm/
ds2.4.1/lib/domains/Praxis/attic/
ds2.4.1/lib/domains/Praxis/cemetery/mon/
ds2.4.1/lib/domains/Praxis/data/
ds2.4.1/lib/domains/Praxis/death/
ds2.4.1/lib/domains/Praxis/mountains/
ds2.4.1/lib/domains/Praxis/obj/armour/
ds2.4.1/lib/domains/Praxis/obj/magic/
ds2.4.1/lib/domains/Praxis/obj/weapon/
ds2.4.1/lib/domains/Praxis/orc_valley/
ds2.4.1/lib/domains/Ylsrim/
ds2.4.1/lib/domains/Ylsrim/adm/
ds2.4.1/lib/domains/Ylsrim/armor/
ds2.4.1/lib/domains/Ylsrim/broken/
ds2.4.1/lib/domains/Ylsrim/fish/
ds2.4.1/lib/domains/Ylsrim/meal/
ds2.4.1/lib/domains/Ylsrim/npc/
ds2.4.1/lib/domains/Ylsrim/obj/
ds2.4.1/lib/domains/Ylsrim/virtual/
ds2.4.1/lib/domains/Ylsrim/weapon/
ds2.4.1/lib/domains/campus/adm/
ds2.4.1/lib/domains/campus/etc/
ds2.4.1/lib/domains/campus/meals/
ds2.4.1/lib/domains/campus/npc/
ds2.4.1/lib/domains/campus/save/
ds2.4.1/lib/domains/campus/txt/ai/charles/
ds2.4.1/lib/domains/campus/txt/ai/charles/bak2/
ds2.4.1/lib/domains/campus/txt/ai/charles/bak2/bak1/
ds2.4.1/lib/domains/campus/txt/ai/charly/
ds2.4.1/lib/domains/campus/txt/ai/charly/bak/
ds2.4.1/lib/domains/campus/txt/jenny/
ds2.4.1/lib/domains/default/creator/
ds2.4.1/lib/domains/default/doors/
ds2.4.1/lib/domains/default/etc/
ds2.4.1/lib/domains/default/weap/
ds2.4.1/lib/domains/town/doors/
ds2.4.1/lib/domains/town/txt/shame/
ds2.4.1/lib/domains/town/virtual/
ds2.4.1/lib/lib/comp/
ds2.4.1/lib/lib/lvs/
ds2.4.1/lib/lib/user/
ds2.4.1/lib/lib/virtual/
ds2.4.1/lib/log/
ds2.4.1/lib/obj/book_source/
ds2.4.1/lib/obj/include/
ds2.4.1/lib/realms/template/
ds2.4.1/lib/realms/template/adm/
ds2.4.1/lib/realms/template/area/armor/
ds2.4.1/lib/realms/template/area/npc/
ds2.4.1/lib/realms/template/area/obj/
ds2.4.1/lib/realms/template/area/room/
ds2.4.1/lib/realms/template/area/weap/
ds2.4.1/lib/realms/template/bak/
ds2.4.1/lib/realms/template/cmds/
ds2.4.1/lib/save/kills/o/
ds2.4.1/lib/secure/cfg/
ds2.4.1/lib/secure/cfg/classes/
ds2.4.1/lib/secure/cmds/creators/include/
ds2.4.1/lib/secure/cmds/players/
ds2.4.1/lib/secure/cmds/players/include/
ds2.4.1/lib/secure/daemon/include/
ds2.4.1/lib/secure/lib/
ds2.4.1/lib/secure/lib/include/
ds2.4.1/lib/secure/lib/net/include/
ds2.4.1/lib/secure/lib/std/
ds2.4.1/lib/secure/modules/
ds2.4.1/lib/secure/npc/
ds2.4.1/lib/secure/obj/include/
ds2.4.1/lib/secure/room/
ds2.4.1/lib/secure/save/
ds2.4.1/lib/secure/save/boards/
ds2.4.1/lib/secure/save/players/g/
ds2.4.1/lib/secure/scripts/
ds2.4.1/lib/secure/tmp/
ds2.4.1/lib/secure/upgrades/files/
ds2.4.1/lib/secure/verbs/creators/
ds2.4.1/lib/shadows/
ds2.4.1/lib/spells/
ds2.4.1/lib/std/board/
ds2.4.1/lib/std/lib/
ds2.4.1/lib/tmp/
ds2.4.1/lib/verbs/admins/include/
ds2.4.1/lib/verbs/common/
ds2.4.1/lib/verbs/common/include/
ds2.4.1/lib/verbs/creators/include/
ds2.4.1/lib/verbs/players/include/SCCS/
ds2.4.1/lib/verbs/rooms/
ds2.4.1/lib/verbs/rooms/include/
ds2.4.1/lib/www/errors/
ds2.4.1/lib/www/images/
ds2.4.1/v22.2b14/
ds2.4.1/v22.2b14/ChangeLog.old/
ds2.4.1/v22.2b14/Win32/
ds2.4.1/v22.2b14/compat/
ds2.4.1/v22.2b14/compat/simuls/
ds2.4.1/v22.2b14/include/
ds2.4.1/v22.2b14/testsuite/
ds2.4.1/v22.2b14/testsuite/clone/
ds2.4.1/v22.2b14/testsuite/command/
ds2.4.1/v22.2b14/testsuite/data/
ds2.4.1/v22.2b14/testsuite/etc/
ds2.4.1/v22.2b14/testsuite/include/
ds2.4.1/v22.2b14/testsuite/inherit/
ds2.4.1/v22.2b14/testsuite/inherit/master/
ds2.4.1/v22.2b14/testsuite/log/
ds2.4.1/v22.2b14/testsuite/single/
ds2.4.1/v22.2b14/testsuite/single/tests/compiler/
ds2.4.1/v22.2b14/testsuite/single/tests/efuns/
ds2.4.1/v22.2b14/testsuite/single/tests/operators/
ds2.4.1/v22.2b14/testsuite/u/
ds2.4.1/v22.2b14/tmp/
ds2.4.1/win32/
#include <lib.h>

#define PH "/realms/drakken/clerics/"
#define SAVE_FILE "/domains/Praxis/data/cleric_crypt"
#define WHAMMER "/realms/zaknaifen/weap/whammer"
#define PHYL "/realms/zaknaifen/armor/phylactery"

inherit LIB_ROOM;

int prayers,is_hammer,is_phyl;

void create() {
    ::create();
    prayers = 0;
    is_hammer = 0;
    is_phyl = 0;
    restore_object(SAVE_FILE);	// restore is_hammer and is_phyl
    SetProperties(([
	"no attack": 1,
	"no steal":1,
	"no castle":1,
	"holy ground":1,
	"light"   : 2,
	"indoors" : 1,
      ]));
    SetShort("a small crypt");
    SetLong("The altar room is carved from the ancient gray stone that Praxis "
      "rests upon. Burning candles along the walls cause the shadows to "
      "dance around the room in a chaotic, yet enchanting dance. A large altar "
      "rises from the floor in the center of the room and steps carved into the "
      "stone lead upwards. ");
    SetExits( ([
	"up" : "/domains/Praxis/cleric_hall"
      ]) );
    SetItems(([
	"altar":(: this_object(), "exaaltar" :),
	"scenes" : "You see Tempos wielding his mighty %^CYAN%^warhammer%^RESET%^ in a variety of battles "
	"you recognize from your religious studies. ",
	({"stones","stone"}):
	"The cold grey stone is creased and marked by the tools that were used "
	"to carve this room beaneath the earth. ",
	({"shadows","shadow"}):
	"The shadows dance enchantingly across the room in time to the music "
	"of the flickering candle flames. ",
	"steps" :  "The steps are carved into the grey stone and are worn by the passage "
	"of many feet over the ages. ",
	({"walls","wall"}):
	"The walls are hewn roughly from the stone beneath Praxis and are lined "
	"with many flickering candles. ",
	({"candle","candles"}):
	"The candles rest in iron stands set along the wall and are made from "
	"animal fat. The candle flames flicker to the tune of the wind, creating "
	"the music by which the shadows cavort and dance. ",
	"stands" : "The stands are made of %^BLACK%^%^BOLD%^black%^RESET%^ iron and are of plain construction. "
	"Each stand holds between three to four lit candles. ",
      ]));
}

void exaaltar() {
    string str;

    str = "The altar is made of ancient gray stone and is huge.  There are scenes "
    "of Tempos fighting mythical beasts carved all along the sides of the altar. "
    "The top of the altar is flat and has the image of a hammer traced along "
    "it in %^YELLOW%^gold%^RESET%^. ";
    if (is_hammer) str += "The %^CYAN%^warhammer%^RESET%^ lieing upon it perfectly fits into the traces. ";
    if (is_phyl) str += "A %^YELLOW%^golden%^RESET%^ phylactery partially covers the traces.";
    write(str);
}

void reset()
{
    ::reset();
    if (!present("box")) {
	//new(PH "obj/donation")->move(this_object());
    }
    prayers = 0;
}

void init()
{
    ::init();
    add_action("pray_func","pray");
}

int pray_func(string str) {
    object ob, ob2, *inv;
    string limb;
    int i,j;

    ob = this_player();
    inv = all_inventory(ob);
    for (i=0; i<sizeof(inv); i++) {
	if ((!str || strlen(str) == 0) && inv[i]->id("hammer of tempos") && is_hammer == 0) {
	    tell_room(this_object(),(string)ob->query_cap_name()+" mutters a prayer in front of the altar. As "+
	      nominative(ob)+" does so, the shape of a demigod appears on the altar. "
	      "You feel the might of the shadow and take part in his pleasure with the prayer as you notice that "
	      "the shadow is an incarnation of Tempos himself! "
	      "Tempos notices that "+ob->query_cap_name()+" carries his %^CYAN%^warhammer%^RESET%^ and takes it away! "
	      "As the shadow disappears the %^CYAN%^warhammer%^RESET%^ appears on the altar.",ob);
	    tell_object(ob,"You mutter a prayer in front of the altar. As you "
	      "do so, the shape of a demigod appears on the altar. "
	      "You feel the might of the shadow and repeat the prayer as you notice that "
	      "the shadow is an incarnation of Tempos himself! "
	      "Tempos notices that you carry his %^CYAN%^warhammer%^RESET%^ and takes it away! "
	      "As the shadow disappears the %^CYAN%^warhammer%^RESET%^ appears on the altar.");
	    is_hammer = 1;
	    save_object(SAVE_FILE);	// save is_hammer
	    inv[i]->destruct();
	    return 1;
	} else if ((!str || strlen(str) == 0) && inv[i]->id("hammer of tempos") && is_hammer == 1) {
	    tell_room(this_object(),(string)ob->query_cap_name()+" mutters a prayer in front of the altar. As "+
	      nominative(ob)+" does so, the shape of a demigod appears on the altar. "
	      "You feel the might of the shadow and take part in his pleasure with the prayer as you notice that "
	      "the shadow is an incarnation of Tempos himself! "
	      "Tempos notices that "+ob->query_cap_name()+" carries his %^CYAN%^warhammer%^RESET%^ and takes it away!",ob);
	    tell_object(ob,"You mutter a prayer in front of the altar. As you "
	      "do so, the shape of a demigod appears on the altar. "
	      "You feel the might of the shadow and repeat the prayer as you notice that "
	      "the shadow is an incarnation of Tempos himself! "
	      "Tempos notices that you carry his %^CYAN%^warhammer%^RESET%^ and takes it away!");
	    inv[i]->destruct();
	    return 1;
	}
	if ((!str || strlen(str) == 0) && inv[i]->id("phylactery") && is_phyl == 0) {
	    tell_room(this_object(),(string)ob->query_cap_name()+" mutters a prayer in front of the altar. As "+
	      nominative(ob)+" does so, the shape of a demigod appears on the altar. "
	      "You feel the might of the shadow and take part in his pleasure with the prayer as you notice that "
	      "the shadow is an incarnation of Tempos himself! "
	      "Tempos notices that "+ob->query_cap_name()+" carries his phylactery and takes it away! "
	      "As the shadow disappears the phylactery appears on the altar.",ob);
	    tell_object(ob,"You mutter a prayer in front of the altar. As you "
	      "do so, the shape of a demigod appears on the altar. "
	      "You feel the might of the shadow and repeat the prayer as you notice that "
	      "the shadow is an incarnation of Tempos himself! "
	      "Tempos notices that you carry his phylactery and takes it away! "
	      "As the shadow disappears the phylactery appears on the altar.");
	    is_phyl = 1;
	    save_object(SAVE_FILE);	// save is_phyl
	    inv[i]->destruct();
	    return 1;
	} else if ((!str || strlen(str) == 0) && inv[i]->id("phylactery") && is_phyl == 1) {
	    tell_room(this_object(),(string)ob->query_cap_name()+" mutters a prayer in front of the altar. As "+
	      nominative(ob)+" does so, the shape of a demigod appears on the altar. "
	      "You feel the might of the shadow and take part in his pleasure with the prayer as you notice that "
	      "the shadow is an incarnation of Tempos himself! "
	      "Tempos notices that "+ob->query_cap_name()+" carries his phylactery and takes it away! ",ob);
	    tell_object(ob,"You mutter a prayer in front of the altar. As you "
	      "do so, the shape of a demigod appears on the altar. "
	      "You feel the might of the shadow and repeat the prayer as you notice that "
	      "the shadow is an incarnation of Tempos himself! "
	      "Tempos notices that you carry his phylactery and takes it away!");
	    inv[i]->destruct();
	    return 1;
	}
    }
    if (is_hammer) {
	j = 0;
	for (i=0; i<sizeof(inv); i++)
	    if (inv[i]->id("hammer of tempos")) {
		j = 1;
		break;
	    }
	if (str == "for warhammer" && j == 0 && ob->query_alignment() >= 1000 && ob->query_level() > 5) {
	    ob2 = new(WHAMMER);
	    if (ob2) {
		tell_room(this_object(),(string)ob->query_cap_name()+" mutters a prayer in front of the altar. As "+
		  nominative(ob)+" does so, the shape of a demigod appears on the altar. "
		  "You feel the might of the shadow and take part in his pleasure with the prayer as you notice that "
		  "the shadow is an incarnation of Tempos himself! "
		  "Tempos notices the %^CYAN%^warhammer%^RESET%^ on top of the altar and hands it to "+ob->query_cap_name()+"!",ob);
		tell_object(ob,"You mutter a prayer in front of the altar. As you "
		  "do so, the shape of a demigod appears on the altar. "
		  "You feel the might of the shadow and repeat the prayer as you notice that "
		  "the shadow is an incarnation of Tempos himself! "
		  "Tempos notices his %^CYAN%^warhammer%^RESET%^ on top of the altar and hands it to you!");
		tell_room(this_object(),"The shadow disappears as the prayer ends.",({}));
		is_hammer = 0;
		save_object(SAVE_FILE);	// save is_hammer
		ob2->move(ob);
		return 1;
	    }
	}
    }
    if (is_phyl) {
	j = 0;
	for (i=0; i<sizeof(inv); i++)
	    if (inv[i]->id("phylactery")) {
		j = 1;
		break;
	    }
	if (str == "for phylactery" && j==0 && ob->query_alignment()>=800 && ob->query_level()>5 && ob->query_skill("faith")>50) {
	    ob2 = new(PHYL);
	    if (ob2) {
		tell_room(this_object(),(string)ob->query_cap_name()+" mutters a prayer in front of the altar. As "+
		  nominative(ob)+" does so, the shape of a demigod appears on the altar. "
		  "You feel the might of the shadow and take part in his pleasure with the prayer as you notice that "
		  "the shadow is an incarnation of Tempos himself! "
		  "Tempos notices the phylactery on top of the altar and hands it to "+ob->query_cap_name()+"!",ob);
		tell_object(ob,"You mutter a prayer in front of the altar. As you "
		  "do so, the shape of a demigod appears on the altar. "
		  "You feel the might of the shadow and repeat the prayer as you notice that "
		  "the shadow is an incarnation of Tempos himself! "
		  "Tempos notices his phylactery on top of the altar and hands it to you!");
		tell_room(this_object(),"The shadow disappears as the prayer ends.",({}));
		is_phyl = 0;
		save_object(SAVE_FILE);	// save is_phyl
		ob2->move(ob);
		return 1;
	    }
	}
    }
    if (prayers < 7) {
	tell_room(this_object(),(string)ob->query_cap_name()+" mutters a prayer in front of the altar. As "+
	  nominative(ob)+" does so, the shape of a demigod appears on the altar. "
	  "You feel the might of the shadow and take part in his pleasure with the prayer as you notice that "
	  "the shadow is an incarnation of Tempos himself!",ob);
	tell_object(ob,"You mutter a prayer in front of the altar. As you "
	  "do so, the shape of a demigod appears on the altar. "
	  "You feel the might of the shadow and repeat the prayer as you notice that "
	  "the shadow is an incarnation of Tempos himself!");
	tell_room(this_object(),"The shadow disappears as the prayer ends.",({}));
	if (random(100) <(15+ob->query_base_stats("charisma"))) ob->add_alignment(random(3)+10-prayers);
    } else {
	limb = ob->return_limb();
	tell_room(this_object(),(string)ob->query_cap_name()+" mutters a prayer in front of the altar. As "+
	  nominative(ob)+" does so, the shape of a demigod appears on the altar. "
	  "You feel the might of the shadow and the fear he installs in your heart! "
	  "The shadow again is an incarnation of Tempos himself, but this time he is annoyed of being "
	  "disturbed that often! With a swing of his hammer he attacks "+(string)ob->query_cap_name()+
	  "! "+ ( is_hammer ?
	    " This time the hammer turns out to be real!\nTempos destroys "+ob->query_cap_name()+" utterly in the "+limb+
	    " with his %^CYAN%^warhammer%^RESET%^!"
	    : "Luckily for "+objective(ob)+ " the hammer is a shadow also, and therefore the damage is minimal."
	  ) ,ob);
	tell_room(this_object(),"Tempos decides "+ob->query_cap_name()+" is not "
	  "worth to bother with anyway and disappears.",ob);
	tell_object(ob,"You mutter a prayer in front of the altar. As you "
	  "do so, the shape of a demigod appears on the altar. "
	  "You feel the might of the shadow and the fear he installs in your heart! "
	  "The shadow again is an incarnation of Tempos himself, but this time he is annoyed of being "
	  "disturbed that often! With a swing of his hammer he attacks you!"
	  + ( is_hammer ? 
	    " This time the hammer turns out to be real!\nTempos destroys you utterly in the "+limb+
	    " with his %^CYAN%^warhammer%^RESET%^!"
	    : " Luckily for you the hammer is a shadow also, and therefore the damage is minimal."
	  ) );
	ob->do_damage(limb,5+random(prayers)+is_hammer*25);
	tell_object(ob,"Tempos decides you are not worth to bother with anyway and disappears.");
    }
    prayers++;
    return 1;
}