Template:SpellRankDef

From Heroes of Might and Magic: Olden Era Official Wiki
Revision as of 20:48, 14 May 2026 by Ketura (talk | contribs) (obelisk-bot: Pushing translation table rework)

This template defines and stores rows for the SpellRank Cargo table. Per-mastery-level structural data for a Spell. Always 4 rows per spell — levels 1=no skill, 2=basic, 3=advanced, 4=expert.

SpellRank carries only the mechanical, language-independent fields. All localizable text — the rank's name, description, and bonus unlock blurb, in every language including English — lives in the shared Translation table, keyed by type=spell_rank, target_id=<spell_id>, variant=<level>.

The bot emits these inline on the parent Data:Spell/<id> page, each {{SpellRankDef}} row followed by its per-language {{TranslationDef}} rows.

Schema

This template defines the table "SpellRank". View table.

{{SpellRankDef
| spell_id = String
| level = Integer                  <!-- 1=no skill, 2=basic, 3=advanced, 4=expert -->
| name_sid = String                <!-- same across all four ranks; per-row for clean labelled queries -->
| description_sid = String
| bonus_description_sid = String    <!-- null at level 1 -->
| mana_cost = Integer
| upgrade_cost = Integer
}}

Field notes

  • Primary key is (spell_id, level).
  • name_sid carries the spell's name SID — same across all four ranks; duplicated per-row for clean labelled per-rank queries. Traceability only; not the translation join path.
  • description_sid / bonus_description_sid point at the L10n entries the rank's text was sourced from. bonus_description_sid is null at level 1.
  • Resolved text for every language (including English) lives in Translation: name, description, and bonus_description columns, WHERE type='spell_rank' AND target_id=<spell_id> AND variant=<level>. Hero-dependent placeholders ({N} for spell-power-scaled values) stay unsubstituted in the stored text.
  • mana_cost / upgrade_cost are the per-rank mechanical costs.

Related tables

  • Spell — joined on SpellRank.spell_id = Spell.id (N:1).
  • Translation — joined on SpellRank.spell_id = Translation.target_id AND SpellRank.level = Translation.variant, WHERE Translation.type='spell_rank' (1:N, one row per language).