PTR build 2.57.1.98674_ptr. Go to the live site.

Hero Reference

How Heroes of the Storm defines heroes in XML and GalaxyScript: files, data model, resolution rules, record types, trigger libraries and mechanics.

Prerequisites

This document assumes you are familiar with parsing XML, and basic programming concepts, such as inheritance and event handling

Overview

Heroes of the Storm runs on a modified StarCraft II engine. Two kinds of file define a hero's mechanics:

  • XML data files describe the hero: its stats, abilities, effects, talents and buttons. Each of these definitions is a record.
  • Galaxy scripts contain code for what the data cannot express. The code can also change record values during a match.

A data file is a flat list of records. Each XML element in the list is one record. Most examples in this document come from Ana.

AnaData.xml holds all of Ana's gameplay records. An example of some record types from it:

<CAbilEffectTarget id="AnaSleepDart">...</CAbilEffectTarget>
<!-- ... -->
<CAccumulatorToken id="AnaShrikeDotDamageToken" parent="BaseAccumulator">...</CAccumulatorToken>
<!-- ... -->
<CBehaviorTokenCounter id="AnaShrikeDotDamageToken" parent="StormGenericToken">...</CBehaviorTokenCounter>
<!-- ... -->
<CEffectModifyTokenCount id="AnaShrikeDotDamageToken" parent="BaseEffectModifyTokenCount">...</CEffectModifyTokenCount>
<!-- ... -->
<CHero id="Ana">...</CHero>
<!-- ... -->
<CUnit id="HeroAna" parent="StormHeroMounted">...</CUnit>

Each record has three parts:

  • A class, which is the element name, such as CAbilEffectTarget. The class sets the catalog and the fields of the record.
  • An id, such as AnaSleepDart. Other records use the id to refer to this record.
  • An optional parent. The record inherits the fields of its parent.

The engine puts each type of record in a catalog: Abil, Accumulator, Behavior, Effect, Hero, Unit and so on. The records above go into these catalogs:

RecordClassCatalog
AnaSleepDartCAbilEffectTargetAbil
AnaShrikeDotDamageTokenCAccumulatorTokenAccumulator
AnaShrikeDotDamageTokenCBehaviorTokenCounterBehavior
AnaShrikeDotDamageTokenCEffectModifyTokenCountEffect
AnaCHeroHero
HeroAnaCUnitUnit

An id is unique only inside its catalog. AnaShrikeDotDamageToken names three records: an accumulator, a behavior and an effect. To select one of them, Galaxy scripts give the catalog and the id. LibHANA.galaxy reads a field of the behavior:

CatalogFieldValueGet(c_gameCatalogBehavior, "AnaShrikeDotDamageToken", "TokenId", c_playerAny);

c_gameCatalogBehavior selects the CBehaviorTokenCounter record, not the accumulator or the effect. The file that contains a record has no effect on the record.

Organization

Read the sections in order.

  1. Files: where the hero data is, and the order in which it loads.
  2. Data model: how a record looks in XML.
  3. Resolution: how the game combines declarations, parents and defaults into the final record.
  4. Record reference: the fields of each record type.
  5. Trigger libraries: the Galaxy script that runs alongside the data.
  6. Mechanics: examples that combine records and script.

Terms

TermMeaning
ModA .StormMod folder of data, script and text files. Mods load in a fixed order, and a mod can change the records of an earlier mod.
Data fileAn XML file that contains a list of records. One file can contain records of any kind.
CatalogThe engine's name for a kind of record, such as Abil or Effect. The class of a record sets its catalog.
RecordOne object in a catalog. Its XML element name is its class, and its id attribute is its name.
ClassThe type of a record, such as CEffectDamage. The class sets the catalog and the fields of the record.
FieldA child element of a record, such as <Duration value="3" />.
TemplateA record that exists to be the parent of other records.
GalaxyThe script language of the engine. See Galaxy.
Trigger libraryA Galaxy source file that a mod loads.
NativeA function that the engine implements and Galaxy code calls.
GameStringsThe text of a mod in one language: names and tooltips as key=value lines.
Game loopOne step of the game simulation. One second of game time has 16 game loops.

Files

Load order

The game data is in .StormMod folders. Three of them contain hero data. They load in this order:

  1. Core.StormMod contains the engine defaults: one id-less default record per class, such as <CEffectDamage default="1">. It also contains NativeLib, the trigger library that all other libraries use.
  2. HeroesData.StormMod contains the shared catalogs, the shared trigger libraries and many of the older heroes.
  3. HeroMods/<Hero>.StormMod contains one hero per mod, or two for Cho'gall.

HeroesData's Includes.xml lists every hero mod:

<Includes id="Mods/HeroesData.StormMod">
  <Path value="Mods/HeroMods/Junkrat.StormMod" />
  <Path value="Mods/HeroMods/Firebat.StormMod" />
  <!-- ... -->
  <Path value="Mods/HeroMods/Ana.StormMod" />
</Includes>

Each hero mod's DocumentInfo declares HeroesData as a dependency:

<DocInfo>
  <Flags>
    <Value>PreloadNoTrigger</Value>
  </Flags>
  <Dependencies>
    <Value>bnet:Heroes of the Storm (Data Mod)/0.0/999,file:Mods/HeroesData.StormMod</Value>
  </Dependencies>
</DocInfo>

You can treat paths inside the data as case-insensitive. HeroesData's GameData.xml uses both GameData/Mounts/... and Gamedata/Mounts/....

Hero mods

A hero mod has the layout below. The examples come from HeroMods/Ana.StormMod.

To register its Galaxy trigger library, the mod adds one element to the global CGame record:

<CGame id="Dflt">
  <TriggerLibs Id="HANA"/>
</CGame>

HANA loads LibHANA.galaxy, and all symbols in that library start with libHANA_. See Naming.

Some mods declare the CGame record in the hero's main data file instead, for example Chromie.

Note: Xal'atath is the newest hero (build 2.57.0.98217), and her mod uses a different layout. It splits the gameplay records across several files:

  • XalatathData.xml: the hero, the unit, the talents and most abilities.
  • XalatathVoidEruptionData.xml: the Void Eruption heroic ability.
  • XalatathVoidVolley2Data.xml: effects and actors of Void Volley.
  • ButtonData.xml, ActorData.xml and MoverData.xml: all of her buttons, and some actors and movers.

The last three files are not in her <Includes> list. HeroesData's AbilData.xml is not in its list either. A file with a standard catalog name seems to load without an entry.

HeroesData heroes

Before Cho'gall, every hero was in the HeroesData mod, under GameData/Heroes/. The triggers of these heroes are in the shared GameDataHelperLib.

Some heroes after Cho'gall are also in that folder. Since Dehaka, each hero has its own mod.

Shared data files

HeroesData's GameData/ folder contains the shared data files. Most of them contain one kind of record, as their names show. They declare the templates that hero records inherit from, such as StormSpell, StormSleep, StormArmor, StormQuestToken and CarryBehaviorParent:

Internal names

These heroes have a CHero id or folder name that is different from their name in the game:

IdHeroLocation
AmazonCassiaHeroMods/Amazon.StormMod
BarbarianSonyaHeroes/BarbarianData
Cho, GallCho'gallHeroMods/ChoGall.StormMod
CrusaderJohannaHeroes/CrusaderData
DemonHunterVallaHeroes/DemonHunterData
DryadLunaraHeroes/DryadData
FaerieDragonBrightwingHeroes/BrightwingData
FirebatBlazeHeroMods/Firebat.StormMod
GreymaneGreymaneHeroes/GennData
L90ETCE.T.C.Heroes/L90ETCData
MedicLt. MoralesHeroes/MedicData
MeiOWMeiHeroMods/MeiOW.StormMod
MonkKharazimHeroes/MonkData
NecromancerXulHeroes/NecromancerData
NexusHunterQhiraHeroMods/NexusHunter.StormMod
RagnarosRagnarosHeroMods/TheFirelords.StormMod
TinkerGazloweHeroes/TinkerData
WitchDoctorNazeeboHeroes/WitchDoctorData
WizardLi-MingHeroes/WizardData

Data model

Records

Each record is one XML element. The element name is the record's class:

<CEffectDamage id="AnaSleepDartNightTerrorsDamage" parent="StormSpellPercentDamage">
  <Chance value="0" />
  <VitalFractionMax index="Life" value="0.08" />
</CEffectDamage>

AnaSleepDartNightTerrorsDamage is a record of class CEffectDamage. The class prefix gives the catalog:

PrefixCatalogCommon classes
CHeroHeroCHero
CUnitUnitCUnit
CAbilAbilCAbilEffectTarget, CAbilEffectInstant
CEffectEffectCEffectSet, CEffectDamage, CEffectApplyBehavior
CBehaviorBehaviorCBehaviorBuff, CBehaviorTokenCounter
CValidatorValidatorCValidatorPlayerTalent, CValidatorCombine
CRequirementRequirement, RequirementNodeCRequirement, CRequirementCountBehavior
CAccumulatorAccumulatorCAccumulatorToken, CAccumulatorDistance
CTalentTalentCTalent
CButtonButtonCButton
CWeaponWeaponCWeaponLegacy
CActorActorCActorModel, CActorAction, CActorSound

A catalog and an id identify a record. The same id can name records in different catalogs: AnaSleepDart is an ability, a buff and a button.

Record attributes

The attributes of a record element set its identity and its inheritance.

id="name"

Names the record. The id is unique in its catalog.

parent="name"

Inherits the fields of the named record in the same catalog. The record's own fields override the inherited fields. See Resolution.

default="1"

Marks a template, which is a record that exists to be a parent. A default="1" record without an id is the class default: the implicit parent of every record of that class that has no parent.

Other attributes

Any other attribute is a token value that templates read as ##name##. See Tokens.

Fields

Each child element of a record is a field. These records come from Ana's data. The example omits some fields:

<CAbilEffectTarget id="AnaSleepDart">
  <Effect value="AnaSleepDartInitialSet" />
  <Flags index="RequireTargetVision" value="0" />
  <Cost>
    <Vital index="Energy" value="50" />
    <Cooldown TimeUse="14" />
  </Cost>
  <!-- ... -->
</CAbilEffectTarget>
<CEffectSet id="AnaSleepDartInitialSet">
  <EffectArray value="AnaSleepDartSetFacing" />
  <EffectArray value="AnaSleepDartLaunchMissile" />
  <EffectArray value="AnaSleepDartJustUsedApplyBehavior" />
  <!-- ... -->
</CEffectSet>
<CEffectApplyBehavior id="AnaSleepDartApplyBehavior">
  <Behavior value="AnaSleepDart" />
  <!-- ... -->
</CEffectApplyBehavior>
<CBehaviorBuff id="AnaSleepDart" parent="StormSleep">
  <Duration value="3" />
  <!-- ... -->
</CBehaviorBuff>
<CEffectDamage id="AnaEyeOfHorusImpactEnemyDamage" parent="StormSpell">
  <Amount value="135" />
  <MultiplicativeModifierArray index="Deadeye" Validator="AnaHasEyeOfHorusDeadeyeTalent" Accumulator="AnaEyeOfHorusDeadeyeAccumulator" />
  <!-- ... -->
</CEffectDamage>

Scalar

A number or a string in value, as in <Duration value="3" />.

A record id in value, as in <Behavior value="AnaSleepDart" />. The field name sets the target catalog. Behavior links to Behavior, Effect and EffectArray link to Effect, and ValidatorArray links to Validator. An attribute can also be a link, such as Validator and Accumulator on the Deadeye entry.

Struct

A field with named members. A member is a child element or an attribute. Cost has the members Vital and Cooldown, and TimeUse is an attribute member of Cooldown.

A member named Value keeps its capital V, as in <WhichUnit Value="Caster" />. The lowercase value belongs to scalars and links.

Array

One element per entry. index selects an entry by position (from 0), by enum name (Flags index="RequireTargetVision") or, in some arrays, by a string key (index="Deadeye"). The engine appends an entry that has no index. removed="1" deletes the entry at index. See Arrays.

Field paths

The engine, the trigger libraries and the tooltips use the same syntax to address a field. A dot enters a struct, and brackets select an array entry:

  • Cost[0].Charge.TimeUse
  • Modification.DamageDealtFraction[Ability]
  • AbilityModificationArray[0].Modifications[5].Value

An array segment without brackets selects entry 0. Ana's Deadeye talent uses Cost.Charge.TimeUse and Cost[0].Charge.HideCount in the same record.

Constants

A <const> record gives a value a name. A field refers to the constant by its $ name. When the constant sets evaluateAsExpression="1", its value is an expression:

<const id="$ArthasDeathCoilRange" value="8" />
<const id="$ArthasGorefiendsGraspRangeModifier" value="0.4" />
<const id="$ArthasGorefiendsGraspRangeIncrease" value="*($ArthasDeathCoilRange $ArthasGorefiendsGraspRangeModifier)" evaluateAsExpression="1" />

Expressions use function-call syntax, with spaces between arguments. Operators are functions too, so *(a b) means a × b. The operators are +, -, * and /. Functions include negate, max and floor. The last constant above is 8 × 0.4 = 3.2. Gorefiend's Grasp uses $ArthasGorefiendsGraspRangeIncrease to add 3.2 to the Range of Death Coil.

Resolution

The XML of one record is rarely the whole record. The engine builds the final record from its declarations, its parents and its class defaults in four steps:

  1. Merge declarations. Collect every declaration of the catalog and id, in load order. A later declaration overrides earlier fields one by one. Append the array entries that have no index.
  2. Resolve the parent chain. Resolve the record's parent first. If the record has no parent, resolve the class default. Then apply the record's own fields. A class default inherits from the default of its base class.
  3. Substitute tokens. Replace ##id## with the record's id and ##name## with the record's token values.
  4. Evaluate constants. Replace $name values with the value of the constant.

Merging

More than one file or mod can declare the same catalog and id. The declarations merge as step 1 describes. Every hero mod adds its TriggerLibs entry to the CGame Dflt record that HeroesData declares in GameData/GameData.xml.

Class defaults

Records with default="1" set default values for all records of their kind. Core declares these for effects:

<CEffect default="1">
  <Chance value="1" />
  <Marker Link="Effect/##id##" />
  <DamageModifierSource Value="Unknown" />
</CEffect>
<CEffectApplyBehavior default="1">
  <Behavior value="##id##" />
  <ValidatorArray value="##id##TargetFilters" />
  <WhichUnit Value="Target" />
  <Count value="1" />
</CEffectApplyBehavior>

These are CEffect and CEffectApplyBehavior. If you ignore class defaults, you may misread hero data. For example, the default Type of CValidatorCombine is Or. In hero data, some CValidatorCombine records set Type to And. Others omit it, such as Rexxar's CasterIsMishaOrRexxar.

HeroesData adds class defaults of its own, which merge with Core's. <CHero default="1"> adds <Unit value="Hero##id##" /> and the talent tier table.

Arrays

An entry with index replaces the inherited entry at that position. An entry with removed="1" deletes it.

For example, StormSpellPercentDamage deletes the crit validator that it inherits from StormSpell:

<CEffectDamage default="1" id="StormSpell" parent="StormDamage">
  <CritValidatorArray value="CritAliasSpellPower" />
  <Kind value="Ability" />
  <KindSplash value="Ability" />
</CEffectDamage>
<CEffectDamage default="1" id="StormSpellPercentDamage" parent="StormSpell">
  <Flags index="NoFractionDealtBonus" value="1" />
  <ArmorMitigationRule value="None" />
  <ResponseExclusionFlags index="Proc" value="1" />
  <Aliases value="PercentDamage" />
  <CritValidatorArray index="0" removed="1" />
</CEffectDamage>

Tokens

##id##

Becomes the id of the record that the engine resolves. The engine replaces tokens after inheritance, so ##id## in a template becomes the id of the child. Class defaults use it for implicit links:

<CEffectApplyBehavior id="AnaNanoBoostMonitor">
  <WhichUnit Value="Caster" />
</CEffectApplyBehavior>

##name##

Becomes the value of the record attribute name. Templates declare these placeholders, and records pass values as attributes. Actor templates use this often:

<CActorAction id="ChromieHeroAttack" parent="RangedHeroAttackMissile" effectImpact="ChromieHeroWeaponDamage" effectLaunch="ChromieHeroWeaponLaunchMissile">

The template chain of ChromieHeroAttack has event terms such as Effect.##effectImpact##.Start.

Record reference

The schemas below list the fields that matter for gameplay. They are not complete class definitions. The schemas use this notation:

NotationMeaning
→AbilA link to a record in the Abil catalog.
<!-- [] -->An array field. The element can repeat.
0|1, Basic|AbilityOne of the listed values.
int, fixedA number. fixed is a decimal.
<!-- default X -->The value when the record does not set the field.

Heroes

CHero is the hero as a roster entry: its abilities for the interface, its talent tree and its scaling table. The unit on the map is the CUnit that Unit links to. Example: CHero Ana.

<CHero id="Ana">
  <AttributeId value="HANA" />
  <Unit value="→Unit" />                                          <!-- default Hero##id## -->
  <ExpandedRole value="Tank|Bruiser|Healer|Support|MeleeAssassin|RangedAssassin" />
  <HeroAbilArray Abil="→Abil" Button="→Button" Unit="→Unit">     <!-- [] -->
    <Flags index="ShowInHeroSelect|Heroic|Trait|UsesCharges|AffectedByCooldownReduction" value="0|1" />  <!-- [] -->
  </HeroAbilArray>
  <HeroicAbilArray Abil="→Abil" />                                <!-- [] -->
  <TalentTreeArray Talent="→Talent" Tier="1-7" Column="1-5">      <!-- [] -->
    <PrerequisiteTalentArray value="→Talent" />                   <!-- [] -->
  </TalentTreeArray>
  <TalentTierArray Tier="1-7" Level="int" ContainsHeroic="0|1" /> <!-- [] -->
  <LevelScalingArray Ability="→Abil">                             <!-- [] -->
    <Modifications>...</Modifications>                            <!-- [] -->
  </LevelScalingArray>
  <Ratings Damage="int" Utility="int" Survivability="int" Complexity="int" />
</CHero>
  • HeroAbilArray pairs each ability with its button and flags. A passive trait has a Button and no Abil.
  • TalentTreeArray places each talent by Tier and Column. PrerequisiteTalentArray makes a talent require another one. Ana's AnaNanoInfusion requires AnaHeroicAbilityNanaBoost. The misspelling "Nana" is in the data.
  • TalentTierArray maps tiers to levels. HeroesData's class default uses levels 1, 4, 7, 10, 13, 16 and 20 and puts the heroic in tier 4. Chromie replaces six entries by index to get levels 2, 5, 8, 11, 14 and 18. Varian moves the heroic to tier 2.
  • LevelScalingArray is the scaling table. See Level scaling.

Units

CUnit is the unit on the map. Example: CUnit HeroAna, which inherits from StormHeroMounted.

<CUnit id="HeroAna" parent="StormHeroMounted">
  <LifeMax value="fixed" />
  <LifeRegenRate value="fixed" />
  <AbilArray Link="→Abil" />                                      <!-- [] -->
  <BehaviorArray Link="→Behavior" />                              <!-- [] -->
  <WeaponArray Link="→Weapon" />                                  <!-- [] -->
  <CardLayouts index="0">
    <LayoutButtons Face="→Button" Type="AbilCmd|Passive" AbilCmd="→Abil,Execute" Slot="Ability1|Ability2|Ability3|Heroic|Trait" />  <!-- [] -->
  </CardLayouts>
  <InitializerFunction value="Galaxy function" />
  <DestructionFunction value="Galaxy function" />
</CUnit>
  • AbilArray lists every ability the unit can cast, including helper abilities that have no button.
  • BehaviorArray lists the behaviors the unit spawns with, such as Ana's trait passives.
  • CardLayouts defines the command card. Each LayoutButtons entry puts a button in a key slot. Ability1 to Ability3 are Q, W and E. Heroic is R, and Trait is D. Face names the CButton that supplies the icon and tooltip. AbilCmd names the ability and command that the button issues. Passive buttons issue no command. A slot can hold more than one entry. The game shows the entry whose command requirements pass, so one key can switch between heroics, talent variants or ability states.
  • InitializerFunction and DestructionFunction name Galaxy functions. See Entry points.

Abilities

CAbil classes define commands that a unit can issue. Example: CAbilEffectTarget AnaSleepDart.

<CAbilEffectTarget id="AnaSleepDart">                             <!-- also CAbilEffectInstant, ... -->
  <PrepEffect value="→Effect" />
  <Effect value="→Effect" />
  <CursorEffect value="→Effect" />
  <Cost>
    <Vital index="Energy|Life" value="fixed" />
    <Cooldown TimeUse="fixed" />
    <Charge CountMax="int" CountStart="int" CountUse="int" Link="Abil/→Abil" />
  </Cost>
  <Range value="fixed" />
  <TargetFilters value="required;excluded" />
  <CastIntroTime value="fixed" />
  <CmdButtonArray index="Execute" DefaultButtonFace="→Button" Requirements="→Requirement" />  <!-- [] -->
</CAbilEffectTarget>
  • PrepEffect runs before the cast. Most heroes use it to dismount and decloak.
  • Effect is the root of the ability's effect tree.
  • CursorEffect is the effect that the targeting preview uses.
  • Cost contains the vital cost, the cooldown and the charges.
  • TargetFilters limits what the player can target. See Target selection.
  • CmdButtonArray has one entry per command. Requirements gates the command. See Talent gating.

Effects

CEffect classes are the actions in an ability's effect tree. Each effect does one thing and can run other effects. All effects in a tree share one context: caster, source, target and origin. Every effect has two gating fields:

  • ValidatorArray: all validators must pass, or the effect does nothing.
  • Chance: the probability that the effect runs. The class default is 1.

The common classes:

  • CEffectSet runs its EffectArray in order.
  • CEffectSwitch runs the first CaseArray entry whose Validator passes, or CaseDefault.
  • CEffectLaunchMissile fires AmmoUnit toward ImpactLocation. SearchEffect runs during the flight. ImpactEffect runs when the missile arrives.
  • CEffectEnumArea finds units that match SearchFilters and runs an AreaArray effect on each.
  • CEffectCreatePersistent runs effects over time. It runs InitialEffect first. Then it runs PeriodicEffectArray PeriodCount times, on the PeriodicPeriodArray schedule. Then it runs FinalEffect.
  • CEffectApplyBehavior and CEffectRemoveBehavior add and remove behaviors. The default link of both is ##id## (Core).
  • CEffectDamage deals Amount, or VitalFractionMax of a vital as percent damage.
  • CEffectCreateHealer heals a flat RechargeVitalRate or a RechargeVitalFraction.
  • CEffectModifyUnit changes vitals and cooldowns on a unit.
  • CEffectModifyTokenCount changes a token counter by Value.
  • CEffectModifyCatalogNumeric changes a catalog field during the match. CatalogModifications takes a Reference path and an Operation. Most records use Set. Others use Multiply, Divide or Subtract.

Behaviors

CBehavior classes are states on a unit. Examples: CBehaviorBuff AnaNanoBoostBuff and CBehaviorTokenCounter AnaEyeOfHorusDeadeyeTokenCounter.

<CBehaviorBuff id="AnaNanoBoostBuff" parent="StormDamageIncrease">
  <Duration value="fixed" />
  <Period value="fixed" />
  <InitialEffect value="→Effect" />                  <!-- also PeriodicEffect, FinalEffect, ExpireEffect, RefreshEffect -->
  <Modification>
    <UnifiedMoveSpeedFactor value="fixed" />
    <DamageDealtFraction index="Basic|Ability" value="fixed" />
    <HealDealtAdditiveMultiplier index="Life|Shields" value="fixed" />
    <StateFlags index="Cloak|SuppressCollision|..." value="0|1" />  <!-- [] -->
  </Modification>
  <ArmorModification>
    <ArmorSet index="Hero|Minion|Merc|Monster|Summon|Structure">
      <ArmorMitigationTable index="Basic|Ability" value="fixed" />
    </ArmorSet>
  </ArmorModification>
  <DamageResponse ModifyLimit="fixed" Handled="→Effect" />
  <BehaviorCategories index="..." value="0|1" />                   <!-- [] -->
  <BehaviorFlags index="Permanent|EnabledWhileDead|..." value="0|1" />  <!-- [] -->
  <RemoveValidatorArray value="→Validator" />                      <!-- [] -->
  <DisableValidatorArray value="→Validator" />                     <!-- [] -->
</CBehaviorBuff>

<CBehaviorTokenCounter id="AnaEyeOfHorusDeadeyeTokenCounter" parent="StormQuestToken">
  <TokenId value="id" />                                           <!-- StormQuestToken: ##id## -->
  <Max value="int" />
  <AtMaxEvents EventId="..." Effect="→Effect" />                   <!-- [] -->
</CBehaviorTokenCounter>
  • Duration and Period are the lifetime and the tick interval in seconds.
  • InitialEffect, PeriodicEffect, FinalEffect, ExpireEffect and RefreshEffect run at points in the behavior's life.
  • Modification changes stats while the behavior is on the unit. ArmorModification changes armor. See Spell Power and armor.
  • RemoveValidatorArray removes the behavior when a validator fails. DisableValidatorArray disables the behavior while a validator fails.
  • CBehaviorTokenCounter is a counter with a TokenId. Quests, stacks and stored numbers use it.

Validators

CValidator classes return pass or fail. Effects, behaviors, buttons, switches and actor events use them. The common classes:

  • CValidatorPlayerTalent checks WhichPlayer for the talent in Value.
  • CValidatorUnitCompareBehaviorCount compares the stack count of Behavior on WhichUnit with Value, using Compare.
  • CValidatorUnitCompareTokenCount does the same for a TokenId.
  • CValidatorUnitFilters tests WhichUnit against a Filters string.
  • CValidatorLocationCompareRange compares a distance with Range.
  • CValidatorCombine combines its CombineArray with Type, which is And or Or.

Two defaults need attention. CValidatorCombine without Type is an Or, as Class defaults shows. CValidatorPlayerTalent without Find passes when the player does not have the talent.

Requirements

CRequirement records gate commands and buttons. A requirement has NodeArray entries for Show and Use. Each entry links to a requirement node such as CRequirementCountBehavior, CRequirementAnd or CRequirementNot. The editor generates the node ids from the node tree, so an id describes its condition. Ultimate1Unlocked is an example:

<CRequirement id="Ultimate1Unlocked">
  <NodeArray index="Use" Link="EqCountBehaviorHeroGenericPregameAbilitySuppressionCompleteOnlyAtUnit0"/>
  <NodeArray index="Show" Link="AndGTECountBehaviorUltimate1UnlockedCompleteOnlyAtUnit14236449987EqCountBehaviorHeroicAbility1SurpressedCompleteOnlyAtUnit01081602903"/>
</CRequirement>
  • Show: the command shows when the hero has at least one Ultimate1Unlocked stack (GTE ... 1) and no HeroicAbility1Surpressed stack (Eq ... 0).
  • Use: the command is usable when the hero has no HeroGenericPregameAbilitySuppression stack. This is true after the pregame ends.

Talents

CTalent records are talents. The talent tree in CHero decides which talents are available at which tiers. Example: CTalent AnaSleepDartNightTerrors.

<CTalent id="AnaSleepDartNightTerrors">
  <Face value="→Button" />
  <Abil value="→Abil" />
  <Trait value="0|1" />
  <Active value="0|1" />
  <QuestData StackBehavior="→Behavior" TargetCount="int" />
  <RankArray>
    <BehaviorArray value="→Behavior" />                             <!-- [] -->
  </RankArray>
  <AbilityModificationArray>                                        <!-- [] -->
    <Modifications>                                                 <!-- [] -->
      <Type value="FlatModification|MultiplyLevelModification|StringReplacement|CatalogReplacement" />
      <Catalog value="Abil|Effect|Behavior|Unit|Accumulator|Actor|..." />
      <Entry value="id" />
      <Field value="field path" />
      <Value value="fixed" />
    </Modifications>
  </AbilityModificationArray>
</CTalent>
  • Face is the button with the talent's name, icon and tooltip.
  • Abil is the ability that the talent belongs to.
  • Active marks a talent that grants something the player activates.
  • QuestData names the token counter that shows quest progress.
  • RankArray lists behaviors that the hero gets when the player picks the talent.
  • AbilityModificationArray lists catalog changes that apply when the player picks the talent. The default Catalog is Abil, so entries that omit it target an ability. See Talent gating.

Buttons

CButton records hold names, icons and tooltips. Example: CButton AnaSleepDart, a child of StormButtonParent.

  • Name and Tooltip are GameStrings keys. Core's class default sets them to Button/Name/##id## and Button/Tooltip/##id##.
  • TooltipAppender adds the text of another button to the tooltip while its validator passes. Picked talents appear in ability tooltips this way.
  • TooltipCooldownOverrideText replaces the cooldown text.

Accumulators

CAccumulator classes compute a number when an effect needs it. Example: CAccumulatorToken AnaEyeOfHorusDeadeyeAccumulator.

<CAccumulatorToken id="AnaEyeOfHorusDeadeyeAccumulator" parent="BaseAccumulator">
  <TokenId value="AnaEyeOfHorusDeadeyeTokenCounter" />
  <Scale value="0.05" />
</CAccumulatorToken>

CAccumulatorToken multiplies a token count by Scale. Other classes measure distance (CAccumulatorDistance), time (CAccumulatorTimed), vitals (CAccumulatorVitals) or tracked units (CAccumulatorTrackedUnitCount). MinAccumulation and MaxAccumulation clamp the result. A field takes an accumulator as a child, as in <Amount value="0"><AccumulatorArray value="..." /></Amount>. Modifier arrays take one through an Accumulator attribute.

Trigger libraries

Some hero logic is in the Galaxy trigger libraries, not in the XML. Heroes use script when the XML cannot express a mechanic, or can express it only with difficulty.

This section describes the language, the layout of a library and the library code that hero data depends on.

Galaxy

Galaxy is the script language of the StarCraft II engine. Its syntax is close to C: functions, structs, arrays, if, while and // comments. The number types are int and fixed, a fixed-point decimal. Game objects have types of their own, such as unit, point and trigger. Source files end in .galaxy.

A trigger library contains functions, global variables and triggers. A trigger is a function that the engine runs when an event occurs, for example when a unit gets a behavior.

Scripts read and change the game through natives. A native is a function that the engine implements, such as UnitBehaviorAdd or CatalogFieldValueSet.

Library files

A library has a source file and a header. The header declares the constants, structs, global variables, functions and triggers of the library. For example, this is part of LibHANA_h.galaxy:

include "TriggerLibs/natives"

// Constants
const fixed libHANA_gv_hero_Ana_NanoBoostCDRAmount_C = -0.0938;

// Structures
struct libHANA_gs_AnaUI {
    int lv_eyeOfHorusTargetAllianceLabel;
    int lv_EyeOfHorusTargetImage;
};

// Variable Declarations
int libHANA_gv_heroAnaTriggerRegistrationVariable;
// ...

// Function Declarations
void libHANA_gf_HeroAnaIncrementHeroCountFunction ();
// ...

// Trigger Declarations
trigger libHANA_gt_HeroAnaNanoBoostCDR;
// ...

The source file includes the libraries that it calls, then its own header. LibHANA.galaxy starts like this:

include "TriggerLibs/NativeLib"
include "TriggerLibs/HeroesLib"
include "TriggerLibs/GameLib"
include "TriggerLibs/AILib"
include "TriggerLibs/UILib"

include "LibHANA_h"

A hero mod registers its library in CGame, as Hero mods shows.

Shared libraries

HeroesData's TriggerLibs/ folder contains the shared libraries. Its LibraryList.xml maps each library id to a file. NativeLib is the exception: it is in Core. The id gives the symbol prefix of the library:

LibraryIdPrefixContents
NativeLibNtvelibNtve_Helper functions around the natives
HeroesLibCorelibCore_Script copies of hero data, such as the level scaling table
GameLibGamelibGame_Match rules: levels, talents, cooldowns and respawns
GameDataHelperLibGDHLlibGDHL_Triggers of the heroes in HeroesData, and shared helpers

The other shared libraries are UILib, AILib, SoundLib, MapMechanicsLib, StartingExperienceLib and SupportLib.

Naming

A global symbol starts with lib, the library id and an underscore. A prefix for the kind of symbol follows:

PrefixKindExample
gf_FunctionlibHANA_gf_HeroAnaIncrementHeroCountFunction
gt_TriggerlibHANA_gt_HeroAnaNanoBoostCDR
gv_Global variable or constantlibHANA_gv_heroAnaTriggerRegistrationVariable
gs_StructlibHANA_gs_AnaUI
ge_Enum or enum valuelibAIAI_ge_DefenderAIState_Idle

Local variables start with lv_ and parameters with lp_. Many constants end in _C. Engine constants start with c_, such as c_timeGame. The editor gives its helper variables generated names, as in for ( ; ( (auto05955D95_ai >= 0 && ....

Triggers

The editor generates each trigger as a global trigger variable and two functions. The _Init function creates the trigger and registers its events. This is libHANA_gt_HeroAnaNanoBoostCDR_Init:

void libHANA_gt_HeroAnaNanoBoostCDR_Init () {
    libHANA_gt_HeroAnaNanoBoostCDR = TriggerCreate("libHANA_gt_HeroAnaNanoBoostCDR_Func");
    TriggerEnable(libHANA_gt_HeroAnaNanoBoostCDR, false);
    TriggerAddEventUnitBehaviorChange(libHANA_gt_HeroAnaNanoBoostCDR, null, "AnaNanoBoostBuff", c_unitBehaviorChangeActivate);
}
  • TriggerCreate binds the trigger to its _Func function by name.
  • TriggerAddEvent* natives register events. This trigger runs when AnaNanoBoostBuff becomes active on any unit.
  • TriggerEnable(..., false) disables the trigger until an entry point enables it.

The _Func function is the body, with the signature bool _Func (bool testConds, bool runActions). When testConds is true, the body checks its conditions first and returns false if one fails. Event natives such as EventUnit() read the data of the event that started the run. The library's InitLib function calls every _Init function.

Hero libraries mostly register three events: an effect runs, a behavior changes, and a unit uses an ability:

TriggerAddEventPlayerEffectUsed(libHANA_gt_HeroAnaShrikeTokenCounter, c_playerAny, "AnaShrikeDotDamage");
TriggerAddEventUnitBehaviorChange(libHANA_gt_HeroAnaNanoBoostCDR, null, "AnaNanoBoostBuff", c_unitBehaviorChangeActivate);
TriggerAddEventUnitAbility(libHANA_gt_HeroAnaConcentratedDoses, null, AbilityCommand("AnaHealingDart", 0), c_unitAbilStageAll, false);

Because an effect that runs is an event, hero files contain effects that do nothing, often with Dummy in the name. AnaEyeOfHorusImpactHeroDummySet exists only to give a trigger an event.

Entry points

The hero's CUnit starts and stops the library. HeroAna names two functions:

<InitializerFunction value="libHANA_gf_HeroAnaIncrementHeroCountFunction" />
<DestructionFunction value="libHANA_gf_HeroAnaDecrementHeroCountFunction" />

The initializer counts the Anas in the match and enables Ana's triggers when the first one spawns. The destructor disables them when the game removes the last one:

void libHANA_gf_HeroAnaIncrementHeroCountFunction () {
    // Automatic Variable Declarations
    // Implementation
    libHANA_gv_heroAnaTriggerRegistrationVariable += 1;
    if ((libHANA_gv_heroAnaTriggerRegistrationVariable == 1)) {
        TriggerEnable(libHANA_gt_CCRecognitionSleep, true);
        TriggerEnable(libHANA_gt_HeroAnaNanoBoostCDR, true);
        // ...
    }
}

Catalog access

Triggers use natives that take the same catalog, entry and field path as the XML: CatalogFieldValueGet, CatalogFieldValueSet and CatalogFieldValueModifyFixed. They also use unit natives such as UnitBehaviorAdd and UnitCreateEffectUnit.

CatalogFieldValueSet(lv_catalog, lv_entry, lv_field, lp_player, CatalogFieldValueGet(lv_catalog, lv_entry, lv_field, 0));

Some values exist only in Galaxy. One example is the cooldown reduction of Nano Boost. While the buff is on a Hero, libHANA_gt_HeroAnaNanoBoostCDR_Func adds libHANA_gv_hero_Ana_NanoBoostCDRAmount_C (-0.0938 seconds) to the Hero's cooldowns once per game loop (0.0625 seconds):

while ((UnitHasBehavior2(lv_hero, "AnaNanoBoostBuff") == true)) {
    while ((UnitHasBehaviorWithCategoryFlag(lv_hero, c_behaviorCategoryTimeStop) == true)) {
        Wait(0.0625, c_timeGame);
    }
    libGame_gf_StormUniversalModifyCooldownonUnitCDRforAbilities(lv_hero, libHANA_gv_hero_Ana_NanoBoostCDRAmount_C, false, false, false);
    Wait(0.0625, c_timeGame);
}

Hanzo's Storm Bow changes its range the same way. libHHAN_gt_HeroHanzoStormBowCharging_Func increases ImpactLocation.ProjectionDistanceScale on HanzoStormBowLaunchMissile every game loop while HanzoStormBowCharging is active.

Mechanics

Level scaling

LevelScalingArray on CHero lists the fields that scale with the hero's level. Ana's table starts like this:

<LevelScalingArray>
  <Modifications>
    <Catalog value="Unit" />
    <Entry value="HeroAna" />
    <Field value="LifeMax" />
    <Value value="0.040000" />
    <AffectedByOverdrive value="1" />
  </Modifications>
  <!-- LifeStart, LifeRegenRate, AnaRangedAttackDamage, AnaShrikeDotDamage -->
</LevelScalingArray>
<LevelScalingArray Ability="AnaHealingDart">
  <Modifications>
    <Catalog value="Effect" />
    <Entry value="AnaHealingDartCreateHealer" />
    <Field value="RechargeVitalRate" />
    <Value value="0.040000" />
    <AffectedByAbilityPower value="1" />
    <AffectedByOverdrive value="1" />
  </Modifications>
</LevelScalingArray>

The trigger libraries apply this table, not the engine. libCore_gf_DataLoadHeroDataIntoIndex in HeroesLib copies it into script memory. libGame_gf_ApplyLevelUpHeroStatsForHeroSingleLevel in GameLib runs each time the hero unit gains a level. This is the main part of that function, with the array lookups shortened:

if ((libGame_gv_dEBUG_PercentScalingEnabled == true) && (lv_percentScaled == true)) {
    lv_newValue = (CatalogFieldValueGetAsFixed(lv_catalog, lv_entry, lv_field, lv_player) * lv_valueAddedPerLevel);
}
else {
    lv_newValue = lv_valueAddedPerLevel;
}
// FieldIsInteger entries use CatalogFieldValueModifyInt instead
CatalogFieldValueModifyFixed(lv_catalog, lv_entry, lv_field, lv_player, lv_newValue, c_upgradeOperationAdd);
  • lv_percentScaled comes from AffectedByOverdrive. The flag selects compound scaling: each level adds field × Value, so after n level-ups the field is base × (1 + Value)^n. Without the flag, each level adds Value. All live entries set the flag.

Spell Power and armor

CEffectDamage has a Kind. Core's class default sets Basic, and HeroesData's StormSpell template sets Ability. Armor applies per damage kind and per attacker type. Physical Armor reduces Basic damage, and Spell Armor reduces Ability damage.

ZaryaPersonalBarrierSpellBarrier gives Spell Armor. Its tooltip reads the value from ArmorModification.ArmorSet[Hero].ArmorMitigationTable[Ability]:

<CBehaviorBuff id="ZaryaPersonalBarrierSpellBarrier" parent="StormArmor">
  <!-- ... -->
  <Duration value="3" />
  <ArmorModification>
    <ArmorSet index="Hero">
      <ArmorMitigationTable index="Ability" value="75" />
    </ArmorSet>
    <!-- the same for Merc, Monster, Summon, Structure and Minion -->
  </ArmorModification>
</CBehaviorBuff>

Physical damage is not limited to basic attacks. For example, Maiev's MaievFanOfKnivesBladeDanceDamage inherits from StormWeapon, so it deals Basic damage from an ability.

Spell Power is a Modification on a behavior. Nano Boost gives it:

<CBehaviorBuff id="AnaNanoBoostBuff" parent="StormDamageIncrease">
  <!-- ... -->
  <BehaviorCategories index="BuffAbilityPower" value="1" />
  <Duration value="8" />
  <Modification>
    <HealDealtAdditiveMultiplier index="Life" value="0.3" />
    <HealDealtAdditiveMultiplier index="Shields" value="0.3" />
    <DamageDealtFraction index="Ability" value="0.3" />
    <VitalDamageLeechScoreArray Value="Healing" />
  </Modification>
  <!-- ... -->
  <Aliases value="CritAliasSpellPower" />
</CBehaviorBuff>

AnaNanoBoostBuff increases Ability damage with DamageDealtFraction and healing with HealDealtAdditiveMultiplier.

Target selection

Three parts of the data decide what an ability hits. The ability sets where the player can click. Search effects find units in an area. Other effects read the target they need from the shared context. Sleep Dart uses all three.

The ability has Range 500 and Arc 360. A range of 500 has no practical limit, because it is many screens wide. A 360 degree arc means that Ana does not turn before she casts. The missile sets how far the dart flies:

<CEffectLaunchMissile id="AnaSleepDartLaunchMissile">
  <ValidatorArray index="0" value="CasterNotDead" />
  <ImpactLocation>
    <Value value="TargetPoint" />
    <ProjectionMultiplier value="1" />
    <UsesLineDash value="1" />
    <ProjectionDistanceScale value="11.75" />
  </ImpactLocation>
  <SharedFlags index="DynamicSearchArea" value="1" />
  <!-- ... -->
  <SearchEffect value="AnaSleepDartMissileScan" />
  <AmmoUnit value="AnaSleepDartMissile" />
  <!-- ... -->
</CEffectLaunchMissile>

ImpactLocation puts the impact point 11.75 units from Ana, toward the point that the player clicked. The distance is the same for every click. While the missile flies, the SearchEffect looks for a target:

<CEffectEnumArea id="AnaSleepDartMissileScan">
  <ImpactLocation Value="TargetPoint" />
  <SearchFilters value="Heroic;Self,Player,Ally,Neutral,ImmuneToSkillshots,Missile,Item,Stasis,Dead,Hidden,Invulnerable" />
  <AreaArray MaxCount="2" Effect="AnaSleepDartImpactSet">
    <RectangleWidth value="0.5" />
    <RectangleHeight value="1.25" />
  </AreaArray>
  <!-- ... -->
  <TargetSorts RequestCount="2">
    <SortArray value="TSDistanceFromCaster" />
  </TargetSorts>
  <ResultsTrackingEffect value="AnaSleepDartLaunchMissile" />
</CEffectEnumArea>
  • A filter string is required;excluded, with commas between flags. This one requires Heroic. It excludes allies, neutrals, ImmuneToSkillshots and the usual dead and untargetable states. - means an empty side: TargetNotUnstoppable uses -;Unstoppable.
  • AreaArray sets the shape (Radius, or a rectangle, and an optional Arc) and the effect to run on each hit. MaxCount and TargetSorts limit and order the hits.

Nano Boost's filter selects the opposite set: Heroic,Visible;Self,Neutral,Enemy,Structure,ImmuneToFriendlyAbilities,Missile,Item,Stasis,Dead,Hallucination. That is allied Heroes other than Ana.

Other effects in the tree select units and points from the shared context with WhichUnit, ImpactUnit, ImpactLocation, LaunchLocation and similar fields. The values are Caster, Source, Target and Origin, with Unit and Point variants for locations, such as TargetUnit or CasterPoint. Effect="X" reads the context as it was at effect X, an earlier effect in the same tree. AnaSleepDartSetFacing turns Ana toward the point she clicked:

<CEffectModifyUnit id="AnaSleepDartSetFacing">
  <ImpactUnit Value="Caster" />
  <FacingLocation Effect="AnaSleepDartInitialSet" Value="TargetPoint" />
  <FacingType value="LookAt" />
</CEffectModifyUnit>

Effect="AnaSleepDartInitialSet" does not run that effect again. It tells FacingLocation to read TargetPoint from the context of AnaSleepDartInitialSet.

Validators and switches add more checks on the target. AnaEyeOfHorusImpactSwitch sends enemies and allies to different branches with TargetIsEnemy and TargetIsAlly. Other effects use validators such as TargetIsHero and TargetNotUnstoppable.

Talent gating

When a player picks a talent, GameLib runs libGame_gf_TalentsChooseTalentForPlayer. With the lookups shortened, it does this:

UnitBehaviorAdd(lv_heroUnit, lv_behaviors[lv_itBehavior], lv_heroUnit, 1);
libGame_gf_SendEventHeroGainTalent(lv_talentCatalogLink, lp_player);
libGame_gf_ApplyAbilityModificationsForPlayerAtTalent(lp_player, lp_tierIndex, lp_buttonIndex);
// ...
PlayerAddTalent(lp_player, lv_talentCatalogLink);

Each line gives the data a different way to check for the talent:

LineData checksSection
UnitBehaviorAddBehaviors from RankArrayGranted behaviors
SendEventHeroGainTalentTrigger codeScript events
ApplyAbilityModificationsForPlayerAtTalentChanged catalog fieldsCatalog changes
PlayerAddTalentCValidatorPlayerTalentTalent validators

Catalog changes

libGame_gf_ApplyAbilityModificationsForPlayerAtTalent applies AbilityModificationArray to the player's copy of the catalogs:

TypeResultNote
FlatModificationfield + ValueAdds to y for offset strings, as level scaling does
MultiplyLevelModificationfield × ValueThe level does not affect it
StringReplacementfield = StringReplacementSkipped for the Button catalog
CatalogReplacementCatalogLinkReplace(Entry → StringReplacement)Replaces every link to one record with a link to another

The most common pattern is a disabled effect. AnaSleepDartNightTerrorsDamage has Chance 0 in AnaSleepEndSet, which Sleep Dart's buff runs when the target wakes. The talent adds 1:

<CTalent id="AnaSleepDartNightTerrors">
  <Face value="AnaSleepDartNightTerrors" />
  <Abil value="AnaSleepDart" />
  <AbilityModificationArray>
    <Modifications>
      <Type value="FlatModification" />
      <Catalog value="Effect" />
      <Entry value="AnaSleepDartNightTerrorsDamage" />
      <Field value="Chance" />
      <Value value="1.000000" />
    </Modifications>
  </AbilityModificationArray>
</CTalent>

Talent validators

PlayerAddTalent sets the state that CValidatorPlayerTalent checks. The move speed bonus of Night Terrors uses one:

<CEffectApplyBehavior id="AnaSleepDartNightTerrorsApplyMoveSpeedBehavior">
  <ValidatorArray index="0" value="AnaHasSleepDartNightTerrorsTalent" />
  <WhichUnit Value="Caster" />
  <Behavior value="AnaSleepDartNightTerrorsMovementSpeedBuff" />
</CEffectApplyBehavior>

The same validator controls the tooltip. Sleep Dart's button has <TooltipAppender Validator="AnaHasSleepDartNightTerrorsTalent" Face="AnaSleepDartNightTerrors" />. Actor events also use talent validators, in terms such as Behavior.AnaAimDownSights.On; ValidatePlayer AnaHasDynamicOptics.

Granted behaviors

The hero gets the RankArray behaviors when the player picks the talent. Validators and requirements then test for them. Heroic abilities work this way. AnaHeroicAbilityNanaBoost grants the shared Ultimate1Unlocked buff, and the Nano Boost command requires the Ultimate1Unlocked requirement:

<CmdButtonArray index="Execute" DefaultButtonFace="AnaNanoBoost" Requirements="Ultimate1Unlocked">

Script events

libGame_gf_SendEventHeroGainTalent sends an event that hero libraries receive through libGame_gf_HeroGainTalent. Ana's Deadeye cooldown conversion is one receiver. Triggers also call PlayerHasTalent directly. GameLib checks some talents by name, such as SamuroHeroicAbilityIllusionMaster and JunkratIHateWaitingTalent.

A respec reverses the catalog changes in libGame_gf_RemoveTalentAbilityModificationsForPlayerAtTalent. See Catalog access.

Quests and stacks

Ana's level 20 talent Deadeye uses most of the mechanisms above:

  1. The talent sets Chance to 1 on three disabled effects and changes the charge and cooldown fields of Eye of Horus.
  2. When Ana enters Eye of Horus, one of those effects, AnaEyeOfHorusDeadeyeTokenCounterApplyBehavior, puts the AnaEyeOfHorusDeadeyeTokenCounter counter on her.
  3. Each round that hits a Hero runs another, AnaEyeOfHorusDeadeyeDelayPersistent. It waits one game loop and then adds a token with AnaEyeOfHorusDeadeyeAddToken.
  4. AnaEyeOfHorusDeadeyeAccumulator converts the token count to count × 0.05.
  5. The damage effect applies the result through a gated modifier:
<CEffectDamage id="AnaEyeOfHorusImpactEnemyDamage" parent="StormSpell">
  <Amount value="135" />
  <MultiplicativeModifierArray index="0" Validator="IsStructureTarget" Modifier="-0.5" />
  <MultiplicativeModifierArray index="Deadeye" Validator="AnaHasEyeOfHorusDeadeyeTalent" Accumulator="AnaEyeOfHorusDeadeyeAccumulator" />
  <SourceButtonFace value="AnaEyeOfHorusActivate" />
</CEffectDamage>

A modifier entry applies while its validator passes. Its value comes from Modifier or from the accumulator and adds to a multiplier of 1. The tooltip shows the -0.5 as "50% less damage to Structures" and each token as 5% more damage. The heal effect for allies has the same Deadeye entry. The validator checks for the talent, so the tokens have no effect without it.

For quest talents, QuestData tells the interface which counter to show. Vampiric Rounds names AnaShrikeVampiricRoundsTokenCounter. The counter inherits from StormQuestToken, which sets TokenId and Face to ##id## and names the QuestIncrease and QuestComplete events. The counter's DeltaEvents and AtMaxEvents attach effects to those events.

Tooltips

Tooltips are GameStrings entries under Button/Tooltip/<id>. Numbers are <d ref> tags that evaluate an expression over Catalog,Entry,Field references. This is the Night Terrors tooltip:

Button/Tooltip/AnaSleepDartNightTerrors=Gain <c val="#TooltipNumbers"><d ref="100*Behavior,AnaSleepDartNightTerrorsMovementSpeedBuff,Modification.UnifiedMoveSpeedFactor"/>%</c> Movement Speed for <c val="#TooltipNumbers"><d ref="Behavior,AnaSleepDartNightTerrorsMovementSpeedBuff,Duration"/></c> seconds for every Hero hit by Sleep Dart. Upon waking, enemy Heroes take <c val="#TooltipNumbers"><d ref="100*Effect,AnaSleepDartNightTerrorsDamage,VitalFractionMax[0]"/>%</c> of their Maximum Health in damage.
  • <d> also takes the player and precision attributes. <c val> sets a color, <n/> breaks a line and <img path> inserts an icon.
  • A reference can read talent data. Deadeye's tooltip computes its cooldown as Abil,AnaEyeOfHorusActivate,Cost[0].Cooldown.TimeUse + Talent,AnaEyeOfHorusDeadeye,AbilityModificationArray[0].Modifications[5].Value.
  • Some records exist only for a tooltip. The cooldown speedup of Nano Boost is a Galaxy constant, so its tooltip reads "150% faster" from AnaNanoBoostCDDummyEffect. No other record refers to this CEffectModifyUnit: <Cost Abil="AnaNanoBoost,Execute" CooldownTimeUse="150" />.
  • Some values are text. Sleep Dart's button sets TooltipCooldownOverrideText to 14 seconds.