Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // LIEUTENANT SHRIKE
- //
- // We must present a letter of recommendation from Captain Krone in
- // the Village of Crowl to even be considered for acceptance into the
- // ranks of the Vanguard.
- //
- // runs Garrison in Kublai Axis
- // we can approach to join the Vanguard
- // get great armor and weapons upon joining
- //
- // must first pass several increasingly difficult tests
- //
- // MISSION 1
- //
- // Challenged to return Elias Conachur to the Axis as a prisoner
- // or else provide proof he is dead!!! Shrike suspects Elias of many
- // murders in the woods. He can mark our maps for the cabin.
- //
- // MISSION 2
- //
- // Get a Roc egg from the mountains and bring it back
- //
- // MISSION 3
- //
- // Determine Green Mandarin's whereabouts and "confiscate" Moon Crystal
- //
- const int Flag_First_Encounter = 0;
- const int Flag_First_Exit = 1;
- const int Flag_First_Exit_Talk = 2;
- const int Flag_Recruited_Into_Party = 3;
- const int Flag_Told_About_Elias_Conachur = 4;
- const int Flag_Asked_About_Elias_Conachur = 5;
- const int Flag_Asked_About_Elias_Conachur_Again = 6;
- const int Flag_Showed_Wolfshead_Ring = 7;
- const int Flag_Imprisoned_Conachur = 8;
- const int Flag_Told_About_Mission_1 = 9;
- const int Flag_Asked_About_Mission_1 = 10;
- const int Flag_Solved_Mission_1 = 11;
- const int Flag_Told_About_Mission_2 = 12;
- const int Flag_Asked_About_Mission_2 = 13;
- const int Flag_Solved_Mission_2 = 14;
- const int Flag_Told_About_Mission_3 = 15;
- const int Flag_Asked_About_Mission_3 = 16;
- const int Flag_Solved_Mission_3 = 17;
- const int Flag_Party_Joined_Vanguard = 18;
- const int Flag_Interested_Joining_Vanguard = 19;
- const int Flag_Discussed_Joining_Vanguard = 20;
- const int Flag_Showed_Rocs_Egg = 21;
- const int Flag_Showed_Moongate_Crystal = 22;
- const int Flag_Got_Recommendation = 23;
- const int Flag_Knows_We_Went_To_Conachurs_Cabin = 24;
- const int Flag_Branded_Traitor = 25;
- const int Flag_Asked_About_Joining = 26;
- const int ITEM_Wolfshead_Ring = 193;
- const int ITEM_Rocs_Egg = 395;
- const int ITEM_Moongate_Crystal = 783;
- const int ITEM_Letter_Of_Recommendation = 788;
- const int HOARD_Recruit_Issue = 85;
- const int QUEST_GET_CONACHUR = 0;
- const int QUEST_GET_ROCS = 1;
- const int QUEST_GET_MANDARIN = 2;
- const int QUEST_COMPLETION_COUNT = 3;
- const int NPC_ELIAS_CONACHUR = 14;
- const int NPC_GREEN_MANDARIN = 36;
- const int MPC_ROC = 194;
- const int QUEST_COMPLETION_EXPERIENCE = 4000;
- const int QUEST_COMPLETION_GOLD = 50000;
- // survive 40+ Roc encounters, you wiped'em out
- const int MPCCOUNT_ROCS_KILLED = 40;
- const int Checkpoint_Harradan_Groves = 125;
- const int Checkpoint_Entrance_Pagoda = 61;
- const int Checkpoint_Axis_Gaol = 68;
- const int Checkpoint_Conachurs_Cabin = 187;
- const int Checkpoint_Blackspike_Mountains = 99;
- const int ITEMSLOOKUP_ROWSIZE = 9;
- const int ITEMSLOOKUP_ITEMIDX = 0;
- const int ITEMSLOOKUP_TOLD = 1;
- const int ITEMSLOOKUP_ASKED = 2;
- const int ITEMSLOOKUP_SOLVED = 3;
- const int ITEMSLOOKUP_CHECKPOINT = 4;
- const int ITEMSLOOKUP_NOTEINDEX = 5;
- const int ITEMSLOOKUP_X = 6;
- const int ITEMSLOOKUP_Y = 7;
- const int ITEMSLOOKUP_FLAGSET = 8;
- // Exclude(10,11,12,13,14,15,16,17,30);
- const int [] Quest_Lookup =
- {
- // item index,told talk,asked talk,solved talk,checkpoint,note index,xpos,ypos,flagset index
- ITEM_Wolfshead_Ring,10,11,12,Checkpoint_Harradan_Groves,27,51,147,Flag_Told_About_Mission_1,
- ITEM_Rocs_Egg,13,14,15,Checkpoint_Blackspike_Mountains,28,115,81,Flag_Told_About_Mission_2,
- ITEM_Moongate_Crystal,16,17,30,Checkpoint_Entrance_Pagoda,29,155,35,Flag_Told_About_Mission_3,
- -1
- };
- bool Get_Conachur()
- {
- int workval = 0;
- bool check = false;
- // check if party has visited conachur cabin, comment
- if(Get(Flag_Knows_We_Went_To_Conachurs_Cabin)==false)
- {
- if(PartyVisited(Checkpoint_Conachurs_Cabin) == true)
- {
- Say(74);
- Set(Flag_Knows_We_Went_To_Conachurs_Cabin);
- }
- }
- if(InParty(NPC_ELIAS_CONACHUR) == true)
- {
- // address elias
- // elias replies
- // shrike asks us to surrender our prisoner
- // if answer yes, drop conachur and move to prison
- // set special check to true
- // if answer no, decline any further quests for party
- if(IsAlive(NPC_ELIAS_CONACHUR)==true)
- {
- Say(75);
- }
- else
- {
- Say(88);
- }
- workval = FindPartyNPC(NPC_ELIAS_CONACHUR);
- if(IsAlive(NPC_ELIAS_CONACHUR) == true)
- {
- HighlightPC(workval, cCOLOR_BLUE);
- Say(84);
- HighlightPC(workval, -1);
- }
- if(AskYesNoQuestion(76) == true )
- {
- if(IsAlive(NPC_ELIAS_CONACHUR) == true)
- {
- HighlightPC(workval, cCOLOR_BLUE);
- Say(85);
- HighlightPC(workval, -1);
- }
- SetNPCHome(Checkpoint_Axis_Gaol,NPC_ELIAS_CONACHUR);
- if(Discharge(NPC_ELIAS_CONACHUR) == true)
- {
- Say(77);
- Narrative(78);
- check = true;
- SetGlobal(cGLOBAL_CONACHUR_WAS_IMPRISONED,false);
- Set(Flag_Imprisoned_Conachur);
- Set(Flag_Solved_Mission_1);
- // set this flag as de facto acceptance of party
- // delivery of wanted criminal qualifies party to join
- Set(Flag_Got_Recommendation);
- SetActive(NPC_ELIAS_CONACHUR,false);
- SetRecruitable(NPC_ELIAS_CONACHUR, false);
- }
- }
- // oh oh, still harboring a fugitive, it's on now
- if(check == false)
- {
- Set(Flag_Branded_Traitor);
- ModifyEnmity(cPARTY_AGENTSOFWHITEOWL,+8);
- ModifyAmity(cPARTY_AGENTSOFWHITEOWL,-8);
- Say(79);
- Narrative(80);
- Fight();
- ExitNow();
- }
- }
- return(check);
- }
- bool SpecialQuestHandler(int taskindex)
- {
- int lookup = 0;
- int flagidx = 0;
- bool specialfinish = false;
- switch(taskindex)
- {
- case QUEST_GET_CONACHUR:
- // if Conachur has been imprisoned by surrendering voluntarily
- if(GetGlobal(cGLOBAL_CONACHUR_WAS_IMPRISONED)==true)
- {
- if(Get(Flag_Got_Recommendation) and
- Get(Flag_Told_About_Mission_1)==true and
- HasMetNPC(NPC_ELIAS_CONACHUR)==true and
- Get(Flag_Imprisoned_Conachur)==false)
- {
- Say(86);
- }
- else
- {
- Say(94);
- }
- specialfinish = true;
- }
- // conachur was killed by somebody else
- if(IsAlive(NPC_ELIAS_CONACHUR)==false and HasMetNPC(NPC_ELIAS_CONACHUR)==false)
- {
- if(Get(Flag_Told_About_Mission_1)==true)
- {
- Say(91);
- }
- else
- {
- Say(94);
- }
- specialfinish = true;
- }
- break;
- case QUEST_GET_ROCS:
- // if the party has killed sufficient numbers of Rocs in encounters
- if(Get(Flag_Told_About_Mission_2) and
- PartyVisited(Checkpoint_Blackspike_Mountains) and
- MonstersKilled(MPC_ROC) >= MPCCOUNT_ROCS_KILLED)
- {
- Say(93);
- specialfinish = true;
- }
- break;
- case QUEST_GET_MANDARIN:
- // either the mandarin is dead or rumored dead
- if(GetGlobal(cGLOBAL_MANDARIN_RUMORED_DEAD)==true)
- {
- if(Get(Flag_Told_About_Mission_3)==true)
- {
- Say(87);
- }
- else
- {
- Say(95);
- }
- specialfinish = true;
- }
- else
- {
- // the mandarin was killed by somebody else
- if(IsAlive(NPC_GREEN_MANDARIN) == false and HasMetNPC(NPC_GREEN_MANDARIN) == false)
- {
- if(Get(Flag_Told_About_Mission_3) == true)
- {
- Say(92);
- }
- else
- {
- Say(95);
- }
- specialfinish = true;
- }
- }
- break;
- default:
- break;
- }
- if(specialfinish)
- {
- lookup = (taskindex * ITEMSLOOKUP_ROWSIZE);
- flagidx = Quest_Lookup[lookup + ITEMSLOOKUP_FLAGSET];
- // set this quest as finished even if it has been through
- // an untraditional route
- Set(flagidx + 2);
- }
- return(specialfinish);
- }
- void OngoingTask(int taskindex)
- {
- int loop = 0;
- int flagidx = 0;
- int talkidx = 0;
- loop = (taskindex * ITEMSLOOKUP_ROWSIZE);
- flagidx = Quest_Lookup[loop + ITEMSLOOKUP_FLAGSET];
- if(Get(flagidx + 2)==true)return;
- if(Get(flagidx)==false)
- {
- talkidx = Quest_Lookup[loop + ITEMSLOOKUP_TOLD];
- Set(flagidx);
- Say(talkidx);
- RevealMap(Quest_Lookup[loop + ITEMSLOOKUP_CHECKPOINT],
- Quest_Lookup[loop + ITEMSLOOKUP_X],
- Quest_Lookup[loop + ITEMSLOOKUP_Y],
- Quest_Lookup[loop + ITEMSLOOKUP_NOTEINDEX]);
- }
- else
- {
- talkidx = Quest_Lookup[loop + ITEMSLOOKUP_ASKED];
- if(Get(flagidx + 1)==false)Set(flagidx + 1);
- Say(talkidx);
- }
- return;
- }
- void CheckOnQuestItem(int chekitem)
- {
- int ival = -1;
- int loop = 0;
- int talkidx = 0;
- int itemidx = 0;
- int taskindex;
- // iterate through all the quests
- for(taskindex = 0;taskindex < QUEST_COMPLETION_COUNT;taskindex++)
- {
- loop = (taskindex * ITEMSLOOKUP_ROWSIZE);
- itemidx = Quest_Lookup[loop + ITEMSLOOKUP_ITEMIDX];
- if(chekitem == itemidx)
- {
- ival = itemidx;
- break;
- }
- }
- if(ival == -1)return;
- if(Get(Quest_Lookup[loop + ITEMSLOOKUP_FLAGSET] + 2)==true)
- {
- Say(20);
- return;
- }
- SetItemName(ival);
- Say(19);
- GetMouse(true);
- talkidx = Quest_Lookup[loop + ITEMSLOOKUP_SOLVED];
- Say(talkidx);
- ModifyEnmity(cPARTY_AGENTSOFWHITEOWL,-1);
- ModifyAmity(cPARTY_AGENTSOFWHITEOWL,+1);
- Set(Quest_Lookup[loop + ITEMSLOOKUP_FLAGSET] + 2);
- return;
- }
- // see if party has fulfilled all quest requirements to join Vanguard
- bool DetermineEligibility()
- {
- int taskindex = -1;
- int flagidx = 0;
- int questscompleted = 0;
- bool completed = false;
- int loop = 0;
- if(Get(Flag_Got_Recommendation) == false)return(false);
- if(Get(Flag_Branded_Traitor)==true || GetEnmity()>5)
- {
- RandomSay(81,82,83);
- return(false);
- }
- if(Get(Flag_Party_Joined_Vanguard)==true)
- {
- RandomSay(3,27,28);
- return(true);
- }
- if(Get(Flag_Interested_Joining_Vanguard)==false)
- {
- if(Get(Flag_Discussed_Joining_Vanguard)==false)
- {
- Say(4);
- Set(Flag_Discussed_Joining_Vanguard);
- }
- else
- {
- RandomSay(5,6,7);
- }
- // Exclude(18);
- if(AskYesNoQuestion(18) == false)
- {
- if(Get(Flag_Asked_About_Joining) == false)
- {
- Set(Flag_Asked_About_Joining);
- Say(8);
- }
- else
- {
- RandomSay(32,33,34);
- }
- return(false);
- }
- else
- {
- Say(9);
- }
- Set(Flag_Interested_Joining_Vanguard);
- }
- questscompleted = 0;
- // iterate through all the quests to how each one is faring
- for(taskindex = 0;taskindex < QUEST_COMPLETION_COUNT;taskindex++)
- {
- loop = (taskindex * ITEMSLOOKUP_ROWSIZE);
- flagidx = Quest_Lookup[loop + ITEMSLOOKUP_FLAGSET];
- if(Get(flagidx + 2) == true)
- {
- questscompleted++;
- }
- else
- {
- if(SpecialQuestHandler(taskindex))
- {
- questscompleted++;
- }
- else
- {
- OngoingTask(taskindex);
- break;
- }
- }
- }
- if(questscompleted >= QUEST_COMPLETION_COUNT) // this signals there are no quests left to pursue
- {
- if(GetGlobal(cGLOBAL_INDUCTED_INTO_VANGUARD) == false)
- {
- Set(Flag_Party_Joined_Vanguard);
- SetGlobal(cGLOBAL_INDUCTED_INTO_VANGUARD,true);
- Say(21);
- GiveGold(QUEST_COMPLETION_GOLD);
- Experience(QUEST_COMPLETION_EXPERIENCE);
- ChangeShopHoard(SELF,HOARD_Recruit_Issue);
- completed = true;
- }
- }
- return(completed);
- }
- bool OnSubject_YOU(int querytype)
- {
- RandomSay(45,46,47);
- return(true);
- }
- bool OnSubject_JOB(int querytype)
- {
- RandomSay(48,49,50);
- return(true);
- }
- bool OnSubject_VANGUARD(int querytype)
- {
- Say(51,52);
- return(true);
- }
- bool OnSubject_RECOMMEND(int querytype)
- {
- RandomSay(63,64,65);
- return(true);
- }
- bool OnSubject_QUEST(int querytype)
- {
- // check on quest status
- if(DetermineEligibility() == true)
- {
- RandomSay(71,72,73);
- }
- return(true);
- }
- bool OnSubject_ELIASCONACH(int querytype)
- {
- if(Get(Flag_Imprisoned_Conachur))
- {
- RandomSay(53,54,55);
- return(true);
- }
- if(Get(Flag_Told_About_Mission_1)==false)
- {
- Say(68,69);
- return(true);
- }
- if(Get(Flag_Showed_Wolfshead_Ring))
- {
- RandomSay(56,57,58);
- }
- else
- {
- if(Get(Flag_Told_About_Elias_Conachur) == false)
- {
- Narrative(59);
- Say(60);
- Set(Flag_Told_About_Elias_Conachur);
- }
- else
- {
- if(Get(Flag_Asked_About_Elias_Conachur ) == false)
- {
- Set(Flag_Asked_About_Elias_Conachur);
- Say(61);
- }
- else
- {
- RandomSay(62,66,67);
- }
- }
- }
- return(true);
- }
- bool OnTalk(int value)
- {
- if(Get(Flag_Got_Recommendation)==false)
- {
- RandomSay(24,25,26);
- //true means we abort this conversation before it starts
- return(true);
- }
- if(Get(Flag_Branded_Traitor))
- {
- RandomSay(81,82,83);
- return(true);
- }
- return(false);
- }
- bool OnEncounter(int value)
- {
- if(Get(Flag_First_Encounter)==false)
- {
- Narrative(1);
- Say(2);
- Set(Flag_First_Encounter);
- }
- if(GetGlobal(cGLOBAL_CONACHUR_WAS_IMPRISONED)==false)Get_Conachur();
- DetermineEligibility();
- return(true);
- }
- bool OnExitEncounter(int value)
- {
- if(Get(Flag_First_Exit)==false)
- {
- Say(31);
- Set(Flag_First_Exit);
- return(true);
- }
- if(Get(Flag_Party_Joined_Vanguard)==true)
- {
- RandomSay(39,40,41);
- }
- else
- {
- RandomSay(42,43,44);
- }
- return(true);
- }
- bool OnExitTalk(int value)
- {
- if(Get(Flag_First_Exit_Talk)==false)
- {
- Say(35);
- Set(Flag_First_Exit_Talk);
- return(true);
- }
- else
- {
- if(Get(Flag_Party_Joined_Vanguard)==false)
- {
- Say(70);
- }
- else
- {
- RandomSay(89,90,96);
- }
- }
- return(true);
- }
- bool OnGiveItem(int value)
- {
- bool btest = false;
- switch(value)
- {
- case ITEM_Letter_Of_Recommendation:
- if(Get(Flag_Got_Recommendation)==false)
- {
- Narrative(29);
- Say(22);
- Set(Flag_Got_Recommendation);
- DetermineEligibility();
- }
- else
- {
- Say(23);
- }
- btest = true;
- break;
- case ITEM_Wolfshead_Ring:
- case ITEM_Rocs_Egg:
- case ITEM_Moongate_Crystal:
- if(Get(Flag_Got_Recommendation))
- {
- // make sure the item is identified for us
- IdentifyMouse();
- btest = true;
- CheckOnQuestItem(value);
- DetermineEligibility();
- }
- else
- {
- RandomSay(99,97,98);
- }
- break;
- default:
- break;
- }
- return(btest);
- }
- bool OnRecruit(int value)
- {
- RandomSay(36,37,38);
- // return true only to abort recruitment
- return(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement