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/
/*
             Drain -
  Coded by Zaknaifen@Nightmare on 3-2-94 for
  the Darkside.
*/
 
 
#include <std.h>    
 
inherit DAEMON;
 
void do_dumb(object ob);
void do_other(object ob);
 
int cmd_drain(string str)
  {
  
  int x, y, z, magic, factor1, factor2, final;
  string *traits;
  object ob;
  
  
  x=(int)this_player()->query_skill("faith"); 
  y=(int)this_player()->query_stats("intelligence");
  z=(int)this_player()->query_stats("wisdom");  
  magic=(int)this_player()->query_mp();  
  
  if((string)this_player()->query_class()!="kataan")
   {
    do_other(this_player());
    return 1;
   }
   
  if(x<30)
   {
    message("my_action", 
            "%^RED%^%^BOLD%^Fangthane tells you:%^RESET%^ "
            "Perhaps when you have more faith I will allow "
            "you to do what you desire.\n", this_player());
    return 1;
   }
  
   if(y<20)
     {
      do_dumb(this_player());
      return 1;
     }
   
   if(!str)
     {
      notify_fail("You recall from your teachings that you must drain "
                  "a specific item.\n");
      return 0;
     }
 
   if(!(ob=present(str, this_player())) )
     {
      notify_fail("You do not possess that object.\n");
      return 0;
     }
 
   traits=(string *)ob->query_property("magic item");
   
   if(!traits) 
    {
     notify_fail("You may only drain the magic from an item that has " 
                 "magic to begin with.\n");
     return 0;
    }
   
   if(magic<10)
     {
      notify_fail("You lack the magical energy required to do that.\n");
      return 0;
     }
   
   message("my_action",
         "%^CYAN%^%^BOLD%^"
         "You call upon your demonic masters to transfer the magical " 
         "strength from your "+str+" to your body.%^RESET%^ ",
         this_player());
   message("other_action",
           "%^RED%^The area around you takes on a reddish-hue as "+
           (string)this_player()->query_cap_name()+" raises an object "
           "above "+this_player()->query_possessive()+" head. The air "   
           "around "+(string)this_player()->query_cap_name()+" crackles "
           "with power as the object disappears!%^RESET%^ ",
           environment(this_player()), this_player());
   factor1=sizeof(traits);
   factor2=x/2+y/2+z/2;
   final=factor2*factor1*random(3)+1;
   if(final<=5)
     {
       final=random(25)+10;
     }
   this_player()->add_skill_points("faith", final);
   present(lower_case(str), this_player())->remove();
   this_player()->add_hp(final);
   this_player()->add_sp(final);
   this_player()->add_alignment(-final);
   this_player()->add_mp(-10);
   return 1;
 }  
 
 
void do_other(object ob)
  {
   
//Done to reflect the fact that summoning demons is not
//something someone other than Kataans would do.
//Zaknaifen
   
   message("my_action", 
      "%^BLACK%^%^BOLD%^"
      "Chaotic visions fill your mind and threaten to drive you mad! "
      "The demons you have summoned run rampant in your mind and "
      "take a piece of it with them before leaving you! ", ob);
   message("other_action",
       "%^CYAN%^"+
       (string)ob->query_cap_name()+" falls to "+
       (string)this_player()->query_possessive()+" knees, screaming "
       "in agony.%^RESET%^ ", environment(ob), ob);
   ob->do_damage("head", random(80)+20);
   ob->add_stat_bonus("intelligence", -10);
   ob->add_stat_bonus("wisdom", -10);
   return;
  }
 
 
 
void do_dumb(object ob)
  {
   
//Done to reflect the fact that dealing with demons is inherently
//dangerous and not to be attempted by the weak of will.
//Zaknaifen
   
   
   message("my_action",
      "%^RED%^"
      "You are engulfed in flame as you lose control of the summoning "
      "process!%^RESET%^ ", ob);
   message("other_action", 
       "%^RED%^"+
       (string)ob->query_cap_name()+" screams as "+
       (string)ob->query_subjective()+" is engulfed in flames! "
       "You hear the sound of cackling as the flames wink out of " 
       "existance. ", environment(ob), ob);
   ob->do_damage("torso", random(30)+50);
   return;
  }
 
 
void help()
  {
   message("info",
     "\n"
     "%^RED%^                            -=Drain=-%^RESET%^\n\n"
     "Calls upon the demons of the nether realms to act as "
     "a conduit for magic power, enabling the caster to transfer "
     "the magic contained in items into his/her own body. "
     "The process is not for the dull-witted, or those without "
     "faith.\n"
     "\n%^RED%^"
     "Syntax:  drain <item_name>%^RESET%^\n", this_player());
  }