Tavern: Difference between revisions
Jump to navigation
Jump to search
imported>Bale mNo edit summary |
imported>Padth Previous information was way wrong |
||
(One intermediate revision by one other user not shown) | |||
Line 13: | Line 13: | ||
}}| | }}| | ||
function_description=Attempts to complete the level 3 tavern quest, stopping when it | function2={{Function| | ||
name={{#var:name}}| | |||
aggregate={{#var:aggregate}}| | |||
return_type={{#var:return_type}}| | |||
return_also={{#var:return_also}}| | |||
parameter1={{Param|string|target}}| | |||
p1desc={{Pspan|target}} is the (optional) target destination (one of "faucet", "baron", "fight", or "explore".) Defaults to "faucet".| | |||
}}| | |||
function_description=Attempts to complete the level 3 tavern quest, stopping when it has reached the target specified. "faucet" and "baron" will find the faucet and the baron respectively, "fight" will find and fight the baron, and "explore" will explore the entire cellar. Returns the square the faucet or baron is found in, 0 if "explore" is chosen, or -1 if an error is encountered. | |||
| | | | ||
Line 24: | Line 30: | ||
code= | code= | ||
<syntaxhighlight> | <syntaxhighlight> | ||
int square = tavern(); | |||
if(get_property("tavernLayout").contains_text("3")) { | |||
print("Found the Rat Faucet in square " + square); | |||
if(available_amount($item[Baron von Ratsworth's monocle]) == 0 | |||
&& available_amount($item[Baron von Ratsworth's money clip]) == 0 | |||
&& available_amount($item[Baron von Ratsworth's tophat]) == 0 | |||
&& user_confirm("Do you want to fight Baron Von Ratsworth?")) { | |||
tavern("fight"); | |||
} | |||
} else print("Did not find the rat faucet.", "red"); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}}| | }}| | ||
see_also={{SeeAlso|chamber|entryway|guardians|hedgemaze}}| | see_also={{SeeAlso|chamber|entryway|guardians|hedgemaze}}| | ||
cli_equiv=The CLI | cli_equiv=The CLI commands "tavern" and "baron" function similarly.| | ||
}} | }} | ||
[[Category:Adventuring]] | [[Category:Adventuring]] |
Latest revision as of 13:55, 28 July 2014
Function Syntax
int tavern()
- target is the (optional) target destination (one of "faucet", "baron", "fight", or "explore".) Defaults to "faucet".
Attempts to complete the level 3 tavern quest, stopping when it has reached the target specified. "faucet" and "baron" will find the faucet and the baron respectively, "fight" will find and fight the baron, and "explore" will explore the entire cellar. Returns the square the faucet or baron is found in, 0 if "explore" is chosen, or -1 if an error is encountered.
Code Sample
Solve the Typical Tavern.
int square = tavern();
if(get_property("tavernLayout").contains_text("3")) {
print("Found the Rat Faucet in square " + square);
if(available_amount($item[Baron von Ratsworth's monocle]) == 0
&& available_amount($item[Baron von Ratsworth's money clip]) == 0
&& available_amount($item[Baron von Ratsworth's tophat]) == 0
&& user_confirm("Do you want to fight Baron Von Ratsworth?")) {
tavern("fight");
}
} else print("Did not find the rat faucet.", "red");
CLI Equivalent
The CLI commands "tavern" and "baron" function similarly.