feasts.c
feasts.c · 3.9 KB
From the archive feasts.zip
Download the archive « Back to the archive contents
/***************************************************************************
_____ __ __ __ __
/ _ \/ \ / \/ \ / \
/ /_\ \ \/\/ /\ \/\/ /
/ | \ / \ /
\____|__ /\__/\ / \__/\ /
\/ \/ \/
As the Wheel Weaves based on ROM 2.4. Original code by Dalsor.
See changes.log for a list of changes from the original ROM code.
Credits for code created by other authors have been left
intact at the head of each function.
Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,
Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.
Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael
Chastain, Michael Quan, and Mitchell Tse.
In order to use any part of this Merc Diku Mud, you must comply with
both the original Diku license in 'license.doc' as well the Merc
license in 'license.txt'. In particular, you may not remove either of
these copyright notices.
Much time and thought has gone into this software and you are
benefitting. We hope that you share your changes too. What goes
around, comes around.
ROM 2.4 is copyright 1993-1998 Russ Taylor
ROM has been brought to you by the ROM consortium
Russ Taylor (rtaylor@hypercube.org)
Gabrielle Taylor (gtaylor@hypercube.org)
Brian Moore (zump@rom.org)
By using this code, you have agreed to follow the terms of the
ROM license, in the file Rom24/doc/rom.license
***************************************************************************/
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#include <sys/time.h>
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "aww.h"
#include "interp.h"
#include "feast.h"
#define MAX_FEAST_FOODS 70
void do_feast( CHAR_DATA *ch, char *argument )
{
int foods, randFoods, plate;
OBJ_DATA *platter;
OBJ_DATA *table;
if ( !is_number( argument ) )
{
stc( "Create how many foods? (1-100)\n\r", ch );
return;
}
foods = atoi( argument );
if ( foods <= 0 || foods > 100 )
{
stc( "That won't work.\n\r", ch );
return;
}
table = create_object( get_obj_index( OBJ_VNUM_GEM ), 0 );
free_string( table->short_descr );
table->short_descr = str_dup( "a long banquet table" );
free_string( table->description );
table->description = str_dup( "Here sits a long banquet table, laden with food." );
free_string( table->name );
table->name = str_dup( "long banquet table" );
free_string( table->material );
table->material = str_dup( "hard wood" );
table->item_type = ITEM_CONTAINER;
table->value[0] = 1000;
table->value[1] = CONT_PUT_ON;
table->value[3] = 1000;
obj_to_room( table, ch->in_room );
for ( plate = 0; plate < foods; plate++ )
{
randFoods = number_range( 1, MAX_FEAST_FOODS );
platter = create_object( get_obj_index( OBJ_VNUM_GEM ), 0 );
platter->item_type = ITEM_FOOD;
free_string( platter->short_descr );
platter->short_descr = str_dup( FeastFoodTable[randFoods-1].shortd );
free_string( platter->description );
platter->description = str_dup( FeastFoodTable[randFoods-1].longd );
free_string( platter->name );
platter->name = str_dup( FeastFoodTable[randFoods-1].name );
free_string( platter->material );
platter->material = str_dup( "delicious looking ingredients" );
platter->value[0] = FeastFoodTable[randFoods-1].hours;
platter->value[1] = FeastFoodTable[randFoods-1].hours;
obj_to_obj( platter, table );
ptc( ch, "Created (%d) %s.\n\r", randFoods, platter->short_descr );
}
ptc( ch, "Created %s and stocked it with %d foods.\n\r",
table->short_descr, foods );
act( "A long table laden with food appears in the room.", ch, NULL, NULL, TO_ROOM );
tail_chain();
}