: Point transfer This gives your players the ability to transfer regenerable points to another character. The loss in transfer is depending on the players wisdome, high wis less loss. You might want to turn this into a skill. The loss will always be 100% if the receiver is fighting. -----------------------------[ Step One ]----------------------------- /* paste somewhere in act.other.c */ ACMD(do_transfer) { int amount, loss, percent; struct char_data *victim = NULL; char arg1[MAX_INPUT_LENGTH]; char arg2[MAX_INPUT_LENGTH]; char arg3[MAX_INPUT_LENGTH]; argument = two_arguments(argument, arg1, arg2); one_argument(argument, arg3); if (IS_NPC(ch)) { send_to_char("You are a monkey, Go Away!\r\n", ch); return; } if (!(victim = get_char_vis(ch, arg2, FIND_CHAR_ROOM))) { send_to_char("There is no such person.\r\n", ch); return; } if (IS_NPC(victim)) { send_to_char("There is no such person.\r\n", ch); return; } if (!*argument || (!*arg1 || (!*arg2 || (!*arg3)))) { send_to_char("Usage: transfer \r\n", ch); return; } if (victim == ch) { send_to_char("Now, that doesn't make sense, does it?\r\n", ch); return; } if (!str_cmp("hit", arg1) || !str_cmp("hitpoints", arg1)) { if ((amount = atoi(arg3)) <= 0) { send_to_char("How many hitpoints do you wish to transfer?\r\n", ch); return; } if (GET_HIT(ch) < amount) { send_to_char("You don't have that many hitpoints.\r\n", ch); return; } if (GET_HIT(victim) >= GET_MAX_HIT(victim)) { sprintf(buf, "%s is already at maxhealth.\r\n", GET_NAME(victim)); send_to_char(buf, ch); return; } if (amount + GET_HIT(victim) > GET_MAX_HIT(victim)) amount = GET_MAX_HIT(victim) - GET_HIT(victim); if (GET_WIS(ch) < number(0,40)) loss = number(0, amount); else loss = 0; if (FIGHTING(victim)) loss = amount; GET_HIT(ch) -= amount; GET_HIT(victim) += amount-loss; percent = (loss*100)/amount; sprintf(buf, "You transfer %d hitpoint%s to %s (%d%% loss).\r\n", amount, (amount == 1 ? "" : "s"), GET_NAME(victim), percent); send_to_char(buf, ch); sprintf(buf, "%s transfers %d hitpoint%s to you (%d%% loss).\r\n", GET_NAME(ch), amount, (amount == 1 ? "" : "s"), percent); send_to_char(buf, victim); if (GET_HIT(victim) >= GET_MAX_HIT(victim)) { sprintf(buf, "%s is now at full health.\r\n", GET_NAME(victim)); send_to_char(buf, ch); } } else if (!str_cmp("mana", arg1) || !str_cmp("magicpoints", arg1)) { if ((amount = atoi(arg3)) <= 0) { send_to_char("How many magic points do you wish to transfer?\r\n", ch); return; } if (GET_MANA(ch) < amount) { send_to_char("You don't have that many magic points.\r\n", ch); return; } if (GET_MANA(victim) >= GET_MAX_MANA(victim)) { sprintf(buf, "%s is already at maxmana.\r\n", GET_NAME(victim)); send_to_char(buf, ch); return; } if (amount + GET_MANA(victim) > GET_MAX_MANA(victim)) amount = GET_MAX_MANA(victim) - GET_MANA(victim); if (GET_WIS(ch) < number(0,40)) loss = number(0, amount); else loss = 0; if (FIGHTING(victim)) loss = amount; GET_MANA(ch) -= amount; GET_MANA(victim) += amount-loss; percent = (loss*100)/amount; sprintf(buf, "You transfer %d magic point%s to %s (%d%% loss).\r\n", amount, (amount == 1 ? "" : "s"), GET_NAME(victim), percent); send_to_char(buf, ch); sprintf(buf, "%s transfers %d magic point%s to you (%d%% loss).\r\n", GET_NAME(ch), amount, (amount == 1 ? "" : "s"), percent); send_to_char(buf, victim); if (GET_MANA(victim) >= GET_MAX_MANA(victim)) { sprintf(buf, "%s is now at full mana.\r\n", GET_NAME(victim)); send_to_char(buf, ch); } } else if (!str_cmp("move", arg1) || !str_cmp("movementpoints", arg1)) { if ((amount = atoi(arg3)) <= 0) { send_to_char("How many movement points do you wish to transfer?\r\n", ch); return; } if (GET_MOVE(ch) < amount) { send_to_char("You don't have that many movement points.\r\n", ch); return; } if (GET_MOVE(victim) >= GET_MAX_MOVE(victim)) { sprintf(buf, "%s is already at maxmove.\r\n", GET_NAME(victim)); send_to_char(buf, ch); return; } if (amount + GET_MOVE(victim) > GET_MAX_MOVE(victim)) amount = GET_MAX_MOVE(victim) - GET_MOVE(victim); if (GET_WIS(ch) < number(0,40)) loss = number(0, amount); else loss = 0; if (FIGHTING(victim)) loss = amount; GET_MOVE(ch) -= amount; GET_MOVE(victim) += amount-loss; percent = (loss*100)/amount; sprintf(buf, "You transfer %d movement point%s to %s (%d%% loss).\r\n", amount, (amount == 1 ? "" : "s"), GET_NAME(victim), percent); send_to_char(buf, ch); sprintf(buf, "%s transfers %d movement point%s to you (%d%% loss).\r\n", GET_NAME(ch), amount, (amount == 1 ? "" : "s"), percent); send_to_char(buf, victim); if (GET_MOVE(victim) >= GET_MAX_MOVE(victim)) { sprintf(buf, "%s is now at full move.\r\n", GET_NAME(victim)); send_to_char(buf, ch); } } else { send_to_char("Usage: transfer \r\n", ch); return; }} -----------------------------[ Step Two ]----------------------------- /* in file interpreter.c */ /* paste UNDER the stock ACMD(do_trans); */ ACMD(do_transfer); /* search and paste UNDER { "transfer" */ { "transfer" , POS_STANDING, do_transfer , 0, 0 }, ---------------------------------------------------------------------- Do whatever you want with this piece of code. Enjoy it, hate it, smash it, remake it...... If you decide to use it, please send me a mail, including the address to your mud. A line in your credit file is of course also appreciated / Hugor (hugor@freebox.com)