Template:SpellRankDef: Difference between revisions
obelisk-bot: uploading initial Cargo templates |
obelisk-bot: uploading initial Cargo templates |
||
| Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
This template defines and stores rows for the '''SpellRank''' Cargo table. Per-mastery-level data for a [[Template:SpellDef|Spell]]. Always 4 rows per spell — levels 1=no skill, 2=basic, 3=advanced, 4=expert. Each row is self-contained: it carries the English defaults, the mechanical fields, ''and'' the 15 non-English translations of every translatable field. The old <code>SpellRankTranslationDef</code> sibling table was folded back into this one — the three-translatable-field shape (name + | This template defines and stores rows for the '''SpellRank''' Cargo table. Per-mastery-level data for a [[Template:SpellDef|Spell]]. Always 4 rows per spell — levels 1=no skill, 2=basic, 3=advanced, 4=expert. Each row is self-contained: it carries the English defaults, the mechanical fields, ''and'' the 15 non-English translations of every translatable field. The old <code>SpellRankTranslationDef</code> sibling table was folded back into this one — the three-translatable-field shape (name + description + bonus_description) didn't fit [[Template:EntryDef|Entry]]'s generic name+description-only schema, so spell ranks get their own expanded shape. | ||
The bot emits these inline on the parent <code>Data:Spell/<id></code> page. There are no individual <code>Data:SpellRank/…</code> pages. | The bot emits these inline on the parent <code>Data:Spell/<id></code> page. There are no individual <code>Data:SpellRank/…</code> pages. | ||
| Line 53: | Line 53: | ||
| uk_name = String | | uk_name = String | ||
| uk_description = Wikitext | | uk_description = Wikitext | ||
| | | uk_bonus_description = Wikitext | ||
| zh_cn_name = String | |||
| zh_cn_description = Wikitext | |||
| zh_cn_bonus_description = Wikitext | |||
| zh_tw_name = String | |||
| zh_tw_description = Wikitext | |||
| zh_tw_bonus_description = Wikitext | |||
}} | |||
<pre><nowiki> | |||
{{SpellRankDef | |||
| spell_id = String <!-- joins SpellDef.id --> | |||
| level = Integer <!-- 1..4 --> | |||
| name_sid = String <!-- spell name SID (shared across ranks; duplicated per row for clean queries) --> | |||
| description_sid = String | |||
| description = Wikitext <!-- resolved English --> | |||
<!-- Level-up bonus + upgrade cost. Null on level 1; populated on levels 2/3/4. --> | |||
| bonus_description_sid = String | |||
| bonus_description = Wikitext <!-- resolved English --> | |||
| mana_cost = Integer | |||
| upgrade_cost = Integer | |||
<!-- Per-language triples for every supported non-English locale. | |||
Each language gets a name + description + bonus_description column. --> | |||
| pt_br_name = String | |||
| pt_br_description = Wikitext | |||
| pt_br_bonus_description = Wikitext | |||
| cs_name = String | |||
| cs_description = Wikitext | |||
| cs_bonus_description = Wikitext | |||
| fr_name = String | |||
| fr_description = Wikitext | |||
| fr_bonus_description = Wikitext | |||
| de_name = String | |||
| de_description = Wikitext | |||
| de_bonus_description = Wikitext | |||
| hu_name = String | |||
| hu_description = Wikitext | |||
| hu_bonus_description = Wikitext | |||
| it_name = String | |||
| it_description = Wikitext | |||
| it_bonus_description = Wikitext | |||
| ja_name = String | |||
| ja_description = Wikitext | |||
| ja_bonus_description = Wikitext | |||
| ko_name = String | |||
| ko_description = Wikitext | |||
| ko_bonus_description = Wikitext | |||
| pl_name = String | |||
| pl_description = Wikitext | |||
| pl_bonus_description = Wikitext | |||
| ru_name = String | |||
| ru_description = Wikitext | |||
| ru_bonus_description = Wikitext | |||
| es_name = String | |||
| es_description = Wikitext | |||
| es_bonus_description = Wikitext | |||
| tr_name = String | |||
| tr_description = Wikitext | |||
| tr_bonus_description = Wikitext | |||
| uk_name = String | |||
| uk_description = Wikitext | |||
| uk_bonus_description = Wikitext | |||
| zh_cn_name = String | |||
| zh_cn_description = Wikitext | |||
| zh_cn_bonus_description = Wikitext | |||
| zh_tw_name = String | |||
| zh_tw_description = Wikitext | |||
| zh_tw_bonus_description = Wikitext | |||
}} | |||
</nowiki></pre> | |||
== Field notes == | |||
* '''Primary key is <code>(spell_id, level)</code>.''' | |||
* '''<code>name_sid</code>''' carries the spell's name SID — same value across all four ranks for a given spell. Duplicated per-row so a query against <code>SpellRank</code> alone can render a labeled per-rank table without joining back to <code>Spell</code>. | |||
* '''<code>description_sid</code>''' points at the source <code>description[level-1]</code> SID. Levels 1 and 2 often share the same SID (the "no mastery" text and the "basic" text are typically identical). | |||
* '''<code>description</code>''' carries the resolved English text. Static spell-config placeholders are pre-substituted (the bot threads the spell's JSON through the resolver). '''Hero-dependent placeholders (<code>{N}</code> for spell-power-scaled values) intentionally stay unsubstituted''' — the actual numbers depend on the casting hero, so the wiki display layer surfaces them generically. See D-030. | |||
* '''<code>bonus_description_sid</code> / <code>bonus_description</code>''' are the unlock-bonus message shown when reaching this level (e.g. "Affects all friendly creatures."). Null for level 1 (the starting rank). | |||
* '''<code>upgrade_cost</code>''' is the resource cost paid to upgrade ''to'' this level (in the spell's primary upgrade resource — usually a small number like 25). Null for level 1. For length-1 source <code>upgradeCost</code> arrays (mostly world-map utility spells), only level 2 gets a value. | |||
* '''<code><lang>_*</code> columns''' are sparse — a row only carries the translations for which the corresponding SID exists. If a spell has no <code>bonus_description_sid</code> at a given level, all 15 <code><lang>_bonus_description</code> columns are simply absent from the emitted invocation. | |||
* '''Resolver context''' for the non-English lookups uses the same per-rank <code>magic_json = {"raw": spell.raw_json, "level": <level>}</code> context the English lookup uses, so per-mastery-level magicDealer values substitute identically across all 16 languages. | |||
== Related tables == | |||
* [[Template:SpellDef|Spell]] — joined on <code>SpellRank.spell_id = Spell.id</code> (N:1). | |||
[[Category:Cargo Definitions]] | |||
</noinclude><includeonly>{{#cargo_store:_table=SpellRank | |||
| spell_id = {{{spell_id|}}} | |||
| level = {{{level|}}} | |||
| name_sid = {{{name_sid|}}} | |||
| description_sid = {{{description_sid|}}} | |||
| description = {{{description|}}} | |||
| bonus_description_sid = {{{bonus_description_sid|}}} | |||
| bonus_description = {{{bonus_description|}}} | |||
| mana_cost = {{{mana_cost|}}} | |||
| upgrade_cost = {{{upgrade_cost|}}} | |||
| pt_br_name = {{{pt_br_name|}}} | |||
| pt_br_description = {{{pt_br_description|}}} | |||
| pt_br_bonus_description = {{{pt_br_bonus_description|}}} | |||
| cs_name = {{{cs_name|}}} | |||
| cs_description = {{{cs_description|}}} | |||
| cs_bonus_description = {{{cs_bonus_description|}}} | |||
| fr_name = {{{fr_name|}}} | |||
| fr_description = {{{fr_description|}}} | |||
| fr_bonus_description = {{{fr_bonus_description|}}} | |||
| de_name = {{{de_name|}}} | |||
| de_description = {{{de_description|}}} | |||
| de_bonus_description = {{{de_bonus_description|}}} | |||
| hu_name = {{{hu_name|}}} | |||
| hu_description = {{{hu_description|}}} | |||
| hu_bonus_description = {{{hu_bonus_description|}}} | |||
| it_name = {{{it_name|}}} | |||
| it_description = {{{it_description|}}} | |||
| it_bonus_description = {{{it_bonus_description|}}} | |||
| ja_name = {{{ja_name|}}} | |||
| ja_description = {{{ja_description|}}} | |||
| ja_bonus_description = {{{ja_bonus_description|}}} | |||
| ko_name = {{{ko_name|}}} | |||
| ko_description = {{{ko_description|}}} | |||
| ko_bonus_description = {{{ko_bonus_description|}}} | |||
| pl_name = {{{pl_name|}}} | |||
| pl_description = {{{pl_description|}}} | |||
| pl_bonus_description = {{{pl_bonus_description|}}} | |||
| ru_name = {{{ru_name|}}} | |||
| ru_description = {{{ru_description|}}} | |||
| ru_bonus_description = {{{ru_bonus_description|}}} | |||
| es_name = {{{es_name|}}} | |||
| es_description = {{{es_description|}}} | |||
| es_bonus_description = {{{es_bonus_description|}}} | |||
| tr_name = {{{tr_name|}}} | |||
| tr_description = {{{tr_description|}}} | |||
| tr_bonus_description = {{{tr_bonus_description|}}} | |||
| uk_name = {{{uk_name|}}} | |||
| uk_description = {{{uk_description|}}} | |||
| uk_bonus_description = {{{uk_bonus_description|}}} | |||
| zh_cn_name = {{{zh_cn_name|}}} | |||
| zh_cn_description = {{{zh_cn_description|}}} | |||
| zh_cn_bonus_description = {{{zh_cn_bonus_description|}}} | |||
| zh_tw_name = {{{zh_tw_name|}}} | |||
| zh_tw_description = {{{zh_tw_description|}}} | |||
| zh_tw_bonus_description = {{{zh_tw_bonus_description|}}} | |||
}}</includeonly> | |||
Revision as of 00:11, 13 May 2026
This template defines and stores rows for the SpellRank Cargo table. Per-mastery-level data for a Spell. Always 4 rows per spell — levels 1=no skill, 2=basic, 3=advanced, 4=expert. Each row is self-contained: it carries the English defaults, the mechanical fields, and the 15 non-English translations of every translatable field. The old SpellRankTranslationDef sibling table was folded back into this one — the three-translatable-field shape (name + description + bonus_description) didn't fit Entry's generic name+description-only schema, so spell ranks get their own expanded shape.
The bot emits these inline on the parent Data:Spell/<id> page. There are no individual Data:SpellRank/… pages.
Schema
This template defines the table "SpellRank". View table.
{{SpellRankDef
| spell_id = String <!-- joins SpellDef.id -->
| level = Integer <!-- 1..4 -->
| name_sid = String <!-- spell name SID (shared across ranks; duplicated per row for clean queries) -->
| description_sid = String
| description = Wikitext <!-- resolved English -->
<!-- Level-up bonus + upgrade cost. Null on level 1; populated on levels 2/3/4. -->
| bonus_description_sid = String
| bonus_description = Wikitext <!-- resolved English -->
| mana_cost = Integer
| upgrade_cost = Integer
<!-- Per-language triples for every supported non-English locale.
Each language gets a name + description + bonus_description column. -->
| pt_br_name = String
| pt_br_description = Wikitext
| pt_br_bonus_description = Wikitext
| cs_name = String
| cs_description = Wikitext
| cs_bonus_description = Wikitext
| fr_name = String
| fr_description = Wikitext
| fr_bonus_description = Wikitext
| de_name = String
| de_description = Wikitext
| de_bonus_description = Wikitext
| hu_name = String
| hu_description = Wikitext
| hu_bonus_description = Wikitext
| it_name = String
| it_description = Wikitext
| it_bonus_description = Wikitext
| ja_name = String
| ja_description = Wikitext
| ja_bonus_description = Wikitext
| ko_name = String
| ko_description = Wikitext
| ko_bonus_description = Wikitext
| pl_name = String
| pl_description = Wikitext
| pl_bonus_description = Wikitext
| ru_name = String
| ru_description = Wikitext
| ru_bonus_description = Wikitext
| es_name = String
| es_description = Wikitext
| es_bonus_description = Wikitext
| tr_name = String
| tr_description = Wikitext
| tr_bonus_description = Wikitext
| uk_name = String
| uk_description = Wikitext
| uk_bonus_description = Wikitext
| zh_cn_name = String
| zh_cn_description = Wikitext
| zh_cn_bonus_description = Wikitext
| zh_tw_name = String
| zh_tw_description = Wikitext
| zh_tw_bonus_description = Wikitext
}}
Field notes
- Primary key is
(spell_id, level). name_sidcarries the spell's name SID — same value across all four ranks for a given spell. Duplicated per-row so a query againstSpellRankalone can render a labeled per-rank table without joining back toSpell.description_sidpoints at the sourcedescription[level-1]SID. Levels 1 and 2 often share the same SID (the "no mastery" text and the "basic" text are typically identical).descriptioncarries the resolved English text. Static spell-config placeholders are pre-substituted (the bot threads the spell's JSON through the resolver). Hero-dependent placeholders ({N}for spell-power-scaled values) intentionally stay unsubstituted — the actual numbers depend on the casting hero, so the wiki display layer surfaces them generically. See D-030.bonus_description_sid/bonus_descriptionare the unlock-bonus message shown when reaching this level (e.g. "Affects all friendly creatures."). Null for level 1 (the starting rank).upgrade_costis the resource cost paid to upgrade to this level (in the spell's primary upgrade resource — usually a small number like 25). Null for level 1. For length-1 sourceupgradeCostarrays (mostly world-map utility spells), only level 2 gets a value.<lang>_*columns are sparse — a row only carries the translations for which the corresponding SID exists. If a spell has nobonus_description_sidat a given level, all 15<lang>_bonus_descriptioncolumns are simply absent from the emitted invocation.- Resolver context for the non-English lookups uses the same per-rank
magic_json = {"raw": spell.raw_json, "level": <level>}context the English lookup uses, so per-mastery-level magicDealer values substitute identically across all 16 languages.
Related tables
- Spell — joined on
SpellRank.spell_id = Spell.id(N:1).


