Skip to main content

wowlab_engine_domain/dbc/semantics/
spell_effects.rs

1use super::SemanticSupport;
2
3const MOVEMENT_HANDLER_GAP: &str = "actor movement and travel time are not modelled";
4
5/// Typed spell-effect identities used by shared engine code.
6#[derive(Clone, Copy, Debug, Eq, PartialEq)]
7#[repr(i32)]
8#[non_exhaustive]
9pub enum SpellEffectKind {
10    None = 0,
11    SchoolDamage = 2,
12    Dummy = 3,
13    ApplyAura = 6,
14    PowerDrain = 8,
15    HealthLeech = 9,
16    Heal = 10,
17    WeaponDamageNoSchool = 17,
18    CreateItem = 24,
19    Summon = 28,
20    Energize = 30,
21    WeaponPercentDamage = 31,
22    TriggerMissile = 32,
23    ApplyPartyAura = 35,
24    Dispel = 38,
25    JumpDest = 42,
26    WeaponDamage = 58,
27    PowerBurn = 62,
28    TriggerSpell = 64,
29    ApplyRaidAura = 65,
30    HealMaxHealthPercent = 67,
31    InterruptCast = 68,
32    ScriptEffect = 77,
33    Attack = 78,
34    Charge = 96,
35    NormalizedWeaponDamage = 121,
36    StealBeneficialBuff = 126,
37    RedirectThreat = 130,
38    DirectHealPercent = 136,
39    EnergizePowerPercent = 137,
40    TriggerSpellWithValue = 142,
41    DirectionalKnockback = 144,
42    LeapBack = 149,
43    TriggerSpell2 = 151,
44    CreateHeirloom = 157,
45    CancelAura = 164,
46    ApplyAuraPet = 174,
47    CreateAreaTrigger = 179,
48    ApplyPlayerPetAura = 202,
49    RemoveAura = 203,
50    TeleportUnits = 252,
51    JumpCharge = 254,
52    ModifiedCrafting = 288,
53    ReduceRemainingCooldown = 290,
54    ImmediateCooldownRechargeCategory = 293,
55}
56
57/// One registered DBC spell-effect type.
58#[derive(Clone, Copy, Debug, Eq, PartialEq)]
59pub struct SpellEffectSemantic {
60    pub kind: SpellEffectKind,
61    pub name: &'static str,
62    pub support: SemanticSupport,
63    pub handler: &'static str,
64}
65
66const fn spell_effect(
67    kind: SpellEffectKind,
68    name: &'static str,
69    support: SemanticSupport,
70    handler: &'static str,
71) -> SpellEffectSemantic {
72    SpellEffectSemantic {
73        kind,
74        name,
75        support,
76        handler,
77    }
78}
79
80/// Canonical registry of spell-effect types understood by the engine.
81#[rustfmt::skip]
82pub const SPELL_EFFECT_SEMANTICS: &[SpellEffectSemantic] = &[
83    spell_effect(SpellEffectKind::None, "None", SemanticSupport::Ignored, "empty DBC effect placeholder"),
84    spell_effect(SpellEffectKind::SchoolDamage, "School Damage", SemanticSupport::Generic, "damage payload resolution"),
85    spell_effect(SpellEffectKind::Dummy, "Dummy", SemanticSupport::ContentRequired, "spec or item content"),
86    spell_effect(SpellEffectKind::ApplyAura, "Apply Aura", SemanticSupport::Generic, "registered source-aura application through shared effect-program lowering"),
87    spell_effect(SpellEffectKind::PowerDrain, "Power Drain", SemanticSupport::Generic, "resource-cost transform"),
88    spell_effect(SpellEffectKind::HealthLeech, "Health Leech", SemanticSupport::Generic, "damage payload and actual-damage healing resolution"),
89    spell_effect(SpellEffectKind::Heal, "Heal", SemanticSupport::Generic, "direct coefficient healing pipeline"),
90    spell_effect(SpellEffectKind::WeaponDamageNoSchool, "Weapon Damage (No School)", SemanticSupport::Generic, "equipped-weapon damage payload resolution"),
91    spell_effect(SpellEffectKind::CreateItem, "Create Item", SemanticSupport::Ignored, "crafted-product transform"),
92    spell_effect(SpellEffectKind::Summon, "Summon", SemanticSupport::ContentRequired, "spec or item content wires summoned-unit behavior"),
93    spell_effect(SpellEffectKind::Energize, "Energize", SemanticSupport::Generic, "resource resolution"),
94    spell_effect(SpellEffectKind::WeaponPercentDamage, "Weapon Percent Damage", SemanticSupport::Generic, "equipped-weapon percentage damage payload resolution"),
95    spell_effect(SpellEffectKind::TriggerMissile, "Trigger Missile", SemanticSupport::Partial, "registered spell activation executes typed child damage, aura, resource, and charge operations; missile travel and unregistered destinations remain unsupported"),
96    spell_effect(SpellEffectKind::ApplyPartyAura, "Apply Party Aura", SemanticSupport::ContentRequired, "spec or item content"),
97    spell_effect(SpellEffectKind::Dispel, "Dispel", SemanticSupport::Generic, "typed DBC dispel-family matching, resistance, removal, and proc dispatch"),
98    spell_effect(SpellEffectKind::JumpDest, "Jump Dest", SemanticSupport::Unsupported, "actor movement and travel time are not modelled"),
99    spell_effect(SpellEffectKind::WeaponDamage, "Weapon Damage", SemanticSupport::Generic, "equipped-weapon damage payload resolution"),
100    spell_effect(SpellEffectKind::PowerBurn, "Power Burn", SemanticSupport::Generic, "optional resource-cost resolution"),
101    spell_effect(SpellEffectKind::TriggerSpell, "Trigger Spell", SemanticSupport::Partial, "registered spell activation executes typed child damage, aura, resource, and charge operations; unsupported child effects and unregistered destinations are explicit gaps"),
102    spell_effect(SpellEffectKind::ApplyRaidAura, "Apply Raid Aura", SemanticSupport::Partial, "aura-subtype registry; raid propagation is outside the single-player model"),
103    spell_effect(SpellEffectKind::HealMaxHealthPercent, "Heal Max Health Percent", SemanticSupport::Generic, "maximum-health percentage healing pipeline"),
104    spell_effect(SpellEffectKind::InterruptCast, "Interrupt Cast", SemanticSupport::Generic, "typed interrupt and cast-school lockout primitive"),
105    spell_effect(SpellEffectKind::ScriptEffect, "Script Effect", SemanticSupport::ContentRequired, "spec or item content"),
106    spell_effect(SpellEffectKind::Attack, "Attack", SemanticSupport::Generic, "action-driven auto-attack lifecycle"),
107    spell_effect(SpellEffectKind::Charge, "Charge", SemanticSupport::Unsupported, MOVEMENT_HANDLER_GAP),
108    spell_effect(SpellEffectKind::NormalizedWeaponDamage, "Normalized Weapon Damage", SemanticSupport::Generic, "normalized equipped-weapon damage payload resolution"),
109    spell_effect(SpellEffectKind::StealBeneficialBuff, "Steal Beneficial Buff", SemanticSupport::Generic, "typed DBC dispel-family matching and transfer to the player"),
110    spell_effect(SpellEffectKind::RedirectThreat, "Redirect Threat", SemanticSupport::Unsupported, "threat redirection is not modelled"),
111    spell_effect(SpellEffectKind::DirectHealPercent, "Direct Heal Percent", SemanticSupport::Generic, "maximum-health percentage healing pipeline"),
112    spell_effect(SpellEffectKind::EnergizePowerPercent, "Energize Power Percent", SemanticSupport::Partial, "typed maximum-capacity percent energize; non-player resource targets are not modeled"),
113    spell_effect(SpellEffectKind::TriggerSpellWithValue, "Trigger Spell With Value", SemanticSupport::Partial, "registered spell activation forwards the driver value through typed child operations; unsupported child effects and unregistered destinations are explicit gaps"),
114    spell_effect(SpellEffectKind::DirectionalKnockback, "Directional Knockback", SemanticSupport::Unsupported, "multi-actor movement and displacement are not modelled"),
115    spell_effect(SpellEffectKind::LeapBack, "Leap Back", SemanticSupport::Unsupported, MOVEMENT_HANDLER_GAP),
116    spell_effect(SpellEffectKind::TriggerSpell2, "Trigger Spell 2", SemanticSupport::Partial, "registered spell activation executes typed child damage, aura, resource, and charge operations; unsupported child effects and unregistered destinations are explicit gaps"),
117    spell_effect(SpellEffectKind::CreateHeirloom, "Create Heirloom", SemanticSupport::Ignored, "crafted-product transform"),
118    spell_effect(SpellEffectKind::CancelAura, "Cancel Aura", SemanticSupport::Generic, "typed direct and child aura-removal effect program"),
119    spell_effect(SpellEffectKind::ApplyAuraPet, "Apply Aura Pet", SemanticSupport::Generic, "registered aura application targets the affected pet actor"),
120    spell_effect(SpellEffectKind::CreateAreaTrigger, "Create Area Trigger", SemanticSupport::ContentRequired, "content wires area-trigger behavior"),
121    spell_effect(SpellEffectKind::ApplyPlayerPetAura, "Apply Player/Pet Aura", SemanticSupport::Generic, "registered aura application propagates to player and primary pet actor state"),
122    spell_effect(SpellEffectKind::RemoveAura, "Remove Aura", SemanticSupport::Generic, "typed direct and child aura-removal effect program"),
123    spell_effect(SpellEffectKind::TeleportUnits, "Teleport Units", SemanticSupport::Unsupported, "multi-actor movement and teleportation are not modelled"),
124    spell_effect(SpellEffectKind::JumpCharge, "Jump Charge", SemanticSupport::Unsupported, MOVEMENT_HANDLER_GAP),
125    spell_effect(SpellEffectKind::ModifiedCrafting, "Modified Crafting", SemanticSupport::Ignored, "crafted-product transform"),
126    spell_effect(SpellEffectKind::ReduceRemainingCooldown, "Reduce Remaining Cooldown", SemanticSupport::Generic, "typed effect-program cooldown mutation"),
127    spell_effect(SpellEffectKind::ImmediateCooldownRechargeCategory, "Immediate Cooldown Recharge Category", SemanticSupport::Generic, "typed effect-program cooldown mutation"),
128];
129
130/// Registry lookup for a raw spell-effect type.
131#[must_use]
132pub fn spell_effect_semantic(raw: i32) -> Option<&'static SpellEffectSemantic> {
133    SPELL_EFFECT_SEMANTICS
134        .iter()
135        .find(|entry| entry.kind as i32 == raw)
136}