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/
#include <std.h>
//#include <str_fmt.h>
 
inherit DAEMON;
 
object ob;
 
void show_quests(object tp);
void money_display();
void stats_display();
void skills_display();
void language_display();
 
int cmd_stat(string str) {
   string name, title, Class, race, married, guild;
   int level, hp, max_hp, mp, max_mp, sp, max_sp, exp;
 
   if(!str) {
      notify_fail("stat <living>\n");
      return 0;
   }
   str = lower_case(str);
   if(!(ob = to_object(str)))
      if(!(ob = present(str, environment(this_player()))))
         if(!(ob = find_object(str))) {
      notify_fail("Failed to find: "+str+".\n");
      return 0;
   }
   if(!living(ob)) {
      notify_fail("That is not a living object.\n");
      return 0;
   }
    if(archp(ob) && (int)ob->query_invis())
      return notify_fail("Failed to find: "+str+".\n");
   title = (string)ob->query_short();
   Class = (string)ob->query_class();
   race = (string)ob->query_race();
   level = (int)ob->query_level();
   exp = (int)ob->query_exp();
   hp = (int)ob->query_hp();
   max_hp = (int)ob->query_max_hp();
   mp = (int)ob->query_mp();
   max_mp = (int)ob->query_max_mp();
   sp = (int)ob->query_sp();
   max_sp = (int)ob->query_max_sp();
   married = (string)ob->query_married();
   guild = (string)ob->query_guild();
 
   if(!married) married = "none";
   if(!guild) guild = "none";
   if(!race) race = "undefined";
   if(!Class) Class = "none";
   printf("%s\n", title);
   printf("%s%s%s\n",
      arrange_string("level: "+level, 25),
      arrange_string("class: "+Class, 25),
      arrange_string("race: "+race,25) );
   printf("%s%s%s\n",
      arrange_string("experience: "+exp, 25),
      arrange_string("alignment: "+ob->query_alignment(),25),
      arrange_string("sex: "+(string)ob->query_gender(), 25) );
   printf("%s%s%s\n",
      arrange_string(hp+"/"+max_hp+" health points", 25),
      arrange_string(sp+"/"+max_sp+" stamina points", 25),
      arrange_string(mp+"/"+max_mp+" magic points", 25) );
   printf("%s%s\n",
      arrange_string("carry: "+ob->query_encumbrance(), 25) ,
      arrange_string("max carry: "+ob->query_max_encumbrance(), 25) );
   printf("%s%s%s\n",
      arrange_string("quest points: "+(int)ob->query_quest_points(), 25),
      arrange_string("spouse: "+married, 25),
      arrange_string("guild: "+guild, 25) );
   if(ob->is_player()) {
      show_quests(ob);
   }
   money_display();
   language_display();
   stats_display();
   skills_display();
   return 1;
}
 
void show_quests(object tp) {
    string *quests;
    int i;
 
    quests = (string *)tp->query_quests();    message("Nwrite", "quests: ", this_player());
    for(i=0; i<sizeof(quests); i++) {
        message("Nwrite", quests[i]+" ", this_player());
    }
    message("Nwrite", "\n\n", this_player());
}

// added by Valodin to display language abilities, Aug. 27, 1993
void language_display() {
  string *langs;
  string ret;
  int i, lsz;

/*    langs = (string *)ob->query_all_languages();

    ret = "Languages: ";
    if(!(lsz = sizeof(langs))) ret += "None";
    else {
        for(i=0; i<lsz; i++) {
          ret += capitalize(langs[i]) + ": "+ ob->query_lang_prof(langs[i]) +
            (i== lsz -1 ? "." : (langs != lsz-2 ? ", " : ", and "));
        }
    }
    message("info", ret + "\n", this_player());
*/
}
 
void money_display() {
    string *currs;
    string borg;
    int i, tmp;
 
    currs = (string *)ob->query_currencies();
    if((!currs || !sizeof(currs)) ) {
        message("info", "No money.", this_player());
        return;
    }
    for(borg = "", i=0, tmp = sizeof(currs); i<tmp; i++) {
        borg += ((ob->query_money(currs[i]))+" "+currs[i]);
        if(i == tmp-1) borg +=(".\n");
        else if(tmp > 2 && i == tmp-2) borg += (", and ");
        else if(tmp == 2) borg +=(" and ");
        else borg +=(", ");
    }
    message("info", borg, this_player());
    return;
}
 
void skills_display() {
    string tmp, sign;
    string *attack, *weapon, *decep, *mag;
    int i, x, skill_size, blah;

    attack = ({ "melee", "attack", "defense", "double wielding" });
    weapon = ({ "knife", "blade", "blunt", "two handed", "projectile" });
    decep = ({ "locks", "stealth", "murder", "stealing", "bargaining" });
    mag = ({ "faith", "healing", "conjuring", "magic attack",
             "magic defense"});
 
    for(i=0; i<5; i++) {
        if(i<4) message("Nwrite", arrange_string(attack[i], 17)+": ", 
                        this_player());
        else message("Nwrite", arrange_string(" ", 19), this_player());
        if(i<4) tmp = ""+(int)ob->query_base_skill(attack[i]);
        else tmp = " ";
        tmp = arrange_string(tmp, 8);
        if(i<4) {
          blah = (int)ob->query_skill_bonus(attack[i]);
          if (blah >= 0)
            sign = "+";
          else
            sign = "-";
          tmp += " ("+sign+blah+")";
        } else 
          tmp = " ";
        message("Nwrite", arrange_string(tmp, 19), this_player());
        message("Nwrite", arrange_string(weapon[i], 17)+": ", this_player());
        tmp = arrange_string(""+(int)ob->query_base_skill(weapon[i]), 8);
        blah = (int)ob->query_skill_bonus(weapon[i]);
        if (blah >= 0)
          sign = "+";
        else
          sign = "-";
        tmp += " ("+sign+blah+")";
        write(arrange_string(tmp, 19));
    }
    write("------------------------------------------------------------------------------");
    for(i=0; i<5; i++) {
        message("Nwrite", arrange_string(decep[i], 17)+": ", this_player());
        tmp = arrange_string(""+(int)ob->query_base_skill(decep[i]),8);
        blah = (int)ob->query_skill_bonus(decep[i]);
        if (blah >= 0)
          sign = "+";
        else
          sign = "-";
        tmp += " ("+sign+blah+")";
        message("Nwrite", arrange_string(tmp, 19), this_player());
        message("Nwrite", arrange_string(mag[i], 17)+": ", this_player());
        tmp = arrange_string(""+(int)ob->query_base_skill(mag[i]),8);
        blah = (int)ob->query_skill_bonus(mag[i]);
        if (blah >= 0)
          sign = "+";
        else
          sign = "-";
        tmp += " ("+sign+blah+")";
        write(arrange_string(tmp, 19));
    }
    return;
}
 
void stats_display() {
    int i, stats_size;
    string *stats;
 
    stats = ({ "strength", "constitution", "dexterity", "charisma",
      "intelligence", "wisdom" });
    stats_size = sizeof(stats); /* speed patch by Val */
    for(i = 0; i < stats_size; i += 3) {
        message("Nwrite", arrange_string(stats[i], 13)+": ", this_player());
        message("Nwrite", (int)ob->query_stats(stats[i])+"     ", 
                this_player());
        if(i+1 >= stats_size) message("Nwrite", "\n", this_player());
        else {
            message("Nwrite", arrange_string(stats[i+1], 13)+": ", 
                    this_player());
            message("Nwrite", (int)ob->query_stats(stats[i+1])+"     ", 
                    this_player());
        }
        if(i+2 >= stats_size) message("Nwrite", "\n", this_player());
        else {
            message("Nwrite", arrange_string(stats[i+2], 13)+": ", 
                    this_player());
            message("Nwrite", (int)ob->query_stats(stats[i+2])+"     ",
                    this_player());
        }
        message("Nwrite", "\n", this_player());
    }
   message("Nwrite", "\n", this_player());
   return;
}

void help() {
    message("help",
      "Syntax: <stat [player]>\n\n"
      "Gives you vital information about a player or monster.", this_player());
}