/* A spy skill written by Eric V. Bahmer Raptor of MultiMUD and world of pain . basically all you need to do is put this in act.other.c and fill in the acmd protos in interpreter.c, define the skill in spells.h and assign it to a class in class.c, put it in spell_parser.c next to the other skills I wrote this when i got bored one day feel free to use it but keep my name in the comment block before the actual code. far as I know there shouldn't be any bugs. */ ACMD(do_spy) { int percent, prob, spy_type, return_room; char *spy_dirs[] = { "north", "east", "south", "west", "up", "down", "\n" }; /* 101% is a complete failure */ percent = number(1, 101); prob = GET_SKILL(ch, SKILL_SPY); spy_type = search_block(argument + 1, spy_dirs, FALSE); if (spy_type < 0 || !EXIT(ch, spy_type) || EXIT(ch, spy_type)->to_room == NOWHERE) { send_to_char("Spy where?\r\n", ch); return; } else { if (!(GET_MOVE(ch) >= 5)) { send_to_char("You don't have enough movement points.\r\n", ch); } else { if (percent > prob) { send_to_char("You suck! You need more practice!!\r\n", ch); GET_MOVE(ch) = MAX(0, MIN(GET_MAX_MOVE(ch), GET_MOVE(ch) - 2)); } else { if (IS_SET(EXIT(ch, spy_type)->exit_info, EX_CLOSED) && EXIT(ch, spy_type)->keyword) { sprintf(buf, "The %s is closed.\r\n", fname(EXIT(ch, spy_type)->keyword)); send_to_char(buf, ch); GET_MOVE(ch) = MAX(0, MIN(GET_MAX_MOVE(ch), GET_MOVE(ch) - 2)); } else { GET_MOVE(ch) = MAX(0, MIN(GET_MAX_MOVE(ch), GET_MOVE(ch) - 5)); return_room = ch->in_room; char_from_room(ch); char_to_room(ch, world[return_room].dir_option[spy_type]->to_room); send_to_char("You spy into the next room and see: \r\n\r\n", ch); look_at_room(ch, 1); char_from_room(ch); char_to_room(ch, return_room); act("$n peeks into the next room.", TRUE, ch, 0, 0, TO_NOTVICT); } } } } }