Template:Average drop value/doc

From Old School RuneScape Wiki
Jump to: navigation, search
Information icon-grey.svg
This is a documentation subpage for Template:Average drop value.
It contains usage information, categories, and other content that is not part of the original template page.
Template:Average drop value invokes function main in Module:Average drop value using Lua.
Template:Average drop value invokes 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|round=integer total|category=will count a specific type of drop|exclude=will exclude a specific type of drop}}

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#Level 98}}:

The average Ankou ( Level 98 ) kill is worth 1,039.05.

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#Level 98|mobname=level 98 ankou}}:

The average level 98 ankou kill is worth 1,039.05.

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#Level 98|raw=y}}: 1039.0482607875

killname

killname will override the word "kill" in the text with the value given.

round

Setting round to any value will make the template return the sum rounded down to the nearest integer.

category

Category will filter any drops from the total that are not in that category. For example it could be used to total up only the seed or herb drops from a given monster. This is based on a category match in dpl. So multiple categories can be used together.

exclude

Exclude will exclude drops in a given category from the total. For example excluding bone drops or herb drops from a monster's loot. This is based on a category match in dpl. So multiple categories can be used together.

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 has custom formatting.

ParameterDescriptionTypeStatus
Monstermob

Name of monster. Defaults to pagename.

Default
empty
Example
Giant Sea Snake
Auto value
empty
Pagesuggested
Monster name overridemobname

Override the monster name

Default
empty
Example
level 149 Giant Sea Snake
Auto value
empty
Stringoptional
Rawraw

If present, only outputs the number

Default
empty
Example
empty
Auto value
empty
Booleanoptional
Killnamekillname

Overwrite the word 'kill' with something else (e.g. 'loot')

Default
empty
Example
empty
Auto value
empty
Stringoptional
Categorycategory

Only includes drops from a given category or dpl formatted list of categories in the total

Default
empty
Example
empty
Auto value
empty
Stringoptional
Excludeexclude

Excludes drops from a given category or dpl formatted list of categories from the total

Default
empty
Example
empty
Auto value
empty
Stringoptional
Roundround

Round the total down to a whole integer value

Default
empty
Example
empty
Auto value
empty
Booleanoptional