thedictator

Charters.ash

Apr 28th, 2019 (edited)
498
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.22 KB | None | 0 0
  1. import DicsLibrary.ash
  2.  
  3. /*******************************************************\
  4. * That 70s Volcano
  5. \*******************************************************/
  6. void getTowerCoin() {
  7. // Equips velvet items and grabs a volcoino
  8. if ( get_property_bool("_infernoDiscoVisited") )
  9. return;
  10. if ( outfit( "smooth velvet" ) ) {
  11. visit_url("place.php?whichplace=airport_hot&action=airport4_zone1");
  12. run_choice(7);
  13. }
  14. else
  15. print("Couldn't equip smooth velvet outfit","red");
  16. }
  17.  
  18. void VolcanoQuest() {
  19. // Takes and finishes the Volcano quest (from the mall if mallprices allow).
  20. if ( usesRemaining("_volcanoItemRedeemed") ) {
  21. int Volcoino = itemValue($item[Volcoino]);
  22. int [item] availableQuests;
  23. item cheapestItem,fuseChoiceNumber;
  24. boolean noAdventure, fusedFuse;
  25.  
  26. void visitVolcanoBunker() {
  27. page = visit_url("place.php?whichplace=airport_hot&action=airport4_questhub");
  28. }
  29.  
  30. int VolcanoQuestCost( item it ) {
  31. int qty = 1;
  32. switch (it) {
  33. case $item[smooth velvet bra]:
  34. qty = 3;
  35. break;
  36. case $item[New Age healing crystal]:
  37. case $item[gooey lava globs]:
  38. qty = 5;
  39. break;
  40. case $item[SMOOCH bracers]:
  41. qty = 15;
  42. it = $item[Superheated metal];
  43. }
  44. return itemValue(it) * qty;
  45. }
  46.  
  47. if ( get_property_int("_volcanoItem1") == 0 )
  48. visitVolcanoBunker();
  49.  
  50. for i from 1 to 3
  51. availableQuests[ to_item(get_property("_volcanoItem"+i)) ] = get_property_int("_volcanoItemCount"+i);
  52.  
  53. foreach it,qty in availableQuests {
  54. if ( it.tradeable ) {
  55. StockUp(qty,it,Volcoino/qty/4,Volcoino/qty);
  56. noAdventure = true;
  57. }
  58. else if ( it == $item[SMOOCH bracers] ) {
  59. StockUp(15,$item[Superheated metal],Volcoino/15/4,Volcoino/15);
  60. noAdventure = true;
  61. }
  62. else if ( it == $item[fused fuse] )
  63. fusedFuse = true;
  64. if ( (cheapestItem == $item[none] || VolcanoQuestCost(it) < VolcanoQuestCost(cheapestItem)) && retrieve_item(qty,it) )
  65. cheapestItem = it;
  66. }
  67.  
  68. if ( cheapestItem == $item[none] && fusedFuse && usesRemaining($item[Clara's bell]) && !bossKilling
  69. && (!Drunk() || available_amount($item[drunkula's wineglass])>0 )
  70. && user_confirm("Do you want to use Clara's Bell to pick up a fused fuse for the volcano quest?",60000,get_property_bool("Dic.UseClara")) )
  71. {
  72. if ( !Drunk() || equip($item[drunkula's wineglass]) ) {
  73. use(1,$item[Clara's Bell]);
  74. cli_execute("mood apathetic");
  75. set_property("choiceAdventure1091",7);
  76. adv1($location[LavaCo&trade; Lamp Factory], -1, "");
  77. }
  78. if ( retrieve_item(1,$item[fused fuse]) )
  79. cheapestItem = $item[fused fuse];
  80. else
  81. print("Failed to get the fused fuse, instead encountered: "+get_property("lastEncounter"));
  82. }
  83.  
  84.  
  85. if ( cheapestItem == $item[none] && noAdventure )
  86. print("Couldn't acquire volcano quest items cheaply","red");
  87. else if ( cheapestItem != $item[none] ) {
  88. visitVolcanoBunker();
  89. for i from 1 to 3 {
  90. if ( cheapestItem == to_item(get_property("_volcanoItem"+i)) ) {
  91. run_choice(i);
  92. break;
  93. }
  94. }
  95. }
  96. else
  97. print("No zero-adventure volcano quests today","orange");
  98. }
  99. }
  100.  
  101. void Volcano() {
  102. if ( !(get_property_bool("_hotAirportToday") || get_property_bool("hotAirportAlways")) || !is_unrestricted($item[Airplane Charter: that 70s Volcano]) )
  103. return;
  104.  
  105. getTowerCoin();
  106. VolcanoQuest();
  107. }
  108.  
  109. /*******************************************************\
  110. * Dinseylandfill
  111. \*******************************************************/
  112. static {
  113. string questLog = "questlog.php?which=1";
  114. string dinseyKiosk = "place.php?whichplace=airport_stench&action=airport3_kiosk";
  115.  
  116. record dinseyQuestData {
  117. int priority;
  118. string questNameKiosk;
  119. string questNameQuestLog;
  120. string questStateProperty;
  121. string questProgressProperty;
  122. int questProgressLimit;
  123. boolean canUseWanderers;
  124. item requiredItem;
  125. location questLocation;
  126. };
  127.  
  128. dinseyQuestData [string] dinseyQuest;
  129. dinseyQuest["lube"] = new dinseyQuestData(0,"Track Maintenance", "Super Luber", "questEStSuperLuber", "", 0, false, $item[lube-shoes], $location[Barf Mountain]);
  130. dinseyQuest["food"] = new dinseyQuestData(1,"Guest Sustenance Assurance", "Will Work With Food", "questEStWorkWithFood", "dinseyTouristsFed", 30, false, $item[none], $location[Barf Mountain]);
  131. dinseyQuest["fuel"] = new dinseyQuestData(2,"Electrical Maintenance", "Give Me Fuel", "questEStGiveMeFuel", "", 0, false, $item[none], $location[The Toxic Teacups]);
  132. dinseyQuest["sexism"] = new dinseyQuestData(3,"Sexism Reduction", "Social Justice Adventurer I", "questEStSocialJusticeI", "dinseySocialJusticeIProgress", 15, true, $item[none], $location[Pirates of the Garbage Barges]);
  133. dinseyQuest["racism"] = new dinseyQuestData(4,"Racism Reduction", "Social Justice Adventurer II", "questEStSocialJusticeII", "dinseySocialJusticeIIProgress",15, true, $item[none], $location[Uncle Gator's Country Fun-Time Liquid Waste Sluice]);
  134. dinseyQuest["fun"] = new dinseyQuestData(5,"Compulsory Fun", "Whistling Zippity-Doo-Dah", "questEStZippityDooDah", "dinseyFunProgress", 15, true, $item[Dinsey mascot mask], $location[The Toxic Teacups]);
  135. dinseyQuest["trash"] = new dinseyQuestData(6,"Waterway Debris Removal", "Teach a Man to Fish Trash", "questEStFishTrash", "dinseyFilthLevel", 0, true, $item[trash net], $location[Pirates of the Garbage Barges]);
  136. dinseyQuest["bear"] = new dinseyQuestData(7,"Bear Removal", "Nasty\, Nasty Bears", "questEStNastyBears", "dinseyNastyBearsDefeated", 8, false, $item[none], $location[Uncle Gator's Country Fun-Time Liquid Waste Sluice]);
  137. }
  138.  
  139. void disposeGarbage() {
  140. if ( usesRemaining("_dinseyGarbageDisposed") && StockUp(1,$item[bag of park garbage],234,234) ) {
  141. visit_url("place.php?whichplace=airport_stench&action=airport3_tunnels");
  142. page = visit_url("choice.php?whichchoice=1067&pwd&option=6");
  143. if ( usesRemaining("_dinseyGarbageDisposed") ) {
  144. if ( contains_text(page,"Your park cleanup quota for today has already been met.") )
  145. set_property("_dinseyGarbageDisposed",true);
  146. else
  147. abort("We failed to dispose garbage somehow?");
  148. }
  149. }
  150. }
  151.  
  152. boolean DinseyHasQuest() {
  153. foreach quest,Q in dinseyQuest
  154. if ( quest == "" ) {
  155. print("charters: removing empty quest data","red");
  156. remove dinseyQuest[""];
  157. return false;
  158. }
  159. else if ( get_property(Q.questStateProperty) != "unstarted" )
  160. return true;
  161. return false;
  162. }
  163.  
  164. string DinseyActiveQuest() {
  165. foreach quest,Q in dinseyQuest
  166. if ( get_property(Q.questStateProperty) != "unstarted" )
  167. return quest;
  168. return "";
  169. }
  170.  
  171. boolean DinseyQuestComplete() {
  172. if ( DinseyHasQuest() ) {
  173. string quest = DinseyActiveQuest();
  174. switch(quest) {
  175. case "fuel":
  176. return StockUp(20,$item[toxic globule],itemValue($item[FunFunds&trade;])*3/20/2,itemValue($item[FunFunds&trade;])*3/20);
  177. case "lube":
  178. return contains_text(visit_url(questLog),"<b>Kiosk</b>");
  179. case "trash":
  180. return get_property_int(dinseyQuest[quest].questProgressProperty) <= dinseyQuest[quest].questProgressLimit && contains_text(visit_url(questLog),"<b>Kiosk</b>");
  181. case "fun":
  182. case "sexism":
  183. case "racism":
  184. return get_property_int(dinseyQuest[quest].questProgressProperty) >= dinseyQuest[quest].questProgressLimit && contains_text(visit_url(questLog),"<b>Kiosk</b>");
  185. default:
  186. return get_property_int(dinseyQuest[quest].questProgressProperty) >= dinseyQuest[quest].questProgressLimit;
  187. }
  188. }
  189. else
  190. return false;
  191. }
  192.  
  193. boolean DinseyHasActiveQuest() {
  194. return DinseyHasQuest() && !DinseyQuestComplete();
  195. }
  196.  
  197. void DinseyPickQuest() {
  198. string [int,int] QuestsOffered;
  199. string [int] quests;
  200. int best;
  201. string bestquest;
  202. boolean doBarf = get_property_bool("_Dic.Barfday"); // Might as well take barf quests if we're barffarming
  203.  
  204. if ( DinseyHasQuest() )
  205. return;
  206.  
  207. if ( get_property_bool("_Charters.DinseyQuestStartedToday") || get_property_bool("_Charters.DinseyQuestsAvoided") )
  208. return;
  209.  
  210. string page = visit_url(dinseyKiosk);
  211. QuestsOffered = group_string(page,"width=250><center><b>([^<]+)</b></center>");
  212.  
  213. foreach i,j in QuestsOffered
  214. if ( j == 1 )
  215. print("Quest "+(i+1)+": "+QuestsOffered[i,j]);
  216.  
  217. if ( count(QuestsOffered) == 1 ) {
  218. if ( QuestsOffered[0,1] == dinseyQuest[DinseyActiveQuest()].questNameKiosk )
  219. print("Already on dinsey quest "+dinseyQuest[DinseyActiveQuest()].questNameKiosk,"orange");
  220. else
  221. abort("Trouble parsing offered dinsey quests, the only one we found doesn't match our active quest");
  222. }
  223. else if ( count(QuestsOffered) == 2) {
  224. for i from 1 to 2 {
  225. foreach quest,Q in dinseyQuest {
  226. if ( Q.questNameKiosk == QuestsOffered[i-1,1] ) {
  227. quests[i] = quest;
  228. if ( ( quest == "fuel" && StockUp(20,$item[toxic globule],itemValue($item[FunFunds&trade;])*3/20/2,itemValue($item[FunFunds&trade;])*3/20)
  229. || Q.canUseWanderers
  230. || Q.questLocation == $location[Barf Mountain] && doBarf)
  231. && ( best == 0 || Q.priority < dinseyQuest[bestquest].priority ) )
  232. {
  233. best = i;
  234. bestquest = quest;
  235. }
  236. break;
  237. }
  238. }
  239. }
  240.  
  241. if ( best != 0 ) {
  242. print("Selecting dinsey quest: "+dinseyQuest[quests[best]].questNameKiosk,"blue");
  243. page = visit_url(dinseyKiosk);
  244. if ( available_choice_options() contains best ) {
  245. run_choice(best);
  246. set_property("_Charters.DinseyQuestStartedToday",true);
  247. }
  248. else
  249. abort("pickDinseyQuest can't find the right choice somehow?");
  250. }
  251. else {
  252. set_property("_Charters.DinseyQuestsAvoided",true);
  253. print("No dinsey quests that you want today","blue");
  254. }
  255. }
  256. else if ( contains_text(page,"You already took a job assignment for today.") ) {
  257. set_property("_Charters.DinseyQuestStartedToday",true);
  258. run_choice(6);
  259. }
  260. else
  261. print("Trouble parsing offered dinsey quests, found "+count(QuestsOffered)+" offers.","red");
  262. }
  263.  
  264. void DinseyTurnInQuest() {
  265. if ( DinseyQuestComplete() ) {
  266. if ( DinseyActiveQuest() == "racism" )
  267. set_property("questEStSocialJusticeI","unstarted");
  268. visit_url(dinseyKiosk);
  269. run_choice(3);
  270. }
  271. }
  272.  
  273. void Dinsey() {
  274. if ( !get_property_bool("_stenchAirportToday") && !get_property_bool("stenchAirportAlways") )
  275. return;
  276.  
  277. disposeGarbage();
  278. DinseyTurnInQuest();
  279. DinseyPickQuest();
  280. DinseyTurnInQuest();
  281. }
  282.  
  283. /*******************************************************\
  284. * Glaciest
  285. \*******************************************************/
  286. static {
  287. string walford = "place.php?whichplace=airport_cold&action=glac_walrus";
  288.  
  289. record glaciestQuestData {
  290. int priority;
  291. boolean [location] combatLocations;
  292. boolean [location] noncombatLocations;
  293. item requiredItem;
  294. string maximize;
  295. };
  296.  
  297. boolean [location] Hotel = $locations[The Ice Hotel];
  298. boolean [location] VYKEA = $locations[VYKEA];
  299. boolean [location] both = $locations[The Ice Hotel,VYKEA];
  300.  
  301. glaciestQuestData [string] glaciestQuest;
  302. glaciestQuest["balls"] = new glaciestQuestData(1,VYKEA,VYKEA,$item[none],", item, 50 max"); // covered by passives
  303. glaciestQuest["chum"] = new glaciestQuestData(2,VYKEA,both ,$item[Mr. Screege's spectacles],", 2 meat drop, 100 max"); // nearly covered by passives
  304. glaciestQuest["blood"] = new glaciestQuestData(3,both ,Hotel,$item[none],""); // bleed damage in combat (covered by tin snips in combat macro)
  305. glaciestQuest["bolts"] = new glaciestQuestData(4,VYKEA,both ,$item[VYKEA hex key],"");
  306. glaciestQuest["chicken"] = new glaciestQuestData(5,Hotel,Hotel,$item[sardine can key],", 5 food drop, 50 max");
  307. glaciestQuest["milk"] = new glaciestQuestData(6,Hotel,VYKEA,$item[norwhal helmet],", 5 booze drop, 50 max");
  308. glaciestQuest["moonbeams"] = new glaciestQuestData(7,both ,both ,$item[none],""); // no hat
  309. glaciestQuest["ice"] = new glaciestQuestData(8,both ,Hotel,$item[none],""); // 10 cold damage in combat (cold immune monsters only)
  310. glaciestQuest["rain"] = new glaciestQuestData(9,Hotel,VYKEA,$item[none],""); // 100 hot damage in combat
  311. }
  312.  
  313. boolean GlaciestHasQuest() {
  314. return ( get_property("questECoBucket") != "unstarted" && get_property("walfordBucketItem") != "" );
  315. }
  316.  
  317. string GlaciestActiveQuest() {
  318. return get_property("walfordBucketItem");
  319. }
  320.  
  321. void GlaciestPickQuest() {
  322. string [int,int] QuestsOffered;
  323. int best,bestValue;
  324. if ( GlaciestHasQuest() )
  325. return;
  326.  
  327. if ( !is_unrestricted($item[Airplane Charter: The Glaciest]) || get_property_bool("_walfordQuestStartedToday") )
  328. return;
  329.  
  330. string page = visit_url(walford);
  331. QuestsOffered = group_string(page,"\\b(balls|blood|bolts|chicken|chum|ice|milk|moonbeams|rain)\\b(?=\")");
  332.  
  333. if ( count(QuestsOffered) == 3 ) {
  334. foreach i in QuestsOffered {
  335. print("Quest "+(i+1)+": "+QuestsOffered[i,1]);
  336. if ( bestValue == 0 || glaciestQuest[QuestsOffered[i,1]].priority < bestValue ) {
  337. best = i+2;
  338. bestValue = glaciestQuest[QuestsOffered[i,1]].priority;
  339. }
  340. }
  341.  
  342. if ( best != 0 ) {
  343. print("Selecting Glaciest quest: "+QuestsOffered[best-2,1],"blue");
  344. if ( available_choice_options() contains best )
  345. run_choice(best);
  346. else
  347. abort("pickGlaciestQuest can't find the right choice somehow?");
  348. }
  349. }
  350. else
  351. abort("Trouble parsing offered Glaciest quests, found "+count(QuestsOffered)+" offers.");
  352. }
  353.  
  354. boolean GlaciestQuestComplete() {
  355. return (get_property_int("walfordBucketProgress") >= 100);
  356. }
  357.  
  358. boolean GlaciestHasActiveQuest() {
  359. return GlaciestHasQuest() && !GlaciestQuestComplete();
  360. }
  361.  
  362. void GlaciestTurnInQuest() {
  363. if ( GlaciestQuestComplete() ) {
  364. if ( equipped_item($slot[off-hand]) == $item[walford's bucket] )
  365. equip($slot[off-hand],$item[none]);
  366. visit_url(walford);
  367. run_choice(1);
  368. }
  369. }
  370.  
  371. void Glaciest() {
  372. if ( !get_property_bool("_coldAirportToday") && !get_property_bool("coldAirportAlways") )
  373. return;
  374.  
  375. GlaciestTurnInQuest();
  376. GlaciestPickQuest();
  377. GlaciestTurnInQuest();
  378. }
  379.  
  380. /*******************************************************\
  381. * Spring Break Beach
  382. \*******************************************************/
  383.  
  384. boolean UMDAvailable() {
  385. return dateDiff("yyyy-MM-dd",get_property("umdLastObtained"),"yyyyMMdd",today_to_string()) >= 7;
  386. }
  387.  
  388. void collectUMD() {
  389.  
  390.  
  391. if ( UMDAvailable() && usesRemaining($item[Clara's bell]) && !bossKilling
  392. && ( boolean_modifier("Adventure Underwater") || equip($item[mer-kin scholar mask]) || equip($item[mer-kin gladiator mask]) || equip($item[aerated diving helmet]) || equip($item[old SCUBA tank]) )
  393. && ( boolean_modifier("Underwater Familiar") || use_familiar($familiar[none]) )
  394. && ( !Drunk() || equip($item[drunkula's wineglass]) )
  395. && !has_effect($effect[smart drunk])
  396. && user_confirm("Do you want to use Clara's Bell to pick up an Ultimate Mind Destroyer in Spring Break Beach?",60000,get_property_bool("Dic.UseClara")) )
  397. {
  398. use(1,$item[Clara's Bell]);
  399. cli_execute("mood apathetic");
  400. set_property("choiceAdventure918",1);
  401. fullHeal();
  402. repeat {
  403. adv1($location[The Sunken Party Yacht], -1, "");
  404. }
  405. until ( !($Strings[a pound of cure, wooof! wooooooof!, your dog found something again, welcome to you!, yacht\, see?] contains stripLastEncounter() ) );
  406. if ( stripLastEncounter() != "yachtzee!" )
  407. print("Failed to get the Ultimate Mind Destroyer, instead encountered: "+get_property("lastEncounter"));
  408. }
  409.  
  410. }
  411.  
  412. void SpringBreakBeach() {
  413. if ( !is_unrestricted($item[Airplane Charter: Spring Break Beach]) || !get_property_bool("_sleazeAirportToday") && !get_property_bool("sleazeAirportAlways") )
  414. return;
  415.  
  416. collectUMD();
  417. }
  418.  
  419. /*******************************************************\
  420. * Conspiracy Island
  421. \*******************************************************/
  422.  
  423. static {
  424. string radio = "place.php?whichplace=airport_spooky&action=airport2_radio";
  425. string omegapanel = "place.php?whichplace=airport_spooky_bunker&action=si_controlpanel";
  426.  
  427. record conspiracyQuestData {
  428. int reward;
  429. string questStateProperty;
  430. int questProgressLimit;
  431. string questProgressProperty;
  432. boolean canUseWanderers;
  433. boolean canUseRunaways;
  434. boolean cleeshSafe;
  435. location questLocation;
  436. item requiredItem;
  437. string maximize;
  438. };
  439.  
  440. conspiracyQuestData [string] conspiracyQuest;
  441. conspiracyQuest["Serum"] = new conspiracyQuestData(30, "questESpSerum", 5, "", false, false, false, $location[The Mansion of Dr. Weirdeaux], $item[none],"10 item, 10 pickpocket chance");
  442. conspiracyQuest["Clipper"] = new conspiracyQuestData(20, "questESpClipper", 23, "fingernailsClipped", false, true, false, $location[The Mansion of Dr. Weirdeaux], $item[none],"");
  443. conspiracyQuest["EVE"] = new conspiracyQuestData(30, "questESpEVE", 0, "", true, true, true, $location[The Secret Government Laboratory], $item[none],"");
  444. conspiracyQuest["Medium"] = new conspiracyQuestData(30, "questESpFakeMedium", 0, "", true, true, true, $location[The Secret Government Laboratory], $item[none],"");
  445. conspiracyQuest["Gore"] = new conspiracyQuestData(20, "questESpGore", 100,"goreCollected", true, false, false, $location[The Secret Government Laboratory], $item[gore bucket],"10 meat");
  446. conspiracyQuest["Pun"] = new conspiracyQuestData(20, "questESpJunglePun", 11, "junglePuns", true, false, false, $location[The Deep Dark Jungle], $item[encrypted micro-cassette recorder],"mys");
  447. conspiracyQuest["Order"] = new conspiracyQuestData(30, "questESpOutOfOrder", 99, "", true, false, false, $location[The Deep Dark Jungle], $item[GPS-tracking wristwatch],"10 Initiative");
  448. conspiracyQuest["Smokes"] = new conspiracyQuestData(30, "questESpSmokes", 10, "", false, false, false, $location[The Deep Dark Jungle], $item[none],"10 item, 10 pickpocket chance");
  449.  
  450. record setting {
  451. item drop;
  452. boolean [monster] m;
  453. };
  454. setting [int] Panel;
  455. Panel[1] = new setting($item[none],$monsters[government scientist]);
  456. Panel[2] = new setting($item[battery-powered drill],$monsters[government scientist]);
  457. Panel[3] = new setting($item[none],$monsters[lab monkey]);
  458. Panel[4] = new setting($item[monkey barf],$monsters[lab monkey]);
  459. Panel[5] = new setting($item[none],$monsters[creepy little girl]);
  460. Panel[6] = new setting($item[cuddly teddy bear],$monsters[creepy little girl]);
  461. Panel[7] = new setting($item[none],$monsters[super-sized Cola Wars soldier]);
  462. Panel[8] = new setting($item[khaki duffel bag],$monsters[super-sized Cola Wars soldier]);
  463. Panel[9] = new setting($item[airborne mutagen],$monsters[government scientist,lab monkey,creepy little girl,super-sized Cola Wars soldier]);
  464. }
  465.  
  466. boolean ConspiracyHasQuest() {
  467. foreach quest,Q in conspiracyQuest
  468. if ( quest == "" ) {
  469. print("Charters: removing empty quest data","red");
  470. remove conspiracyQuest[""];
  471. return false;
  472. }
  473. else
  474. if ( get_property(Q.questStateProperty) != "unstarted" && get_property(Q.questStateProperty) != "finished" )
  475. return true;
  476. return false;
  477. }
  478.  
  479. string ConspiracyActiveQuest() {
  480. foreach quest,Q in conspiracyQuest
  481. if ( get_property(Q.questStateProperty) != "unstarted" && get_property(Q.questStateProperty) != "finished" )
  482. return quest;
  483. return "";
  484. }
  485.  
  486. boolean ConspiracyQuestComplete() {
  487. if ( !ConspiracyHasQuest() )
  488. return false;
  489. return get_property(conspiracyQuest[ConspiracyActiveQuest()].questStateProperty) == ( conspiracyQuest[ConspiracyActiveQuest()].requiredItem == $item[none] ? "step1" : "step2" );
  490. }
  491.  
  492. boolean ConspiracyHasActiveQuest() {
  493. return ConspiracyHasQuest() && !ConspiracyQuestComplete();
  494. }
  495.  
  496. void ConspiracyPickQuest() {
  497. if ( ConspiracyHasQuest() || get_property_bool("_Charters.ConspiracyQuestStartedToday") || get_property_bool("_Charters.ConspiracyQuestsAvoided") )
  498. return;
  499.  
  500.  
  501. if ( get_property("_questESp") == "" ) {
  502. if ( handling_choice() && last_choice() != 984 ) {
  503. page = visit_url("main.php");
  504. }
  505. page = visit_url(radio);
  506. int breakout;
  507. while ( get_property("_questESp") == "" && handling_choice() && last_choice() == 984 && breakout <= 37 ) {
  508. run_choice(5);
  509. breakout++;
  510. }
  511. if ( get_property("_questESp") == "" )
  512. abort("Charters: couldn't parse conspiracy quest, breakout limit reached.");
  513. }
  514.  
  515. foreach quest,Q in conspiracyQuest
  516. if ( get_property("_questESp") == Q.questStateProperty ) {
  517. print("Conspiracy quest of the day: "+quest,"blue");
  518. if ( Q.canUseWanderers || quest == "Clipper" || quest=="Smokes" || quest=="Serum" && StockUp(5,$item[experimental serum P-00],ItemValue($item[Coinspiracy])/24,ItemValue($item[Coinspiracy])/6) ) {
  519. visit_url(radio);
  520. set_property("_Charters.ConspiracyQuestStartedToday",true);
  521. run_choice(1);
  522. }
  523. else {
  524. set_property("_Charters.ConspiracyQuestsAvoided",true);
  525. print("No conspiracy quests that you want today","blue");
  526. break;
  527. }
  528. }
  529. }
  530.  
  531. void ConspiracyCompleteQuest() {
  532. if ( !ConspiracyHasActiveQuest() )
  533. return;
  534.  
  535. boolean claraUsed = false;
  536. switch (ConspiracyActiveQuest()) {
  537. case "Serum":
  538. StockUp(5,$item[experimental serum P-00],ItemValue($item[Coinspiracy])/24,ItemValue($item[Coinspiracy])/6);
  539. break;
  540. case "EVE":
  541. case "Medium":
  542. if ( $location[The Secret Government Laboratory].turns_spent - get_property_int("Dic.SecretLabNoncombatTimer") < 0 )
  543. set_property("Dic.SecretLabNoncombatTimer",$location[The Secret Government Laboratory].turns_spent);
  544. if ( $location[The Secret Government Laboratory].turns_spent - get_property_int("Dic.SecretLabNoncombatTimer") < 15
  545. && usesRemaining($item[Clara's bell]) && get_property_bool("Dic.UseClara") && NEPDone() && !UMDAvailable()
  546. && use(1,$item[Clara's bell]) )
  547. claraUsed = true;
  548. if ( ($location[The Secret Government Laboratory].turns_spent - get_property_int("Dic.SecretLabNoncombatTimer") > 20 || claraUsed)
  549. && !has_effect($effect[Steely-Eyed Squint])
  550. && !bossKilling )
  551. {
  552. try {
  553. cli_execute("mood apathetic");
  554. string aas = get_property("afterAdventureScript");
  555. set_property("afterAdventureScript","");
  556. equip($slot[acc1],$item[Personal Ventilation Unit]);
  557. fullHeal();
  558. if ( ConspiracyActiveQuest() == "EVE" )
  559. maximize("mainstat, equip Personal Ventilation Unit",false);
  560. adv1($location[The Secret Government Laboratory],-1,"");
  561. } finally {
  562. set_property("afterAdventureScript",aas);
  563. }
  564. }
  565. // Also handled with runaways in Electrofishing.ash
  566. break;
  567.  
  568. case "Gore":
  569. case "Pun":
  570. case "Order":
  571. // Handled with wandering monsters in afterAdventure.ash
  572. break;
  573. case "Clipper":
  574. // Handled with runaways in Electrofishing.ash
  575. break;
  576. case "Smokes":
  577. // Handled by free kills in SandwormSummon.ash
  578. break;
  579. }
  580. }
  581.  
  582. void ConspiracyTurnInQuest() {
  583. if ( ConspiracyQuestComplete() ) {
  584. visit_url(radio);
  585. run_choice(1);
  586. }
  587. }
  588.  
  589. void ConspiracyOmegaDevice() {
  590. if ( usesRemaining("_controlPanelUsed") ) {
  591. visit_url(omegapanel);
  592. int best = 1;
  593. int bestValue = 0;
  594. foreach i,s in Panel
  595. if ( !get_property_bool("controlPanel"+i) && itemValue(s.drop) >= bestValue ) {
  596. best = i;
  597. bestValue = itemValue(s.drop);
  598. }
  599. run_choice(best);
  600. }
  601.  
  602. if ( get_property_int("controlPanelOmega") >= 100 ) {
  603. visit_url(omegapanel);
  604. run_choice(10);
  605. }
  606. }
  607.  
  608. void ConspiracyIsland() {
  609. if ( !get_property_bool("_spookyAirportToday") && !get_property_bool("spookyAirportAlways") )
  610. return;
  611.  
  612. ConspiracyTurnInQuest();
  613. ConspiracyOmegaDevice();
  614. ConspiracyPickQuest();
  615. ConspiracyCompleteQuest();
  616. ConspiracyTurnInQuest();
  617. }
Add Comment
Please, Sign In to add comment