Template:SkillCode: Difference between revisions

From Elanthipedia
Jump to navigation Jump to search
(Coding improvements)
(disabled skillset limiting as it may be causing problems)
Line 1: Line 1:
<includeonly>{{#If:{{{skillset|}}}|{{#switch:{{lc:{{{skillset}}}}}|armor={{#switch:{{uc:{{{1}}}}}|SU=Shield Usage|LA=Leather Armor|CA=Cloth Armor|LC=Light Chain|HC=Heavy Chain|LP=Light Plate|HP=Heavy Plate|BA=Bone Armor|NC={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Neutral Chain}}|NP={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Neutral Plate}}|SSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Small Shield}}|MSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Medium Shield}}|LSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Large Shield}}|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}#default=}}}}|weapons={{#switch:{{uc:{{{1}}}}}|PA=Parry Ability|MO=Multi Opponent|OW=Offhand Weapon|LE=Light Edged|ME=Medium Edged|HE=Heavy Edged|2HE=Twohanded Edged|LB=Light Blunt|MB=Medium Blunt|HB=Heavy Blunt|2HB=Twohanded Blunt|SL=Slings|STS=Staff Sling|SB=Short Bow|LOB=Long Bow|CB=Composite Bow|LX=Light Crossbow|HX=Heavy Crossbow|SS=Short Staff|QS=Quarter Staff|PI=Pikes|HAL=Halberds|LT=Light Thrown|HT=Heavy Thrown|BR=Brawling|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}#default=}}}}|survival={{#switch:{{uc:{{{1}}}}}|EV=Evasion|CL=Climbing|PE=Perception|SC=Scouting|HI=Hiding|LO=Lockpicking|DT=Disarm Traps|STA=Stalking|STE=Stealing|FA=First Aid|FO=Foraging|ES=Escaping|BS=Backstab|SK=Skinning|SW=Swimming|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}#default=}}}}|lore={{#switch:{{uc:{{{1}}}}}|SCH=Scholarship|ML=Mechanical Lore|MT=Musical Theory|AP=Appraisal|TE=Teaching|TR=Trading|AL=Animal Lore|PCN=Percussions|STR=Strings|WI=Winds|VO=Vocals|EM=Empathy|AS=Astrology
<includeonly>{{#switch:{{uc:{{{1}}}}}|PA=Parry Ability|MO=Multi Opponent|OW=Offhand Weapon|LE=Light Edged|ME=Medium Edged|HE=Heavy Edged|2HE=Twohanded Edged|LB=Light Blunt|MB=Medium Blunt|HB=Heavy Blunt|2HB=Twohanded Blunt|SL=Slings|STS=Staff Sling|SB=Short Bow|LOB=Long Bow|CB=Composite Bow|LX=Light Crossbow|HX=Heavy Crossbow|SS=Short Staff|QS=Quarter Staff|PI=Pikes|HAL=Halberds|LT=Light Thrown|HT=Heavy Thrown|BR=Brawling|SU=Shield Usage|LA=Leather Armor|CA=Cloth Armor|LC=Light Chain|HC=Heavy Chain|LP=Light Plate|HP=Heavy Plate|BA=Bone Armor|PM=Primary Magic|HA=Harness Ability|PP=Power Perception|MD=Magical Devices|TM=Targeted Magic|EV=Evasion|CL=Climbing|PE=Perception|SC=Scouting|HI=Hiding|LO=Lockpicking|DT=Disarm Traps|STA=Stalking|STE=Stealing|FA=First Aid|FO=Foraging|ES=Escaping|BS=Backstab|SK=Skinning|SW=Swimming|SCH=Scholarship|ML=Mechanical Lore|MT=Musical Theory|AP=Appraisal|TE=Teaching|TR=Trading|AL=Animal Lore|PCN=Percussions|STR=Strings|WI=Winds|VO=Vocals|EM=Empathy|AS=Astrology|NC={{#Ifeq:{{lc:{{{disableadd}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Neutral Chain}}|NP={{#Ifeq:{{lc:{{{disableadd}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Neutral Plate}}|SSH={{#Ifeq:{{lc:{{{disableadd}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Small Shield}}|MSH={{#Ifeq:{{lc:{{{disableadd}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Medium Shield}}|LSH={{#Ifeq:{{lc:{{{disableadd}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Large Shield}}|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}|#default=}}}}</includeonly>
|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}#default=}}}}|magic={{#switch:{{uc:{{{1}}}}}|PM=Primary Magic|HA=Harness Ability|PP=Power Perception|MD=Magical Devices|TM=Targeted Magic|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}#default=}}}}}}|{{#switch:{{uc:{{{1}}}}}|PA=Parry Ability|MO=Multi Opponent|OW=Offhand Weapon|LE=Light Edged|ME=Medium Edged|HE=Heavy Edged|2HE=Twohanded Edged|LB=Light Blunt|MB=Medium Blunt|HB=Heavy Blunt|2HB=Twohanded Blunt|SL=Slings|STS=Staff Sling|SB=Short Bow|LOB=Long Bow|CB=Composite Bow|LX=Light Crossbow|HX=Heavy Crossbow|SS=Short Staff|QS=Quarter Staff|PI=Pikes|HAL=Halberds|LT=Light Thrown|HT=Heavy Thrown|BR=Brawling|SU=Shield Usage|LA=Leather Armor|CA=Cloth Armor|LC=Light Chain|HC=Heavy Chain|LP=Light Plate|HP=Heavy Plate|BA=Bone Armor|PM=Primary Magic|HA=Harness Ability|PP=Power Perception|MD=Magical Devices|TM=Targeted Magic|EV=Evasion|CL=Climbing|PE=Perception|SC=Scouting|HI=Hiding|LO=Lockpicking|DT=Disarm Traps|STA=Stalking|STE=Stealing|FA=First Aid|FO=Foraging|ES=Escaping|BS=Backstab|SK=Skinning|SW=Swimming|SCH=Scholarship|ML=Mechanical Lore|MT=Musical Theory|AP=Appraisal|TE=Teaching|TR=Trading|AL=Animal Lore|PCN=Percussions|STR=Strings|WI=Winds|VO=Vocals|EM=Empathy|AS=Astrology|NC={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Neutral Chain}}|NP={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Neutral Plate}}|SSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Small Shield}}|MSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Medium Shield}}|LSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}|Large Shield}}|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}|#default=}}}}}}</includeonly>
<noinclude>
<noinclude>
==Usage Documentation==
==Usage Documentation==
This template will take the skillcodes associated with [[Experience command|<tt>EXP SKILL</tt>]] and convert them to their skills. Because EXP currently lacks a code for [[Staff Sling skill|staff sling]], use StS.
This template will take the skillcodes associated with [[Experience command|<tt>EXP SKILL</tt>]] and convert them to their skills. Because EXP currently lacks a code for [[Staff Sling skill|staff sling]], use StS.


In addition, to assist with armor type processing, it will return NC and NP as Neutal Chain and Neutral Plate, and SSH, MSH or LSH as Small Shield, Medium Shield, or Large Shield. To disable this, add <nowiki>|disableadd=n</nowiki> to the variable list.
If <nowiki>|skillset=</nowiki> is defined and not whitespace, the template will only check the given skillset, if it is valid.

In addition, to assist with armor type processing, it will return NC and NP as Neutal Chain and Neutral Plate, and SSH, MSH or LSH as Small Shield, Medium Shield, or Large Shield. To disable this, add <nowiki>|type=n</nowiki> to the variable list.


If there are no matches, this template will return SKILLCODE ERROR, unless the variable <nowiki>|error=</nowiki> is included. If error is set to empty or to whitespace, nothing will be returned on error, otherwise the given string will be returned.
If there are no matches, this template will return SKILLCODE ERROR, unless the variable <nowiki>|error=</nowiki> is included. If error is set to empty or to whitespace, nothing will be returned on error, otherwise the given string will be returned.
Line 18: Line 15:


Additional options are:
Additional options are:
|disableadd=
|type=
|skillset=
|error=
|error=
</pre>
</pre>
[[Category:Templates|{{PAGENAME}}]]
[[Category:Templates|{{PAGENAME}}]][[Category:Templates for Templates|{{PAGENAME}}]]
[[Category:Templates for Templates|{{PAGENAME}}]]
</noinclude>
</noinclude>

Revision as of 20:27, 4 June 2008


Usage Documentation

This template will take the skillcodes associated with EXP SKILL and convert them to their skills. Because EXP currently lacks a code for staff sling, use StS.

In addition, to assist with armor type processing, it will return NC and NP as Neutal Chain and Neutral Plate, and SSH, MSH or LSH as Small Shield, Medium Shield, or Large Shield. To disable this, add |disableadd=n to the variable list.

If there are no matches, this template will return SKILLCODE ERROR, unless the variable |error= is included. If error is set to empty or to whitespace, nothing will be returned on error, otherwise the given string will be returned.

Note: All variable contents will be handled on case insensitive basis.

Syntax

{{SkillCode|code}}

Additional options are:
|disableadd=
|error=