Template:HeroesWithSpell: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary
No edit summary
 
Line 4: Line 4:
     Hero = H,
     Hero = H,
     Translation = T,
     Translation = T,
     Translation = E
     Translation = E,
    Hero__start_magics = SM
| join on =
| join on =
     H.id = T.target_id,
     H.id = T.target_id,
     H.id = E.target_id
     H.id = E.target_id,
    H._ID = SM._rowID
| where =
| where =
     (H.start_magics HOLDS '{{{id}}}' OR H.start_magics HOLDS '{{{id}}}_special')
     SM._value IN ('{{{id}}}', '{{{id}}}_special')
     AND H.id NOT LIKE 'campaign%'
     AND H.id NOT LIKE 'campaign%'
     AND H.id NOT LIKE 'tutorial%'
     AND H.id NOT LIKE 'tutorial%'
Line 21: Line 23:
     E.name = link,
     E.name = link,
     T.name = text,
     T.name = text,
     T.language = lang
     T.language = lang,
    IF(SM._value LIKE '%_special', 'peru', "") = color
| format =
| format =
     template
     template
Line 40: Line 43:
1. Basic, with the {{b|id}} of the spell:
1. Basic, with the {{b|id}} of the spell:


{{Color|yellow|Input:}} <code><nowiki>{{HeroesWithSpell | id=primal_3_magic_wean}}</nowiki></code>
{{Color|yellow|Input:}} <code><nowiki>{{HeroesWithSpell | id=night_6_magic_deaths_grip}}</nowiki></code>


{{Color|lime|Output:}} {{HeroesWithSpell | id=primal_3_magic_wean}}
{{Color|lime|Output:}} {{HeroesWithSpell | id=night_6_magic_deaths_grip}}


----<!--=====================================================================-->
----<!--=====================================================================-->
Line 48: Line 51:
2. With {{b|lang}}:
2. With {{b|lang}}:


{{Color|yellow|Input:}} <code><nowiki>{{HeroesWithSpell | id=primal_3_magic_wean | lang=ja}}</nowiki></code>
{{Color|yellow|Input:}} <code><nowiki>{{HeroesWithSpell | id=night_6_magic_deaths_grip | lang=ja}}</nowiki></code>


{{Color|lime|Output:}} {{HeroesWithSpell | id=primal_3_magic_wean | lang=ja}}
{{Color|lime|Output:}} {{HeroesWithSpell | id=night_6_magic_deaths_grip | lang=ja}}


----<!--=====================================================================-->
----<!--=====================================================================-->
Line 56: Line 59:
3. When there are no heroes to match the criteria, the `wiki_none` text is displayed:
3. When there are no heroes to match the criteria, the `wiki_none` text is displayed:


{{Color|yellow|Input:}} <code><nowiki>{{HeroesWithSpell | id=neutral_magic_dimension_door}}</nowiki></code>
{{Color|yellow|Input:}} <code><nowiki>{{HeroesWithSpell | id=foo}}</nowiki></code>


{{Color|lime|Output:}} {{HeroesWithSpell | id=neutral_magic_dimension_door}}
{{Color|lime|Output:}} {{HeroesWithSpell | id=foo}}


</noinclude>
</noinclude>

Latest revision as of 10:50, 28 June 2026


This template enumerates the heroes starting with a particular spell.

Usage

1. Basic, with the id of the spell:

Input: {{HeroesWithSpell | id=night_6_magic_deaths_grip}}

Output: Shadespinner
Oona
Sister
Keiri


2. With lang:

Input: {{HeroesWithSpell | id=night_6_magic_deaths_grip | lang=ja}}

Output: 影紡ぎのウーナ修道女ケイリ


3. When there are no heroes to match the criteria, the `wiki_none` text is displayed:

Input: {{HeroesWithSpell | id=foo}}

Output: None