Шаблон:Event infobox — различия между версиями
Материал из Guild Wars 2 wiki
Blood (обсуждение | вклад) |
Blood (обсуждение | вклад) |
||
(не показано 9 промежуточных версий этого же участника) | |||
Строка 1: | Строка 1: | ||
− | {{# | + | {{#set:Has context=Event}}{{#if:{{{event id|}}}|{{#arraymap:{{{event id}}}|,|@@@|{{#set:Has game guid=@@@}}}}}}<!-- |
− | | | + | -->{{infobox status|{{{status|}}}|{{{status notes|}}}|date={{{status date|}}}}}<!-- |
− | | | + | -->{{infobox requires|{{{requires|}}} }}<!-- |
− | | | + | --><div class="infobox quest" {{#if:{{{event id|}}}|data-guid="{{{event id}}}" }}> |
− | + | <p class="heading">[[Has canonical name::{{{name|{{#titleparts:{{PAGENAME}}}}}}}]]</p> | |
− | + | <div class="wrapper"> | |
− | }}<div class="infobox quest" {{#if:{{{event id|}}}|data-guid="{{{event id}}}" | ||
− | <p class="heading">[[Has canonical name::{{{name|{{PAGENAME}}}}}]]</p> | ||
;[[Location|Локация]] | ;[[Location|Локация]] | ||
− | :{{#if:{{{location|}}} | + | :{{#if: {{{location|}}} |
− | + | | {{#ifexpr: {{#len:{{#arraymap: {{{location|}}} |;|@@@|.|}}}} <= 3 | |
− | + | | {{#arraymap:{{{location}}}|;|@@@| {{cname|@@@}} {{#set:Starts in=@@@}} {{#if: {{#vardefineecho:parentLocation|{{#show:@@@|?Located in}}}} | <br><small>({{#var:parentLocation}})</small> }} |<br>}} | |
− | + | | {{#arraymap:{{{location}}}|;|@@@| {{cname|@@@}} {{#set:Starts in=@@@}} |<br>}} | |
− | + | }} | |
− | + | | ''Не указано'' | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}} | }} | ||
;Тип события | ;Тип события | ||
− | :{{#ifeq:{{lc:{{{type|}}}}}|skill challenge| {{event icon| | + | :{{#ifeq:{{#replace:{{lc:{{{type|}}}}}|skill|hero}}|hero challenge| {{event icon|hero}}{{#set:Has event icon=hero}} | {{#if:{{{indicator|}}}|{{event icon|{{{indicator|}}}}}{{#set:Has event icon={{lc:{{{indicator|}}}}}}}|}} |
− | }} {{#if: {{{type|}}} |[[{{ucfirst:{{lc:{{{type}}}}}}}]]{{#set:Has event type={{ucfirst:{{lc:{{{type}}}}}}}}} |[[Has event type::Dynamic event]]}} | + | }} {{#if: {{{type|}}} |[[{{ucfirst:{{#replace:{{lc:{{{type}}}}}|skill|hero}}}}|{{#switch:{{#replace:{{lc:{{{type}}}}}|skill|hero}}|dynamic event=Динамическое|group event=Групповое|meta event=Мета-событие|#default={{ucfirst:{{#replace:{{lc:{{{type}}}}}|skill|hero}}}}}}]]{{#set:Has event type={{ucfirst:{{#replace:{{lc:{{{type}}}}}|skill|hero}}}}}} |[[Has event type::Dynamic event|Динамическое]]}} |
{{#if: {{{meta_event|}}}| | {{#if: {{{meta_event|}}}| | ||
− | ;Часть | + | ;Часть |
− | :{{cname|{{{meta_event}}}}} {{#set:Is part of meta event={{{meta_event}}}}} | + | :{{cname|{{{meta_event}}}}} {{#set:Is part of meta event={{{meta_event}}}}}<!-- временно комментим{{#vardefine:meta_event_param_i|2}}{{#while: |
+ | | {{{meta_event{{#var:meta_event_param_i}}|}}} | ||
+ | | <br>{{cname|{{{meta_event{{#var:meta_event_param_i}}}}}}} {{#set:Is part of meta event={{{meta_event{{#var:meta_event_param_i}}}}}}}{{#vardefine:meta_event_param_i| {{#expr: {{#var:meta_event_param_i}}+1 }} }} }}--> | ||
}} | }} | ||
− | ;[[ | + | ;[[Character#Развитие|Уровень]] |
:{{#if: {{{level|}}} | | :{{#if: {{{level|}}} | | ||
{{#ifeq: {{lc:{{{type}}}}} | meta event | {{#ifeq: {{lc:{{{type}}}}} | meta event | ||
− | + | | {{#ask:[[Is part of meta event::{{PAGENAME}}]]|?Has event level|format=min}}-{{#ask:[[Is part of meta event::{{PAGENAME}}]]|?Has event level|format=max}} | |
− | + | | {{#if: {{#pos:{{{level}}}|,}} | {{#arraymap:{{{level}}}|,|@@@|[[Has event level::@@@]]}} | {{#if: {{#pos:{{{level}}}|-}} | {{#set:Has event level={{#explode:{{{level}}}|-|1}}}}{{{level}}} | [[Has event level::{{{level}}}]] }} }} | |
}} | }} | ||
− | + | | ''Не указано'' {{#set:Has event level=0}} | |
}}{{#ifeq: {{lc:{{{type}}}}} | meta event | | }}{{#ifeq: {{lc:{{{type}}}}} | meta event | | ||
− | ;Кол. событий | + | ;Кол. событий |
:{{#ask:[[Is part of meta event::{{PAGENAME}}]]|format=count}} | :{{#ask:[[Is part of meta event::{{PAGENAME}}]]|format=count}} | ||
}}{{#if: {{{boss|}}}| | }}{{#if: {{{boss|}}}| | ||
Строка 42: | Строка 36: | ||
:{{#arraymap: {{{boss}}} |,|@@@|{{cname|@@@}}{{#set:Has event boss=@@@}}|<br>}} | :{{#arraymap: {{{boss}}} |,|@@@|{{cname|@@@}}{{#set:Has event boss=@@@}}|<br>}} | ||
}}{{#if: {{{start_npc|}}} | | }}{{#if: {{{start_npc|}}} | | ||
− | ; | + | ;Выдает |
:{{#arraymap: {{{start_npc}}} |,|@@@|{{cname|@@@}}{{#set:Has initiator=@@@}}|<br>}} | :{{#arraymap: {{{start_npc}}} |,|@@@|{{cname|@@@}}{{#set:Has initiator=@@@}}|<br>}} | ||
}}{{#if: {{{heart|}}}| | }}{{#if: {{{heart|}}}| | ||
− | ;[[Renown Heart|Сердце | + | ;[[Renown Heart|Сердце]] |
:[[{{{heart|}}}]] | :[[{{{heart|}}}]] | ||
}}{{#if: {{{event_prev|}}} | | }}{{#if: {{{event_prev|}}} | | ||
− | ; | + | ;Предшествует |
− | :{{ | + | :{{event icon|back}} {{cname|{{{event_prev}}}}} {{#if:{{{event_prev2|}}} |
|<br /> {{dialogue icon|back}} {{cname|{{{event_prev2|}}}}}}} {{#if:{{{event_prev3|}}} | |<br /> {{dialogue icon|back}} {{cname|{{{event_prev2|}}}}}}} {{#if:{{{event_prev3|}}} | ||
|<br /> {{dialogue icon|back}} {{cname|{{{event_prev3|}}}}}}} {{#if:{{{event_prev4|}}} | |<br /> {{dialogue icon|back}} {{cname|{{{event_prev3|}}}}}}} {{#if:{{{event_prev4|}}} | ||
Строка 55: | Строка 49: | ||
|<br /> {{dialogue icon|back}} {{cname|{{{event_prev5|}}}}}}} | |<br /> {{dialogue icon|back}} {{cname|{{{event_prev5|}}}}}}} | ||
}}{{#if: {{{event_success|}}} | | }}{{#if: {{{event_success|}}} | | ||
− | ;{{#if: {{{event_failure|}}}|В случае победы| | + | ;{{#if: {{{event_failure|}}}|В случае победы|Следует}} |
:{{event icon|success}} {{cname|{{{event_success}}}}} {{#if:{{{event_success2|}}} | :{{event icon|success}} {{cname|{{{event_success}}}}} {{#if:{{{event_success2|}}} | ||
|<br /> {{event icon|success}} {{cname|{{{event_success2}}}}}}} {{#if:{{{event_success3|}}} | |<br /> {{event icon|success}} {{cname|{{{event_success2}}}}}}} {{#if:{{{event_success3|}}} | ||
Строка 68: | Строка 62: | ||
|<br /> {{event icon|failure}} {{cname|{{{event_failure4}}}}}}} {{#if:{{{event_failure5|}}} | |<br /> {{event icon|failure}} {{cname|{{{event_failure4}}}}}}} {{#if:{{{event_failure5|}}} | ||
|<br /> {{event icon|failure}} {{cname|{{{event_failure5}}}}}}} | |<br /> {{event icon|failure}} {{cname|{{{event_failure5}}}}}}} | ||
− | }} | + | }}{{#if: {{{event id|}}} | {{#vardefine:cnt|1}} |
+ | ;API | ||
+ | {{#if: {{#iferror: {{#explode:{{{event id}}}|,|3}} | ||
+ | | Error: String exceeds 1,000 character limit. Assuming more than three ids. | ||
+ | | {{#explode:{{{event id}}}|,|3}} | ||
+ | }} | ||
+ | | <dd><div class="mw-collapsible mw-collapsed">{{#arraymap: {{{event id}}}|,|@@@| | ||
+ | {{#switch: {{#var:cnt}} | ||
+ | | 1 = [https://api.guildwars2.com/v1/event_details.json?event_id=@@@&lang=en API]{{increment|cnt}} | ||
+ | | 3 = ...<div class="mw-collapsible-content">[https://api.guildwars2.com/v1/event_details.json?event_id=@@@&lang=en 3]{{increment|cnt}} | ||
+ | | #default = [https://api.guildwars2.com/v1/event_details.json?event_id=@@@&lang=en {{#var:cnt}}]{{increment|cnt}} | ||
+ | }}|,<nowiki> </nowiki>}}</div></div></dd> | ||
+ | |:{{#arraymap: {{{event id}}}|,|@@@| | ||
+ | {{#switch: {{#var:cnt}} | ||
+ | | 1 = [https://api.guildwars2.com/v1/event_details.json?event_id=@@@&lang=en API]{{increment|cnt}} | ||
+ | | #default = [https://api.guildwars2.com/v1/event_details.json?event_id=@@@&lang=en {{#var:cnt}}]{{increment|cnt}} | ||
+ | }}|,<nowiki> </nowiki>}} | ||
+ | }}}} | ||
+ | </div> | ||
+ | {{#if: {{ifimage|{{#titleparts:{{PAGENAME}}}}.jpg|+}}{{{map1|}}}{{{map2|}}} | | ||
{{event infobox gallery | {{event infobox gallery | ||
| gallery1 = {{{map1|}}} | | gallery1 = {{{map1|}}} | ||
Строка 80: | Строка 93: | ||
| gallery5 = {{{map5|}}} | | gallery5 = {{{map5|}}} | ||
| gallery5-text = {{{map5-text|}}} | | gallery5-text = {{{map5-text|}}} | ||
− | }}</div><!-- | + | }}|<!-- временно комментим |
+ | {{#if: {{#switch: {{lc:{{{type}}}}} | meta event | map meta event = | #default = {{{coordinates|}}}{{{path|}}}{{{bounds|}}} }} | {{{!}} style="width:100%;" | ||
+ | {{!}} '''Интерактивная карта''' | ||
+ | {{!}}- style="text-align:center;" | ||
+ | {{!}} {{Infobox map | coordinates = {{{coordinates|}}} | path = {{{path|}}} | bounds = {{{bounds|}}} | type = {{#if: {{{indicator|}}} | {{{indicator}}} | {{{type|}}} }} | localtiles = {{{localtiles|}}} | requires = {{{requires|{{{release|}}}}}} }} | ||
+ | {{!}}} | ||
+ | | {{clear}} }}--> }}</div><!-- | ||
AUTOCATEGORIZATION | AUTOCATEGORIZATION | ||
-->{{#if: {{NAMESPACE}}<!-- no categories if outside of article namespace --> | -->{{#if: {{NAMESPACE}}<!-- no categories if outside of article namespace --> | ||
{{#ifeq: {{{categorize|y}}} | n | do not categorize | <!-- categorize --> }} | {{#ifeq: {{{categorize|y}}} | n | do not categorize | <!-- categorize --> }} | ||
{{#switch: {{lc:{{{status|}}}}} | historical | unimplemented | future = do not categorize }} | {{#switch: {{lc:{{{status|}}}}} | historical | unimplemented | future = do not categorize }} | ||
− | |||
| <!-- Do not categorize --> | | | <!-- Do not categorize --> | | ||
− | + | {{#if: {{{type|}}} | |
− | + | | {{#switch: {{lc:{{{type}}}}} | |
− | + | | meta event = [[Category:Meta events]] | |
− | + | | group event = [[Category:Group events]] | |
− | + | | skill challenge | |
− | + | | hero challenge = [[Category:Hero challenge events]] | |
− | + | | guild mission = [[Category:Guild missions]] | |
+ | }} | ||
+ | }} | ||
+ | {{#if: {{{location|}}} | ||
+ | | {{#arraymap:{{{location}}}|;|@@@| | ||
+ | {{#if: {{#vardefineecho:parentLocation|{{#show:@@@|?Located in|link=none}}}} | ||
+ | | {{#arraymap:{{#var:parentLocation}}|,|$$$|<!-- events within story zones --> | ||
+ | {{#switch: {{#show:$$$|?Has location type|link=none}} | ||
+ | | Dungeon | ||
+ | | City | ||
+ | | Zone = [[Category:$$$ events]] | ||
+ | | #default = [[Category:@@@ events]] | ||
+ | }} | ||
+ | |}} | ||
}} | }} | ||
− | }} | + | |}} |
+ | }} | ||
+ | {{#if: {{{coordinates|}}} | | ||
+ | {{#set: | ||
+ | | Has x coordinate = {{#replace:{{#explode: {{{coordinates|}}} |,|0}}|[|}} | ||
+ | | Has y coordinate = {{#replace:{{#explode: {{{coordinates|}}} |,|1}}|]|}} | ||
+ | }} | ||
+ | }} | ||
}}<noinclude> | }}<noinclude> | ||
− | + | == Usage == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<pre> | <pre> | ||
{{Event infobox | {{Event infobox | ||
Строка 130: | Строка 144: | ||
| level = | | level = | ||
| heart = | | heart = | ||
− | | meta_event = | + | | meta_event = |
+ | | meta_event2 = | ||
+ | | meta_event3 = | ||
+ | | meta_event4 = | ||
+ | ... | ||
+ | | meta_event99 = | ||
| boss = | | boss = | ||
| start_npc = | | start_npc = | ||
− | |||
− | |||
| event_prev = | | event_prev = | ||
| event_prev2 = | | event_prev2 = | ||
| event_prev3 = | | event_prev3 = | ||
| event_prev4 = | | event_prev4 = | ||
− | | | + | ... |
+ | | event_prev99 = | ||
| event_success = | | event_success = | ||
| event_success2 = | | event_success2 = | ||
| event_success3 = | | event_success3 = | ||
| event_success4 = | | event_success4 = | ||
− | | | + | ... |
+ | | event_success99 = | ||
| event_failure = | | event_failure = | ||
| event_failure2 = | | event_failure2 = | ||
| event_failure3 = | | event_failure3 = | ||
| event_failure4 = | | event_failure4 = | ||
− | | | + | ... |
+ | | event_failure99 = | ||
+ | | event id = | ||
+ | | coordinates = | ||
| map1 = | | map1 = | ||
| map1-text = | | map1-text = | ||
Строка 160: | Строка 182: | ||
| map5 = | | map5 = | ||
| map5-text = | | map5-text = | ||
+ | | requires = | ||
}}</pre> | }}</pre> | ||
− | == Example == | + | === Parameters === |
+ | ; name : Only use if the event name does not match the article name; defaults to <code><nowiki>{{PAGENAME}}</nowiki></code>. | ||
+ | ; location : Required. The location in which the event takes places (e.g. Shaemoor Fields). Separate multiple values with a semi-colon. | ||
+ | ; coordinates / path / bounds: Optional. The X and Y coordinates to the NPCs location. Displays an interactive map with a marker for the event location. EG <code>[12345, 31321]</code>. Obtain the coordinates from [[Widget:Event table]]. See {{tl|Infobox map}} for more details. | ||
+ | ; type : The event type (i.e. Dynamic event, Group event, Guild mission, Map meta event, Meta event, Special event, Hero challenge); defaults to ''Dynamic event''. | ||
+ | ; indicator : Name the icon indicator of the event. See {{tl|Event icon}} for a full list. | ||
+ | ; level : Required. The level of this event. | ||
+ | ; meta_event : The [[meta event]] this event is part of. | ||
+ | ; meta_event2... meta_event99 : Same as above. (Only used if the event is part of multiple meta events) | ||
+ | ; boss : The name of this event's [[boss]], if it has one | ||
+ | ; heart: If the event contributes towards the completion of a nearby heart, note the heart name (the wiki-link is generated automatically). | ||
+ | ; start_npc : The NPC used to initiate the event. (separate multiple entries with a comma) | ||
+ | ; map1... map5 : Map images of the event (or parts of the event.) | ||
+ | ; map1-text ... map5-text : Map image descriptions. Defaults to "Click to enlarge". | ||
+ | ; event_prev : The event this is preceded by; | ||
+ | ; event_prev2... event_prev99 : Same as above. (Only used if there are multiple preceding events) | ||
+ | ; event_success : The event that follows if the completion of the current event is considered successful. | ||
+ | ; event_success2... event_success99 : Same as above. (Only used if there are multiple such events) | ||
+ | ; event_failure : The event that follows if the completion of the current event is considered a failure. | ||
+ | ; event_failure2... event_failure99 : Same as above. (Only used if there are multiple such events) | ||
+ | ; event id: Internal event identifier ([[w:GUID|GUID]]). Multiple ids should be comma separated. | ||
+ | ; categorize : Optional. "y" or "n" to turn on/off categorization. Default is on for main namespace articles and off for others. If using "status", don't set this parameter. | ||
+ | ; status : Optional. Status of content. Only set if not currently obtainable ingame, displays relevant notice. Available options: "historical", "future", "unimplemented", "current" (default), or "hot" (Heart of Thorns content; implies "current"). | ||
+ | ; status notes : Optional. Allows provision of additional reason for the given status. | ||
+ | ; status date : Optional. Sets the date of the update that marked this skill as historical (in YYYY-MM-DD format). | ||
+ | ; requires : Optional. The expansion or living world season required to access the content. Displays a notice of the release. See {{tl|infobox requires}} for options. | ||
+ | |||
+ | === Example === | ||
<pre> | <pre> | ||
{{Event infobox | {{Event infobox | ||
| name = Defend Bloodsaw Mill from the Flame Legion | | name = Defend Bloodsaw Mill from the Flame Legion | ||
− | | location = | + | | location = Bulliyak Arsenal |
| type = Dynamic event | | type = Dynamic event | ||
| indicator = flag | | indicator = flag | ||
− | | | + | | meta_event = Flame Legion Battles |
| level = 23 | | level = 23 | ||
| event_prev = Prevent the Flame Legion from retaking Incendio Templum | | event_prev = Prevent the Flame Legion from retaking Incendio Templum | ||
Строка 183: | Строка 233: | ||
{{Event infobox | {{Event infobox | ||
| name = Defend Bloodsaw Mill from the Flame Legion | | name = Defend Bloodsaw Mill from the Flame Legion | ||
− | | location = | + | | location = Bulliyak Arsenal |
| type = Dynamic event | | type = Dynamic event | ||
| indicator = flag | | indicator = flag |
Текущая версия на 12:23, 11 августа 2021
Usage[править]
{{Event infobox | name = | location = | type = | indicator = | level = | heart = | meta_event = | meta_event2 = | meta_event3 = | meta_event4 = ... | meta_event99 = | boss = | start_npc = | event_prev = | event_prev2 = | event_prev3 = | event_prev4 = ... | event_prev99 = | event_success = | event_success2 = | event_success3 = | event_success4 = ... | event_success99 = | event_failure = | event_failure2 = | event_failure3 = | event_failure4 = ... | event_failure99 = | event id = | coordinates = | map1 = | map1-text = | map2 = | map2-text = | map3 = | map3-text = | map4 = | map4-text = | map5 = | map5-text = | requires = }}
Parameters[править]
- name
- Only use if the event name does not match the article name; defaults to
{{PAGENAME}}
. - location
- Required. The location in which the event takes places (e.g. Shaemoor Fields). Separate multiple values with a semi-colon.
- coordinates / path / bounds
- Optional. The X and Y coordinates to the NPCs location. Displays an interactive map with a marker for the event location. EG
[12345, 31321]
. Obtain the coordinates from Widget:Event table. See {{Infobox map}} for more details. - type
- The event type (i.e. Dynamic event, Group event, Guild mission, Map meta event, Meta event, Special event, Hero challenge); defaults to Dynamic event.
- indicator
- Name the icon indicator of the event. See {{Event icon}} for a full list.
- level
- Required. The level of this event.
- meta_event
- The meta event this event is part of.
- meta_event2... meta_event99
- Same as above. (Only used if the event is part of multiple meta events)
- boss
- The name of this event's boss, if it has one
- heart
- If the event contributes towards the completion of a nearby heart, note the heart name (the wiki-link is generated automatically).
- start_npc
- The NPC used to initiate the event. (separate multiple entries with a comma)
- map1... map5
- Map images of the event (or parts of the event.)
- map1-text ... map5-text
- Map image descriptions. Defaults to "Click to enlarge".
- event_prev
- The event this is preceded by;
- event_prev2... event_prev99
- Same as above. (Only used if there are multiple preceding events)
- event_success
- The event that follows if the completion of the current event is considered successful.
- event_success2... event_success99
- Same as above. (Only used if there are multiple such events)
- event_failure
- The event that follows if the completion of the current event is considered a failure.
- event_failure2... event_failure99
- Same as above. (Only used if there are multiple such events)
- event id
- Internal event identifier (GUID). Multiple ids should be comma separated.
- categorize
- Optional. "y" or "n" to turn on/off categorization. Default is on for main namespace articles and off for others. If using "status", don't set this parameter.
- status
- Optional. Status of content. Only set if not currently obtainable ingame, displays relevant notice. Available options: "historical", "future", "unimplemented", "current" (default), or "hot" (Heart of Thorns content; implies "current").
- status notes
- Optional. Allows provision of additional reason for the given status.
- status date
- Optional. Sets the date of the update that marked this skill as historical (in YYYY-MM-DD format).
- requires
- Optional. The expansion or living world season required to access the content. Displays a notice of the release. See {{infobox requires}} for options.
Example[править]
{{Event infobox | name = Defend Bloodsaw Mill from the Flame Legion | location = Bulliyak Arsenal | type = Dynamic event | indicator = flag | meta_event = Flame Legion Battles | level = 23 | event_prev = Prevent the Flame Legion from retaking Incendio Templum | event_success = Recover the scattered pieces of scrap metal for Savor Foulnight | event_success2 = Defend Faint Ghostnight as he searches for a new devourer egg | event_success3 = Defeat Hazarar Razenight | event_failure = Recapture Bloodsaw Mill from the Flame Legion | map1 =User Lucian Shadowborn map.jpg | map1-text = Quest path }}
Defend Bloodsaw Mill from the Flame Legion
- Локация
- Bulliyak Arsenal
(Diessa Plateau) - Тип события
- Динамическое
- Часть
- Flame Legion Battles
- Уровень
- 23
- Предшествует
- Prevent the Flame Legion from retaking Incendio Templum
- В случае победы
- Recover the scattered pieces of scrap metal for Savor Foulnight
Defend Faint Ghostnight as he searches for a new devourer egg
Defeat Hazarar Razenight - В случае провала
- Recapture Bloodsaw Mill from the Flame Legion
Карты события | |
Quest path |