mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
GetSpellLossOfControlCooldown treated Polymorph (and every stun, fear, confuse, charm) as blocking every spell, so a druid form reported a lockout while polymorphed. The forms grant Polymorph immunity, and the client's caster validator lets such a spell through via its per-arm crowd-control scans. Blocks() now asks that arm's engine scan instead of restating the gate. Fixes #114
40 lines
1.9 KiB
C++
40 lines
1.9 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>
|
|
|
|
namespace LossOfControl {
|
|
|
|
// The loss-of-control effect currently blocking the local player from
|
|
// casting `spellID`, if any: writes its start / end engine ticks (unsigned
|
|
// ms, `GetTime()` epoch — see `Time::Clock`) and returns true. Considers
|
|
// only effects with KNOWN timing (a school lockout, or a CC aura whose
|
|
// applying cast was observed) — an effect with unknown timing has nothing a
|
|
// cooldown display could show. When several effects block the spell, the
|
|
// one ending last wins. Returns false for an unknown `spellID`.
|
|
//
|
|
// Which effects block which spells restates the server's cast gates:
|
|
// SCHOOL_INTERRUPT → spells of the locked school
|
|
// STUN / FEAR / CONFUSE / CHARM / POSSESS → every spell
|
|
// SILENCE → spells with PreventionType SILENCE (1)
|
|
// PACIFY → spells with PreventionType PACIFY (2)
|
|
// PACIFYSILENCE → both of the above
|
|
// ROOT / DISARM → nothing (neither stops a cast)
|
|
// except that, like the client's own cast check, a spell granting immunity
|
|
// to the effect is not blocked by it (a druid form under Polymorph).
|
|
bool LockoutForSpell(int spellID, uint32_t *startMs, uint32_t *endMs);
|
|
|
|
} // namespace LossOfControl
|