Alright folks. Running rom24b6 in Cygwin. Most of you have heard from me before. Im getting nothing at all but grief when I try to add questing to my mud. *Growls and pulls hair out* I find the documentation and installation directions on it very very poorly done, and cannot understand half of it.
I send my plea to you all. If you can so kindly take a look at the code below, and please alter it with correct directions on where things go and what file they go in and where I would eternally be in your debt. Thanks.
----------------------------------------------------
------------------------------------------------------------------
/* Automated quest code originall written by Vassago (Who i'm giving
credit to despite the fact he gives no credit to the people who's code he
copies (aka the rom consortium).
Revamped by Kharas (mud@fading.tcimet.net) */
/* You need to add the following to pc_data:
sh_int quest_curr; /* current number of quest points */
int quest_accum; /* quest points accumulated in players life */
CHAR_DATA * questgiver; /* who gave the quest quest */
int questpoints;
int nextquest;
int countdown;
int questobj;
int questmob;
You need to #define PLR_QUESTING (??) in merc.h
Add a new spec_fun in special.c:
At the top add: DECLARE_SPEC_FUN( spec_questmaster );
In: const struct spec_type spec_table[] =
Add: { "spec_questmaster", spec_questmaster },
Add the following anywhere in special.c:
bool spec_questmaster( CHAR_DATA *ch )
{
return TRUE;
}
In fight.c, in the function group_gain, after all the stuff about
getting zapped by equipment, add the following:
if (!IS_NPC(gch) && IS_SET(gch->act,PLR_QUESTING )
&& IS_NPC(victim))
{
if (gch->pcdata->questmob == victim->pIndexData->vnum)
{
send_to_char("You have almost completed your quest!\n\r",gch);
send_to_char(
"Return to the questmaster before your time runs of time.\n\r",gch);
ch->pcdata->questmob = -1;
}
}
....
In save.c you need add the following in fwrite_char:
fprintf( fp, "Quest_Curr %d\n", ch->pcdata->quest_curr );
fprintf( fp, "Quest_Accum %d\n", ch->pcdata->quest_accum );
if (ch->pcdata->nextquest != 0)
fprintf( fp, "QuestNext %d\n", ch->pcdata->nextquest );
else if (ch->pcdata->countdown != 0)
fprintf( fp, "QuestNext %d\n", 10 );
in fread_char, under case 'Q': you need to add:
KEY( "Quest_Curr", ch->pcdata->quest_curr, fread_number( fp ) );
KEY( "Quest_Accum", ch->pcdata->quest_accum, fread_number( fp ) );
KEY( "QuestNext", ch->pcdata->nextquest, fread_number( fp ));
You will also need to add quest_update(); in update.c right before/after
area_update();.
This was originally modified for my smaug mud, but I think i've changed
everything so it will work with rom. Go ahead and write me if ya have
problems (mud@fading.tcimet.net)
*/
----------------------------------------------------------
Thats the installation stuff. I find this very confusing for some reason. The rest of the code is quest.c and that I can install. Simple as adding quest.c to the src directory and adding the file in make I believe? Anyhow I'll post the code below. Beware, its long.
------------------------------------------------------
/* Real quest.c stuff.. above is just installation crud :) */
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include "mud.h"
struct reward_type
{
char *name;
char *keyword;
int cost;
bool object;
int value;
void * where;
};
/* Descriptions of quest items go here:
Format is: "keywords", "Short description", "Long description" */
const struct quest_desc_type quest_desc[] =
{
{"quest sceptre", "the Sceptre of Courage",
"The Sceptre of Courage is lieing here, waiting to be returned to its owner."},
{"quest crown", "the Crown of Wisdom",
"The Crown of Wisdom is lieing here, waiting to be returned to its owner."},
{"quest gauntlet", "the Gauntlets of Strength",
"The Gauntlets of Strength are lieing here, waiting to be returned to its owner."},
{NULL, NULL, NULL}
};
/* Local functions */
void generate_quest args(( CHAR_DATA *ch, CHAR_DATA *questman ));
void quest_update args(( void ));
bool quest_level_diff args(( int clevel, int mlevel));
------------------------------------
If you need to see the actual quest.c file please let me know. |