Modèle:Npc infobox/drop : Différence entre versions

De Terraria Wiki
Aller à : navigation, rechercher
m
m
Ligne 16 : Ligne 16 :
   
 
// set cargo and modeclass vars
 
// set cargo and modeclass vars
-->{{#if:{{#ifeq:{{{A}}}|treasurebag|y|{{#dplvar:_npc_infobox:trsbg}}}}|<!-- default for treasure bag items:
+
-->{{#if:{{#dplvar:_npc_infobox:in_loot}}|<!--
-->{{#vardefine:modeclass|m-expert-master}}<!--
+
-->{{#vardefine:nidrop:nameraw|{{#dplvar:_npc_infobox:loot_source}}}}<!--
-->{{#vardefine:nidrop:expert|yes}}<!--
+
-->{{#ifeq:{{#sub:{{#var:nidrop:nameraw}}|0|12}}|Treasure Bag|<!--
-->{{#vardefine:nidrop:master|yes}}<!--
+
-->{{#vardefine:nidrop:name|{{eil|{{#var:nidrop:nameraw}}|{{tr|Treasure Bag}}}}<br/>{{note|paren=y|{{#var:ni:name}}}}}}<!--
 
-->|<!--
-->{{#vardefine:nidrop:nameraw|Treasure Bag ({{#var:ni:name}})}}<!--
 
-->{{#vardefine:nidrop:name|{{eil|{{#var:nidrop:nameraw}}|{{tr|Treasure Bag}}}}<br/>{{note|paren=y|{{#var:ni:name}}}}}}<!--
+
-->{{#vardefine:nidrop:name|{{eil|{{#var:nidrop:nameraw}}}}}}<!--
  +
-->}}<!--
 
-->}}<!--
 
-->}}<!--
   
Ligne 42 : Ligne 43 :
 
-->{{#vardefine:modeclass|m-master}}<!--
 
-->{{#vardefine:modeclass|m-master}}<!--
 
-->{{#vardefine:nidrop:master|yes}}<!--
 
-->{{#vardefine:nidrop:master|yes}}<!--
-->|#default=<!-- normal and above (all)
+
-->|#default=<!-- normal, expert, and master
 
-->{{#vardefine:nidrop:normal|yes}}<!--
-->{{#if:{{#dplvar:_npc_infobox:trsbg}}||<!-- treasure bag items already got their default
 
-->{{#vardefine:nidrop:normal|yes}}<!--
+
-->{{#vardefine:nidrop:expert|yes}}<!--
-->{{#vardefine:nidrop:expert|yes}}<!--
+
-->{{#vardefine:nidrop:master|yes}}<!--
-->{{#vardefine:nidrop:master|yes}}<!--
 
-->}}<!--
 
 
-->{{#vardefine:cell3|{{{C|}}}}}<!--
 
-->{{#vardefine:cell3|{{{C|}}}}}<!--
 
-->}}<!--
 
-->}}<!--
Ligne 56 : Ligne 55 :
 
-->{{#switch:{{{A}}}<!--
 
-->{{#switch:{{{A}}}<!--
 
-->|:group:start=<!--
 
-->|:group:start=<!--
--><li class="caption {{#var:modeclass}} {{#if:{{#dplvar:_npc_infobox:in_loot}}|loot}}">{{{B|}}}</li><!--
+
--><li class="caption {{#var:modeclass}} {{#dplvar:_npc_infobox:in_loot}}">{{{B|}}}</li><!--
 
-->{{#dplvar:set|_npc_infobox:in_group|groupend {{#var:modeclass}}}}<!-- flag, and also as a pre-cache of ending classes.
 
-->{{#dplvar:set|_npc_infobox:in_group|groupend {{#var:modeclass}}}}<!-- flag, and also as a pre-cache of ending classes.
 
-->|:group:end=<!--
 
-->|:group:end=<!--
--><li class="{{#dplvar:_npc_infobox:in_group}} {{#if:{{#dplvar:_npc_infobox:in_loot}}|loot}}"></li><!-- follow the mode class of group start.
+
--><li class="{{#dplvar:_npc_infobox:in_group}} {{#dplvar:_npc_infobox:in_loot}}"></li><!-- follow the mode class of group start.
 
-->{{#dplvar:set|_npc_infobox:in_group|}}<!--
 
-->{{#dplvar:set|_npc_infobox:in_group|}}<!--
 
-->|:loot:start=<!--
 
-->|:loot:start=<!--
-->{{#dplvar:set|_npc_infobox:in_loot|y}}<!-- flag
+
-->{{#dplvar:set|_npc_infobox:in_loot|loot}}<!-- flag
  +
-->{{#vardefine:nidrop:nameraw_snap|{{#var:nidrop:nameraw}}}}<!-- snapshot to restore after the loot section
  +
-->{{#vardefine:nidrop:name_snap|{{#var:nidrop:name}}}}<!-- snapshot to restore after the loot section
 
-->|:loot:end=<!--
 
-->|:loot:end=<!--
-->{{#dplvar:set|_npc_infobox:in_loot|}}<!--
+
-->{{#dplvar:set|_npc_infobox:in_loot||_npc_infobox:loot_source|}}<!--
 
-->{{#vardefine:nidrop:nameraw|{{#var:nidrop:nameraw_snap}}}}<!-- restore snapshot
  +
-->{{#vardefine:nidrop:name|{{#var:nidrop:name_snap}}}}<!-- restore snapshot
 
-->|:note:=<!--
 
-->|:note:=<!--
 
--><li class="notebox"><div><div style="{{#var:cell3}}">{{{B|}}}</div></div></li><!--
 
--><li class="notebox"><div><div style="{{#var:cell3}}">{{{B|}}}</div></div></li><!--
Ligne 73 : Ligne 76 :
 
-->|group=<!--
 
-->|group=<!--
 
-->{{#dplvar:set|_npc_infobox:group|{{#var:cell3|0}}}}<!--
 
-->{{#dplvar:set|_npc_infobox:group|{{#var:cell3|0}}}}<!--
--><li class="caption {{#var:modeclass}} {{#ifexpr:{{#dplvar:_npc_infobox:group}}||group_end}} {{#if:{{#dplvar:_npc_infobox:in_loot}}|loot}}">{{{B|}}}</li><!--
+
--><li class="caption {{#var:modeclass}} {{#ifexpr:{{#dplvar:_npc_infobox:group}}||group_end}} {{#dplvar:_npc_infobox:in_loot}}">{{{B|}}}</li><!--
-->|treasurebag=<!--
 
-->{{#dplvar:set|_npc_infobox:trsbg|{{item|{{l10n|npc_infobox|dropped_from_trsbg}}|mode=image|image=Treasure Bag ({{#var:ni:name}}).png|size=12px|nolink=y}}}}<!--
 
--><li class="caption {{#var:modeclass}} trsbg">{{l10n|npc_infobox|trsbg_contents|$trsbg-icon$={{#dplvar:_npc_infobox:trsbg}}}}</li><!--
 
 
-->|#default=<!--
 
-->|#default=<!--
 
-->{{#ifexpr:{{#dplvar:_npc_infobox:group}}|<!--
 
-->{{#ifexpr:{{#dplvar:_npc_infobox:group}}|<!--
 
-->{{#dplvar:set|_npc_infobox:group|{{#expr:{{#dplvar:_npc_infobox:group}}-1}}}}<!--
 
-->{{#dplvar:set|_npc_infobox:group|{{#expr:{{#dplvar:_npc_infobox:group}}-1}}}}<!--
 
-->{{#ifexpr:{{#dplvar:_npc_infobox:group}}|<!--
 
-->{{#ifexpr:{{#dplvar:_npc_infobox:group}}|<!--
--><li class="{{#var:modeclass}} {{#if:{{#dplvar:_npc_infobox:in_group}}|group}} {{#if:{{#dplvar:_npc_infobox:in_loot}}|loot}}"><!--
+
--><li class="{{#var:modeclass}} {{#if:{{#dplvar:_npc_infobox:in_group}}|group}} {{#dplvar:_npc_infobox:in_loot}}"><!--
 
-->|<!--
 
-->|<!--
--><li class="group_end {{#var:modeclass}} {{#if:{{#dplvar:_npc_infobox:in_group}}|group}} {{#if:{{#dplvar:_npc_infobox:in_loot}}|loot}}"><!--
+
--><li class="group_end {{#var:modeclass}} {{#if:{{#dplvar:_npc_infobox:in_group}}|group}} {{#dplvar:_npc_infobox:in_loot}}"><!--
 
-->}}<!--
 
-->}}<!--
 
-->|<!--
 
-->|<!--
--><li class="{{#var:modeclass}} {{#if:{{#dplvar:_npc_infobox:in_group}}|group}} {{#if:{{#dplvar:_npc_infobox:in_loot}}|loot}}"><!--
+
--><li class="{{#var:modeclass}} {{#if:{{#dplvar:_npc_infobox:in_group}}|group}} {{#dplvar:_npc_infobox:in_loot}}"><!--
 
-->}}<!--
 
-->}}<!--
 
--><div><!--
 
--><div><!--
Ligne 104 : Ligne 104 :
 
-->}}<!--
 
-->}}<!--
 
-->{{#vardefine:nidrop:items|{{{A|}}}}}<!--
 
-->{{#vardefine:nidrop:items|{{{A|}}}}}<!--
 
-->{{#if:{{#dplvar:_npc_infobox:in_loot}}||<!--
  +
-->{{#dplvar:set|_npc_infobox:loot_source|{{#var:nidrop:items}}}}<!-- store item(s) as loot source in case there is a loot section ahead
  +
-->}}<!--
 
-->{{#vardefine:nidrop:quantity|{{#or:{{{B|}}}|1}}}}<!--
 
-->{{#vardefine:nidrop:quantity|{{#or:{{{B|}}}|1}}}}<!--
 
-->}}<!--
 
-->}}<!--
 
--></div><!--
 
--></div><!--
--><div>{{#dplvar:_npc_infobox:trsbg}} {{percent|{{#vardefineecho:nidrop:rate|{{#var:cell3}}}}}}</div><!--
+
--><div>{{percent|{{#vardefineecho:nidrop:rate|{{#var:cell3}}}}}}</div><!-- rate
 
--></li><!--
 
--></li><!--
 
-->}}<!-- end of switch
 
-->}}<!-- end of switch
Ligne 128 : Ligne 131 :
 
-->|master={{#var:nidrop:master}}<!--
 
-->|master={{#var:nidrop:master}}<!--
 
-->}}<!--
 
-->}}<!--
  +
-->{{#vardefine:___debug:cargolog|{{#var:___debug:cargolog}}A:</esc>{{{A}}}---B:{{{B}}}---C:{{{C}}}<esc>---nameraw:{{#var:nidrop:nameraw}}---name:{{#var:nidrop:name}}---item:@@@@<br/>}}<!--
 
--></esc>|}}<!--
 
--></esc>|}}<!--
 
-->}}<!--
 
-->}}<!--

Version du 15 septembre 2020 à 07:13

Ce modèle définit le tableau « Drops ». Voir le tableau.

Internal sub-template. It handles the parameters for the "Drops" section of the infobox and stores drop information to the Cargo table.