Trivia.how explains how to add Trivia to a ROM style MUD.


BEFORE YOU START!

And I quote:

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 you're in doubt as to whether the licenses apply to you, then
chances are they do.


Step1: Add the following to files specified.

-- Merc.h, Mud.h, or whatever your primary header is. Mine is aww.h

typedef struct  trivia_data         TRIVIA_DATA;
struct  trivia_data
{
	bool   running;
	char  *question;
	char  *answer;
	sh_int reward;
	sh_int qnumber;
	sh_int timer;
};
void do_trivia args(( CHAR_DATA *ch, char*argument ));
extern TRIVIA_DATA *trivia;

-- Db.c

TRIVIA_DATA * trivia;

- Add this in boot_db

trivia = (TRIVIA_DATA *) malloc (sizeof(TRIVIA_DATA));
trivia->running = FALSE;
trivia->question = NULL;
trivia->answer = NULL;
trivia->reward = 0;;
trivia->qnumber = 0;

-- Update.c

- Add this in update_handler after violence_update

if ( trivia->running )
trivia_update();

-- Trivia.c

Change the include for aww.h to your primary header

Step2: Add trivia.o to your Makefile
Step3: Populate trivia.h with LOTS of questions. Recommend 500-1000 questions.
Step4: Make Clean
Step5: Reboot and Trivia Open

Things to consider:
-------------------
Add a help file for Trivia according to the questions your system will ask.
I've made no effort to add one here, as the basic how-to is given when a
character types Trivia without an argument.

Add a method to turn Trivia off for characters who don't want to get the
Trivia messages.

Change the Trivia messages so that they fit your MUD.

Please don't claim this as your code. I wrote it, de-bugged it, and released
it so you and yours' can have fun with it. I'm not asking for credit in your
help files, your snippet files, an email, or anything beyond enjoying this
snippet. Just don't say you wrote it when you didn't. I've seen an alarming
number of claims that someone else 'wrote' my homes code, or my smithing code,
or my whatever code, and it's just plain irritating. If you change it, great!
If you make it better, wonderful! But I wrote it.

Help Me!?!?!
------------
More than glad to. Drop me an email at dalsor@cfl.rr.com or log onto my MUD
at www.aww-mud.org:6500 and say that you need help with a Dalsor snippet for
your MUD. If for some reason you can't reach me via either of these means,
I frequent www.kyndig.com on the Coder's board.