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/
//  _raise.c
//  from the Nightmare mudlib
//  raises a corpse from the dead
//  Created by Manny@Nightmare 940911

#include <std.h>
#include <objects.h>

inherit DAEMON;

int cmd_raise(string str) {
  object corpse, ob, me;
  int healing, faith, needs, sp_needed, level;
  string Class;

  if(!str) return notify_fail("Raise what?");

  me = this_player();

  if(me->query_ghost())
    return notify_fail("The dead cannot raise the dead.\n");

  Class=me->query_class();
  if(!(Class="cleric" || Class="kataan"))
    return notify_fail("You are unfamilar with such arts.\n");

  if(me->query_level() < 5)
    return notify_fail("You are too ingorant in the ways of the world.\n"
);

  if(!corpse=present(str, environment(this_player())))
    return notify_fail("You feel a bit lost..\n");

  if(!corpse->id("corpse"))
    return notify_fail("You oaf, you can only raise a corpse!!\n");

  needs=(int)me->query_alignment();
  if(Class=="cleric" && needs>1000)
    return notify_fail("You cringe at the thought of performing "
        "such an act of evil.\n");
  if(Class=="kataan" && needs<-800)
    return notify_fail("The gods no longer pay heed to your "
        "evil pleas.\n");
  needs=(needs<0 ? 100 : needs/4);
  me->add_alignment(-(needs<0 ? 100 : needs));

  if((healing=(int)me->query_skill("healing")) < (random(20)+60))
    return notify_fail("You lack the skill to perform such an act.\n");

  if((faith=(int)me->query_skill("faith")) < random(10)+40)
    return notify_fail("The gods fail to hear your words.\n");

  if(me->query_mp() < random(20)+130)
    return notify_fail("Your prayers go unanswered.\n");
  me->add_mp(-(random(50)+100));

  sp_needed=150-healing;
  if(sp_needed < 0) sp_needed=0;
  level = corpse->query_level();
  sp_needed += random(level*10) + 5*level;
  if(me->query_sp() < sp_needed)
    return notify_fail("Your concentration is just too weak.\n");
  me->add_sp(-sp_needed);

  this_player()->set_magic_round();
  ob = new(OB_UNDEAD);
  corpse->make_new_body(ob);
  ob->set_level(level-(200/needs));
  ob->set_decay_rate(to_int(5*sqrt(to_float(healing)))+random(100));
  ob->set_exp(random(100));
  ob->set("master", me);
  ob->move(environment(me));
  corpse->remove();
  me->add_follower(ob);
  me->add_skill_points("healing", random(healing/4));
  me->add_skill_points("faith", random(faith/8));

  message("say", "%^GREEN%^You call upon your "
    "gods to allow the dead one last chance of service.", me);
  message("say", "%^GREEN%^%^BOLD%^"+me->query_cap_name()+"Waves "+
    me->query_possessive()+" hands wildily in the air and chants a spell "+
    "of archaic words.  The dead corpse begins to rise.", environment(me));

  return 1;
}


void help() {
  message("help", "Syntax: raise <corpse>\n\n"
      "Attempt to raise a corpse from the dead.\n"
      "See also: order", this_player());
}