Difference between revisions of "Template:RareItem.dpl2detailed"

Line 4: Line 4:
 
{{!!}}{{#if: {{{graphic|}}} |[[:Category:UO:Items_using_graphic_{{{graphic}}}|{{{graphic}}}]]|unknown}}
 
{{!!}}{{#if: {{{graphic|}}} |[[:Category:UO:Items_using_graphic_{{{graphic}}}|{{{graphic}}}]]|unknown}}
 
{{!!}}{{#if: {{{hue|}}} |[[:Category:UO:Items_using_hue_{{{hue}}}|{{{hue}}}]]|unknown}}
 
{{!!}}{{#if: {{{hue|}}} |[[:Category:UO:Items_using_hue_{{{hue}}}|{{{hue}}}]]|unknown}}
{{!!}}
+
{{!!}}<!--
{{#if: {{{type|}}} | {{#arraydefine: types | {{{type}}} }}{{#arraysort: types|asc}}{{#arrayprint:types |,&nbsp; |@@@@ | {{#vardefine: itemtype |{{#replace: {{#replace: {{#replace: @@@@|Em|EM}}|Gm|GM}}|Igm|IGM}}{{#if: {{{crafter|}}}|-crafted|}} Item}}[[:Category:UO:{{#var:itemtype}}s|{{#var:itemtype}}]] }}|[[:Category:Items of unknown origin|unknown]]}}
+
--> {{#if: {{{type|}}} | {{#arraydefine: types | {{{type}}} }}{{#arraysort: types|asc}}{{#arrayprint:types |,&nbsp; |@@@@ | {{#vardefine: itemtype |{{#replace: {{#replace: {{#replace: @@@@|Em|EM}}|Gm|GM}}|Igm|IGM}}{{#if: {{{crafter|}}}|-crafted|}} Item}}[[:Category:UO:{{#var:itemtype}}s|{{#var:itemtype}}]] }}|[[:Category:Items of unknown origin|unknown]]}}
{{!!}}
+
{{!!}}<!--
{{#arraydefine: shards | Arirang, Asuka, Atlantic, Baja, Balhae, Catskills, Chesapeake, Drachenfels, Europa, Formosa, GL, Hokuto, Izumo, LA, LS, Legends, Mizuho, Mugen, Napa, Oceania, Origin, Pacific, Sakura, SP, Sonoma, Test, Wakoku,Yamato,Abyss,Baekdu,Farmageddon,Retribution,SantaSlay,ShardOfScreams,ShardOfTheDead,ShardOfTheDead2,Winterland}}
+
--> {{#arraydefine: shards| Arirang,Asuka,Atlantic,Baja,Balhae,Catskills,Chesapeake,Drachenfels,Europa,Formosa,GL,Hokuto,Izumo,LA,LS,Legends,Mizuho,Mugen,Napa,Oceania,Origin,Pacific,Sakura,SP,Sonoma,Wakoku,Yamato,NL,Test,Abyss,Baekdu,Farmageddon,Retribution,SantaSlay,ShardOfScreams,ShardOfTheDead,ShardOfTheDead2,Winterland}}<!--
{{#vardefine: n | 0}}
+
--> {{#arraydefine: shardTypes| a,j,w,w,a,w,w,w,w,a,w,j,j,w,w,w,j,jh,w,a,w,w,j,wh,w,j,j,,,,,,,,,,,}}
{{#loop: i | 0 | {{#arraysize: shards}} | {{#vardefine: shard | {{#arrayindex: shards | {{#var:i}} }} }}
+
{{#vardefine: n|0}}{{#vardefine: allwestern|{{Boolean|1}}}}{{#vardefine: alljapan|{{Boolean|1}}}}{{#vardefine: allasia|{{Boolean|1}}}}
 +
{{#loop: i | 0 | {{#arraysize: shards}} |
 +
{{#vardefine: exist|{{Boolean|{{{ {{#arrayindex:shards|{{#var:i}}}}|}}} }} }}
 +
{{#switch: {{#arrayindex: shardTypes|{{#var:i}}}}
 +
|j|jh = {{#ifexpr: {{#var:exist}}||{{#vardefine: alljapan|{{Boolean|0}}}}{{#vardefine: allasia|{{Boolean|0}}}} }}
 +
|w|wh = {{#ifexpr: {{#var:exist}}||{{#vardefine: allwestern|{{Boolean|0}}}} }}
 +
|a = {{#ifexpr: {{#var:exist}}||{{#vardefine: allasia|{{Boolean|0}}}} }}
 +
}}
 +
}}
 +
{{#ifexpr: {{#var:allwestern}} and {{#var:allasia}}
 +
|All Shards<br/>
 +
|{{#ifexpr: {{#var:allasia}}|All Asia Shards<br/>|{{#ifexpr: {{#var:alljapan}}|All Japanese Shards<br/>|}}{{#ifexpr: {{#var:allasia}}|All Western Shards<br/>|}} }}
 +
}}
 +
{{#loop: i | 0 | {{#arraysize: shards}} |
 +
{{#vardefine: shard|{{#arrayindex: shards|{{#var:i}}}} }}
 +
{{#vardefine: exist|{{Boolean|{{{ {{#var:shard}}|}}} }} }}
 +
{{#switch: {{#arrayindex: shardTypes|{{#var:i}}}}
 +
|j|jh = {{#ifexpr: {{#var:alljapan}} or {{#var:allasia}}|{{#vardefine: exist|{{Boolean|0}}}}|}}
 +
|w|wh = {{#ifexpr: {{#var:allwestern}}|{{Boolean|0}}|}}
 +
|a = {{#ifexpr: {{#var:allasia}}|{{Boolean|0}}|}}
 +
}}
 
{{#vardefine: shardname |
 
{{#vardefine: shardname |
 
{{#switch: {{#var:shard}}
 
{{#switch: {{#var:shard}}
Line 17: Line 37:
 
| Napa = Napa Valley
 
| Napa = Napa Valley
 
| SP = Siege Perilous
 
| SP = Siege Perilous
 +
| NL = New Legacy
 
| Test = Test Center
 
| Test = Test Center
 
| SantaSlay = Santa's Slay
 
| SantaSlay = Santa's Slay
Line 25: Line 46:
 
}}
 
}}
 
}}
 
}}
{{#ifeq: {{Boolean|{{{ {{#var:shard}}|}}} }} | 1 | {{#vardefine:n|{{#expr:{{#var:n}}+1}}}}[[:Category:UO:{{#var:shardname}} Rares]][[UO:{{#var:shardname}} Rares|{{#var:shardname}}]]<br/> |}}
+
{{#ifeqexpr: {{#var:exist}}|{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}[[UO:{{#var:shardname}} Rares|{{#var:shardname}}]]<br/>|}}
 
}}
 
}}
{{#ifeq:{{#var:n}}|0|[[:Category:UO:Rares from unknown shards]][[UO:Rares from unknown shards|unknown]]|}}
+
{{#ifeq:{{#var:n}}|0|[[Category:UO:Rares from unknown shards]][[UO:Rares from unknown shards|unknown]]|}}
{{!!}}
+
{{!!}}{{#arraydefine: seasons | {{{season|}}}|,}}{{#vardefine: firstseason | {{#arrayindex:seasons|0}} }}
{{#arraydefine: seasons | {{{season|}}}|,}}{{#vardefine: firstseason | {{#arrayindex:seasons|0}} }}
+
{{#if:{{{season|}}} | {{#vardefine: year |20{{padleft:{{#expr: 2+{{#var:firstseason}} }}|2}} }} [[Category:UO:Rares From {{#var: year}}]]&nbsp;[[UO:Rares From {{#var: year}}|{{#var: year}}]]|{{#if:{{{year|}}}| [[Category:UO:Rares From {{{year}}}]]&nbsp;[[UO:Rares From {{{year}}}|{{{year}}}]]|[[Category:UO:Rares with unknown year]][[UO:Rares with unknown year|unknown]]}} }}
{{#vardefine: month | {{#switch: {{lc:{{padleft:|3|{{{month|}}}~ }} }} | 1~1 | jan = January | 2~2 | feb = February | 3~3 | mar = March | 4~4 | apr = April | 5~5 | may = May | 6~6 | jun = June | 7~7 | jul = July | 8~8 | aug = August | 9~9 | sep | sept = September | 10~ | oct = October | 11~ | nov = November | 12~ | dec = December | #default = }} }}{{#var: month}}{{#if: {{{day|}}} |&nbsp;{{{day}}}, |}}
 
{{#if:{{{season|}}} | {{#vardefine: year |20{{padleft:{{#expr: 2+{{#var:firstseason}} }}|2}} }} [[:Category:UO:Rares From {{#var: year}}]]&nbsp;[[UO:Rares From {{#var: year}}|{{#var: year}}]]|{{#if:{{{year|}}}| [[:Category:UO:Rares From {{{year}}}]]&nbsp;[[UO:Rares From {{{year}}}|{{{year}}}]]|[[:Category:UO:Rares with unknown year]][[UO:Rares with unknown year|unknown]]}} }}
 
 
{{#if: {{{year_end|}}} | &#8211;}}
 
{{#if: {{{year_end|}}} | &#8211;}}
{{!!}}
+
{{!!}}<!--
{{#if: {{{quantity|}}} | {{#replace: {{{quantity}}}|*|&lowast;}}|unknown[[:Category:UO:Rares of unknown quantity]]}}
+
--> {{#vardefine: month | {{#switch: {{lc:{{padleft:|3|{{{month|}}}~ }} }} | 1~1 | jan = Jan | 2~2 | feb = Feb | 3~3 | mar = Mar | 4~4 | apr = Apr | 5~5 | may = May | 6~6 | jun = Jun | 7~7 | jul = Jul | 8~8 | aug = Aug | 9~9 | sep | sept = Sep | 10~ | oct = Oct | 11~ | nov = Nov | 12~ | dec = Dec | #default = }} }}{{#var: month}}{{#if: {{{day|}}} |&nbsp;{{{day}}}|}}
 +
{{!!}}<!--
 +
--> {{#if: {{{quantity|}}} | {{#replace: {{{quantity}}}|*|&lowast;}}|unknown[[Category:UO:Rares of unknown quantity]]}}
 
}}
 
}}

Revision as of 22:59, 9 January 2022