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/
//	_pick.c
//	Rogue ability
//	created 04 November 1992 by Descartes of Borg

#include <std.h>

inherit DAEMON;

int cmd_pick(string str) {
    object ob, tp;
    int steal, resist;
    int platinum, gold, electrum, silver, copper;

    tp = this_player();
    if(tp->query_ghost()) {
	notify_fail("You cannot do that in your immaterial state.\n");
	return 0;
    }
    if(environment(this_player())->query_property("no steal")) {
	notify_fail("A magic force prevents you from doing that.\n");
	return 0;
    }
    if(!str) {
	notify_fail("Pick whom?\n");
	return 0;
    }
    if(tp->query_current_attacker()) {
	notify_fail("You can't do that while in combat!\n");
	return 0;
    }
    ob = present(str, environment(tp));
    if(!ob) ob = parse_objects(environment(tp), str);
    if(!ob) {
	notify_fail("No "+str+" here!\n");
	return 0;
    }
    if(!living(ob)) {
	notify_fail(capitalize(str)+" is not a living thing!\n");
	return 0;
    }
    if(creatorp(ob)) {
	notify_fail("That is not adviseable.\n");
	return 0;
    }
    if(ob->is_player() && !interactive(ob)) return 0;
    if(ob==tp) {
	notify_fail("You cannot pick your own purse!\n");
	return 0;
    }
    if(tp->query_disable()) return 1;
    tp->set_disable();
    steal = (int)tp->query_skill("stealing");
    resist = (int)ob->query_skill("stealing");
    resist += (int)ob->query_stats("dexterity");
    steal -= random(resist);
    if(steal <10) {
	write("You utterly fail in your attempt to pick from "+ob->query_cap_name()+".");
	tell_object(ob, "You catch "+tp->query_cap_name()+" trying to pick your purse!");
	tell_room(environment(tp), "You notice "+tp->query_cap_name()+" trying to pick "+ob->query_cap_name()+"'s purse!", ({ ob, tp }));
	if((string)ob->query_class() != "rogue") {
	    ob->add_skill_points("stealing", random(10));
	    ob->add_alignment(-2);
	}
	if(!ob->is_player()) ob->kill_ob(tp, 0);
	return 1;
    }
    steal = random(steal);
    if(steal < 10) {
	write("You fail in your attempt to pick from "+ob->query_cap_name()+".");
	tell_room(environment(tp), "You notice "+tp->query_cap_name()+" attempt to pick "+ob->query_cap_name()+"'s purse.", ({tp, ob}) );
	if((string)ob->query_class() != "rogue") {
	    ob->add_skill_points("stealing", 10);
	    ob->add_alignment(-5);
	}
	return 1;
    }
    if(steal < 20) {
	write("You fail in your attempt to pick from "+ob->query_cap_name()+".");
	if((string)ob->query_class() != "rogue") {
	    ob->add_skill_points("stealing", 15);
	    ob->add_alignment(-10);
	}
	return 1;
    }
    platinum = (int)ob->query_money("platinum");
    gold = (int)ob->query_money("gold");
    electrum = (int)ob->query_money("electrum");
    silver = (int)ob->query_money("silver");
    copper = (int)ob->query_money("copper");
    if(!platinum && !gold && !electrum && !silver && !copper) {
        tp->add_skill_points("stealing",20);
        tp->add_alignment(-15);
	notify_fail(ob->query_cap_name()+" is flat broke!\n");
	return 0;
    }
    platinum = (steal*(platinum/10))/100;
    gold = (steal*(gold/10))/100;
    electrum = (steal*(electrum/10))/100;
    silver = (steal*(silver/10))/100;
    copper = (steal*(copper/10))/100;
    if(!platinum && !gold && !silver && !electrum && !copper) {
	write("You fail to get anything from "+ob->query_cap_name()+"'s purse.");
	if((string)ob->query_class() != "rogue") {
	    tp->add_skill_points("stealing", 20);
	    tp->add_alignment(-15);
	}
	return 1;
    }
    ob->add_money("platinum", -platinum);
    ob->add_money("gold", -gold);
    ob->add_money("electrum", -electrum);
    ob->add_money("silver", -silver);
    ob->add_money("copper", -copper);
    tp->add_money("platinum", platinum);
    tp->add_money("gold", gold);
    tp->add_money("electrum", electrum);
    tp->add_money("silver", silver);
    tp->add_money("copper", copper);
    write("You pick some money from "+ob->query_cap_name()+"'s purse.");
    gold = gold + platinum*10 + electrum/10 + silver/50 + copper/100;
    if((int)tp->query_skill("stealing") > random(101)) {
	if((string)ob->query_class() == "rogue") return 1;
	tp->add_skill_points("stealing", 20+gold);
	tp->add_exp(20);
	tp->add_alignment(-20);
	return 1;
    }
    tell_object(ob, "You feel someone brush up against you.");
    if((string)ob->query_class() == "rogue") return 1;
    tp->add_skill_points("stealing", random(gold+20));
    tp->add_exp(20);
    tp->add_alignment(-20);
    return 1;
}

void help() {
    write("Syntax: <pick [living]>\n\n"+
	"Picks the pocket of the living being named as a target.\n");
}