Public feed
#530404
//inc_quests//Modular Quests System//Stephen Jackson / losl//blade2k.losl@gmail.com//Uses a system of modules to implement quests.//CONSTANTSconst string QUEST_PREFIX = "QUEST_";const string QUEST_2DA = "quests";const string QUEST_STARTVAR = "QUEST_Start";//PROTOTYPES//QUEST_beginQuest()//Arguements: oPC - PC begining the quest// oGiver - NPC giving the quest//Interprests variables from the quest giver and sets local//variables on the PC to mark the quest progress.void QUEST_beginQuest(object oPC, object oGiver);//QUEST_branch()//Arguments: oPC - PC doing the quest// oGiver - The Quest giver// nConflict - The conflict step we are advancing from// nBranch - Which one we are testing for// bSuccess - Wheither or not advance for success or failure//Changes the quest marker for oPC, advancing the questvoid QUEST_branch(object oPC, object oGiver, int nConflict, int nBranch, int bSuccess);//QUEST_performCheck()//Arguements: oPC - PC doing the quest// nConflict - the current conflict line// nBranch - Which branch we are checkingint QUEST_performCheck(object oPC, int nConflict, int nBranch);//QUEST_getConflict//Arguments: oPC - PC doing the quest// oGiver - The Quest Giverint QUEST_getConflict(object oPC, object oGiver);//SKILL CHECK PROTOTYPES//QUEST_persuadeCheck()//Arguements: oPC - PC doing the quest// nCheckDC - DC of the check//on oGiver and makes a persuade check, true if the check passed or false if it didn't.int QUEST_persuadeCheck(object oPC, int nCheckDC);//QUEST_intimidateCheck//Arguements: oPC - PC doing the quest// nCheckDC - DC of the check//on oGiver and makes a intimidate check, true if the check passed or false if it didn't.int QUEST_intimidateCheck(object oPC, int nCheckDC);//QUEST_wisdomCheck//Arguements: oPC - PC doing the quest// nCheckDC - DC of the check//on oGiver and makes a wisdom check, true if the check passed or false if it didn't.int QUEST_wisdomCheck(object oPC, int nCheckDC);//QUEST_intelligenceCheck//Arguements: oPC - PC doing the quest// nCheckDC - DC of the check//on oGiver and makes a intelligence check, true if the check passed or false if it didn't.int QUEST_intelligenceCheck(object oPC, int nCheckDC);//QUEST_charismaCheck//Arguements: oPC - PC doing the quest// nCheckDC - DC of the check//on oGiver and makes a charisma check, true if the check passed or false if it didn't.int QUEST_charismaCheck(object oPC, int nCheckDC);//QUEST_bluffCheck//Arguements: oPC - PC doing the quest// nCheckDC - DC of the check//on oGiver and makes a bluff check, true if the check passed or false if it didn't.int QUEST_bluffCheck(object oPC, int nCheckDC);//DEFINITIONSvoid QUEST_beginQuest(object oPC, object oGiver){ SetLocalInt(oPC, QUEST_PREFIX+GetTag(oGiver), GetLocalInt(oGiver,QUEST_PREFIX+QUEST_STARTVAR));}void QUEST_branch(object oPC, object oGiver, int nConflict, int nBranch, int bSuccess){ string sToFetch = "Branch"; string sConflict; sToFetch = sToFetch + IntToString(nBranch); if(bSuccess) sToFetch = sToFetch+"S"; else sToFetch = sToFetch+"F"; sConflict = Get2DAString(QUEST_2DA, sToFetch, nConflict); SetLocalInt(oPC, QUEST_PREFIX+GetTag(oGiver), StringToInt(sConflict));}