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/
//     /wizards/kalinash/bin/_fear.c
//     A spell for those evil little kataans... ;)
//     By Kalinash@Nightmare on 1 Jan 94
 
#include <std.h>
 
inherit DAEMON;
 
int cmd_fear() {
    object who, me;
    int x, mw, hw, mma, hmd, amt, tot;
 
    me = this_player();
    if((string)me->query_class() != "kataan")
        return notify_fail("You mumble in confusion.\n");
    if(me->query_ghost())
        return notify_fail("You are not fearfull in your etherial state.\n");
    if(environment(me)->query_property("no magic") ||
      environment(me)->query_property("no attack"))
        return notify_fail("A supernatural force stops your spell.\n");
    if((int)me->query_skill("faith") < 25)
        return notify_fail("You are not yet ready for this spell.\n");
    if(me->query_casting())
        return 1;
    if((int)me->query_mp() < 0)
        return notify_fail("You're mind is too fatigued for that.\n");
    if(!who=me->query_current_attacker())
        return notify_fail("You are not fighting anyone!\n");
    if(who->query_property("no fear"))
	return notify_fail(sprintf("You will ever strike fear into %s.",
          who->query_objective()));
    mma = (int)me->query_skill("faith");
    mw = (int)me->query_stats("wisdom");
    message("my_action", "You call upon your powers to strike fear into "
      "the hearts of you enemies!", me);
    message("their_action", sprintf("%s casts a spell of fear!",
      me->query_cap_name()), environment(me), me);
    hw = (int)who->query_stats("wisdom");
    hmd = (int)who->query_skill("magic defense");
    amt = (mma - hmd) / 10;
    amt = amt + ((mw - hw) / 5);
    if(amt > 0) {
        tot += amt;
        amt = random(amt + (int)who->query_level());
    }
    if(amt >= 30) {
        who->set_paralyzed(amt, "You are too scared to move!");
        message("their_action", sprintf("%s strikes fear into your heart!",
          me), who);
        message("my_action", sprintf("You paralyze %s with fear!",
          who->query_cap_name()), me);
    }
    if(amt < 30 && amt >= 10) {
        string *going, des, home;
 
        message("my_action", "You run away, screaming in terror!", who);
        message("their_action", sprintf("%s runs away, screaming in terror.",
              who->query_cap_name()), environment(who), who);
            home = file_name(environment(who));
            going = environment(me)->query_destinations();
            who->move(going[random(sizeof(going))]);
            if(!who->is_player())
                call_out("go_home", 30, ({ who, home}) );
    }
    if(amt > 0 && amt < 10) {
        message("their_action", "You shiver in fear, but hold your ground.",
          who);
        message("my_action", sprintf("%s holds %s ground.",
          who->query_cap_name(), who->query_possessive()), me);
        }
    if(amt < 1) {
        message("my_action", "You failed to scare a single thing.", me);
        return 1;
    }
    me->add_mp(-(tot * 10));
    me->add_skill_points("magic attack", tot);
    return 1;
}
 
void go_home(mixed *drow) {
    drow[0]->move_player(drow[1], "timidly");
}
 
void help() {
    message("help", "Usage : <fear>\n\nThis spell causes your enemy "
      "to see you as his deepest, darkest fear.",
      this_player());
    return;
}