This is a framework for BBS quests like the one in the german quest documentation by Olaf Theune. You can use it for your own quests. All functions and variables mentioned here are described in the BBS Documentation.
The TODO comments in the source code are just reminders, you can delete them if you want.
/********************************************************************* * Quest: Quest name * Author: Your name * * Date: 07/22/2002 * Last change: 07/22/2002 * * State: not ready *********************************************************************/ class (QUESTOBJ(Q_ID)) : OBJ_BBS_QUEST { // Variable declarations // TODO: Declare your static and dynamic variables here... //**************************************************************** // Set() // Initialization of static variables //**************************************************************** void Set() { qu_TextPage = TPAGE_ID; // TODO: Initialize your specific variables and (if necessary) // qu_Timeout, qu_StoryState and qu_IncomingMessage } //**************************************************************** // EvaluatePriority() // Limits number of instances to create and returns priority // // station: Current location of the player // existingOffers: Offered instances of this quest in this station //**************************************************************** int EvaluatePriority(GALOBJ station, int existingOffers) { // TODO: Set qu_MaxOffers to the limit of offers to create // and return the priority of this quest // (0: ignore, 100: create "qu_MaxOffers" instances, // 0 < p < 100 = create some instances if possible) } //**************************************************************** // Evaluate() // Can we offer this mission? Initialization of dynamic variables //**************************************************************** int Evaluate() { // TODO: Return TRUE or FALSE to indicate whether the mission // can be offered. Initialize all needed variables here. } //**************************************************************** // Select() // The player pressed a button, can the mission be started? // // value: The "value" argument of the selected [select] button //**************************************************************** int Select(string value) { // TODO: Check if the player is able to do the mission // Return QUEST_ACCEPTED, QUEST_REJECTED or QUEST_NONE // or if the quest is running, a Check() return value. if (!value) { return QUEST_CONTINUED; // OK button pressed in incoming message } } //**************************************************************** // Check() // Check the status of the mission //**************************************************************** int Check() { // TODO: Return QUEST_CONTINUED, QUEST_FINISHED, QUEST_ABORTED // or QUEST_UPDATE. Call OBJ_QUESTMASTER.BBSQuestFinished(this) // or OBJ_QUESTMASTER.BBSQuestAborted(this) if necessary } //**************************************************************** // GetOfferText() (text id #1) //**************************************************************** string GetOfferText() { // TODO: Overwrite these functions to insert names and numbers return super.GetOfferText(); } //**************************************************************** // GetUpdateText() (text id #2) //**************************************************************** string GetUpdateText() { return super.GetUpdateText(); } //**************************************************************** // GetFinishText() (text id #3) //**************************************************************** string GetFinishText() { return super.GetFinishText(); } //**************************************************************** // GetAbortedText() (text id #4) //**************************************************************** string GetAbortedText() { return super.GetAbortedText(); } //**************************************************************** // GetAcceptText() (text id #5) // Tells the player that the mission has started //**************************************************************** string GetAcceptText() { return super.GetAcceptText(); } //**************************************************************** // GetRejectText() (text id #6) // Tells the player why he cannot do the mission //**************************************************************** string GetRejectText() { // TODO: Return a reject reason, you might need more than one textID return super.GetRejectText(); } //**************************************************************** // Force() // Function to test the quest //**************************************************************** void Force() { } // TODO: You can overwrite Offer(), Accept(), Reject(), Vbi(), // UpdateMessage(), Finish() and Abort() if you want }