Template:Average drop value

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to navigation Jump to search
Template documentation
This documentation is transcluded from Template:Average drop value/doc. [edit] [history] [purge]
Template:Average drop value invokes function main in Module:Average drop value using Lua.

Calculates the average drop value of a monster, using the SMW data for that monster. This should really only be used on drop tables where the exact or near-exact format is known.

Details

This will calculate using the item name, the quantity, and the rarity. If it fails to parse any of these, it will ignore that item.

  • Item name must be a GE item and present in Module:GEPrices/data, or be 'Coins'.
  • Rarity must be something that can be #expr:'d into a number, or 'Always'.
  • Quantity must be a number, or a simple range. Multiple quantities (separated by ;) are currently not supported.

This will search in the SMW data for Property:Drop from the specified monster and Property:Dropped item with some value. This means that:

Usage

{{Average drop value}}

{{Average drop value|mob=monster|mobname=override name|raw=total only|parse=attempt to parse text drop rarities|rdt=include drops from the rare drop table}}

mob

The monster it fetches data for is defined using the mob or 1 (first unnamed parameter). By default, if no name is provided it will use the current page name.

Use the relevant subobject name to get data for the correct sub-version, for example {{Average drop value|mob=Ankou#60}}:

The average Ankou (60) kill is worth 1,986.28 coins.

mobname

mobname will override the name in the text with the value given. The default behaviour is to just use the monster name, with the version in brackets if necessary.

Example: {{Average drop value|mob=Ankou#60|mobname=level 60 ankou}}:

The average level 60 ankou kill is worth 1,986.28 coins.

raw

Setting raw to any value will make the template return only the sum, and none of the surrounding text or formatting. This is able to be used in other calculations or a custom string written around it. Obviously, with this the mobname parameter does nothing.

Example: {{Average drop value|mob=Ankou#60|raw=y}}:

1986.277303125

parse

Setting parse to any value will try to parse worded drop rates (common, uncommon etc) into drop values as follows: This should be avoided as it is very inaccurate, and cannot be used on mainspace pages!

Common 1/16
Uncommon 1/64
Rare 1/256
Very Rare 1/1024

Example: {{Average drop value|mob=Ankou#60|parse=y}}:

The average Ankou (60) kill is worth 1,990.91 coins (includes worded aproximate drop rates)

rdt

Setting rdt to any value will include the rare drop table in the average value returned. For calculations the chance of rolling the rdt is assumed to be 1/1024 (very rare).

Example: {{Average drop value|mob=Ankou#60|rdt=y}}:

The average Ankou (60) kill is worth 4,114.61 coins.

Template data

Show/hide template's data

The following information is used by extensions and applications, such as VisualEditor, to help users implement this template onto pages. Please ensure that it is up-to-date.

Calculates the average drop value of a monster, using the SMW data for that monster. This should really only be used on drop tables where the exact or near-exact format is known.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Monstermob

Name of monster. Defaults to pagename.

Example
Giant Sea Snake
Page namesuggested
Monster name overridemobname

Override the monster name

Example
level 149 Giant Sea Snake
Stringoptional
rawraw

If present, only outputs the number

Booleanoptional
parseparse

If present, will try to parse worded drop rates (common, uncommon etc) into drop values

Booleanoptional
rdtrdt

If present, includes the rare drop table in the average drop value (assumes 1/1024 chance or rolling rdt)

Booleanoptional