Template:AutoArmourStats: Difference between revisions

From Melvor Idle
(Fixing melee defence bonus)
m (Removed mention of a non-existent template)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Automatic version of [[Template:ArmourStats]] that pulls data via Lua.
{{T|{{PAGENAME}}|Ragnar God Gloves}} gives {{{{PAGENAME}}|Ragnar God Gloves}}


{{T|{{PAGENAME}}|Ragnar God Gloves}} gives {{{{PAGENAME}}|Ragnar God Gloves}}
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>{{#vardefine:item|{{{1|{{PAGENAME}}}}}}}{| class="wikitable"
<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>
! colspan="4" style = "border-bottom: solid medium black;"| Armour Stats
|-
! colspan="2" style = "border-bottom: solid thin black;"| Offensive Stats
! colspan="2" style = "border-bottom: solid thin black;"| Defensive Stats
|-
! style ="text-align: right;"| {{Skill|Strength|notext=true}} Strength Bonus
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|meleeStrengthBonus|ForceZero=true}}
! style ="text-align: right;"| {{Skill|Defence|notext=true}} Defence Bonus
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|meleeDefenceBonus|ForceZero=true}}
|-
! style ="text-align: right;"| [[File:Combat.svg|25px|middle|link=Attack]] Stab Bonus
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|stabAttackBonus|ForceZero=true}}
! style ="text-align: right;"| [[File:Defence (skill).svg|25px|middle|link=Defence]] Damage Reduction
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|damageReduction|ForceZero=true}}%
|-
! style ="text-align: right;"| [[File:Combat.svg|25px|middle|link=Strength]] Slash Bonus
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|slashAttackBonus|ForceZero=true}}
! style ="text-align: right;"| [[File:Ranged (skill).svg|25px|middle|link=Ranged]] Defence Bonus
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|rangedDefenceBonus|ForceZero=true}}
|-
! style ="text-align: right;"| [[File:Combat.svg|25px|middle|link=Defence]] Block Bonus
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|blockAttackBonus|ForceZero=true}}
! style ="text-align: right;border-bottom: solid thin black;"| [[File:Magic (skill).svg|25px|middle|link=Magic]] Defence Bonus
| style ="text-align: right;border-bottom: solid thin black;"| {{#invoke:Items|getItemStat|{{#var:item}}|magicDefenceBonus|ForceZero=true}}
|-
! style ="text-align: right;"| [[File:Ranged (skill).svg|25px|middle|link=Ranged]] Attack Bonus
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|rangedAttackBonus|ForceZero=true}}
! colspan="2" style = "border-bottom: solid thin black;"| Other
|-
! style ="text-align: right;"| [[File:Ranged (skill).svg|25px|middle|link=Ranged]] Strength Bonus
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|rangedStrengthBonus|ForceZero=true}}
! style ="text-align: right;"| [[File:Slayer (skill).svg|25px|middle|link=Slayer]] Bonus Slayer XP
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|slayerBonusXP|ForceZero=true}}%
|-
! style ="text-align: right;"| [[File:Magic (skill).svg|25px|middle|link=Magic]] Attack Bonus
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|magicAttackBonus|ForceZero=true}}
! style ="text-align: right;"| [[File:Defence (skill).svg|25px|middle|link=Defence]] Level Required
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|defenceLevelRequired|ForceZero=true}}
|-
! style ="text-align: right;"| [[File:Magic (skill).svg|25px|middle|link=Magic]] % Damage Bonus
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|magicDamageBonus|ForceZero=true}}%
! style ="text-align: right;"| [[File:Ranged (skill).svg|25px|middle|link=Ranged]] Level Required
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|rangedLevelRequired|ForceZero=true}}
|-
| colspan="2"|
! style ="text-align: right;"| [[File:Magic (skill).svg|25px|middle|link=Magic]] Level Required
| style ="text-align: right;"| {{#invoke:Items|getItemStat|{{#var:item}}|magicLevelRequired|ForceZero=true}}
|}</onlyinclude></includeonly>

Latest revision as of 12:36, 2 July 2024

{{AutoArmourStats|Ragnar God Gloves}} gives

Armour Stats
Offensive Stats Defensive Stats
Error creating thumbnail: File missing
Strength Bonus
16
Error creating thumbnail: File missing
Defence Bonus
11
Error creating thumbnail: File missing
Stab Bonus
12
Error creating thumbnail: File missing
Damage Reduction
7%
Error creating thumbnail: File missing
Slash Bonus
12
Error creating thumbnail: File missing
Defence Bonus
0
Error creating thumbnail: File missing
Block Bonus
12
Error creating thumbnail: File missing
Defence Bonus
0
Error creating thumbnail: File missing
Attack Bonus
-5 Equip Requirements
Error creating thumbnail: File missing
Strength Bonus
0
Error creating thumbnail: File missing
Level Required
85
Error creating thumbnail: File missing
Attack Bonus
-8
Error creating thumbnail: File missing
 % Damage Bonus
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.