From: David A. Carver <DCARVER@cougar.colstate.cc.oh.us>
Subject: Staff And Wand Recharger

Remember to assign the object the spec_proc in 'spec_assign.c'  This can
easily be modified for use with a MOB if you prefer.  You will also need
to add the RECHARGE command to 'interpreter.c' as a 'do_not_here' command.

Add this special below in 'spec_proc.c'

SPECIAL(recharger)
{
  char buf[MAX_STRING_LENGTH];
  struct obj_data *obj;
  int maxcharge = 0, mincharge = 0, chargeval = 0;

  if (CMD_IS("list"))
  {
    send_to_char("You may use the SWEET machine to recharge a staff or wand.\r\n", ch);
    send_to_char("It costs 10000 coins to recharge a staff or wand.\r\n", ch);
    send_to_char("To recharge and item type: 'recharge <staff or wand>'.\r\n", ch);
    return (TRUE);
  } else
    if (CMD_IS("recharge")) {
    argument = one_argument(argument, buf);

    if (!(obj = get_obj_in_list_vis(ch, buf, ch->carrying)))
    {
      send_to_char("You don't have that!\r\n", ch);
      return (TRUE);
    }
    if (GET_OBJ_TYPE(obj) != ITEM_STAFF &&
        GET_OBJ_TYPE(obj) != ITEM_WAND)
    {
      send_to_char("Are you daft!  You can't recharge that!\r\n", ch);
      return (TRUE);
    }
    if (GET_GOLD(ch) < 10000) {
      send_to_char("You don't have enough gold!\r\n", ch);
      return (TRUE);
    }
    maxcharge = GET_OBJ_VAL(obj, 1);
    mincharge = GET_OBJ_VAL(obj, 2);

    if (mincharge < maxcharge)
    {
     chargeval = maxcharge - mincharge;
     GET_OBJ_VAL(obj, 2) += chargeval;
     GET_GOLD(ch) -= 10000;
     send_to_char("Grrrr... Hmmmmm... Belch... BING!\r\n",ch);
     sprintf(buf, "The item now has %d charges remaining.\r\n", maxcharge);
     send_to_char(buf, ch);
     act("The machine hums and churns as it recharges the item.",
          FALSE, ch, obj, 0, TO_ROOM);
     }
   else
     {
     send_to_char("The item does not need recharging.\r\n", ch);
     act("The machine hums, churns, and then goes quiet.",
         FALSE, ch, obj, 0, TO_ROOM);
     }
    return 1;
  }
  return 0;
}
