Difference between revisions of "Template:Itembox"

m (Some general post-move cleanup.)
Line 722: Line 722:
 
{{tocright}}
 
{{tocright}}
  
'''Template:Items''' is a template intended for use on item pages to display item properties in a tooltip-style format. It is designed to simulate the look of the tooltips that one encounters when hovering the mouse over an item in the Ultima Online 2d client.
+
'''Template:Tooltip''' is a template intended for use on item pages to display item properties in a tooltip-style format. It is designed to simulate the look of the tooltips that one encounters when hovering the mouse over an item in the Ultima Online 2d client.
:<span style="text-decoration:underline;">Note:</span> If the 2d client is ever dropped in favor of the KR client, the look and feel of this template will be changed accordingly.
+
:<span style="text-decoration:underline;">Note:</span> If the 2d client is ever dropped in favor of the KR or SA clients, the look and feel of this template will be changed accordingly.
  
 
All of the properties in Template:Items are displayed as centered in the tooltip, and all are displayed in white text except for the name of the item, which is displayed in yellow text. Most item properties are displayed as links to their related page as is some other text.
 
All of the properties in Template:Items are displayed as centered in the tooltip, and all are displayed in white text except for the name of the item, which is displayed in yellow text. Most item properties are displayed as links to their related page as is some other text.
:<span style="text-decoration:underline;">Example:</span> In the display of the ''swingspeedincrease'' parameter the words "Swing Speed Increase" will be displayed as a link to that page, whereas in the display of the ''skillrequired'' parameter it is not the words "Skill Required" that will be displayed as a link, but the actual skill that is entered as that parameter's value, such as "Swordsmanship" or "Archery", that will be displayed as a link.
+
: <span style="text-decoration:underline;">Example:</span> In the display of the ''swingspeedincrease'' parameter the words "Swing Speed Increase" will be displayed as a link to that page, whereas in the display of the ''skillrequired'' parameter it is not the words "Skill Required" that will be displayed as a link, but the actual skill that is entered as that parameter's value, such as "Swordsmanship" or "Archery", that will be displayed as a link.
  
 
'''NOTE: This template is far from finished. As more item property parameters are included and as more functionality is added to the current item property parameters, both the complete template that is displayed for copying and pasting in the "Full Template" section and the information on specific item property parameters below will be updated.'''
 
'''NOTE: This template is far from finished. As more item property parameters are included and as more functionality is added to the current item property parameters, both the complete template that is displayed for copying and pasting in the "Full Template" section and the information on specific item property parameters below will be updated.'''
 
'''There are plans to revisit this template soon, possibly even before the end of the year.'''
 
 
==Warning==
 
'''NOTE: Please do not attempt to edit this template unless you are extremely experienced with wiki templates, as Template:Items is an exceptionally complex template. Following immediately after this warning is a small sample of this template's code. It is the code for just one single item property; namely ''physicaldamage''. If you can make neither heads nor tails of this sample, please do not attempt to edit this template.'''
 
 
 
'''<span style="text-decoration:underline;">Code Sample:</span>'''
 
<br />
 
<nowiki>
 
{{#if:{{{physicaldamage|}}}|{{#ifexpr:{{{physicaldamage|}}} >= 1|{{#if:{{{firedamage|}}}|{{#if:{{{colddamage|}}}|{{#if:{{{poisondamage|}}}|{{#if:{{{energydamage|}}}|{{#ifexpr:{{{physicaldamage|}}} + {{{firedamage|}}} + {{{colddamage|}}} + {{{poisondamage|}}} + {{{energydamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}|{{#ifexpr:{{{physicaldamage|}}} + {{{firedamage|}}} + {{{colddamage|}}} + {{{poisondamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}}}|{{#if:{{{energydamage|}}}|{{#ifexpr:{{{physicaldamage|}}} + {{{firedamage|}}} + {{{colddamage|}}} + {{{energydamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}|{{#ifexpr:{{{physicaldamage|}}} + {{{firedamage|}}} + {{{colddamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}}}}}|{{#if:{{{poisondamage|}}}|{{#if:{{{energydamage|}}}|{{#ifexpr:{{{physicaldamage|}}} + {{{firedamage|}}} + {{{poisondamage|}}} + {{{energydamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}|{{#ifexpr:{{{physicaldamage|}}} + {{{firedamage|}}} + {{{poisondamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}}}|{{#if:{{{energydamage|}}}|{{#ifexpr:{{{physicaldamage|}}} + {{{firedamage|}}} + {{{energydamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}|{{#ifexpr:{{{physicaldamage|}}} + {{{firedamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}}}}}}}|{{#if:{{{colddamage|}}}|{{#if:{{{poisondamage|}}}|{{#if:{{{energydamage|}}}|{{#ifexpr:{{{physicaldamage|}}} + {{{colddamage|}}} + {{{poisondamage|}}} + {{{energydamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}|{{#ifexpr:{{{physicaldamage|}}} + {{{colddamage|}}} + {{{poisondamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}}}|{{#if:{{{energydamage|}}}|{{#ifexpr:{{{physicaldamage|}}} + {{{colddamage|}}} + {{{energydamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}|{{#ifexpr:{{{physicaldamage|}}} + {{{colddamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}}}}}|{{#if:{{{poisondamage|}}}|{{#if:{{{energydamage|}}}|{{#ifexpr:{{{physicaldamage|}}} + {{{poisondamage|}}} + {{{energydamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}|{{#ifexpr:{{{physicaldamage|}}} + {{{poisondamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}}}|{{#if:{{{energydamage|}}}|{{#ifexpr:{{{physicaldamage|}}} + {{{energydamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}|{{#ifexpr:{{{physicaldamage|}}} = 100|<li>{{Link|Physical Damage|color=FFFFFF}} {{{physicaldamage|}}}%|}}}}}}}}}}|}}|}}
 
</nowiki>
 
  
 
==Usage==
 
==Usage==
Since it is highly unlikely if not impossible that an item will ever be encountered that uses absolutely every item property that is available in the template, Template:Items has been designed with conditional parameters. This means that when using this template on an item's page it is intended that only the parameters which correspond to the properties which are displayed on that specific item should be included. Unlike many of the other templates that show in their entirety no matter what, if one of the parameters from Template:Items is not included, left blank, or supplied with an impossible value, its associated property will simply not display at all.
+
Since it is highly unlikely if not impossible that an item will ever be encountered that uses absolutely every item property that is available in the template, '''Template:Tooltip''' has been designed with conditional parameters. This means that when using this template on an item's page it is intended that only the parameters which correspond to the properties which are displayed on that specific item should be included. Unlike many of the other templates that show in their entirety no matter what, if one of the parameters from Template:Items is not included or left blank, its associated property will simply not display at all.
  
It is suggested that when using Template:Items one should choose one of the two following strategies:
+
It is suggested that when using '''Template:Tooltip''' one should choose one of the two following strategies:
# Copy and paste the entirety of the template, which is included in a <nowiki><pre></nowiki> section below, and delete those parameters whose corresponding properties are not present on the item which you are editing.
+
# Copy and paste the entirety of the template, which is shown in a the "Full Template" section below, and delete those parameters whose corresponding properties are not present on the item which you are editing.
 
# Copy and paste only the parameters from below that correspond to properties which are present on the item that you are editing and ignore the others completely.
 
# Copy and paste only the parameters from below that correspond to properties which are present on the item that you are editing and ignore the others completely.
  
It is '''NOT''' recommended that you copy and paste the complete template and leave it in its entirety with blank, unused parameters. Template:Items was designed conditionally so that this would not be necessary. It was intended that this template would be easier to use and read due to less unused code, and that this in turn would have the added benefit of saving space.
+
It is '''NOT''' recommended that you copy and paste the complete template and leave it in its entirety with blank, unused parameters. '''Template:Tooltip''' was designed conditionally so that this would not be necessary. It was intended that this template would be easier to use and read due to less unused code, and that this in turn would have the added benefit of saving valuable server space.
  
 
===Full Template===
 
===Full Template===
The following is the entirety of Template:Items, which includes every item property parameter that has so far been added.
+
The following is the entirety of '''Template:Tooltip''', which includes every item property parameter that has so far been added.
 
<pre>
 
<pre>
 
{{Item
 
{{Item
Line 790: Line 778:
 
</pre>
 
</pre>
  
The ''name'' parameter displays the name of the item at the top of the tooltip. It is the only item property that displays in yellow text. When entering a value for this parameter, any string may be used. If the ''name'' parameter is left blank or not used, the template is coded to automatically use the name of the page. It is recommended in most instances that the ''name'' parameter be left out in order to allow it to automatically take the name of an item's page.
+
The ''name'' parameter displays the name of the item at the top of the tooltip. It is the only item property that displays in yellow text. When entering a value for this parameter, any string may be used. If the ''name'' parameter is left blank or not used, the template is coded to automatically use the name of the page on which it is being used. It is recommended in most instances that the ''name'' parameter be left out in order to take advantage of this functionality.
  
 
The ''name'' parameter displays as follows:
 
The ''name'' parameter displays as follows:
 
* Manually-entered value:
 
* Manually-entered value:
 
** <span style="background-color:#111111; border:3px solid #111111; color:#FFFF00; font-weight:bold; text-align:center; width:auto;">An_sword_001</span>
 
** <span style="background-color:#111111; border:3px solid #111111; color:#FFFF00; font-weight:bold; text-align:center; width:auto;">An_sword_001</span>
* Automatic value:
+
* Automatic value (the derived name of this Template page):
 
** <span style="background-color:#111111; border:3px solid #111111; color:#FFFF00; font-weight:bold; text-align:center; width:auto;">{{PAGENAME}}</span>
 
** <span style="background-color:#111111; border:3px solid #111111; color:#FFFF00; font-weight:bold; text-align:center; width:auto;">{{PAGENAME}}</span>
 +
  
 
===blessed===
 
===blessed===
Line 810: Line 799:
 
* Cursed:
 
* Cursed:
 
** <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Cursed|color=FFFFFF}}</span>
 
** <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Cursed|color=FFFFFF}}</span>
 +
  
 
===weight===
 
===weight===
Line 820: Line 810:
 
The ''weight'' parameter displays as follows:
 
The ''weight'' parameter displays as follows:
 
* <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Weight|color=FFFFFF}}: 10 Stones</span>
 
* <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Weight|color=FFFFFF}}: 10 Stones</span>
 +
  
 
===swingspeedincrease===
 
===swingspeedincrease===
Line 830: Line 821:
 
The ''swingspeedincrease'' parameter displays as follows:
 
The ''swingspeedincrease'' parameter displays as follows:
 
* <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Swing Speed Increase|color=FFFFFF}} 30%</span>
 
* <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Swing Speed Increase|color=FFFFFF}} 30%</span>
 +
  
 
===Resist parameters===
 
===Resist parameters===
Line 848: Line 840:
 
* ''poisonresist'': <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Poison Resist|color=FFFFFF}} 10%</span>
 
* ''poisonresist'': <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Poison Resist|color=FFFFFF}} 10%</span>
 
* ''energyresist'': <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Energy Resist|color=FFFFFF}} 25%</span>
 
* ''energyresist'': <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Energy Resist|color=FFFFFF}} 25%</span>
 +
  
 
===Damage Type parameters===
 
===Damage Type parameters===
Line 866: Line 859:
 
* ''poisondamage'': <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Poison Damage|color=FFFFFF}} 20%</span>
 
* ''poisondamage'': <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Poison Damage|color=FFFFFF}} 20%</span>
 
* ''energydamage'': <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Energy Damage|color=FFFFFF}} 20%</span>
 
* ''energydamage'': <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">{{ColoredLink|Energy Damage|color=FFFFFF}} 20%</span>
 +
  
 
===handedweapon===
 
===handedweapon===
Line 881: Line 875:
 
* Input of '2': <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">Two-Handed Weapon</span>
 
* Input of '2': <span style="background-color:#111111; border:3px solid #111111; color:#FFFFFF; font-weight:bold; text-align:center; width:auto;">Two-Handed Weapon</span>
 
* Any other input: (Does not display)
 
* Any other input: (Does not display)
 +
  
 
===durability===
 
===durability===

Revision as of 15:59, 10 May 2009

Template:Tooltip is a template intended for use on item pages to display item properties in a tooltip-style format. It is designed to simulate the look of the tooltips that one encounters when hovering the mouse over an item in the Ultima Online 2d client.

Note: If the 2d client is ever dropped in favor of the KR or SA clients, the look and feel of this template will be changed accordingly.

All of the properties in Template:Items are displayed as centered in the tooltip, and all are displayed in white text except for the name of the item, which is displayed in yellow text. Most item properties are displayed as links to their related page as is some other text.

Example: In the display of the swingspeedincrease parameter the words "Swing Speed Increase" will be displayed as a link to that page, whereas in the display of the skillrequired parameter it is not the words "Skill Required" that will be displayed as a link, but the actual skill that is entered as that parameter's value, such as "Swordsmanship" or "Archery", that will be displayed as a link.

NOTE: This template is far from finished. As more item property parameters are included and as more functionality is added to the current item property parameters, both the complete template that is displayed for copying and pasting in the "Full Template" section and the information on specific item property parameters below will be updated.

Usage

Since it is highly unlikely if not impossible that an item will ever be encountered that uses absolutely every item property that is available in the template, Template:Tooltip has been designed with conditional parameters. This means that when using this template on an item's page it is intended that only the parameters which correspond to the properties which are displayed on that specific item should be included. Unlike many of the other templates that show in their entirety no matter what, if one of the parameters from Template:Items is not included or left blank, its associated property will simply not display at all.

It is suggested that when using Template:Tooltip one should choose one of the two following strategies:

  1. Copy and paste the entirety of the template, which is shown in a the "Full Template" section below, and delete those parameters whose corresponding properties are not present on the item which you are editing.
  2. Copy and paste only the parameters from below that correspond to properties which are present on the item that you are editing and ignore the others completely.

It is NOT recommended that you copy and paste the complete template and leave it in its entirety with blank, unused parameters. Template:Tooltip was designed conditionally so that this would not be necessary. It was intended that this template would be easier to use and read due to less unused code, and that this in turn would have the added benefit of saving valuable server space.

Full Template

The following is the entirety of Template:Tooltip, which includes every item property parameter that has so far been added.

{{Item
|name=
|blessed=
|weight=
|hitstaminaleech=
|spellchanneling=
|swingspeedincrease=
|damageincrease=
|physicalresist=
|fireresist=
|coldresist=
|poisonresist=
|energyresist=
|physicaldamage=
|firedamage=
|colddamage=
|poisondamage=
|energydamage=
|mindamage=
|maxdamage=
|weaponspeed=
|range=
|strengthrequirement=
|handedweapon=
|skillrequired=
|durability=
}}

Parameters

name

|name=

The name parameter displays the name of the item at the top of the tooltip. It is the only item property that displays in yellow text. When entering a value for this parameter, any string may be used. If the name parameter is left blank or not used, the template is coded to automatically use the name of the page on which it is being used. It is recommended in most instances that the name parameter be left out in order to take advantage of this functionality.

The name parameter displays as follows:

  • Manually-entered value:
    • An_sword_001
  • Automatic value (the derived name of this Template page):
    • Itembox


blessed

|blessed=

The blessed parameter displays whether an item is Blessed or Cursed. In order for the Blessed property to display, this parameter requires a value of "yes", "YES", "Yes", "y", or "Y". In order for the Cursed property to display, this parameter requires a value of "cursed", "CURSED", or "Cursed".

The blessed parameter displays as follows:


weight

|weight=

The weight parameter displays the weight of an item in the format "Weight: X Stones", where X is the value inputed. The weight parameter does not accept any value less than 1.

The weight parameter displays as follows:


swingspeedincrease

|swingspeedincrease=

The swingspeedincrease parameter displays the Swing Speed Increase property on an item in the format "Swing Speed Increase X%", where X is the value inputed. The swingspeedincrease parameter does not accept any value less than 1.

The swingspeedincrease parameter displays as follows:


Resist parameters

|physicalresist=
|fireresist=
|coldresist=
|poisonresist=
|energyresist=

The resist parameters display their corresponding resist property (physical, fire, cold, poison, or energy) on an item in the format "Y Resist X%", where X is the inputed value and Y is the resist type. Resist parameters do not accept any value of less than 1.

The resist parameters display as follows:


Damage Type parameters

|physicaldamage=
|firedamage=
|colddamage=
|poisondamage=
|energydamage=

The damage type parameters display their corresponding damage type property (physical, fire, cold, poison, or energy) on an item in the format "Y Damage X%", where X is the inputed value and Y is the damage type. Damage types do not accept any value of less than 1. If the combined value of the damage types you use for an item does not equal 100, none of the damage types will display, as any other combined value would be impossible within the limitations of the game.

The damage type parameters display as follows:


handedweapon

|handedweapon=

The handedweapon parameter displays whether an item, when equipped, requires one hand to wield, or two. As these are currently the only two possible options in the game, the only two valid input values are as follows:

  • 1
  • 2

If any value other than the preceding two are used, the property will not display.

The handedweapon parameter displays as follows:

  • Input of '1': One-Handed Weapon
  • Input of '2': Two-Handed Weapon
  • Any other input: (Does not display)


durability

|durability=

The durability parameter displays the durability of an item in the format "Durability: X / X", where X is the value inputed. For consistency's sake, the value inputed is applied to both the maximum durability as well as the current durability. The durability parameter does not accept any value less than 1.

The durability parameter displays as follows: