My maxmp: Difference between revisions
Jump to navigation
Jump to search
imported>StDoodle mNo edit summary |
imported>Bale mNo edit summary |
||
Line 5: | Line 5: | ||
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 35: | Line 34: | ||
special=When not logged in, this function returns 0. | special=When not logged in, this function returns 0. | ||
}} | }} | ||
[[Category:Your Character]] |
Latest revision as of 21:33, 21 May 2010
Function Syntax
int my_maxmp()
Returns the logged-in character's maximum MP level as an int.
Code Samples
The following example attempts to ensure that you are able to cast Olfaction before adventuring.
location bountylocation = $location[Hole in the Sky];
if(my_maxmp() < mp_cost($skill[transcendant olfaction])) {
print("You are unable to cast Olfaction." , "red");
}
else {
restore_mp(mp_cost($skill[transcendant olfaction]));
}
adventure(my_adventures() , bountylocation);
See Also
Special
When not logged in, this function returns 0.