mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
Reuses the C_LossOfControl classifier so the two never drift. Extract ClassifyControlLoss out of the LoC module into a shared Spell::CrowdControl: Classify(rec) returns the hard control-loss type string (stun/fear/silence/root/charm/confuse/pacify/possess/disarm) and still backs C_LossOfControl; IsCrowdControl(spellID) backs the aura filter. Crowd control is broader than loss of control: IsCrowdControl also counts movement slows / snares (SPELL_AURA_MOD_DECREASE_SPEED = 33, added to Offsets.h), which are crowd control but not a loss of control — so a Frostbolt/Hamstring slow is CROWD_CONTROL while C_LossOfControl still ignores it. Classify (LoC) is unchanged. Wire it as a third CcMode dimension on the Aura::Data::Match struct, checked in MatchesAura; tokenizer honors CROWD_CONTROL / !CROWD_CONTROL. Docs updated. Verified in-game: Psychic Scream (fear) and a Frostbolt slow both classify as CROWD_CONTROL; DoTs and buffs do not.
41 lines
1.8 KiB
C++
41 lines
1.8 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>
|
|
|
|
// Crowd-control classification of a Spell.dbc record, shared by
|
|
// `C_LossOfControl` (which reports the control-loss type) and the
|
|
// `C_UnitAuras` `CROWD_CONTROL` aura filter (which only needs presence). One
|
|
// source of truth for "is this a hard control effect" so the two never drift.
|
|
|
|
namespace Spell::CrowdControl {
|
|
|
|
// Classifies a spell by its `EffectApplyAuraName` set into a control-loss
|
|
// type string, priority-ordered (strongest control first) so a multi-effect
|
|
// spell resolves to one type:
|
|
// POSSESS, CHARM, STUN, FEAR, CONFUSE, PACIFYSILENCE, SILENCE, PACIFY,
|
|
// ROOT, DISARM
|
|
// Returns nullptr if the spell applies no control-loss aura (`spellRecord`
|
|
// may be null → nullptr). Movement-only slows/snares are intentionally NOT
|
|
// classified — they are not a loss of control.
|
|
const char *Classify(const uint8_t *spellRecord);
|
|
|
|
// True iff `spellID` is a crowd-control aura. Broader than `Classify`: it
|
|
// also counts movement slows / snares (`MOD_DECREASE_SPEED`), which are crowd
|
|
// control but not loss of control. Backs the C_UnitAuras CROWD_CONTROL filter.
|
|
bool IsCrowdControl(uint32_t spellID);
|
|
|
|
} // namespace Spell::CrowdControl
|