Difference between pages "Item drops" and "Monster"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>AlbinoRhino
 
imported>Heeheehee
 
Line 1: Line 1:
{{
+
#REDIRECT [[Datatype_Constants#.24monster.5Bconstant.5D]]
#vardefine:name|item_drops}}{{
 
#vardefine:return_type|int [item]}}{{
 
#vardefine:aggregate|yes}}{{
 
 
 
FunctionPage|
 
name={{#var:name}}|
 
 
 
function1={{Function|
 
name={{#var:name}}|
 
aggregate={{#var:aggregate}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}
 
}}|
 
 
 
function2={{Function|
 
name={{#var:name}}|
 
aggregate={{#var:aggregate}}|
 
parameter1={{Param|monster|m}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}
 
}}|
 
 
 
function_description=Returns a map of the monster's drop rates, indexed by item names.|
 
 
 
code1={{CodeSample|
 
title=Code Samples|
 
description=Prints the drops of a certain monster.|
 
code=
 
<syntaxhighlight>
 
void drops(monster mob){
 
  int[item] drops = item_drops(mob);
 
  print("Monster: " + mob);
 
  foreach i in drops {
 
      print("Drop rate of " + i + " is " + drops[i]*(1+item_drop_modifier()/100) + "%");
 
  }
 
}
 
</syntaxhighlight>
 
}}|
 
 
 
see_also={{SeeAlso|meat_drop|item_drop_modifier|item_drops_array}}|
 
special=This function has a known limitation: if a monster drops the same item more than once, the map only returns the last rate in that monster's entry in monsters.txt, however [[item_drops_array|item_drops_array()]] can be used to bypass this limitation.
 
}}
 
 
 
[[Category:Item Management]]
 

Revision as of 20:18, 6 March 2010