#include "quest_inc" int StartingConditional() { object oPC = GetPCSpeaker(); string sDB = CharacterDB(oPC); string sAreaString = GetLocalString(GetArea(OBJECT_SELF), "AreaString"); if (GetFactionLeader(oPC) != oPC) return FALSE; //Only the party leader should be able to decide if they want to complete the quest //Lost quest template - we don't want PCs to be able to return there if they have an escorted NPC with them even though the quest is marked as in progress int i = 1; object oHench = GetHenchman(oPC, i); int nEscortBack = FALSE; while (oHench != OBJECT_INVALID) { if (GetLocalInt(oHench, "LostQuest") == TRUE && GetCampaignString(sDB, "QUEST_TEMPLATE") == "lost" && GetIsQuestComplete(oPC) == FALSE && GetIsQuestFailed(oPC) == FALSE) { nEscortBack = TRUE; break; } i++; oHench = GetHenchman(oPC, i); } int nMiles; string sDifficulty = GetLocalString(GetModule(), "mDiffExplo"); if (sDifficulty == "COMMONER") nMiles = 3; if (sDifficulty == "ADVENTURER") nMiles = 5; if (sDifficulty == "HERO") nMiles = 7; if (sDifficulty == "LEGEND") nMiles = 10; if (sDifficulty == "DEMIGOD") nMiles = 15; int nTravelled = GetLocalInt(oPC, "Miles"); string sEntry = IntToString(GetCampaignInt(sDB, "QUEST_JOURNAL")); sEntry = GetStringRight(sEntry, 1); if (GetCampaignInt(sDB, "QUEST_ACTIVE") == TRUE && nTravelled >= nMiles && sEntry == "1") { if (nEscortBack == TRUE) return FALSE; if (GetCampaignString(sDB, "QUEST_REGION") == "greencoast" && GetStringLeft(sAreaString, 1) == "1") return TRUE; } return FALSE; }