- summary: The server's authoritative spell state for one fighter: spell cooldowns and spell cast counters. The client never computes these itself; it applies what this event says.
- area: Game.Fight
The server's authoritative spell state for one fighter: spell cooldowns and spell cast counters. The client never computes these itself; it applies what this event says.
Kind event · Area Game.Fight
This name is not Ankama's. It was chosen for this documentation from proven client behaviour, and is a label rather than protocol documentation.
The complete spell-cast state of ONE fighter, as the server sees it: how many turns each spell still has to wait, and how many times each spell has been cast this turn (in total, on each target, and against the spell's global limit).
WHY IT EXISTS
Whether a spell may be cast depends on counters only the server keeps. The official client never counts
turns down on a cooldown and never counts casts by itself: it stores and enforces exactly what the server
last sent. Three things write these counters on the client: this event (the whole state of one fighter),
the refresh carried by each spell cast (AbilityRefreshInfo inside GameActionFightEvent.targeted_ability),
and the fight-resume data when the client joins or rejoins a fight. When a turn passes or an effect changes
a cooldown or a counter, the server pushes this event with the fighter's new state.
WHEN IT ARRIVES
- Around a fighter's turn. In a 3.7.10.10 capture it arrived twice during the player's turn, before the first spell cast, with ONLY fighter_id set: no cooldown and no cast yet, so every cast counter of that fighter went back to 0 and its cooldowns stayed as they were. - During an action. If the client is playing a fight action sequence when it arrives, it does not apply it at once: it queues it as a step of that sequence, so the counters change in order with the action's other effects. Otherwise it applies it immediately.
WHAT TO DO WHEN YOU RECEIVE IT
1. TIMING: if you are replaying an action sequence (SequenceStartEvent ... SequenceEndEvent), apply
it at its place in that sequence; otherwise apply it now.
2. FIGHTER: RefreshSpellCastStateEvent.fighter_id. Everything below concerns that fighter only.
3. COOLDOWNS: for each FightSpellCoolDown of RefreshSpellCastStateEvent.spell_cool_downs, set that spell's cooldown to
its cool_down. A spell that is NOT listed keeps the cooldown you already have for it: the list is not a
replacement and nothing counts down on your side. A cool_down of 63 is not a number of turns: the client
treats it as "this spell can no longer be cast".
4. RESET every cast counter of the fighter to 0, for EVERY spell: the count this turn, the global count and
all per-target counts. Then:
5. CAST COUNTS: for each FightSpellCast of RefreshSpellCastStateEvent.cast_counts, set the spell's count this turn to
cast_count and its per-target counts to target_cast_counts (CastCountOneSomeone).
6. GLOBAL CAST COUNTS: for each FightSpellCast of RefreshSpellCastStateEvent.global_cast_counts, set the spell's global
count to cast_count. Ignore that entry's per-target list.
7. SEND NOTHING BACK.
BEFORE CASTING, CHECK WHAT THE OFFICIAL CLIENT CHECKS (spell level data, after spell modifiers):
- cooldown > 0: refused (63: "can no longer be cast"; otherwise "cooldown"); - count this turn >= maxCastPerTurn (when that limit is > 0): refused; - global count >= maxGlobalCastPerTurn (when > 0): refused; - count on the chosen target >= maxCastPerTarget, or >= maxGlobalCastPerTarget (when > 0): refused.
When you may send it
- Requires
character_loadedinferred - Raised by: a change of the fighter's spell state on the server: a turn passing (cooldowns go down, per-turn counters restart) or an effect that changes cooldowns or cast counts inferred
Related messages
- Unsolicited - nothing you send causes this observed — pushed by the server around a fighter's turn (seen twice during the player's turn in a 3.7.10.10 capture); no request asks for it
Fields
| # | Field | Type | Meaning | You set it |
|---|---|---|---|---|
| 1 | cast_counts | repeated FightSpellCast | This turn's cast count of each spell, with its per-target counts. Every counter is reset to 0 first: a spell not listed has been cast 0 times. Checked against maxCastPerTurn and maxCastPerTarget. | never |
| 2 | fighter_id | int64 | The fighter whose spell state this is. (fighter (entity) id) Selects that fighter's spell manager; nothing here concerns another fighter. | never |
| 3 | global_cast_counts | repeated FightSpellCast | Each spell's global cast count. Only cast_count is used; the per-target list of these entries is ignored. Reset to 0 first like the other counters; checked against maxGlobalCastPerTurn. | never |
| 4 | spell_cool_downs | repeated FightSpellCoolDown | New cooldown of each listed spell. Spells not listed keep their previous cooldown (not a replacement list). A cool down of 63 means the spell can no longer be cast. | never |