This could form the base of your include file. You can call the functions from wherever you need, provided that your script includes this file. If your quests are given through conversation, the scripts calling these functions will be placed in either "Text appears when" or "Action taken" tabs of the convo.
// CONSTANTS
const string QUEST_ITEM_TAG = ""; // put the tag of your undroppable item here
const string QUEST_ITEM_VAR = "quests";
const int QUEST_1 = 1; // these are the quest IDs
const int QUEST_2 = 2;
const int QUEST_3 = 4;
const int QUEST_4 = 8;
const int QUEST_5 = 16;
const int QUEST_6 = 32;
const int QUEST_7 = 64;
const int QUEST_8 = 128;
const int QUEST_9 = 256;
const int QUEST_10 = 512;
// PROTOTYPES
// Returns TRUE if nQuest is done for oPC
int GetQuestDone(object oPC, int nQuest);
// Sets nQuest as done for oPC.
void SetQuestDone(object oPC, int nQuest);
// DEFINITIONS
int GetQuestDone(object oPC, int nQuest)
{
object oQuestItem = GetItemPossessedBy(oPC, QUEST_ITEM_TAG);
int nDone = GetLocalString(oQuestItem, QUEST_ITEM_VAR);
return nDone & nQuest;
}
void SetQuestDone(object oPC, int nQuest)
{
object oQuestItem = GetItemPossessedBy(oPC, QUEST_ITEM_TAG);
int nDone = GetLocalString(oQuestItem, QUEST_ITEM_VAR);
SetLocalInt(oQuestItem, QUEST_ITEM_VAR, nDone|nQuest);
}
Kato