Meat drop modifier: Difference between revisions
Jump to navigation
Jump to search
imported>Grotfang Create page |
imported>Bale mNo edit summary |
||
(11 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
a | {{ | ||
#vardefine:name|meat_drop_modifier}}{{ | |||
#vardefine:return_type|float}}{{ | |||
FunctionPage| | |||
name={{#var:name}}| | |||
function1={{Function| | |||
name={{#var:name}}| | |||
aggregate={{#var:aggregate}}| | |||
return_type={{#var:return_type}}| | |||
return_also={{#var:return_also}} | |||
}}| | |||
function_description=Returns the percentage that you currently increase or decrease your meat drops as a result of equipment, effects (including familiars) and area modifiers (such as on the sea floor).| | |||
code1={{CodeSample| | |||
title=Code Samples| | |||
description=Uses the baseline meat drop to determine how much you can expect to get, on average, from a given monster.| | |||
code= | |||
<syntaxhighlight> | |||
float monster_drop(monster mob) { | |||
int monster_drop = meat_drop(mob); | |||
float adjust_drop = monster_drop * (meat_drop_modifier() / 100.0 + 1); | |||
return adjust_drop; | |||
} | |||
</syntaxhighlight> | |||
}} | |||
{{CodeSample| | |||
description=This goes one step further and calculates an average return per monster for a given location. It calls the preceeding function.| | |||
code= | |||
<syntaxhighlight> | |||
float total_monster_drop() { | |||
monster [int] monster_list = get_monsters($location[giant castle]); | |||
float total_meat = 0; | |||
foreach int in monster_list { | |||
total_meat = total_meat + monster_drop(monster_list[int]); | |||
} | |||
return (total_meat / count(monster_list)); | |||
} | |||
</syntaxhighlight> | |||
}}| | |||
see_also={{SeeAlso|item_drop_modifier|meat_drop}}| | |||
special=Returns 0.0 when not logged in. | |||
}} | |||
[[Category:Your Character]] |
Latest revision as of 21:36, 21 May 2010
Function Syntax
float meat_drop_modifier()
Returns the percentage that you currently increase or decrease your meat drops as a result of equipment, effects (including familiars) and area modifiers (such as on the sea floor).
Code Samples
Uses the baseline meat drop to determine how much you can expect to get, on average, from a given monster.
float monster_drop(monster mob) {
int monster_drop = meat_drop(mob);
float adjust_drop = monster_drop * (meat_drop_modifier() / 100.0 + 1);
return adjust_drop;
}
This goes one step further and calculates an average return per monster for a given location. It calls the preceeding function.
float total_monster_drop() {
monster [int] monster_list = get_monsters($location[giant castle]);
float total_meat = 0;
foreach int in monster_list {
total_meat = total_meat + monster_drop(monster_list[int]);
}
return (total_meat / count(monster_list));
}
See Also
Special
Returns 0.0 when not logged in.