Skip to content

feat(effect-list): cooldowns for spells that lock out their targets - #2464

Merged
mrhoribu merged 2 commits into
elanthia-online:masterfrom
Nisugi:feat/spell-cooldown-data
Sep 12, 2026
Merged

mrhoribu merged 2 commits into
elanthia-online:masterfrom
Nisugi:feat/spell-cooldown-data

Conversation

@Nisugi

@Nisugi Nisugi commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Five spells stop a character from receiving them again for a while, and nothing in the effect list said so. Companion to elanthia-online/lich-5#1597, which reads these and tracks the cooldowns per character; without that PR these attributes are inert, and without this one its code has no data to act on. Either can merge first.

Two shapes, so two attributes.

group-cooldown -- the lockout a group (EVOKE) casting puts on each target. Bravery (211) and Heroism (215) at 180s, Spell Shield (219) at 360s. The caster's own start message names the group, which is how Lich tells a group casting apart from a self-cast.

target-cooldown -- the lockout a spell puts on the one character it lands on. Wall of Force (140) at 270s, Celerity (506) at 240s. It belongs to that character whoever cast it, so it pairs with a target-start message: the third-person line naming them, with the name captured as (?<noun>...).

<spell ... number='140' ... target-cooldown='270'>
   <message type='target-start'>A wall of force surrounds (?&lt;noun&gt;[A-Z][a-z]+)\.</message>

Lengths are from the spell pages on the wiki. Existing attributes and messages are untouched, so a Lich that does not know these names ignores them.

Deliberately left out: Rapid Fire (515), whose recovery starts when the effect ends and scales with the target's Elemental Mana Control rather than being a constant; Barkskin (605), whose cooldown starts when the spell absorbs a hit, an event with no fixed relationship to the casting; and Invisibility (916) and Resist Nature (620), whose group versions have no per-target lockout.

Test plan

  • XML parses under Ox with the same options Lich uses (mode: :generic, skip: :skip_none)
  • All five entries read back with the expected attribute values and messages
  • The two target-start patterns match the real game lines and capture the name, and do not match the second-person lines, the group-casting line, or a pet's line
  • In game on a live install: Wall of Force cast on a character reads 268.98 seconds left a moment later, from 0.0 before

🤖 Generated with Claude Code

Five spells stop a character from receiving them again for a while, and
nothing in the effect list said so, leaving the caster with no way to
know who they can still cast on.

Two shapes, so two attributes:

group-cooldown is the lockout a group (EVOKE) casting puts on each
target -- Bravery (211) and Heroism (215) at 180s, Spell Shield (219)
at 360s. The caster's own message names the group, which is how the
casting is told apart from a self-cast.

target-cooldown is the lockout a spell puts on the one character it
lands on -- Wall of Force (140) at 270s, Celerity (506) at 240s. It
belongs to that character whoever cast it, so it pairs with a
target-start message: the third-person line that names them, with the
name captured as (?<noun>...).

Lengths are from the spell pages on the wiki. Verified in game against
Wall of Force: casting it on a character reads 268.98 seconds left a
moment later, and a misfire leaves the existing cooldown running rather
than restarting it, since the cooldown follows the effect message and
not the cast command.

Requires the Lich-side support in elanthia-online/lich-5.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1ac14bb1-3e57-4b9d-a905-8f7e6ab165a3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mrhoribu

Copy link
Copy Markdown
Contributor

would it be better served to do:

   <spell availability='all' name='Wall of Force' number='140' type='defense'>
      <duration cast-type='self' span='refreshable'>1.5</duration>
      <duration cast-type='target' span='refreshable'>1</duration>
      <cost type='mana'>40</cost>
      <bonus type='bolt-ds'>100</bonus>
      <bonus type='physical-ds'>100</bonus>
      <cooldown type='target'>270</cooldown>
      <cooldown type='group'>270</cooldown>
      <message type='start'>A wall of force surrounds you\.</message>
      <message type='end'>The wall of force disappears from around you\.</message>
      <message type='target-start'>A wall of force surrounds (?&lt;noun&gt;[A-Z][a-z]+)\.</message>
   </spell>

Move the group and target cooldowns off the <spell> tag's attributes and
onto <cooldown type='group'> and <cooldown type='target'> children, per
review feedback on elanthia-online#2464. Matches how duration, cost and bonus are
already carried, and takes a further cooldown kind without adding an
attribute per kind.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Nisugi

Nisugi commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Agreed, that reads better and matches how duration, cost and bonus are already carried. Adopted in 1e0d03c — all five spells now use <cooldown type='group'> / <cooldown type='target'> children, placed after bonus and before message as in your example.

Parsing side updated to match in elanthia-online/lich-5#1597, which now reads them with a locate('cooldown') loop instead of attribute lookups.

Worth landing the lich-5 side first or close to this one. Each is harmless alone, but if this merges first, anyone pulling a fresh effect-list before the parsing change ships would see these cooldowns read as nil.

@mrhoribu mrhoribu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be better served to do:

   <spell availability='all' name='Wall of Force' number='140' type='defense'>
      <duration cast-type='self' span='refreshable'>1.5</duration>
      <duration cast-type='target' span='refreshable'>1</duration>
      <cost type='mana'>40</cost>
      <bonus type='bolt-ds'>100</bonus>
      <bonus type='physical-ds'>100</bonus>
      <cooldown type='target'>270</cooldown>
      <cooldown type='group'>270</cooldown>
      <message type='start'>A wall of force surrounds you\.</message>
      <message type='end'>The wall of force disappears from around you\.</message>
      <message type='target-start'>A wall of force surrounds (?&lt;noun&gt;[A-Z][a-z]+)\.</message>
   </spell>

@mrhoribu
mrhoribu merged commit 7c6c7f7 into elanthia-online:master Sep 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants