nightmare3_fluffos_v2/
nightmare3_fluffos_v2/bin/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/ChangeLog.old/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/Win32/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/compat/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/compat/simuls/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/include/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/clone/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/command/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/data/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/etc/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/include/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/inherit/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/inherit/master/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/log/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/compiler/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/efuns/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/operators/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/u/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/tmp/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/windows/
nightmare3_fluffos_v2/lib/cmds/ambassador/
nightmare3_fluffos_v2/lib/cmds/database/
nightmare3_fluffos_v2/lib/cmds/hm/
nightmare3_fluffos_v2/lib/cmds/soul/
nightmare3_fluffos_v2/lib/daemon/cfg/
nightmare3_fluffos_v2/lib/daemon/cfg/mon_races/
nightmare3_fluffos_v2/lib/daemon/cfg/races/
nightmare3_fluffos_v2/lib/daemon/include/
nightmare3_fluffos_v2/lib/daemon/save/
nightmare3_fluffos_v2/lib/daemon/services/
nightmare3_fluffos_v2/lib/daemon/soul/
nightmare3_fluffos_v2/lib/doc/
nightmare3_fluffos_v2/lib/doc/TestPlans/
nightmare3_fluffos_v2/lib/doc/approval/
nightmare3_fluffos_v2/lib/doc/approval/QC/
nightmare3_fluffos_v2/lib/doc/approval/balance/
nightmare3_fluffos_v2/lib/doc/build/
nightmare3_fluffos_v2/lib/doc/build/armours/
nightmare3_fluffos_v2/lib/doc/build/economy/
nightmare3_fluffos_v2/lib/doc/build/etc/
nightmare3_fluffos_v2/lib/doc/build/monster/
nightmare3_fluffos_v2/lib/doc/build/room/
nightmare3_fluffos_v2/lib/doc/build/virtual/
nightmare3_fluffos_v2/lib/doc/build/weapon/
nightmare3_fluffos_v2/lib/doc/classes/
nightmare3_fluffos_v2/lib/doc/efun/
nightmare3_fluffos_v2/lib/doc/etc/
nightmare3_fluffos_v2/lib/doc/help/creator/
nightmare3_fluffos_v2/lib/doc/help/hm/
nightmare3_fluffos_v2/lib/doc/law/
nightmare3_fluffos_v2/lib/doc/lpc/basic/
nightmare3_fluffos_v2/lib/doc/lpc/data_types/
nightmare3_fluffos_v2/lib/doc/lpc/etc/
nightmare3_fluffos_v2/lib/doc/lpc/intermediate/
nightmare3_fluffos_v2/lib/doc/lpc/types/
nightmare3_fluffos_v2/lib/doc/mudlib/
nightmare3_fluffos_v2/lib/doc/mudlib/features/
nightmare3_fluffos_v2/lib/domains/Examples/etc/
nightmare3_fluffos_v2/lib/domains/Examples/room/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/exaA/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/exaB/
nightmare3_fluffos_v2/lib/domains/Examples/weapon/
nightmare3_fluffos_v2/lib/domains/Praxis/
nightmare3_fluffos_v2/lib/domains/Praxis/adm/
nightmare3_fluffos_v2/lib/domains/Praxis/attic/
nightmare3_fluffos_v2/lib/domains/Praxis/cemetary/
nightmare3_fluffos_v2/lib/domains/Praxis/cemetary/mon/
nightmare3_fluffos_v2/lib/domains/Praxis/data/
nightmare3_fluffos_v2/lib/domains/Praxis/death/
nightmare3_fluffos_v2/lib/domains/Praxis/mountains/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/armour/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/magic/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/weapon/
nightmare3_fluffos_v2/lib/domains/Praxis/orc_valley/
nightmare3_fluffos_v2/lib/domains/Praxis/quests/
nightmare3_fluffos_v2/lib/domains/Praxis/standardOld/
nightmare3_fluffos_v2/lib/include/
nightmare3_fluffos_v2/lib/log/
nightmare3_fluffos_v2/lib/log/errors/
nightmare3_fluffos_v2/lib/log/reports/
nightmare3_fluffos_v2/lib/log/watch/
nightmare3_fluffos_v2/lib/news/
nightmare3_fluffos_v2/lib/secure/cfg/
nightmare3_fluffos_v2/lib/secure/cmds/ambassador/
nightmare3_fluffos_v2/lib/secure/cmds/mortal/
nightmare3_fluffos_v2/lib/secure/save/users/d/
nightmare3_fluffos_v2/lib/secure/std/
nightmare3_fluffos_v2/lib/std/hm/
nightmare3_fluffos_v2/lib/std/living/
nightmare3_fluffos_v2/lib/std/room/
nightmare3_fluffos_v2/lib/std/user/
nightmare3_fluffos_v2/lib/std/virtual/
nightmare3_fluffos_v2/lib/www/
nightmare3_fluffos_v2/lib/www/errors/
nightmare3_fluffos_v2/lib/www/gateways/
nightmare3_fluffos_v2/win32/
//	/std/deputy.c
//	from the Nightmare mudlib
//	a monster to assist the victim of a PK attack
//	by Aleas

#include <std.h>
#include <rooms.h>
#include <deputies.h>

inherit MONSTER;

int query_deputy() { return 1; }

object currvict, currfoe;

object query_pk_victim() { return currvict; }

object query_pk_attacker() { return currfoe; }

void create()
{
    ::create();
    set_properties( ([
	"no bump":1,
	"no paralyze":1,
    ]) );
    set_name("deputy");
    set_race(({"kender","elf","human","gnone","halfling"})[random(5)]);
    set_gender(({"male","female"})[random(2)]);
    set_alignment(0);
    set_body_type("human");
    set_class("fighter");
    set_id( ({"deputy"}) );
    set_short("deputy");
    currvict = 0;
    currfoe = 0;
}

void launch_deputy(object victim, object attacker, int nr) {
    int alevel, i, j, tmp, * deps;

    currvict = victim;
    currfoe = attacker;
    if (nr)
    {
	set_short(possessive_noun(victim->query_name())+ " " + (nr == 1 ? "first" : "second")+" deputy");
	set_id( ({"deputy", (nr == 1 ? "first" : "second")+" deputy" }) );
    }
    else
	set_short(possessive_noun(victim->query_name())+" deputy");
    set_long("You remember the face of this strong "+query_gender()+" "+query_race()+" fighter "
	"from the Praxis sheriff's office. "+capitalize(nominative(query_gender()))+" looks very angry. ");
    set_emotes(10,({"%^BOLD%^%^BLUE%^"+capitalize(query_short())+" shouts:%^RESET%^ "+
	attacker->query_cap_name()+"! How dare you attack "+victim->query_cap_name()+"?"}),1);
    alevel = attacker->query_level();
    if (alevel <= 20)
	deps = DEPUTIES_LOW;
    else
	deps = DEPUTIES_HIGH;
    alevel <<= 1;
    j = deps[0];
    if ( (tmp = sizeof(deps)) > 1 )
	for (i = 1; i < tmp; i++)
	    if ( absolute_value( deps[i] - alevel ) < absolute_value( j - alevel ) )
		j = deps[i];

    set_level(j);

    // BALANCE: adjust here! 
    set_stats("constitution",j * 2);
    set_stats("strength", j * 2);
    set_stats("intelligence", j * 2);
    set_stats("wisdom", j * 2);
    set_stats("dexterity", j * 2);
    set_stats("charisma", j * 2);
    set_skill("melee", j * 5);
    set_skill("attack", j * 5);
    set_skill("defense", j * 5);

    this_object()->kill_ob(attacker,0);
}

void heart_beat() {
    object env;

    ::heart_beat();
    env = environment(this_object());
    if (this_object()->query_current_attacker() == 0) {
	if (env)
	    message("mout",capitalize(query_short())+" leaves for the sheriff.",env);
	// attention! change ROOM_VOID's go_back callout to check for this_player() != 0
	// otherwise this fails
	this_object()->move(ROOM_VOID);
	this_object()->remove();
	return;
    }
    if (env) {
	if (!currvict || !objectp(currvict) || !interactive(currvict) ||
		environment(currvict) != env || currvict->query_ghost()) {
	    message("mout",capitalize(query_short())+" leaves for the sheriff.",env);
	    this_object()->move(ROOM_VOID);
	    this_object()->remove();
	}
    }
}