Item drop modifier: Difference between revisions
Jump to navigation
Jump to search
imported>StDoodle mNo edit summary |
imported>Bale mNo edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 5: | Line 5: | ||
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 19: | Line 17: | ||
code1={{CodeSample| | code1={{CodeSample| | ||
title=Code Samples| | title=Code Samples| | ||
description=Shows your current item drop percentages for each of a monster's item drops.| | description=Shows your current item drop percentages for each of a monster's item drops (assuming that the monster does not have any repeat drops).| | ||
code= | code= | ||
<syntaxhighlight> | <syntaxhighlight> | ||
void item_drop() { | void item_drop( monster mob) { | ||
int[item] monster_items = item_drops( | int[item] monster_items = item_drops(mob); | ||
foreach item in monster_items { | foreach item in monster_items { | ||
float drop_rate = monster_items[item]; | float drop_rate = monster_items[item]; | ||
Line 37: | Line 35: | ||
special=Returns 0.0 when not logged in. | special=Returns 0.0 when not logged in. | ||
}} | }} | ||
[[Category:Your Character]] |
Latest revision as of 21:36, 21 May 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 (assuming that the monster does not have any repeat drops).
void item_drop( monster mob) {
int[item] monster_items = item_drops(mob);
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.0 when not logged in.