Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.76 KB | None | 0 0
  1. // LIEUTENANT SHRIKE
  2. //
  3. // We must present a letter of recommendation from Captain Krone in
  4. // the Village of Crowl to even be considered for acceptance into the
  5. // ranks of the Vanguard.
  6. //
  7. // runs Garrison in Kublai Axis
  8. // we can approach to join the Vanguard
  9. // get great armor and weapons upon joining
  10. //
  11. // must first pass several increasingly difficult tests
  12. //
  13. // MISSION 1
  14. //
  15. // Challenged to return Elias Conachur to the Axis as a prisoner
  16. // or else provide proof he is dead!!! Shrike suspects Elias of many
  17. // murders in the woods. He can mark our maps for the cabin.
  18. //
  19. // MISSION 2
  20. //
  21. // Get a Roc egg from the mountains and bring it back
  22. //
  23. // MISSION 3
  24. //
  25. // Determine Green Mandarin's whereabouts and "confiscate" Moon Crystal
  26. //
  27.  
  28. const int Flag_First_Encounter = 0;
  29. const int Flag_First_Exit = 1;
  30. const int Flag_First_Exit_Talk = 2;
  31. const int Flag_Recruited_Into_Party = 3;
  32. const int Flag_Told_About_Elias_Conachur = 4;
  33. const int Flag_Asked_About_Elias_Conachur = 5;
  34. const int Flag_Asked_About_Elias_Conachur_Again = 6;
  35. const int Flag_Showed_Wolfshead_Ring = 7;
  36. const int Flag_Imprisoned_Conachur = 8;
  37. const int Flag_Told_About_Mission_1 = 9;
  38. const int Flag_Asked_About_Mission_1 = 10;
  39. const int Flag_Solved_Mission_1 = 11;
  40. const int Flag_Told_About_Mission_2 = 12;
  41. const int Flag_Asked_About_Mission_2 = 13;
  42. const int Flag_Solved_Mission_2 = 14;
  43. const int Flag_Told_About_Mission_3 = 15;
  44. const int Flag_Asked_About_Mission_3 = 16;
  45. const int Flag_Solved_Mission_3 = 17;
  46. const int Flag_Party_Joined_Vanguard = 18;
  47. const int Flag_Interested_Joining_Vanguard = 19;
  48. const int Flag_Discussed_Joining_Vanguard = 20;
  49. const int Flag_Showed_Rocs_Egg = 21;
  50. const int Flag_Showed_Moongate_Crystal = 22;
  51. const int Flag_Got_Recommendation = 23;
  52. const int Flag_Knows_We_Went_To_Conachurs_Cabin = 24;
  53. const int Flag_Branded_Traitor = 25;
  54. const int Flag_Asked_About_Joining = 26;
  55.  
  56. const int ITEM_Wolfshead_Ring = 193;
  57. const int ITEM_Rocs_Egg = 395;
  58. const int ITEM_Moongate_Crystal = 783;
  59. const int ITEM_Letter_Of_Recommendation = 788;
  60.  
  61. const int HOARD_Recruit_Issue = 85;
  62.  
  63. const int QUEST_GET_CONACHUR = 0;
  64. const int QUEST_GET_ROCS = 1;
  65. const int QUEST_GET_MANDARIN = 2;
  66. const int QUEST_COMPLETION_COUNT = 3;
  67.  
  68. const int NPC_ELIAS_CONACHUR = 14;
  69. const int NPC_GREEN_MANDARIN = 36;
  70.  
  71. const int MPC_ROC = 194;
  72.  
  73. const int QUEST_COMPLETION_EXPERIENCE = 4000;
  74. const int QUEST_COMPLETION_GOLD = 50000;
  75.  
  76. // survive 40+ Roc encounters, you wiped'em out
  77. const int MPCCOUNT_ROCS_KILLED = 40;
  78.  
  79. const int Checkpoint_Harradan_Groves = 125;
  80. const int Checkpoint_Entrance_Pagoda = 61;
  81. const int Checkpoint_Axis_Gaol = 68;
  82. const int Checkpoint_Conachurs_Cabin = 187;
  83. const int Checkpoint_Blackspike_Mountains = 99;
  84.  
  85. const int ITEMSLOOKUP_ROWSIZE = 9;
  86. const int ITEMSLOOKUP_ITEMIDX = 0;
  87. const int ITEMSLOOKUP_TOLD = 1;
  88. const int ITEMSLOOKUP_ASKED = 2;
  89. const int ITEMSLOOKUP_SOLVED = 3;
  90. const int ITEMSLOOKUP_CHECKPOINT = 4;
  91. const int ITEMSLOOKUP_NOTEINDEX = 5;
  92. const int ITEMSLOOKUP_X = 6;
  93. const int ITEMSLOOKUP_Y = 7;
  94. const int ITEMSLOOKUP_FLAGSET = 8;
  95.  
  96. // Exclude(10,11,12,13,14,15,16,17,30);
  97. const int [] Quest_Lookup =
  98. {
  99. // item index,told talk,asked talk,solved talk,checkpoint,note index,xpos,ypos,flagset index
  100. ITEM_Wolfshead_Ring,10,11,12,Checkpoint_Harradan_Groves,27,51,147,Flag_Told_About_Mission_1,
  101. ITEM_Rocs_Egg,13,14,15,Checkpoint_Blackspike_Mountains,28,115,81,Flag_Told_About_Mission_2,
  102. ITEM_Moongate_Crystal,16,17,30,Checkpoint_Entrance_Pagoda,29,155,35,Flag_Told_About_Mission_3,
  103. -1
  104. };
  105.  
  106. bool Get_Conachur()
  107. {
  108. int workval = 0;
  109. bool check = false;
  110.  
  111. // check if party has visited conachur cabin, comment
  112. if(Get(Flag_Knows_We_Went_To_Conachurs_Cabin)==false)
  113. {
  114. if(PartyVisited(Checkpoint_Conachurs_Cabin) == true)
  115. {
  116. Say(74);
  117.  
  118. Set(Flag_Knows_We_Went_To_Conachurs_Cabin);
  119. }
  120. }
  121.  
  122. if(InParty(NPC_ELIAS_CONACHUR) == true)
  123. {
  124. // address elias
  125. // elias replies
  126. // shrike asks us to surrender our prisoner
  127. // if answer yes, drop conachur and move to prison
  128. // set special check to true
  129. // if answer no, decline any further quests for party
  130.  
  131. if(IsAlive(NPC_ELIAS_CONACHUR)==true)
  132. {
  133. Say(75);
  134. }
  135. else
  136. {
  137. Say(88);
  138. }
  139.  
  140. workval = FindPartyNPC(NPC_ELIAS_CONACHUR);
  141.  
  142. if(IsAlive(NPC_ELIAS_CONACHUR) == true)
  143. {
  144. HighlightPC(workval, cCOLOR_BLUE);
  145. Say(84);
  146. HighlightPC(workval, -1);
  147. }
  148.  
  149. if(AskYesNoQuestion(76) == true )
  150. {
  151. if(IsAlive(NPC_ELIAS_CONACHUR) == true)
  152. {
  153. HighlightPC(workval, cCOLOR_BLUE);
  154. Say(85);
  155. HighlightPC(workval, -1);
  156. }
  157.  
  158. SetNPCHome(Checkpoint_Axis_Gaol,NPC_ELIAS_CONACHUR);
  159.  
  160. if(Discharge(NPC_ELIAS_CONACHUR) == true)
  161. {
  162. Say(77);
  163.  
  164. Narrative(78);
  165.  
  166. check = true;
  167.  
  168. SetGlobal(cGLOBAL_CONACHUR_WAS_IMPRISONED,false);
  169.  
  170. Set(Flag_Imprisoned_Conachur);
  171. Set(Flag_Solved_Mission_1);
  172.  
  173. // set this flag as de facto acceptance of party
  174. // delivery of wanted criminal qualifies party to join
  175. Set(Flag_Got_Recommendation);
  176.  
  177. SetActive(NPC_ELIAS_CONACHUR,false);
  178. SetRecruitable(NPC_ELIAS_CONACHUR, false);
  179. }
  180. }
  181.  
  182. // oh oh, still harboring a fugitive, it's on now
  183. if(check == false)
  184. {
  185. Set(Flag_Branded_Traitor);
  186.  
  187. ModifyEnmity(cPARTY_AGENTSOFWHITEOWL,+8);
  188. ModifyAmity(cPARTY_AGENTSOFWHITEOWL,-8);
  189.  
  190. Say(79);
  191. Narrative(80);
  192. Fight();
  193. ExitNow();
  194. }
  195. }
  196.  
  197. return(check);
  198. }
  199.  
  200. bool SpecialQuestHandler(int taskindex)
  201. {
  202. int lookup = 0;
  203. int flagidx = 0;
  204. bool specialfinish = false;
  205.  
  206. switch(taskindex)
  207. {
  208. case QUEST_GET_CONACHUR:
  209. // if Conachur has been imprisoned by surrendering voluntarily
  210. if(GetGlobal(cGLOBAL_CONACHUR_WAS_IMPRISONED)==true)
  211. {
  212. if(Get(Flag_Got_Recommendation) and
  213. Get(Flag_Told_About_Mission_1)==true and
  214. HasMetNPC(NPC_ELIAS_CONACHUR)==true and
  215. Get(Flag_Imprisoned_Conachur)==false)
  216. {
  217. Say(86);
  218. }
  219. else
  220. {
  221. Say(94);
  222. }
  223.  
  224. specialfinish = true;
  225. }
  226.  
  227. // conachur was killed by somebody else
  228. if(IsAlive(NPC_ELIAS_CONACHUR)==false and HasMetNPC(NPC_ELIAS_CONACHUR)==false)
  229. {
  230. if(Get(Flag_Told_About_Mission_1)==true)
  231. {
  232. Say(91);
  233. }
  234. else
  235. {
  236. Say(94);
  237. }
  238.  
  239. specialfinish = true;
  240. }
  241.  
  242. break;
  243.  
  244. case QUEST_GET_ROCS:
  245. // if the party has killed sufficient numbers of Rocs in encounters
  246. if(Get(Flag_Told_About_Mission_2) and
  247. PartyVisited(Checkpoint_Blackspike_Mountains) and
  248. MonstersKilled(MPC_ROC) >= MPCCOUNT_ROCS_KILLED)
  249. {
  250. Say(93);
  251.  
  252. specialfinish = true;
  253. }
  254.  
  255. break;
  256.  
  257. case QUEST_GET_MANDARIN:
  258. // either the mandarin is dead or rumored dead
  259. if(GetGlobal(cGLOBAL_MANDARIN_RUMORED_DEAD)==true)
  260. {
  261. if(Get(Flag_Told_About_Mission_3)==true)
  262. {
  263. Say(87);
  264. }
  265. else
  266. {
  267. Say(95);
  268. }
  269.  
  270. specialfinish = true;
  271. }
  272. else
  273. {
  274. // the mandarin was killed by somebody else
  275. if(IsAlive(NPC_GREEN_MANDARIN) == false and HasMetNPC(NPC_GREEN_MANDARIN) == false)
  276. {
  277. if(Get(Flag_Told_About_Mission_3) == true)
  278. {
  279. Say(92);
  280. }
  281. else
  282. {
  283. Say(95);
  284. }
  285.  
  286. specialfinish = true;
  287. }
  288. }
  289.  
  290. break;
  291.  
  292. default:
  293. break;
  294. }
  295.  
  296. if(specialfinish)
  297. {
  298. lookup = (taskindex * ITEMSLOOKUP_ROWSIZE);
  299.  
  300. flagidx = Quest_Lookup[lookup + ITEMSLOOKUP_FLAGSET];
  301.  
  302. // set this quest as finished even if it has been through
  303. // an untraditional route
  304. Set(flagidx + 2);
  305. }
  306.  
  307. return(specialfinish);
  308. }
  309.  
  310. void OngoingTask(int taskindex)
  311. {
  312. int loop = 0;
  313. int flagidx = 0;
  314. int talkidx = 0;
  315.  
  316. loop = (taskindex * ITEMSLOOKUP_ROWSIZE);
  317.  
  318. flagidx = Quest_Lookup[loop + ITEMSLOOKUP_FLAGSET];
  319.  
  320. if(Get(flagidx + 2)==true)return;
  321.  
  322. if(Get(flagidx)==false)
  323. {
  324. talkidx = Quest_Lookup[loop + ITEMSLOOKUP_TOLD];
  325.  
  326. Set(flagidx);
  327.  
  328. Say(talkidx);
  329.  
  330. RevealMap(Quest_Lookup[loop + ITEMSLOOKUP_CHECKPOINT],
  331. Quest_Lookup[loop + ITEMSLOOKUP_X],
  332. Quest_Lookup[loop + ITEMSLOOKUP_Y],
  333. Quest_Lookup[loop + ITEMSLOOKUP_NOTEINDEX]);
  334. }
  335. else
  336. {
  337. talkidx = Quest_Lookup[loop + ITEMSLOOKUP_ASKED];
  338.  
  339. if(Get(flagidx + 1)==false)Set(flagidx + 1);
  340.  
  341. Say(talkidx);
  342. }
  343.  
  344. return;
  345. }
  346.  
  347. void CheckOnQuestItem(int chekitem)
  348. {
  349. int ival = -1;
  350. int loop = 0;
  351. int talkidx = 0;
  352. int itemidx = 0;
  353. int taskindex;
  354.  
  355. // iterate through all the quests
  356. for(taskindex = 0;taskindex < QUEST_COMPLETION_COUNT;taskindex++)
  357. {
  358. loop = (taskindex * ITEMSLOOKUP_ROWSIZE);
  359.  
  360. itemidx = Quest_Lookup[loop + ITEMSLOOKUP_ITEMIDX];
  361.  
  362. if(chekitem == itemidx)
  363. {
  364. ival = itemidx;
  365.  
  366. break;
  367. }
  368. }
  369.  
  370. if(ival == -1)return;
  371.  
  372. if(Get(Quest_Lookup[loop + ITEMSLOOKUP_FLAGSET] + 2)==true)
  373. {
  374. Say(20);
  375.  
  376. return;
  377. }
  378.  
  379. SetItemName(ival);
  380.  
  381. Say(19);
  382.  
  383. GetMouse(true);
  384.  
  385. talkidx = Quest_Lookup[loop + ITEMSLOOKUP_SOLVED];
  386.  
  387. Say(talkidx);
  388.  
  389. ModifyEnmity(cPARTY_AGENTSOFWHITEOWL,-1);
  390.  
  391. ModifyAmity(cPARTY_AGENTSOFWHITEOWL,+1);
  392.  
  393. Set(Quest_Lookup[loop + ITEMSLOOKUP_FLAGSET] + 2);
  394.  
  395. return;
  396. }
  397.  
  398. // see if party has fulfilled all quest requirements to join Vanguard
  399. bool DetermineEligibility()
  400. {
  401. int taskindex = -1;
  402. int flagidx = 0;
  403. int questscompleted = 0;
  404. bool completed = false;
  405. int loop = 0;
  406.  
  407. if(Get(Flag_Got_Recommendation) == false)return(false);
  408.  
  409. if(Get(Flag_Branded_Traitor)==true || GetEnmity()>5)
  410. {
  411. RandomSay(81,82,83);
  412.  
  413. return(false);
  414. }
  415.  
  416. if(Get(Flag_Party_Joined_Vanguard)==true)
  417. {
  418. RandomSay(3,27,28);
  419.  
  420. return(true);
  421. }
  422.  
  423. if(Get(Flag_Interested_Joining_Vanguard)==false)
  424. {
  425. if(Get(Flag_Discussed_Joining_Vanguard)==false)
  426. {
  427. Say(4);
  428.  
  429. Set(Flag_Discussed_Joining_Vanguard);
  430. }
  431. else
  432. {
  433. RandomSay(5,6,7);
  434. }
  435.  
  436. // Exclude(18);
  437. if(AskYesNoQuestion(18) == false)
  438. {
  439. if(Get(Flag_Asked_About_Joining) == false)
  440. {
  441. Set(Flag_Asked_About_Joining);
  442.  
  443. Say(8);
  444. }
  445. else
  446. {
  447. RandomSay(32,33,34);
  448. }
  449.  
  450. return(false);
  451. }
  452. else
  453. {
  454. Say(9);
  455. }
  456.  
  457. Set(Flag_Interested_Joining_Vanguard);
  458. }
  459.  
  460. questscompleted = 0;
  461.  
  462. // iterate through all the quests to how each one is faring
  463. for(taskindex = 0;taskindex < QUEST_COMPLETION_COUNT;taskindex++)
  464. {
  465. loop = (taskindex * ITEMSLOOKUP_ROWSIZE);
  466.  
  467. flagidx = Quest_Lookup[loop + ITEMSLOOKUP_FLAGSET];
  468.  
  469. if(Get(flagidx + 2) == true)
  470. {
  471. questscompleted++;
  472. }
  473. else
  474. {
  475. if(SpecialQuestHandler(taskindex))
  476. {
  477. questscompleted++;
  478. }
  479. else
  480. {
  481. OngoingTask(taskindex);
  482.  
  483. break;
  484. }
  485. }
  486. }
  487.  
  488. if(questscompleted >= QUEST_COMPLETION_COUNT) // this signals there are no quests left to pursue
  489. {
  490. if(GetGlobal(cGLOBAL_INDUCTED_INTO_VANGUARD) == false)
  491. {
  492. Set(Flag_Party_Joined_Vanguard);
  493.  
  494. SetGlobal(cGLOBAL_INDUCTED_INTO_VANGUARD,true);
  495.  
  496. Say(21);
  497.  
  498. GiveGold(QUEST_COMPLETION_GOLD);
  499. Experience(QUEST_COMPLETION_EXPERIENCE);
  500.  
  501. ChangeShopHoard(SELF,HOARD_Recruit_Issue);
  502.  
  503. completed = true;
  504. }
  505. }
  506.  
  507. return(completed);
  508. }
  509.  
  510. bool OnSubject_YOU(int querytype)
  511. {
  512. RandomSay(45,46,47);
  513.  
  514. return(true);
  515. }
  516.  
  517. bool OnSubject_JOB(int querytype)
  518. {
  519. RandomSay(48,49,50);
  520.  
  521. return(true);
  522. }
  523.  
  524. bool OnSubject_VANGUARD(int querytype)
  525. {
  526. Say(51,52);
  527.  
  528. return(true);
  529. }
  530.  
  531. bool OnSubject_RECOMMEND(int querytype)
  532. {
  533. RandomSay(63,64,65);
  534.  
  535. return(true);
  536. }
  537.  
  538. bool OnSubject_QUEST(int querytype)
  539. {
  540. // check on quest status
  541.  
  542. if(DetermineEligibility() == true)
  543. {
  544. RandomSay(71,72,73);
  545. }
  546.  
  547. return(true);
  548. }
  549.  
  550. bool OnSubject_ELIASCONACH(int querytype)
  551. {
  552. if(Get(Flag_Imprisoned_Conachur))
  553. {
  554. RandomSay(53,54,55);
  555.  
  556. return(true);
  557. }
  558.  
  559. if(Get(Flag_Told_About_Mission_1)==false)
  560. {
  561. Say(68,69);
  562.  
  563. return(true);
  564. }
  565.  
  566. if(Get(Flag_Showed_Wolfshead_Ring))
  567. {
  568. RandomSay(56,57,58);
  569. }
  570. else
  571. {
  572. if(Get(Flag_Told_About_Elias_Conachur) == false)
  573. {
  574. Narrative(59);
  575. Say(60);
  576.  
  577. Set(Flag_Told_About_Elias_Conachur);
  578. }
  579. else
  580. {
  581. if(Get(Flag_Asked_About_Elias_Conachur ) == false)
  582. {
  583. Set(Flag_Asked_About_Elias_Conachur);
  584.  
  585. Say(61);
  586. }
  587. else
  588. {
  589. RandomSay(62,66,67);
  590. }
  591. }
  592. }
  593.  
  594. return(true);
  595. }
  596.  
  597. bool OnTalk(int value)
  598. {
  599. if(Get(Flag_Got_Recommendation)==false)
  600. {
  601. RandomSay(24,25,26);
  602.  
  603. //true means we abort this conversation before it starts
  604. return(true);
  605. }
  606.  
  607. if(Get(Flag_Branded_Traitor))
  608. {
  609. RandomSay(81,82,83);
  610.  
  611. return(true);
  612. }
  613.  
  614. return(false);
  615. }
  616.  
  617. bool OnEncounter(int value)
  618. {
  619. if(Get(Flag_First_Encounter)==false)
  620. {
  621. Narrative(1);
  622. Say(2);
  623.  
  624. Set(Flag_First_Encounter);
  625. }
  626.  
  627. if(GetGlobal(cGLOBAL_CONACHUR_WAS_IMPRISONED)==false)Get_Conachur();
  628.  
  629. DetermineEligibility();
  630.  
  631. return(true);
  632. }
  633.  
  634. bool OnExitEncounter(int value)
  635. {
  636. if(Get(Flag_First_Exit)==false)
  637. {
  638. Say(31);
  639.  
  640. Set(Flag_First_Exit);
  641.  
  642. return(true);
  643. }
  644.  
  645. if(Get(Flag_Party_Joined_Vanguard)==true)
  646. {
  647. RandomSay(39,40,41);
  648. }
  649. else
  650. {
  651. RandomSay(42,43,44);
  652. }
  653.  
  654. return(true);
  655. }
  656.  
  657. bool OnExitTalk(int value)
  658. {
  659. if(Get(Flag_First_Exit_Talk)==false)
  660. {
  661. Say(35);
  662.  
  663. Set(Flag_First_Exit_Talk);
  664.  
  665. return(true);
  666. }
  667. else
  668. {
  669. if(Get(Flag_Party_Joined_Vanguard)==false)
  670. {
  671. Say(70);
  672. }
  673. else
  674. {
  675. RandomSay(89,90,96);
  676. }
  677. }
  678.  
  679. return(true);
  680. }
  681.  
  682. bool OnGiveItem(int value)
  683. {
  684. bool btest = false;
  685.  
  686. switch(value)
  687. {
  688. case ITEM_Letter_Of_Recommendation:
  689.  
  690. if(Get(Flag_Got_Recommendation)==false)
  691. {
  692. Narrative(29);
  693. Say(22);
  694.  
  695. Set(Flag_Got_Recommendation);
  696.  
  697. DetermineEligibility();
  698. }
  699. else
  700. {
  701. Say(23);
  702. }
  703.  
  704. btest = true;
  705.  
  706. break;
  707.  
  708. case ITEM_Wolfshead_Ring:
  709. case ITEM_Rocs_Egg:
  710. case ITEM_Moongate_Crystal:
  711.  
  712. if(Get(Flag_Got_Recommendation))
  713. {
  714. // make sure the item is identified for us
  715. IdentifyMouse();
  716.  
  717. btest = true;
  718.  
  719. CheckOnQuestItem(value);
  720.  
  721. DetermineEligibility();
  722. }
  723. else
  724. {
  725. RandomSay(99,97,98);
  726. }
  727.  
  728. break;
  729.  
  730. default:
  731. break;
  732. }
  733.  
  734. return(btest);
  735. }
  736.  
  737. bool OnRecruit(int value)
  738. {
  739. RandomSay(36,37,38);
  740.  
  741. // return true only to abort recruitment
  742. return(true);
  743. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement