Template:HeroSpecializationDef: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
obelisk-bot: uploading initial Cargo templates
obelisk-bot: uploading initial Cargo templates
Line 57: Line 57:
| icon = {{{icon|}}}
| icon = {{{icon|}}}
| source_path = {{{source_path|}}}
| source_path = {{{source_path|}}}
}}</includeonly>
}}
Created <code>HeroSpecialization</code> entry: <code>{{{id|}}}</code></includeonly>

Revision as of 01:12, 13 May 2026

One row per hero specialization (126 in the 2026-05-03 corpus: 108 faction + 9 campaign + 5 tutorial + 4 test). Each spec is the unique passive that distinguishes one hero mechanically — every Hero record carries specialization_id pointing at one of these.

The specialization carries identity (name, desc, icon) plus a list of structured bonuses[] effects that compose the spec's mechanical impact. Bonuses are emitted as inline {{HeroSpecializationBonus}} rows on the same wiki page.

Page layout

Data:HeroSpecialization/<id> carries:

  1. {{HeroSpecializationDef | id=… | name=… | desc=… | icon=… | …}}
  2. {{TranslationDef | type=hero_specialization | target_id=<id> | …}}
  3. N × {{HeroSpecializationBonus | spec_id=<id> | ordinal=N | …}} (1367 total bonus rows across all 126 specs)

Schema

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

{{HeroSpecializationDef
| id = String
| name = String
| description = Wikitext
| name_sid = String
| desc_sid = String
| icon = String
| source_path = String
}}

Field notes

  • id is the source JSON id (e.g. human_hero_1_specialization, campaign_hero_4_specialization). The _specialization suffix is preserved.
  • name_sid / desc_sid point at the L10n entries (e.g. human_hero_1_spec_name / human_hero_1_spec_description). Description text is heavy with {0}/{1} placeholders for stat values; the resolver substitutes via the standard pipeline before storing.
  • name / desc carry the resolved English text inline. Translations live on the {{TranslationDef | type=hero_specialization}} row.
  • No hero_id back-reference. The Hero → HeroSpecialization direction is sufficient (forward join via Hero.specialization_id = HeroSpecialization.id). Reverse queries — "which hero has this spec" — work via the same join. Per D-028.

Related tables

  • Hero — joined on id = Hero.specialization_id (1:1 in practice; the schema permits N:1 in case a future patch shares specs across heroes).
  • HeroSpecializationBonus — joined on id = spec_id (1:N).
  • TranslationDef — one row per spec with type=hero_specialization, target_id=id.

Notes