This is a little healing snippet I wrote up. I'm still a newbie coder, but there's no bugs in this that I've found. So, install, and enjoy. structs.h: --!Begin!-- #define ROOM_BFS_MARK (1 << 15) /* (R) breath-first srch mrk */ +#define ROOM_HEAL (1 << 16) /* Healing Room */ --!End!-- interpreter.c --!Begin!-- ACMD(do_help); +ACMD(do_heal); -------------------- { "help" , POS_DEAD , do_help , 0, 0 }, + { "heal" , POS_RESTING , do_heal , 0, 0 }, --!End!-- act.other.c: --!Begin!-- ACMD(do_gen_tog); +ACMD(do_heal); -------------------- /* Snippet Written by Cypress(Tatsutaka@aol.com) */ ACMD(do_heal) { int MANA = 0, HIT = 0, MOVE = 0; one_argument(argument, arg); if (!*argument) { act("What do you want to heal? HP, Mana, or Move?", TRUE, ch, 0, 0, TO_CHAR); act("Syntax: Heal ", TRUE, ch, 0, 0, TO_CHAR); act("Hp - 7000 Gold", TRUE, ch, 0, 0, TO_CHAR); act("Mana - 5000 Gold", TRUE, ch, 0, 0, TO_CHAR); act("Move - 11000 Gold", TRUE, ch, 0, 0, TO_CHAR); } /*------------------------------------------*/ /*-------------------Mana-------------------*/ /*------------------------------------------*/ if (!str_cmp(arg,"mana") && !IS_SET(ROOM_FLAGS(ch->in_room), ROOM_HEAL)) { send_to_char("You're not in a healing room!\r\n", ch); return; } if (!str_cmp(arg,"mana") && GET_GOLD(ch) < 5000) { act("&15You don't have the gold to heal!&00", TRUE, ch, 0, 0, TO_CHAR); } if (!str_cmp(arg,"mana") && GET_MANA(ch) >= GET_MAX_MANA(ch)) { act("Your mana is already at is max!", TRUE, ch, 0, 0, TO_CHAR); return; } else if (!str_cmp(arg,"mana") && GET_MANA(ch) < GET_MAX_MANA(ch) && GET_GOLD(ch) >= 5000) { send_to_char("You restore your Mana.", ch); act("$n restores $s Mana.", TRUE, ch, 0, 0, TO_ROOM); MANA = number(1, 200); GET_MANA(ch) = GET_MAX_MANA(ch); GET_GOLD(ch) = GET_GOLD(ch) - 5000; return; } /*------------------------------------------*/ /*-------------------Move-------------------*/ /*------------------------------------------*/ if (!str_cmp(arg,"move") && !IS_SET(ROOM_FLAGS(ch->in_room), ROOM_HEAL)) { send_to_char("You're not in a healing room!\r\n", ch); return; } if (!str_cmp(arg,"move") && GET_GOLD(ch) < 11000) { act("You don't have the gold to heal!", TRUE, ch, 0, 0, TO_CHAR); } if (!str_cmp(arg,"move") && GET_MOVE(ch) >= GET_MAX_MOVE(ch)) { act("Your move energy is already at it's max!", TRUE, ch, 0, 0, TO_CHAR); return; } else if (!str_cmp(arg,"move") && GET_MOVE(ch) < GET_MAX_MOVE(ch) && GET_GOLD(ch) >= 11000) { send_to_char("You restore your Move Energy.", ch); act("$n restores $s Energy.", TRUE, ch, 0, 0, TO_ROOM); MOVE = number(1, 200); GET_MOVE(ch) = GET_MAX_MOVE(ch); GET_GOLD(ch) = GET_GOLD(ch) - 11000; return; } /*------------------------------------------*/ /*-------------------Hitp-------------------*/ /*------------------------------------------*/ if (!str_cmp(arg,"hp") && !IS_SET(ROOM_FLAGS(ch->in_room), ROOM_HEAL)) { send_to_char("You're not in a healing room!\r\n", ch); return; } if (!str_cmp(arg,"hp") && GET_GOLD(ch) < 7000) { act("You don't have the gold to heal!", TRUE, ch, 0, 0, TO_CHAR); } if (!str_cmp(arg,"hp") && GET_HIT(ch) >= GET_MAX_HIT(ch)) { act("Your HP is already at it's max!", TRUE, ch, 0, 0, TO_CHAR); return; } else if (!str_cmp(arg,"hp") && GET_HIT(ch) < GET_MAX_HIT(ch) && GET_GOLD(ch) >= 7000) { send_to_char("You restore your Hp.", ch); act("$n restores $s Hp.", TRUE, ch, 0, 0, TO_ROOM); HIT = number(1, 200); GET_HIT(ch) = GET_MAX_HIT(ch); GET_GOLD(ch) = GET_GOLD(ch) - 7000; return; } } --!End!-- oasis.h --!Begin!-- /* * Macros, defines, structs and globals for the OLC suite. You will need * to adjust these numbers if you ever add more. */ -#define NUM_ROOM_FLAGS 16 +#define NUM_ROOM_FLAGS 17 --!End!-- constants.c --!Begin!-- "*", /* BFS MARK */ + "Healing Room", --!End!-- Compile, and you're done! This was tested and works for Circle30bpl19, I don't know what it'll do to your MUD, and I will not be held responsible for what it does. If you use this code, drop me a line at Tatsutaka@aol.com, including your name, your MUD's name, it's hostname(Or IP), and port. And don't be surprised to see someone named Cypress to come on your MUD. :) (Cypress)