Installation stuff for quest code.
--------------------------------------
------------------------------------------------------------------
/* 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)
*/
----------------------------------------------
In another post, I will post the actual quest.c file.
--------------------------------------
------------------------------------------------------------------
/* 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)
*/
----------------------------------------------
In another post, I will post the actual quest.c file.