Template:SkillCode: Difference between revisions

From Elanthipedia
Jump to navigation Jump to search
(updated additional option processing to actually work (I hope))
(Coding improvements)
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>
{{#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|}}}|{{{error}}}|SKILLCODE ERROR}}|Neutral Chain}}|NP={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}|Neutral Plate}}|SSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}|Small Shield}}|MSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}|Medium Shield}}|LSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}|Large Shield}}|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}}}|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}}}}}}|survival={{#switch:{{uc:{{{1}}}}}|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}}}}}}|lore={{#switch:{{uc:{{{1}}}}}|EV=Evasion|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|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}}}|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}}}}}}}}|{{#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|}}}|{{{error}}}|SKILLCODE ERROR}}|Neutral Chain}}|NP={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}|Neutral Plate}}|SSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}|Small Shield}}|MSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}|Medium Shield}}|LSH={{#Ifeq:{{lc:{{{type}}}}}|n|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}|Large Shield}}|{{#If:{{{error}}}|{{#If:{{{error|}}}|{{{error}}}|SKILLCODE ERROR}}}}}}}}
|{{#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>
</includeonly>
<noinclude>
<noinclude>
==Usage Documentation==
==Usage Documentation==
Line 19: Line 18:


Additional options are:
Additional options are:
|type=n
|type=
|skillset=
|skillset=
|error=
|error=

Revision as of 16:59, 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.

If |skillset= 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 |type=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:
|type=
|skillset=
|error=