Difference between revisions of "Template:InfoBox UOSound"

m
m
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{UOSoundData}}{{#vardefine: sound |{{#replace:{{PAGENAME}}|UO:Items that make sound |}} }}
+
<includeonly>{{UOSoundData}}{{#vardefine: soundId |{{#replace:{{PAGENAME}}|UO:Items that make sound |}} }}{{#vardefine: soundNum |{{#expr: {{#var:soundId}} + 1 }}}}{{#vardefine:soundfile|UO-Sound-{{#var:soundNum}}-1.mp3}}
 
{| class=infobox style="margin-top: 5em;"
 
{| class=infobox style="margin-top: 5em;"
 
|class=titlecell colspan="2"| Sound
 
|class=titlecell colspan="2"| Sound
 
|-
 
|-
|colspan="2" style="text-align:center;"| [[File:UO-Sound-{{#var:sound}}-1.mp3|File:UO-Sound-{{#var:sound}}-1.mp3]]
+
|colspan="2" style="text-align:center;"|{{#ifeq:{{#arrayindex:sound{{#var:soundNum}}|0}}|unused|This sound number is not used by the client.|[[File:{{#var:soundfile}}|File:{{#var:soundfile}}]]
|-
+
{{!}}-
|Internal Name||{{#arrayindex:sound{{#var:sound}}|0}}
+
{{!}}&nbsp;
|-
+
{{!}}-
|Length||{{#arrayindex:sound{{#var:sound}}|1}} seconds
+
{{!}}Internal Name{{!!}}{{#arrayindex:sound{{#var:soundNum}}|0}}
|-
+
{{!}}-
|Number (decimal)||{{#var:sound}}
+
{{!}}Length{{!!}}{{#arrayindex:sound{{#var:soundNum}}|1}} seconds
|-
+
{{!}}-
|Number (hex)||{{#ifeq: {{#var:sound}}|1|0x01|{{Dec2hex|{{#var:sound}}}}}}
+
{{!}}Number (decimal)*{{!!}}{{#var:soundId}}
|}[[Category:UO Items Using Specific Sounds]]</includeonly>
+
{{!}}-
 +
{{!}}Number (hex)*{{!!}}{{#ifeq: {{#var:soundId}}|1|0x01|{{Dec2hex|{{#var:soundId}}}}}}
 +
{{!}}-
 +
{{!}} colspan=2 {{!}} <div>* Note that internally, a sound packet (packet 0x54) uses a<br> [[Wikipedia:Word_(computer_architecture)|word]]-sized index starting from 0, not 1.  This means that<br>sound file number #1 internally has packet ID #0.<div>
 +
{{!}}}[[Category:UO Items Using Specific Sounds]]}}</includeonly>

Latest revision as of 00:39, 22 June 2020