dsIIr4/bin/
dsIIr4/extra/creremote/
dsIIr4/extra/wolfpaw/
dsIIr4/lib/cmds/admins/
dsIIr4/lib/cmds/common/
dsIIr4/lib/cmds/creators/include/
dsIIr4/lib/cmds/creators/include/SCCS/
dsIIr4/lib/daemon/services/
dsIIr4/lib/doc/
dsIIr4/lib/domains/Ylsrim/
dsIIr4/lib/domains/Ylsrim/adm/
dsIIr4/lib/domains/Ylsrim/armor/
dsIIr4/lib/domains/Ylsrim/broken/
dsIIr4/lib/domains/Ylsrim/fish/
dsIIr4/lib/domains/Ylsrim/meal/
dsIIr4/lib/domains/Ylsrim/npc/
dsIIr4/lib/domains/Ylsrim/virtual/
dsIIr4/lib/domains/Ylsrim/weapon/
dsIIr4/lib/domains/campus/adm/
dsIIr4/lib/domains/campus/etc/
dsIIr4/lib/domains/campus/meals/
dsIIr4/lib/domains/campus/npc/
dsIIr4/lib/domains/campus/save/
dsIIr4/lib/domains/campus/txt/
dsIIr4/lib/domains/campus/txt/ai/charles/
dsIIr4/lib/domains/campus/txt/ai/charles/bak2/
dsIIr4/lib/domains/campus/txt/ai/charles/bak2/bak1/
dsIIr4/lib/domains/campus/txt/ai/charly/
dsIIr4/lib/domains/campus/txt/ai/charly/bak/
dsIIr4/lib/domains/campus/txt/jenny/
dsIIr4/lib/domains/default/creator/
dsIIr4/lib/domains/default/doors/
dsIIr4/lib/domains/default/etc/
dsIIr4/lib/domains/default/virtual/
dsIIr4/lib/domains/default/weap/
dsIIr4/lib/domains/town/virtual/
dsIIr4/lib/lib/comp/
dsIIr4/lib/lib/lvs/
dsIIr4/lib/lib/user/
dsIIr4/lib/lib/virtual/
dsIIr4/lib/log/
dsIIr4/lib/obj/book_source/
dsIIr4/lib/obj/include/
dsIIr4/lib/realms/template/
dsIIr4/lib/realms/template/adm/
dsIIr4/lib/realms/template/area/armor/
dsIIr4/lib/realms/template/area/npc/
dsIIr4/lib/realms/template/area/obj/
dsIIr4/lib/realms/template/area/room/
dsIIr4/lib/realms/template/area/weap/
dsIIr4/lib/realms/template/bak/
dsIIr4/lib/realms/template/cmds/
dsIIr4/lib/save/
dsIIr4/lib/save/kills/o/
dsIIr4/lib/secure/cfg/classes/
dsIIr4/lib/secure/cmds/creators/include/
dsIIr4/lib/secure/cmds/players/
dsIIr4/lib/secure/cmds/players/include/
dsIIr4/lib/secure/daemon/include/
dsIIr4/lib/secure/lib/
dsIIr4/lib/secure/lib/include/
dsIIr4/lib/secure/lib/net/include/
dsIIr4/lib/secure/lib/std/
dsIIr4/lib/secure/modules/
dsIIr4/lib/secure/npc/
dsIIr4/lib/secure/obj/include/
dsIIr4/lib/secure/room/
dsIIr4/lib/secure/save/
dsIIr4/lib/secure/save/boards/
dsIIr4/lib/secure/save/players/g/
dsIIr4/lib/secure/tmp/
dsIIr4/lib/secure/verbs/creators/
dsIIr4/lib/shadows/
dsIIr4/lib/spells/
dsIIr4/lib/std/board/
dsIIr4/lib/std/lib/
dsIIr4/lib/tmp/
dsIIr4/lib/verbs/admins/include/
dsIIr4/lib/verbs/common/
dsIIr4/lib/verbs/common/include/
dsIIr4/lib/verbs/creators/include/
dsIIr4/lib/verbs/players/include/SCCS/
dsIIr4/lib/verbs/rooms/
dsIIr4/lib/verbs/rooms/include/
dsIIr4/lib/www/
dsIIr4/v22.2b14-dsouls2/
dsIIr4/v22.2b14-dsouls2/ChangeLog.old/
dsIIr4/v22.2b14-dsouls2/Win32/
dsIIr4/v22.2b14-dsouls2/compat/
dsIIr4/v22.2b14-dsouls2/compat/simuls/
dsIIr4/v22.2b14-dsouls2/include/
dsIIr4/v22.2b14-dsouls2/mudlib/
dsIIr4/v22.2b14-dsouls2/testsuite/
dsIIr4/v22.2b14-dsouls2/testsuite/clone/
dsIIr4/v22.2b14-dsouls2/testsuite/command/
dsIIr4/v22.2b14-dsouls2/testsuite/data/
dsIIr4/v22.2b14-dsouls2/testsuite/etc/
dsIIr4/v22.2b14-dsouls2/testsuite/include/
dsIIr4/v22.2b14-dsouls2/testsuite/inherit/
dsIIr4/v22.2b14-dsouls2/testsuite/inherit/master/
dsIIr4/v22.2b14-dsouls2/testsuite/log/
dsIIr4/v22.2b14-dsouls2/testsuite/single/
dsIIr4/v22.2b14-dsouls2/testsuite/single/tests/compiler/
dsIIr4/v22.2b14-dsouls2/testsuite/single/tests/efuns/
dsIIr4/v22.2b14-dsouls2/testsuite/single/tests/operators/
dsIIr4/v22.2b14-dsouls2/testsuite/u/
dsIIr4/v22.2b14-dsouls2/tmp/
dsIIr4/win32/
/*    /cmds/players/wimpy.c
 *    from the Dead Souls V Object Library
 *    wimpy NUM
 *    wimpy STR
 *    created by Descartes of Borg 960113
 */

#include <lib.h>
#include <message_class.h>

inherit LIB_DAEMON;

mixed cmd(string args) {
    int percentage;
    string cmd;

    if( !args || args == "" ) {
	percentage = (int)this_player()->GetWimpy();
	cmd = (string)this_player()->GetWimpyCommand();
	if( !percentage )
	    this_player()->eventPrint("You have wimpy turned off.", MSG_SYSTEM);
	else this_player()->eventPrint("Percentage: " + percentage + "%\n"
	      "Command: " + cmd, MSG_SYSTEM);
	return 1;
    }
    if( args == "0" ) {
	percentage = 0;
	cmd = 0;
    }
    else if( percentage = to_int(args) ) cmd = 0;
    else if( args == "on" ) {
	percentage = 23;
	cmd = 0;
    }
    else if( args == "off" ) {
	percentage = 0;
	cmd = 0;
    }
    else {
	percentage = 0;
	cmd = args;
    }
    if( !cmd ) {
	if( !percentage ) {
	    this_player()->SetWimpy(0);
	    this_player()->eventPrint("Wimpy is now off!  You are so brave!",
	      MSG_SYSTEM);
	    return 1;
	}
	if( percentage > 30 ) {
	    this_player()->eventPrint("You may not set wimpy greater than "
	      "30%.", MSG_SYSTEM);
	    return 1;
	}
	else if( percentage < 1 ) return "That is not a valid percentage!";
	this_player()->SetWimpy(percentage);
	if( percentage > 20 ) {
	    this_player()->eventPrint("What a weenie!  Get some backbone!",
	      MSG_SYSTEM);
	    return 1;
	}
	else if( percentage > 10 ) {
	    this_player()->eventPrint("You are the cautious one!", MSG_SYSTEM);
	    return 1;
	}
	else {
	    this_player()->eventPrint("You are brave, but not foolish!",
	      MSG_SYSTEM);
	    return 1;
	}
    }
    this_player()->SetWimpyCommand(cmd);
    this_player()->eventPrint("You will execute the command: \"" + cmd +
      "\" next time you wimpy.", MSG_SYSTEM);
    return 1;
}

string GetHelp(string str) {
    return ("Syntax: <wimpy>\n"
      "        <wimpy on>\n"
      "        <wimpy off>\n"
      "        <wimpy PERCENTAGE>\n"
      "        <wimpy COMMAND>\n\n"
      "Wimpy is a system that allows you to automatically execute "
      "a command when your health points get below a certain percentage "
      "of your maximum health points.  The wimpy command allows you "
      "to set which command will be used at which percentage.  "
      "The \"on\" and \"off\" arguments are simply quick ways to "
      "set the percentage to 23% and 0% respectively.  You cannot "
      "Set yourself to wimpy at anything greater than 30%.\n"
      "If you set go and enter commands, for example:\n"
      "\tgo west\n"
      "the wimpy system will first try to use that command, and if it "
      "fails, it will search for an exit in the room to take.  If "
      "you set another command as your wimpy command, however, other "
      "than a go or enter, it will not make any attempt to execute "
      "some other command.\n"
      "For example, if you issued the command:\n"
      "\twimpy gate to Mystery Person\n"
      "so that \"gate to Mystery Person\" was your wimpy command, "
      "the wimpy system would try to execute that command when you "
      "wimpy and will not try any other command, even if the gate "
      "fails (too low on mp, Mystery Person is not online, etc.).\n"
      "Without any arguments, the wimpy command displays your current "
      "settings.\n\n"
      "See also: attack, status");
}