Difference between revisions of "Template:AutoArmourStats"

From Melvor Idle
(Change to single Lua invocation)
Tag: Replaced
(Added the ability for autoarmourstats to collapse to a single line if it's all zeros)
 
Line 2: Line 2:
  
 
{{T|{{PAGENAME}}|Ragnar God Gloves}} gives {{{{PAGENAME}}|Ragnar God Gloves}}
 
{{T|{{PAGENAME}}|Ragnar God Gloves}} gives {{{{PAGENAME}}|Ragnar God Gloves}}
<includeonly><onlyinclude>{{#invoke:Items|getArmourStatsBox|{{{1|{{PAGENAME}}}}}}}</onlyinclude></includeonly>
+
 
 +
When called for items without any combat stats, it returns a simple statement to that effect. For example, {{T|{{PAGENAME}}|Gold Topaz Ring}} gives<br/>{{{{PAGENAME}}|Gold Topaz Ring}}
 +
<includeonly><onlyinclude>{{#ifeq:true|{{#invoke:Items|getItemStat|{{{1|{{PAGENAME}}}}}|hasCombatStats}}|{{#invoke:Items|getArmourStatsBox|{{{1|{{PAGENAME}}}}}}}|{{{1|{{PAGENAME}}}}} does not provide any stat bonuses in combat.}}
 +
</onlyinclude></includeonly>

Latest revision as of 00:46, 12 January 2022

Automatic version of Template:ArmourStats that pulls data via Lua.

{{AutoArmourStats|Ragnar God Gloves}} gives

Armour Stats
Offensive Stats Defensive Stats
Strength (skill).svg Strength Bonus 16 Defence (skill).svg Defence Bonus 11
Combat.svg Stab Bonus 12 Defence (skill).svg Damage Reduction 7%
Combat.svg Slash Bonus 12 Ranged (skill).svg Defence Bonus 0
Combat.svg Block Bonus 12 Magic (skill).svg Defence Bonus 0
Ranged (skill).svg Attack Bonus -5 Other
Ranged (skill).svg Strength Bonus 0 Slayer (skill).svg Bonus Slayer XP 0%
Magic (skill).svg Attack Bonus -8 Defence (skill).svg Level Required 85
Magic (skill).svg % Damage Bonus 0% Ranged (skill).svg Level Required 0
Magic (skill).svg Level Required 0


When called for items without any combat stats, it returns a simple statement to that effect. For example, {{AutoArmourStats|Gold Topaz Ring}} gives
Gold Topaz Ring does not provide any stat bonuses in combat.