SPECIAL(pop_dispenser) { struct obj_data *obj = me, *drink; int give_coke = 1206; /* Vnum of the can of coke */ if (CMD_IS("list")) { send_to_char("To buy a coke, type 'buy coke'.\r\n", ch); return (TRUE); } else if (CMD_IS("buy")) { if (GET_GOLD(ch) < 25) { send_to_char("You don't have enough gold!\r\n", ch); return (TRUE); } else { drink = read_object(give_coke, VIRTUAL); obj_to_char(drink, ch); send_to_char("You insert your money into the machine\r\n",ch); GET_GOLD(ch) -= 25; /* coke costs 25 gold */ act("$n gets a pop can from $p.", FALSE, ch, obj, 0, TO_ROOM); send_to_char("You get a pop can from the machine.\r\n",ch); } return 1; } return 0; }