Item drop modifier: Difference between revisions
Jump to navigation
Jump to search
imported>Heeheehee m Removed an extraneous closing curly brace. |
imported>Bale watch your int to float error! |
||
Line 24: | Line 24: | ||
foreach item in monster_items { | foreach item in monster_items { | ||
float drop_rate = monster_items[item]; | float drop_rate = monster_items[item]; | ||
float modified = drop_rate * (item_drop_modifier()/100); | float modified = drop_rate * (item_drop_modifier()/100.0); | ||
float your_rate = drop_rate + modified; | float your_rate = drop_rate + modified; | ||
print( item + ": " + your_rate ); | print( item + ": " + your_rate ); |
Revision as of 09:18, 4 March 2010
Function Syntax
float item_drop_modifier()
Returns the percentage modification on item drops as a result of your equipment, effects (including familiar) and area modifiers (such as in the sea).
Code Samples
Shows your current item drop percentages for each of a monster's item drops.
void item_drop() {
int[item] monster_items = item_drops($monster[alphabet giant]);
foreach item in monster_items {
float drop_rate = monster_items[item];
float modified = drop_rate * (item_drop_modifier()/100.0);
float your_rate = drop_rate + modified;
print( item + ": " + your_rate );
}
}
See Also
Special
Returns 0 when not logged in.