Meat drop modifier: Difference between revisions
Jump to navigation
Jump to search
imported>Grotfang No edit summary |
imported>Heeheehee No edit summary |
||
Line 34: | Line 34: | ||
monster [int] monster_list = get_monsters($location[giant castle]); | monster [int] monster_list = get_monsters($location[giant castle]); | ||
float total_meat = 0; | float total_meat = 0; | ||
foreach int in monster_list { | foreach int in monster_list { | ||
total_meat = total_meat + monster_drop(monster_list[int]); | total_meat = total_meat + monster_drop(monster_list[int]); | ||
} | } | ||
return (total_meat / | return (total_meat / count(monster_list)); | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 02:47, 4 March 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 when not logged in.