Files
ClassicAPI/src/spell/Interruptible.h
T
Brues b4e5f4f2bb feat(spell): fill notInterruptible in UnitCastingInfo / UnitChannelInfo
Mirror the 3.3.5 client's own predicate on 1.12 data instead of pushing a
placeholder false. The value is relative to the local player: the spellbook
is folded into school masks of INTERRUPT_CAST spells and MOD_SILENCE spells
(cached on Player::StatSignal), a cast is not interruptible when its
PreventionType is not SILENCE or when the caster's immunity auras (effect /
state / school / mechanic immunity) strip every mask, and the flag is never
reported while the player knows no interrupt or silence at all.

1.12 differences, each documented in Spell::Interruptible: the vanilla
server's interrupt effect also needs InterruptFlags 0x02 (channels:
ChannelInterruptFlags 0x04), which silence ignores; SMSG_SPELL_START carries
no immunity block, so creature_template interrupt immunity stays invisible;
Feral Charge's interrupt lives on its triggered spell, so the capability walk
follows one TRIGGER_SPELL hop.

Verified in-game: a paladin's Holy Light reads false, flips to true while
Divine Shield is up, and back to false when it drops.

Also centralize SPELL_EFFECT_APPLY_AURA in Offsets.h (was local to Level.cpp).
2026-09-12 22:21:16 -05:00

33 lines
1.5 KiB
C++

// This file is part of ClassicAPI.
//
// ClassicAPI is free software: you can redistribute it and/or modify it under the terms
// of the GNU General Public License as published by the Free Software Foundation, either
// version 3 of the License, or (at your option) any later version.
//
// ClassicAPI is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// ClassicAPI. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <cstdint>
// `Spell::Interruptible` — the `notInterruptible` field of `UnitCastingInfo` /
// `UnitChannelInfo`: can nothing the LOCAL PLAYER knows stop this cast? The
// 3.3.5 client's own predicate, run on 1.12 data — see Interruptible.cpp.
namespace Spell::Interruptible {
// True when no interrupt or silence the local player knows can stop
// `spellRecord`, cast (or channeled, per `isChannel`) by `caster` — a CGUnit
// pointer, or null when the caster's auras aren't readable (the static and
// capability parts still apply). False for a null record, and ALWAYS false
// while the player knows no interrupt or silence at all (the 3.3.5 reader's
// rule: the flag only exists for someone who could act on it).
bool NotInterruptible(const uint8_t *caster, const uint8_t *spellRecord,
bool isChannel);
} // namespace Spell::Interruptible