Difference between revisions of "Template:ItemPropertiesInfoBox"

From ChatWars Wiki
Jump to: navigation, search
(minor bugfix for pages using this to get info of other pages)
 
(92 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{#vardefine: source | {{{source|{{PAGENAME}} }}} }}
 +
 +
{{#vardefine: enchantAtk1 | {{#show: {{#var: source}} |?EnchantAtk1 }} }}
 +
{{#vardefine: enchantAtk2 | {{#show: {{#var: source}} |?EnchantAtk2 }} }}
 +
{{#vardefine: enchantAtk3 | {{#show: {{#var: source}} |?EnchantAtk3 }} }}
 +
{{#vardefine: enchantAtk4 | {{#show: {{#var: source}} |?EnchantAtk4 }} }}
 +
 +
{{#vardefine: enchantDef1 | {{#show: {{#var: source}} |?EnchantDef1 }} }}
 +
{{#vardefine: enchantDef2 | {{#show: {{#var: source}} |?EnchantDef2 }} }}
 +
{{#vardefine: enchantDef3 | {{#show: {{#var: source}} |?EnchantDef3 }} }}
 +
{{#vardefine: enchantDef4 | {{#show: {{#var: source}} |?EnchantDef4 }} }}
 +
 +
{{#vardefine: enchantMana1 | {{#show: {{#var: source}} |?EnchantMana1 }} }}
 +
{{#vardefine: enchantMana2 | {{#show: {{#var: source}} |?EnchantMana2 }} }}
 +
{{#vardefine: enchantMana3 | {{#show: {{#var: source}} |?EnchantMana3 }} }}
 +
{{#vardefine: enchantMana4 | {{#show: {{#var: source}} |?EnchantMana4 }} }}
 +
 +
{{#vardefine: showAtkEnchant | 0 }}
 +
{{#vardefine: showDefEnchant | 0 }}
 +
{{#vardefine: showManaEnchant | 0 }}
 
<includeonly>
 
<includeonly>
<!--|colspan="2" style="text-align: center"-->||'''Stats'''
+
|Craftable
 +
| {{#if: {{#show: {{#var: source}} |?BoolCraft }} | {{#ifeq: {{#show: {{#var: source}} |?BoolCraft }} | true | yes | no}} | [[??]] }}
 +
|-
 +
|Tradeable (Auction)
 +
| {{#if: {{#show: {{#var: source}} |?BoolAuction }} | {{#ifeq: {{#show: {{#var: source}} |?BoolAuction }} | true | yes | no}} | [[??]] }}
 +
|-
 +
|Shop prices (buy / sell)
 +
| {{#if: {{#show: {{#var: source}} |?ShopBuyPrice }}
 +
    | {{#show: {{#var: source}} |?ShopBuyPrice }}{{Emoticon|emoticon=Gold}}
 +
    | ''Can't be bought''
 +
  }} / <!--
 +
-->{{#if: {{#show: {{#var: source}} |?ShopSellPrice}}
 +
    | {{#show: {{#var: source}} |?ShopSellPrice }}{{Emoticon|emoticon=Gold}}
 +
    | {{#if: {{#show: {{#var: source}} |?ShopBuyPrice }}
 +
        | {{#ifexpr: {{#show: {{#var: source}} |?ShopBuyPrice }} < 4
 +
            | 0{{Emoticon|emoticon=Gold}}
 +
            | ''Can't be sold''
 +
          }}
 +
        | ''Can't be sold''
 +
      }}
 +
  }}
 +
|-
 +
|colspan="2" align="center"|'''Stats'''
 
|-
 
|-
 
|'''Attribute'''
 
|'''Attribute'''
Line 6: Line 48:
 
|-
 
|-
 
|Attack  
 
|Attack  
| +{{#show: {{PAGENAME}} |?Attack}} {{Emoticon|emoticon=Attack}}
+
| +{{#if: {{#show: {{#var: source}} |?Attack }} | {{#show: {{#var: source}} |?Attack }} | [[??]] }} {{Emoticon|emoticon=Attack}}
 
|-
 
|-
 
|Defense
 
|Defense
| +{{#show: {{PAGENAME}} |?Defense}} {{Emoticon|emoticon=Defend}}
+
| +{{#if: {{#show: {{#var: source}} |?Defense }} | {{#show: {{#var: source}} |?Defense }} | [[??]] }} {{Emoticon|emoticon=Defend}}
 
|-
 
|-
 
|Mana
 
|Mana
| +{{#show: {{PAGENAME}} |?Mana}} {{Emoticon|emoticon=Mana}}
+
| +{{#if: {{#show: {{#var: source}} |?Mana }} | {{#show: {{#var: source}} |?Mana }} | [[??]] }} {{Emoticon|emoticon=Mana}}
 +
|-
 +
{{#if: {{#show: {{#var: source}} |?Stamina }} |
 +
  {{#ifeq: {{#show: {{#var: source}} |?Stamina }} | 0 | |
 +
    {{!}}Stamina
 +
    {{!}} +{{#show: {{#var: source}} |?Stamina }} {{Emoticon|emoticon=Stamina}}
 +
    {{!}}-
 +
  }}
 +
}}
 +
{{#if: {{#show: {{#var: source}} |?InventoryIncrease }} |
 +
  {{#ifeq: {{#show: {{#var: source}} |?InventoryIncrease }} | 0 | |
 +
    {{!}}Inventory increase
 +
    {{!}} +{{#show: {{#var: source}} |?InventoryIncrease }} {{Emoticon|emoticon=Bag}}
 +
    {{!}}-
 +
  }}
 +
}}
 +
{{#if: {{#show: {{#var: source}} |?Luck }} |
 +
  {{#ifeq: {{#show: {{#var: source}} |?Luck }} | 0 | |
 +
    {{!}}Luck
 +
    {{!}} +{{#show: {{#var: source}} |?Luck }} {{Emoticon|emoticon=Luck}}
 +
    {{!}}-
 +
  }}
 +
}}
 +
|[[Skill]]
 +
| {{#switch: {{#show: {{#var: source}} |?ItemType# }}
 +
    | Weapon = {{#ask: [[{{#var: source}}]]
 +
                |mainlabel=-
 +
                |headers=hide
 +
                |format=template
 +
                |template=GenerateMastery
 +
                |?ItemSubType#
 +
              }}
 +
    | Protective Gear = {{#if: {{#show: {{#var: source}} |?ArmorClass# }}
 +
                          | {{#ask: [[{{#var: source}}]]
 +
                              |mainlabel=-
 +
                              |headers=hide
 +
                              |format=template
 +
                              |template=GenerateMastery
 +
                              |?ArmorClass#
 +
                            }} ([[Armor Mastery]])
 +
                          | [[Armor Mastery]]
 +
                        }}
 +
    | -
 +
  }}
 
|-
 
|-
 
|Level Requirement
 
|Level Requirement
|{{#show: {{PAGENAME}} |?LevelEquipRequirement}}{{#switch: {{#show: {{PAGENAME}} |?LevelEquipRequirement}} | 15 =, {{Emoticon|emoticon=Bookred}} | 25 =, {{Emoticon|emoticon=Bookgreen}} | 35 =, {{Emoticon|emoticon=Bookblue}} | 45 =, {{Emoticon|emoticon=Bookorange}} }}
+
| {{#show: {{#var: source}} |?LevelEquipRequirement }} {{#switch: {{#show: {{#var: source}} |?LevelEquipRequirement }} | 15 = ({{Emoticon|emoticon=Bookred}}) | 25 = ({{Emoticon|emoticon=Bookgreen}}) | 35 = ({{Emoticon|emoticon=Bookblue}}) | 45 = ({{Emoticon|emoticon=Bookorange}}) }}
 
|-
 
|-
 
|Enchantment Slot
 
|Enchantment Slot
|{{#show: {{PAGENAME}} |?BoolEnchantment}}{{#switch: {{#show: {{PAGENAME}} |?LevelEquipRequirement}} | 15 =, {{Emoticon|emoticon=Bookred}} | 25 =, {{Emoticon|emoticon=Bookgreen}} | 35 =, {{Emoticon|emoticon=Bookblue}} | 45 =, {{Emoticon|emoticon=Bookorange}} }}
+
| {{#ifeq: {{#show: {{#var: source}} |?BoolEnchantment }} | true
 +
    | yes {{#switch: {{#show: {{#var: source}} |?LevelEquipRequirement }}
 +
            | 15 = ({{Emoticon|emoticon=Bookred}})
 +
            | 25 = ({{Emoticon|emoticon=Bookgreen}})
 +
            | 35 = ({{Emoticon|emoticon=Bookblue}})
 +
            | 45 = ({{Emoticon|emoticon=Bookorange}})
 +
          }}
 +
      {{#ifexpr: {{#expr: {{#var: enchantAtk1|0}} + <!-- checks if this should be displayed at all (if any of the enchantment values are != 0-->
 +
                          {{#var: enchantAtk2|0}} +
 +
                          {{#var: enchantAtk3|0}} +
 +
                          {{#var: enchantAtk4|0}} +
 +
                          {{#var: enchantDef1|0}} +
 +
                          {{#var: enchantDef2|0}} +
 +
                          {{#var: enchantDef3|0}} +
 +
                          {{#var: enchantDef4|0}} +
 +
                          {{#var: enchantMana1|0}} +
 +
                          {{#var: enchantMana2|0}} +
 +
                          {{#var: enchantMana3|0}} +
 +
                          {{#var: enchantMana4|0}}
 +
                }} > 0
 +
        | {{!}}-
 +
          {{!}}Enchant Levels
 +
          {{!}}
 +
          {{{!}} class="wikitable"
 +
          !Level
 +
          {{#ifexpr: {{#expr: {{#var: enchantAtk1|0}} + <!-- checks if there is any attack enchantment bonus, only displays atk column if true -->
 +
                              {{#var: enchantAtk2|0}} +
 +
                              {{#var: enchantAtk3|0}} +
 +
                              {{#var: enchantAtk4|0}}
 +
                    }} > 0
 +
            | !{{Emoticon|emoticon=Attack}}
 +
              !{{Emoticon|emoticon=Attack}} (total)<!--
 +
              -->{{#vardefine: showAtkEnchant | 1 }}<!--
 +
      -->}}<!--
 +
      -->{{#ifexpr: {{#expr: {{#var: enchantDef1|0}} + <!-- checks if there is any defense enchantment bonus, only displays def column if true -->
 +
                              {{#var: enchantDef2|0}} +
 +
                              {{#var: enchantDef3|0}} +
 +
                              {{#var: enchantDef4|0}}
 +
                    }} > 0
 +
            | {{#ifexpr: {{#var: showAtkEnchant}} | ! }}!{{Emoticon|emoticon=Defend}}
 +
              !{{Emoticon|emoticon=Defend}} (total)<!--
 +
              -->{{#vardefine: showDefEnchant | 1 }}
 +
          }}<!--
 +
      -->{{#ifexpr: {{#expr: {{#var: enchantMana1|0}} + <!-- checks if there is any mana enchantment bonus, only displays mana column if true -->
 +
                              {{#var: enchantMana2|0}} +
 +
                              {{#var: enchantMana3|0}} +
 +
                              {{#var: enchantMana4|0}}
 +
                    }} > 0
 +
            | {{#ifexpr: {{#var: showAtkEnchant}} or {{#var: showDefEnchant}} | ! }}!{{Emoticon|emoticon=Mana}}
 +
              !{{Emoticon|emoticon=Mana}} (total)<!--
 +
              -->{{#vardefine: showManaEnchant | 1 }}
 +
          }}
 +
          {{!}}-
 +
          {{!}} style="text-align: center" {{!}} 1
 +
          {{#ifexpr: {{#var: showAtkEnchant}} != 0
 +
            | {{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantAtk1}} | {{#var: enchantAtk1}} | [[??]] }} <!-- atk bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantAtk1}} | {{#var: enchantAtk1}} | [[??]] }} <!-- total atk bonus to this level -->
 +
          }}<!--
 +
      -->{{#ifexpr: {{#var: showDefEnchant}} != 0
 +
            | {{#ifexpr: {{#var: showAtkEnchant}} | {{!}} }}{{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantDef1}} | {{#var: enchantDef1}} | [[??]] }} <!-- def bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantDef1}} | {{#var: enchantDef1}} | [[??]] }} <!-- total def bonus to this level -->
 +
          }}<!--
 +
      -->{{#ifexpr: {{#var: showManaEnchant}} != 0
 +
            | {{#ifexpr: {{#var: showAtkEnchant}} or {{#var: showDefEnchant}} | {{!}} }}{{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantMana1}} | {{#var: enchantMana1}} | [[??]] }} <!-- mana bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantMana1}} | {{#var: enchantMana1}} | [[??]] }} <!-- total mana bonus to this level -->
 +
          }}           
 +
          {{!}}-
 +
          {{!}} style="text-align: center" {{!}} 2
 +
          {{#ifexpr: {{#var: showAtkEnchant}} != 0
 +
            | {{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantAtk2}} | {{#var: enchantAtk2}} | [[??]] }} <!-- atk bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#ifexpr: {{#if: {{#var: enchantAtk1}} |1 |0 }} and {{#if: {{#var: enchantAtk2}} |1 |0 }} <!-- total atk bonus to this level -->
 +
                                                        | {{#expr: {{#var: enchantAtk1}} + {{#var: enchantAtk2}} }} | [[??]]
 +
                                                      }}
 +
          }}<!--
 +
      -->{{#ifexpr: {{#var: showDefEnchant}} != 0
 +
            | {{#ifexpr: {{#var: showAtkEnchant}} | {{!}} }}{{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantDef2}} | {{#var: enchantDef2}} | [[??]] }} <!-- def bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#ifexpr: {{#if: {{#var: enchantDef1}} |1 |0 }} and {{#if: {{#var: enchantDef2}} |1 |0 }} <!-- total def bonus to this level -->
 +
                                                        | {{#expr: {{#var: enchantDef1}} + {{#var: enchantDef2}} }} | [[??]]
 +
                                                      }}
 +
          }}<!--
 +
      -->{{#ifexpr: {{#var: showManaEnchant}} != 0
 +
            | {{#ifexpr: {{#var: showAtkEnchant}} or {{#var: showDefEnchant}} | {{!}} }}{{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantMana2}} | {{#var: enchantMana2}} | [[??]] }} <!-- mana bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#ifexpr: {{#if: {{#var: enchantMana1}} |1 |0 }} and {{#if: {{#var: enchantMana2}} |1 |0 }} <!-- total mana bonus to this level -->
 +
                                                        | {{#expr: {{#var: enchantMana1}} + {{#var: enchantMana2}} }} | [[??]]
 +
                                                      }}
 +
          }}
 +
          {{!}}-
 +
          {{!}} style="text-align: center" {{!}} 3
 +
          {{#ifexpr: {{#var: showAtkEnchant}} != 0
 +
            | {{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantAtk3}} | {{#var: enchantAtk3}} | [[??]] }} <!-- atk bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#ifexpr: {{#if: {{#var: enchantAtk1}} |1 |0 }} and {{#if: {{#var: enchantAtk2}} |1 |0 }} and {{#if: {{#var: enchantAtk3}} |1 |0 }} <!-- total atk bonus to this level -->
 +
                                                        | {{#expr: {{#var: enchantAtk1}} + {{#var: enchantAtk2}} + {{#var: enchantAtk3}} }} | [[??]]
 +
                                                      }}
 +
          }}<!--
 +
      -->{{#ifexpr: {{#var: showDefEnchant}} != 0
 +
            | {{#ifexpr: {{#var: showAtkEnchant}} | {{!}} }}{{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantDef3}} | {{#var: enchantDef3}} | [[??]] }} <!-- def bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#ifexpr: {{#if: {{#var: enchantDef1}} |1 |0 }} and {{#if: {{#var: enchantDef2}} |1 |0 }} and {{#if: {{#var: enchantDef3}} |1 |0 }} <!-- total def bonus to this level -->
 +
                                                        | {{#expr: {{#var: enchantDef1}} + {{#var: enchantDef2}} + {{#var: enchantDef3}} }} | [[??]]
 +
                                                      }}
 +
          }}<!--
 +
      -->{{#ifexpr: {{#var: showManaEnchant}} != 0
 +
            | {{#ifexpr: {{#var: showAtkEnchant}} or {{#var: showDefEnchant}} | {{!}} }}{{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantMana3}} | {{#var: enchantMana3}} | [[??]] }} <!-- mana bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#ifexpr: {{#if: {{#var: enchantMana1}} |1 |0 }} and {{#if: {{#var: enchantMana2}} |1 |0 }} and {{#if: {{#var: enchantMana3}} |1 |0 }} <!-- total mana bonus to this level -->
 +
                                                        | {{#expr: {{#var: enchantMana1}} + {{#var: enchantMana2}} + {{#var: enchantMana3}} }} | [[??]]
 +
                                                      }}
 +
          }}
 +
          {{!}}-
 +
          {{!}} style="text-align: center" {{!}} 4
 +
          {{#ifexpr: {{#var: showAtkEnchant}} != 0
 +
            | {{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantAtk4}} | {{#var: enchantAtk4}} | [[??]] }} <!-- atk bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#ifexpr: {{#if: {{#var: enchantAtk1}} |1 |0 }} and {{#if: {{#var: enchantAtk2}} |1 |0 }} and {{#if: {{#var: enchantAtk3}} |1 |0 }} and {{#if: {{#var: enchantAtk4}} |1 |0 }} <!-- total atk bonus to this level -->
 +
                                                        | {{#expr: {{#var: enchantAtk1}} + {{#var: enchantAtk2}} + {{#var: enchantAtk3}} + {{#var: enchantAtk4}} }} | [[??]]
 +
                                                      }}
 +
          }}<!--
 +
      -->{{#ifexpr: {{#var: showDefEnchant}} != 0
 +
            | {{#ifexpr: {{#var: showAtkEnchant}} | {{!}} }}{{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantDef4}} | {{#var: enchantDef4}} | [[??]] }} <!-- def bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#ifexpr: {{#if: {{#var: enchantDef1}} |1 |0 }} and {{#if: {{#var: enchantDef2}} |1 |0 }} and {{#if: {{#var: enchantDef3}} |1 |0 }} and {{#if: {{#var: enchantDef4}} |1 |0 }} <!-- total def bonus to this level -->
 +
                                                        | {{#expr: {{#var: enchantDef1}} + {{#var: enchantDef2}} + {{#var: enchantDef3}} + {{#var: enchantDef4}} }} | [[??]]
 +
                                                      }}
 +
          }}<!--
 +
      -->{{#ifexpr: {{#var: showManaEnchant}} != 0
 +
            | {{#ifexpr: {{#var: showAtkEnchant}} or {{#var: showDefEnchant}} | {{!}} }}{{!}} style="text-align: center" {{!}} +{{#if: {{#var: enchantMana4}} | {{#var: enchantMana4}} | [[??]] }} <!-- mana bonus this enchant -->
 +
              {{!}} style="text-align: center" {{!}} +{{#ifexpr: {{#if: {{#var: enchantMana1}} |1 |0 }} and {{#if: {{#var: enchantMana2}} |1 |0 }} and {{#if: {{#var: enchantMana3}} |1 |0 }} and {{#if: {{#var: enchantMana4}} |1 |0 }} <!-- total mana bonus to this level -->
 +
                                                        | {{#expr: {{#var: enchantMana1}} + {{#var: enchantMana2}} + {{#var: enchantMana3}} + {{#var: enchantMana4}} }} | [[??]]
 +
                                                      }}
 +
          }}
 +
          {{!}}-
 +
          {{!}}}
 +
      }}
 +
    | no
 +
  }}  
 
|-
 
|-
 +
{{#if: {{GetAmmunition | source = {{#var: source}} }} |
 +
{{!}}Ammunition
 +
{{!}} {{GetAmmunition | source = {{#var: source}} }}
 +
{{!}}-
 +
}}
 
</includeonly>
 
</includeonly>
  

Latest revision as of 02:13, 24 October 2019












This template is designed for being used inside Template:InfoOverview. It adds information on equippable Items to the general info overview