Re: autoquest code

From: Eduo - Tempus Fugit Pseudo Admin (mud@SPARC.CIATEQ.CONACYT.MX)
Date: 08/15/97


On Fri, 15 Aug 1997, Snow Man wrote:

>  I have added the autoquest code for the circlemud that was posted on
> the list a while back.. yet I can not get it to work... I have added all
> there is plus! I goto type medit (mob number) and I goto the mob_flags
> and MOB_QUESTMASTER and MOB_QUEST arent on the list yet there in the
> code.. the code compiles fine...

---

From a previous post:

---


Date: Wed, 2 Jul 1997 15:32:28 -0600 (CST)
From: Eduo - Tempus Fugit Pseudo Admin <mud@sparc.ciateq.conacyt.mx>
To: Alex <fletcher@cspo.queensu.ca>
Subject: Quest code additions.


Hiya!

I was segint he quest code in the snippets page and saw it missed some
instructions:

Let's see...

This is all you need to get the autoquest system to compile, you still
need to create 5 objects rewards 1250, 1251, 1252, 1253 and 1254 and also
5 quest items 1256, 1257, 1258, 1259 and 1260. Create a mob and flag it
MOB_QUESTMASTER and flag some mobs around your world MOB_QUEST and you are
all ready to go :)

 Makefile
 --------

Under "OBJFILES =" add:

+  quest.obj

and under # Dependencies for the object files (automagically generated
with
          # gcc -MM)

+  quest.obj: quest.c conf.h sysdep.h structs.h utils.h handler.h
interpreter.h comm.h db.h
+       $(CC) -c $(CFLAGS) quest.c

 Comm.c
 ------

In "void heartbeat" add the following line to be called each minute:

+ quest_update();  // LJ autoquest


 Fight.c
 -------

Under /* External structures */ add:

+ extern struct index_data *mob_index;  /* LJ autoquest */

In "void damage" right after:

=  if (GET_POS(victim) == POS_DEAD) {

add:

+  if (PLR_FLAGGED(ch,PLR_QUESTOR) && IS_NPC(victim)) {  /* LJ autoquest
*/
+    if (GET_QUESTMOB(ch) == GET_MOB_VNUM(victim)) {
+      send_to_char("You have almost completed your QUEST!\n\r",ch);
+      send_to_char("Return to the questmaster before your time runs
out!\n\r",ch);
+      GET_QUESTMOB(ch) = -1;
+    }
+  }

 Structs.h
 ---------

Add new player flag:

+  #define PLR_QUESTOR          (1 << XX)  /* LJ autoquest */

Add 2 new mob flags:

+  #define MOB_QUESTMASTER  (1 << XX) /* LJ autoquest */
+  #define MOB_QUEST        (1 << XX) /* LJ autoquest */

In "struct player_special_data_saved" add:

+  struct char_data *questgiver;  /* LJ autoquest */

replace 5 int spares with:

+  int questpoints;  /* LJ autoquest */
+  int nextquest;  /* LJ autoquest */
+  int countdown;  /* LJ autoquest */
+  int questobj;  /* LJ autoquest */
+  int questmob;  /* LJ autoquest */


 Utils.h
 -------

Add somewhere:

+  #define GET_QUESTMOB(ch)     ((ch)->player_specials->saved.questmob)
/* LJ autoquest */
+  #define GET_QUESTOBJ(ch)     ((ch)->player_specials->saved.questobj)
/* LJ autoquest */
+  #define GET_QUESTGIVER(ch)   ((ch)->player_specials->saved.questgiver)
/* LJ autoquest */
+  #define GET_COUNTDOWN(ch)    ((ch)->player_specials->saved.countdown)
/* LJ autoquest */
+  #define GET_NEXTQUEST(ch)    ((ch)->player_specials->saved.nextquest)
/* LJ autoquest */
+  #define GET_QUESTPOINTS(ch)
((ch)->player_specials->saved.questpoints)
/* LJ autoquest */


 act.infomative.c
 ----------------

Under /* extern variables */ add:

+  extern struct index_data *mob_index;  /* LJ autoquest */

In "void list_one_char" after the part with:

=  if (IS_AFFECTED(ch, AFF_DETECT_ALIGN)) {
=    if (IS_EVIL(i))
=      strcat(buf, "(Red Aura) ");
=    else if (IS_GOOD(i))
=      strcat(buf, "(Blue Aura) ");
=    }

add:

+  if (IS_NPC(i) && GET_QUESTMOB(ch) == GET_MOB_VNUM(i))  /* LJ autoquest
*/
+    strcat(buf, "(TARGET) ");


 interpreter.c
 -------------

Under /* prototypes for all do_x functions. */ add:

+  ACMD(do_autoquest);  /* LJ autoquest */

In the "Master Command list" add:

+  { "autoquest", POS_STANDING, do_autoquest, 0, 0 },  /* LJ autoquest */


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST