boolean WhiteCastle() {
//set to always kick in the front door (it is quicker)
//set_property("choiceAdventure931","3");
cli_execute("create * opium grenade");
cli_execute("conditions clear");
string qgw = get_property("questG02Whitecastle");
buffer page;
while (qgw!="finished") {
switch (qgw) {
case "unstarted":
page = visit_url("guild.php?place=paco");
page = run_choice(1);
break;
case "started":
adventure(1,$location[Whitey's Grove]);
break;
case "step1":
case "step2":
case "step3":
case "step4":
if (item_amount($item[opium grenade]) < 2) { buy(5,$item[opium grenade],2222); }
adventure(1,$location[The Road to the White Citadel]);
break;
case "step5":
case "step6":
//abort("kill the witch!");
page = visit_url("adventure.php?snarfblat=413");
if (contains_text(page, "Playing Fetch")) { page = run_choice(1); }
if (contains_text(page, "value=\"Kick in the front door\"")) { page = run_choice(3); }
if (contains_text(page, "value=\"Screw it, kick in the front door\"")) { page = run_choice(1); }
if (contains_text(page, "value=\"So much for the direct approach.\"")) { page = run_choice(1); }
if (contains_text(page, "Combat: Round")) { page = run_combat(); }
break;
case "step7":
case "step8":
//abort("explore the chests");
page = visit_url("adventure.php?snarfblat=413");
if (contains_text(page, "Playing Fetch")) { page = run_choice(1); }
if (contains_text(page, "value=\"Investigate the chests\"")) { page = run_choice(1); }
if (contains_text(page, "value=\"Open the first chest\"")) {
if (contains_text(page, "value=\"Leave the treasure chamber\"")) {
page = run_choice(4);
} else {
page = run_choice(1);
}
}
if (contains_text(page, "value=\"Examine some more chests\"")) { page = run_choice(1); }
if (contains_text(page, "value=\"Return to the chests\"")) { page = run_choice(2); }
if (contains_text(page, "Combat: Round")) { page = run_combat(); }
break;
case "step9":
adventure(1,$location[The Road to the White Citadel]);
break;
case "step10":
case "step11":
page = visit_url("shop.php?whichshop=whitecitadel");
page = visit_url("guild.php?place=paco");
break;
}
qgw = get_property("questG02Whitecastle");
}
if (qgw=="finished") { return true; }
return false;
}