Difference between revisions of "Item drop modifier"
Jump to navigation
Jump to search
imported>Grotfang m (moved Item drop modifier() to Item drop modifier: Conformity in naming. Creating page.) |
imported>Grotfang |
||
Line 1: | Line 1: | ||
− | a | + | {{#vardefine:name|item_drop_modifier}} |
+ | {{#vardefine:return_type|float}} | ||
+ | |||
+ | {{FunctionPage| | ||
+ | name={{#var:name}}| | ||
+ | function_category=Your Character| | ||
+ | |||
+ | function1={{Function| | ||
+ | name={{#var:name}}| | ||
+ | aggregate={{#var:aggregate}}| | ||
+ | return_type={{#var:return_type}}| | ||
+ | return_also={{#var:return_also}} | ||
+ | }}| | ||
+ | |||
+ | function_description=Returns the percentage modification on item drops as a result of your equipment, effects (including familiar) and area modifiers (such as in the sea).| | ||
+ | |||
+ | code1={{CodeSample| | ||
+ | title=Code Samples| | ||
+ | description=Shows your current item drop percentages for each of a monster's item drops.| | ||
+ | code= | ||
+ | <syntaxhighlight> | ||
+ | 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); | ||
+ | float your_rate = drop_rate + modified; | ||
+ | print( item + ": " + your_rate ); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | }}| | ||
+ | |||
+ | see_also={{SeeAlso|meat_drop_modifier|item_drops}}| | ||
+ | special=Returns 0 when not logged in. | ||
+ | }} |
Revision as of 23:50, 28 February 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);
float your_rate = drop_rate + modified;
print( item + ": " + your_rate );
}
}
}
See Also
Special
Returns 0 when not logged in.