Template:InfoItem: Difference between revisions

From IdleOn MMO Wiki
No edit summary
Tag: Manual revert
mNo edit summary
Line 61: Line 61:
}}<!--
}}<!--


--><div class="Infobox">
--><Infobox>
<div class="Header">{{#if:{{#var:SlabNum}}|<div class="SlabNum">[[File:The Slab Icon.png|28px|link=The Slab]][[The Slab|<span>{{#var:SlabNum}}</span>]]</div>}} {{PAGENAME}}</div>
  <title><default>{{#if:{{#var:SlabNum}}|<div class="SlabNum">[[File:The Slab Icon.png|28px|link=The Slab]][[The Slab|<span>{{#var:SlabNum}}</span>]]</div>}} {{PAGENAME}}</default></title>
<div class="HeaderImage">{{#ifeq:{{{type|}}}|Dungeon Evaporate||[[file:{{PAGENAME}}.png]]}}</div><!--
  <panel>
-->{{#if:{{{description|}}}|<div class="SubHeader">Information</div>
      <section>
<dl>
          <image>
<dt>Description</dt><dd style="display:inline;">{{{description|}}}</dd>
              <default>
</dl>}}<!--
                  {{#ifeq:{{{type|}}}|Dungeon Evaporate||[[file:{{PAGENAME}}.png]]}}
-->{{#ifeq:{{{type}}}|Trophy|<div class="SubHeader">Character Effect</div>
              </default>
<dl>
          </image>
<dt>Title</dt><dd>[[File:{{PAGENAME}}_Title.png]]</dd>
      </section>
</dl>}}<!--
  </panel>
-->{{#if:{{{class|}}}{{{level|}}}|<div class="SubHeader">Requirements</div>
  <group name="InfoSection">
<dl>
      <header>Information</header>
{{#if:{{{class|}}}|<dt>Class</dt><dd>{{{class|}}}</dd>}}
      <data source="description">
{{#if:{{{level|}}}|<dt>Level</dt><dd>{{skillicon|{{{type|}}}}} {{{level|}}}</dd>}}
          <label>Description</label>
</dl>}}<!--
      </data>
-->{{#if:{{{speed|}}}{{{weaponpower|}}}{{{skillpower|}}}{{{bonus|}}}{{{str|}}}{{{agi|}}}{{{wis|}}}{{{luck|}}}{{{misc|}}}{{{reach|}}}{{{upgrade|}}}{{{defence|}}}|<div class="SubHeader">Stats</div>
  </group>
<dl>
  <group name="TrophySection">
{{#if:{{{weaponpower|}}}|<dt>Weapon Power</dt><dd>{{{weaponpower|}}}</dd>}}
      <header>Character Effect</header>
{{#if:{{{skillpower|}}}|<dt>{{#if:{{{skill|}}}|{{{skill|}}}|Skill}} Power</dt><dd>{{#if:{{{skill|}}}|{{skillicon|{{{skill}}}}}|{{skillicon|{{{type}}}}}}} {{{skillpower|}}}</dd>}}
      <data>
{{#if:{{{bonus|}}}|<dt>Bonus</dt><dd>{{{bonus|}}}</dd>}}
          <label>Title</label>
{{#if:{{{speed|}}}|<dt>Speed</dt><dd>{{{speed|}}} ({{#switch:{{{speed|}}}|0=Immobile|1=Molasses|2=Sluggish|3=Slower|4=Slow|5=Medium|6=Quick|7=Fast|8=Faster|9=Turbo|10=Supersonic}})</dd>}}
          <default>{{#ifeq:{{{type|}}}|Trophy|[[File:{{PAGENAME}}_Title.png]]}}</default>
{{#if:{{{str|}}}|<dt>Strength</dt><dd>{{{str|}}}</dd>}}
      </data>
{{#if:{{{agi|}}}|<dt>Agility</dt><dd>{{{agi|}}}</dd>}}
  </group>
{{#if:{{{wis|}}}|<dt>Wisdom</dt><dd>{{{wis|}}}</dd>}}
  <group name="RequirementsSection">
{{#if:{{{luck|}}}|<dt>Luck</dt><dd>{{{luck|}}}</dd>}}
      <header>Requirements</header>
{{#if:{{{reach|}}}|<dt>Reach</dt><dd>{{{reach|}}}</dd>}}
      <data source="class">
{{#if:{{{misc|}}}|<dt>Misc</dt><dd>{{{misc|}}}</dd>}}
          <label>Class</label>
{{#if:{{{misc2|}}}|<dt>Misc2</dt><dd>{{{misc2|}}}</dd>}}
      </data>
{{#if:{{{charge|}}}|<dt>Max Charge</dt><dd>{{{charge|}}}%</dd>}}
      <data source="level">
{{#if:{{{defence|}}}|<dt>Defence</dt><dd>{{{defence|}}}</dd>}}
          <label>Level</label>
{{#if:{{{upgrade|}}}|<dt>Upgrade slots</dt><dd>{{{upgrade|}}}</dd>}}
          <format>{{skillicon|{{{type|}}}}} {{{level|}}}</format>
</dl>}}<!--
      </data>
-->{{#if:{{{quest|}}}|<div class="SubHeader">Quest Specifics</div>
  </group>
<dl>
  <group name="StatsSection">
<dt>Quest</dt><dd style="display:inline;">{{{quest|}}}</dd>
      <header>Stats</header>
</dl>}}<!--
      <data source="weaponpower">
{{#switch:{{{type|}}}|Ore|Logs|Fish|Bugs=<div class="SubHeader">Resource Specifics</div>
          <label>Weapon Power</label>
<dl>
      </data>
{{#if:{{{skill|}}}|<dt>Skill</dt><dd>{{skilldis|{{{skill|}}}}}</dd>}}
      <data source="skillpower">
</dl>}}
          <label>{{{skill|Skill}}} Power</label>
--><div class="SubHeader">Other</div>
          <format>{{skillicon|{{{skill|{{{type}}}}}}}} {{{skillpower|}}}</format>
<dl>
      </data>
{{#switch:{{{type|}}}|Circle Obol|Square Obol|Hexagon Obol|Sparkle Obol=|#default={{#if: {{{sellprice|}}} |<dt>Sell Price</dt><dd>{{Coindisplay|{{{sellprice}}}}}</dd>}}}}
      <data source="bonus">
<dt>Type</dt><dd>[[{{{type|Uncategorized Item}}}]]</dd>
          <label>Bonus</label>
{{#if:{{{rarity|}}}|<dt>Rarity</dt><dd>{{{rarity|}}}</dd>}}
      </data>
{{#if:{{{tier|}}}|<dt>Tier</dt><dd>{{{tier|}}}</dd>}}
      <data source="speed">
<dt>Source</dt><dd style="display:inline;">{{#invoke:LuaVar|var|name=Sources}}</dd>
          <label>Speed</label>
</dl>
          <format>{{{speed|}}} ({{#switch:{{{speed|}}}|0=Immobile|1=Molasses|2=Sluggish|3=Slower|4=Slow|5=Medium|6=Quick|7=Fast|8=Faster|9=Turbo|10=Supersonic}})</format>
{{#ifeq: {{{hascard}}} | no || {{#cargo_query:tables=Cards
      </data>
|fields=CardOrder=order, Category=category, Effect=effect, Bonus=bonus, DropChance=dropchance
      <data source="str">
|where= Title LIKE "{{PAGENAME}}"
          <label>Strength</label>
|format=template
      </data>
|template=InfoCard/boxrow
      <data source="agi">
|named args=yes
          <label>Agility</label>
|default=
      </data>
}}}}
      <data source="wis">
</div><!--
          <label>Wisdom</label>
      </data>
      <data source="luck">
          <label>Luck</label>
      </data>
      <data source="reach">
          <label>Reach</label>
      </data>
      <data source="misc">
          <label>Misc</label>
      </data>
      <data source="misc2">
          <label>Misc2</label>
      </data>
      <data source="charge">
          <label>Max Charge</label>
          <format>{{{charge|}}}%</format>
      </data>
      <data source="defence">
          <label>Defence</label>
      </data>
      <data source="upgrade">
          <label>Upgrade Slots</label>
      </data>
  </group>
  <group name="QuestSection">
      <header>Quest Specifics</header>
      <data source="quest">
          <label>Quest</label>
      </data>
  </group>
  <group name="OtherSection">
      <header>Other</header>
      <data source="sellprice">
          <label>Sell Price</label>
          <format>{{#switch:{{{type|}}}|Circle Obol|Square Obol|Hexagon Obol|Sparkle Obol=|#default={{Coindisplay|{{{sellprice}}}}} }}</format>
      </data>
      <data source="type">
          <label>Type</label>
          <format>[[{{Pluralizer|{{{type|Uncategorized Item}}}}}]]</format>
      </data>
      <data source="rarity">
          <label>Rarity</label>
      </data>
      <data source="tier">
          <label>Tier</label>
      </data>
      <data name="Sources">
          <label>Source</label>
          <default>{{#var:Sources}}</default>
      </data>
  </group>
  <group name="CardSection">
      <header>Card Info</header>
      <data source="hascard">
        <label>Card</label>
        <format>[[File:{{PAGENAME}} Card.png|24px]] [[{{PAGENAME}} Card]]</format>
      </data>
      <data source="hascard">
        <label>Effect</label>
        <format>{{#dpl:|uses=Template:InfoCard|includepage={InfoCard}:effect|title={{PAGENAME}} Card|count=1|mode=inline|format=,}}</format>
      </data>
      <data source="hascard">
        <format>{{#dpl:|uses=Template:InfoCard|includepage={InfoCard}:bonus:bonus:bonus:bonus:bonus|title={{PAGENAME}} Card|count=1|mode = userformat|table = class="pi-horizontal-group",-, Base, [[File:Star1.png|class=CardStar|link=]], [[File:Star2.png|class=CardStar|link=]], [[File:Star3.png|class=CardStar|link=]], [[File:Star4.png|class=CardStar|link=]]|tablerow=%%, <!-- Star1 -->²{#expr:%% * 2}², <!-- Star2 -->²{#expr:%% * 3}², <!-- Star3 -->²{#expr:%% * 4}², <!-- Star4 -->²{#expr:%% * 5}²}}</format>
      </data>
      <data source="hascard">
        <label>Category</label>
        <format>{{#dpl:|uses=Template:InfoCard|includepage={InfoCard}:category|title={{PAGENAME}} Card|count=1|mode=inline|format=,}}</format>
      </data>
      <data source="hascard">
        <label>Dropchance</label>
        <format>{{Chancedisplay|{{#dpl:|uses=Template:InfoCard|includepage={InfoCard}:dropchance|title={{PAGENAME}} Card|count=1|mode=inline|format=,}}}}</format>
      </data>
  </group>
</infobox><!--
 
-->{{SetHeader}}
-->{{SetHeader}}
{{{notes|}}}
{{{notes|}}}

Revision as of 11:23, 16 February 2023

This template defines the table "Items". View table.

Usage:
{{InfoItem
|type=example (needs to be included every time)
|class=example
|level=example
|skill=example
|skillpower=example (needs a defined skill to display correctly)
|weaponpower=example
|str=example
|agi=example
|wis=example
|luck=example
|reach=example (only for weapons)
|speed=example (only for weapons)
|misc=example
|defence=example
|upgrade=example
|quest=example (only for quest items)
|description=example
|notes=example 
|sellprice=example
|rarity=example (for obols)
|tier=example (for upgrade stones)
|source=example
|quest=example
|hascard=Yes/No (for ores, logs, fish and bugs)
}}

Don't have empty definitions, that will produce empty fields. If there is no description for example, don't include a description= at all.