AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
SpellProcIntegrationTest.cpp File Reference
#include "AuraScriptTestFramework.h"
#include "SpellMgr.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"

Go to the source code of this file.

Classes

class  SpellProcIntegrationTest
 Integration tests for the proc system. More...
 

Functions

 TEST_F (SpellProcIntegrationTest, MeleeAutoAttackProc_NormalHit)
 
 TEST_F (SpellProcIntegrationTest, MeleeAutoAttackProc_CritOnly)
 
 TEST_F (SpellProcIntegrationTest, MeleeAutoAttackProc_Miss)
 
 TEST_F (SpellProcIntegrationTest, SpellDamageProc_OnHit)
 
 TEST_F (SpellProcIntegrationTest, SpellDamageProc_OnCast)
 
 TEST_F (SpellProcIntegrationTest, HealProc_OnHeal)
 
 TEST_F (SpellProcIntegrationTest, HealProc_CritHeal)
 
 TEST_F (SpellProcIntegrationTest, PeriodicDamageProc)
 
 TEST_F (SpellProcIntegrationTest, PeriodicHealProc)
 
 TEST_F (SpellProcIntegrationTest, KillProc)
 
 TEST_F (SpellProcIntegrationTest, DeathProc)
 
 TEST_F (SpellProcIntegrationTest, DodgeProc)
 
 TEST_F (SpellProcIntegrationTest, ParryProc)
 
 TEST_F (SpellProcIntegrationTest, BlockProc)
 
 TEST_F (SpellProcIntegrationTest, FullBlockProc)
 
 TEST_F (SpellProcIntegrationTest, AbsorbProc)
 
 TEST_F (SpellProcIntegrationTest, SpellFamilyMatch_SameFamily)
 
 TEST_F (SpellProcIntegrationTest, SpellFamilyMatch_DifferentFamily)
 
 TEST_F (SpellProcIntegrationTest, SpellFamilyMatch_NoFamilyFilter)
 
 TEST_F (SpellProcIntegrationTest, SpellFamilyMatch_FlagMismatch)
 
 TEST_F (SpellProcIntegrationTest, MultipleProcFlags_MeleeOrSpell)
 
 TEST_F (SpellProcIntegrationTest, MultipleHitMasks_CritOrNormal)
 
 TEST_F (SpellProcIntegrationTest, SchoolMaskFilter_FireOnly_FireDamage)
 
 TEST_F (SpellProcIntegrationTest, SchoolMaskFilter_FireOnly_FrostDamage)
 
 TEST_F (SpellProcIntegrationTest, SchoolMaskFilter_NoSchoolMask_AnySchoolTriggers)
 
 TEST_F (SpellProcIntegrationTest, EmptyProcFlags_NeverTriggers)
 
 TEST_F (SpellProcIntegrationTest, AllHitMasks_TriggersOnAny)
 

Function Documentation

◆ TEST_F() [1/27]

TEST_F ( SpellProcIntegrationTest  ,
AbsorbProc   
)
308{
309 auto procEntry = SpellProcEntryBuilder()
312 .Build();
313
314 auto scenario = ProcScenarioBuilder()
316 .WithAbsorb();
317
318 EXPECT_PROC_TRIGGERS(procEntry, scenario);
319}
#define EXPECT_PROC_TRIGGERS(procEntry, scenario)
Definition AuraScriptTestFramework.h:472
@ PROC_HIT_ABSORB
Definition SpellMgr.h:267
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG
Definition SpellMgr.h:135
Helper class for testing specific proc scenarios.
Definition AuraScriptTestFramework.h:252
ProcScenarioBuilder & OnTakenSpellDamage()
Definition AuraScriptTestFramework.h:291
ProcScenarioBuilder & WithAbsorb()
Definition AuraScriptTestFramework.h:393
Builder class for creating SpellProcEntry test instances.
Definition ProcEventInfoHelper.h:141
SpellProcEntryBuilder & WithHitMask(uint32 hitMask)
Definition ProcEventInfoHelper.h:184
SpellProcEntry Build() const
Definition ProcEventInfoHelper.h:226
SpellProcEntryBuilder & WithProcFlags(uint32 procFlags)
Definition ProcEventInfoHelper.h:166

References SpellProcEntryBuilder::Build(), EXPECT_PROC_TRIGGERS, ProcScenarioBuilder::OnTakenSpellDamage(), PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_HIT_ABSORB, ProcScenarioBuilder::WithAbsorb(), SpellProcEntryBuilder::WithHitMask(), and SpellProcEntryBuilder::WithProcFlags().

◆ TEST_F() [2/27]

TEST_F ( SpellProcIntegrationTest  ,
AllHitMasks_TriggersOnAny   
)
543{
544 auto procEntry = SpellProcEntryBuilder()
547 .Build();
548
549 // Should trigger on any hit type
550 std::vector<uint32_t> hitTypes = {
553 };
554
555 for (uint32_t hitType : hitTypes)
556 {
557 auto eventInfo = ProcEventInfoBuilder()
559 .WithHitMask(hitType)
560 .Build();
561
562 EXPECT_TRUE(sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo))
563 << "Failed for hit type: " << hitType;
564 }
565}
@ PROC_HIT_BLOCK
Definition SpellMgr.h:263
@ PROC_HIT_MISS
Definition SpellMgr.h:259
@ PROC_HIT_DODGE
Definition SpellMgr.h:261
@ PROC_HIT_PARRY
Definition SpellMgr.h:262
@ PROC_HIT_MASK_ALL
Definition SpellMgr.h:271
@ PROC_HIT_CRITICAL
Definition SpellMgr.h:258
@ PROC_HIT_NORMAL
Definition SpellMgr.h:257
#define sSpellMgr
Definition SpellMgr.h:836
@ PROC_FLAG_DONE_MELEE_AUTO_ATTACK
Definition SpellMgr.h:113
Builder class for creating ProcEventInfo test instances.
Definition ProcEventInfoHelper.h:31
ProcEventInfoBuilder & WithTypeMask(uint32 typeMask)
Definition ProcEventInfoHelper.h:57
ProcEventInfoBuilder & WithHitMask(uint32 hitMask)
Definition ProcEventInfoHelper.h:75
ProcEventInfo Build()
Definition ProcEventInfoHelper.h:111

References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_DONE_MELEE_AUTO_ATTACK, PROC_HIT_BLOCK, PROC_HIT_CRITICAL, PROC_HIT_DODGE, PROC_HIT_MASK_ALL, PROC_HIT_MISS, PROC_HIT_NORMAL, PROC_HIT_PARRY, sSpellMgr, ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [3/27]

TEST_F ( SpellProcIntegrationTest  ,
BlockProc   
)
276{
277 auto procEntry = SpellProcEntryBuilder()
280 .Build();
281
282 auto scenario = ProcScenarioBuilder()
284 .WithBlock();
285
286 EXPECT_PROC_TRIGGERS(procEntry, scenario);
287}
@ PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK
Definition SpellMgr.h:114
ProcScenarioBuilder & OnTakenMeleeAutoAttack()
Definition AuraScriptTestFramework.h:275
ProcScenarioBuilder & WithBlock()
Definition AuraScriptTestFramework.h:381

References SpellProcEntryBuilder::Build(), EXPECT_PROC_TRIGGERS, ProcScenarioBuilder::OnTakenMeleeAutoAttack(), PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK, PROC_HIT_BLOCK, ProcScenarioBuilder::WithBlock(), SpellProcEntryBuilder::WithHitMask(), and SpellProcEntryBuilder::WithProcFlags().

◆ TEST_F() [4/27]

TEST_F ( SpellProcIntegrationTest  ,
DeathProc   
)
232{
233 auto procEntry = SpellProcEntryBuilder()
235 .Build();
236
237 auto scenario = ProcScenarioBuilder()
238 .OnDeath();
239
240 EXPECT_PROC_TRIGGERS(procEntry, scenario);
241}
@ PROC_FLAG_DEATH
Definition SpellMgr.h:146
ProcScenarioBuilder & OnDeath()
Definition AuraScriptTestFramework.h:343

References SpellProcEntryBuilder::Build(), EXPECT_PROC_TRIGGERS, ProcScenarioBuilder::OnDeath(), PROC_FLAG_DEATH, and SpellProcEntryBuilder::WithProcFlags().

◆ TEST_F() [5/27]

◆ TEST_F() [6/27]

TEST_F ( SpellProcIntegrationTest  ,
EmptyProcFlags_NeverTriggers   
)
522{
523 auto procEntry = SpellProcEntryBuilder()
524 .WithProcFlags(PROC_FLAG_NONE) // No flags set
525 .Build();
526
527 auto scenario = ProcScenarioBuilder()
529 .WithNormalHit();
530
531 // Without PROC_FLAG_NONE special handling, this might still match
532 // The actual behavior depends on implementation
533 auto eventInfo = scenario.Build();
534
535 // Event has flags but proc entry has none - should not trigger
536 if (procEntry.ProcFlags == 0 && scenario.GetTypeMask() != 0)
537 {
538 EXPECT_FALSE(sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo));
539 }
540}
@ PROC_FLAG_NONE
Definition SpellMgr.h:108
ProcScenarioBuilder & OnMeleeAutoAttack()
Definition AuraScriptTestFramework.h:268
ProcScenarioBuilder & WithNormalHit()
Definition AuraScriptTestFramework.h:357
ProcEventInfo Build()
Definition AuraScriptTestFramework.h:422

References ProcScenarioBuilder::Build(), SpellProcEntryBuilder::Build(), ProcScenarioBuilder::OnMeleeAutoAttack(), PROC_FLAG_NONE, sSpellMgr, ProcScenarioBuilder::WithNormalHit(), and SpellProcEntryBuilder::WithProcFlags().

◆ TEST_F() [7/27]

◆ TEST_F() [8/27]

TEST_F ( SpellProcIntegrationTest  ,
HealProc_CritHeal   
)
157{
158 auto procEntry = SpellProcEntryBuilder()
163 .Build();
164
165 // Normal heal should NOT trigger crit-only proc
166 auto normalScenario = ProcScenarioBuilder()
167 .OnHeal()
168 .WithNormalHit();
169 EXPECT_PROC_DOES_NOT_TRIGGER(procEntry, normalScenario);
170
171 // Crit heal should trigger
172 auto critScenario = ProcScenarioBuilder()
173 .OnHeal()
174 .WithCrit();
175 EXPECT_PROC_TRIGGERS(procEntry, critScenario);
176}
#define EXPECT_PROC_DOES_NOT_TRIGGER(procEntry, scenario)
Definition AuraScriptTestFramework.h:478
@ PROC_SPELL_TYPE_HEAL
Definition SpellMgr.h:240
@ PROC_SPELL_PHASE_HIT
Definition SpellMgr.h:249
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS
Definition SpellMgr.h:131
ProcScenarioBuilder & WithCrit()
Definition AuraScriptTestFramework.h:351
ProcScenarioBuilder & OnHeal()
Definition AuraScriptTestFramework.h:300
SpellProcEntryBuilder & WithSpellTypeMask(uint32 spellTypeMask)
Definition ProcEventInfoHelper.h:172
SpellProcEntryBuilder & WithSpellPhaseMask(uint32 spellPhaseMask)
Definition ProcEventInfoHelper.h:178

References SpellProcEntryBuilder::Build(), EXPECT_PROC_DOES_NOT_TRIGGER, EXPECT_PROC_TRIGGERS, ProcScenarioBuilder::OnHeal(), PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS, PROC_HIT_CRITICAL, PROC_SPELL_PHASE_HIT, PROC_SPELL_TYPE_HEAL, ProcScenarioBuilder::WithCrit(), SpellProcEntryBuilder::WithHitMask(), ProcScenarioBuilder::WithNormalHit(), SpellProcEntryBuilder::WithProcFlags(), SpellProcEntryBuilder::WithSpellPhaseMask(), and SpellProcEntryBuilder::WithSpellTypeMask().

◆ TEST_F() [9/27]

◆ TEST_F() [10/27]

TEST_F ( SpellProcIntegrationTest  ,
KillProc   
)
220{
221 auto procEntry = SpellProcEntryBuilder()
223 .Build();
224
225 auto scenario = ProcScenarioBuilder()
226 .OnKill();
227
228 EXPECT_PROC_TRIGGERS(procEntry, scenario);
229}
@ PROC_FLAG_KILL
Definition SpellMgr.h:111
ProcScenarioBuilder & OnKill()
Definition AuraScriptTestFramework.h:336

References SpellProcEntryBuilder::Build(), EXPECT_PROC_TRIGGERS, ProcScenarioBuilder::OnKill(), PROC_FLAG_KILL, and SpellProcEntryBuilder::WithProcFlags().

◆ TEST_F() [11/27]

◆ TEST_F() [12/27]

◆ TEST_F() [13/27]

◆ TEST_F() [14/27]

◆ TEST_F() [15/27]

TEST_F ( SpellProcIntegrationTest  ,
MultipleProcFlags_MeleeOrSpell   
)
387{
388 // Proc on melee OR spell damage
389 // Note: Spell procs require SpellPhaseMask to be set, otherwise the check
390 // (eventInfo.SpellPhaseMask & procEntry.SpellPhaseMask) fails when procEntry = 0
391 auto procEntry = SpellProcEntryBuilder()
394 .Build();
395
396 // Melee test
397 auto meleeEventInfo = ProcEventInfoBuilder()
400 .Build();
401 EXPECT_TRUE(sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, meleeEventInfo));
402
403 // Spell test - needs matching SpellPhaseMask AND SpellInfo
404 auto* spellInfo = CreateSpellInfo(100);
405 DamageInfo damageInfo(nullptr, nullptr, 100, spellInfo, SPELL_SCHOOL_MASK_FIRE, SPELL_DIRECT_DAMAGE);
406 auto spellEventInfo = ProcEventInfoBuilder()
410 .WithDamageInfo(&damageInfo)
411 .Build();
412 EXPECT_TRUE(sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, spellEventInfo));
413}
@ SPELL_SCHOOL_MASK_FIRE
Definition SharedDefines.h:287
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG
Definition SpellMgr.h:134
@ SPELL_DIRECT_DAMAGE
Definition Unit.h:255
Definition Unit.h:336
ProcEventInfoBuilder & WithSpellPhaseMask(uint32 spellPhaseMask)
Definition ProcEventInfoHelper.h:69
ProcEventInfoBuilder & WithDamageInfo(DamageInfo *damageInfo)
Definition ProcEventInfoHelper.h:87

References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_DONE_MELEE_AUTO_ATTACK, PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG, PROC_HIT_NORMAL, PROC_SPELL_PHASE_HIT, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, sSpellMgr, ProcEventInfoBuilder::WithDamageInfo(), ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), ProcEventInfoBuilder::WithSpellPhaseMask(), SpellProcEntryBuilder::WithSpellPhaseMask(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [16/27]

◆ TEST_F() [17/27]

TEST_F ( SpellProcIntegrationTest  ,
PeriodicDamageProc   
)
184{
185 // Note: PROC_FLAG_DONE_PERIODIC is in REQ_SPELL_PHASE_PROC_FLAG_MASK,
186 // so SpellPhaseMask must be set (can't be 0)
187 auto procEntry = SpellProcEntryBuilder()
191 .Build();
192
193 auto scenario = ProcScenarioBuilder()
195 .WithNormalHit();
196
197 EXPECT_PROC_TRIGGERS(procEntry, scenario);
198}
@ PROC_SPELL_TYPE_DAMAGE
Definition SpellMgr.h:239
@ PROC_FLAG_DONE_PERIODIC
Definition SpellMgr.h:137
ProcScenarioBuilder & OnPeriodicDamage()
Definition AuraScriptTestFramework.h:318

References SpellProcEntryBuilder::Build(), EXPECT_PROC_TRIGGERS, ProcScenarioBuilder::OnPeriodicDamage(), PROC_FLAG_DONE_PERIODIC, PROC_SPELL_PHASE_HIT, PROC_SPELL_TYPE_DAMAGE, ProcScenarioBuilder::WithNormalHit(), SpellProcEntryBuilder::WithProcFlags(), SpellProcEntryBuilder::WithSpellPhaseMask(), and SpellProcEntryBuilder::WithSpellTypeMask().

◆ TEST_F() [18/27]

◆ TEST_F() [19/27]

TEST_F ( SpellProcIntegrationTest  ,
SchoolMaskFilter_FireOnly_FireDamage   
)
443{
444 // Proc entry requires fire school damage
445 auto procEntry = SpellProcEntryBuilder()
449 .Build();
450
451 // Create fire spell and fire damage info
452 auto* fireSpell = CreateSpellInfo(133, 3, 0); // Fireball
453 DamageInfo fireDamageInfo(nullptr, nullptr, 100, fireSpell, SPELL_SCHOOL_MASK_FIRE, SPELL_DIRECT_DAMAGE);
454
455 auto eventInfo = ProcEventInfoBuilder()
460 .WithDamageInfo(&fireDamageInfo)
461 .Build();
462
463 // Fire damage should trigger fire-only proc
464 EXPECT_TRUE(sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo));
465}
ProcEventInfoBuilder & WithSpellTypeMask(uint32 spellTypeMask)
Definition ProcEventInfoHelper.h:63
SpellProcEntryBuilder & WithSchoolMask(uint32 schoolMask)
Definition ProcEventInfoHelper.h:148

References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG, PROC_HIT_NORMAL, PROC_SPELL_PHASE_HIT, PROC_SPELL_TYPE_DAMAGE, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, sSpellMgr, ProcEventInfoBuilder::WithDamageInfo(), ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), SpellProcEntryBuilder::WithSchoolMask(), ProcEventInfoBuilder::WithSpellPhaseMask(), SpellProcEntryBuilder::WithSpellPhaseMask(), ProcEventInfoBuilder::WithSpellTypeMask(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [20/27]

TEST_F ( SpellProcIntegrationTest  ,
SchoolMaskFilter_FireOnly_FrostDamage   
)
468{
469 // Proc entry requires fire school damage
470 auto procEntry = SpellProcEntryBuilder()
474 .Build();
475
476 // Create frost spell and frost damage info
477 auto* frostSpell = CreateSpellInfo(116, 3, 0); // Frostbolt
478 DamageInfo frostDamageInfo(nullptr, nullptr, 100, frostSpell, SPELL_SCHOOL_MASK_FROST, SPELL_DIRECT_DAMAGE);
479
480 auto eventInfo = ProcEventInfoBuilder()
485 .WithDamageInfo(&frostDamageInfo)
486 .Build();
487
488 // Frost damage should NOT trigger fire-only proc
489 EXPECT_FALSE(sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo));
490}
@ SPELL_SCHOOL_MASK_FROST
Definition SharedDefines.h:289

References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG, PROC_HIT_NORMAL, PROC_SPELL_PHASE_HIT, PROC_SPELL_TYPE_DAMAGE, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE, SPELL_SCHOOL_MASK_FROST, sSpellMgr, ProcEventInfoBuilder::WithDamageInfo(), ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), SpellProcEntryBuilder::WithSchoolMask(), ProcEventInfoBuilder::WithSpellPhaseMask(), SpellProcEntryBuilder::WithSpellPhaseMask(), ProcEventInfoBuilder::WithSpellTypeMask(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [21/27]

TEST_F ( SpellProcIntegrationTest  ,
SchoolMaskFilter_NoSchoolMask_AnySchoolTriggers   
)
493{
494 // Proc entry with no school mask filter (accepts all schools)
495 auto procEntry = SpellProcEntryBuilder()
497 .WithSchoolMask(0) // No filter
499 .Build();
500
501 // Test with shadow damage
502 auto* shadowSpell = CreateSpellInfo(686, 5, 0); // Shadow Bolt
503 DamageInfo shadowDamageInfo(nullptr, nullptr, 100, shadowSpell, SPELL_SCHOOL_MASK_SHADOW, SPELL_DIRECT_DAMAGE);
504
505 auto eventInfo = ProcEventInfoBuilder()
510 .WithDamageInfo(&shadowDamageInfo)
511 .Build();
512
513 // Any school should trigger when no school mask filter is set
514 EXPECT_TRUE(sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo));
515}
@ SPELL_SCHOOL_MASK_SHADOW
Definition SharedDefines.h:290

References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG, PROC_HIT_NORMAL, PROC_SPELL_PHASE_HIT, PROC_SPELL_TYPE_DAMAGE, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_SHADOW, sSpellMgr, ProcEventInfoBuilder::WithDamageInfo(), ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), SpellProcEntryBuilder::WithSchoolMask(), ProcEventInfoBuilder::WithSpellPhaseMask(), SpellProcEntryBuilder::WithSpellPhaseMask(), ProcEventInfoBuilder::WithSpellTypeMask(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [22/27]

TEST_F ( SpellProcIntegrationTest  ,
SpellDamageProc_OnCast   
)
117{
118 auto procEntry = SpellProcEntryBuilder()
121 .Build();
122
123 // Should trigger on cast phase
124 auto castScenario = ProcScenarioBuilder()
126 .OnCast();
127 EXPECT_PROC_TRIGGERS(procEntry, castScenario);
128
129 // Should NOT trigger on hit phase when configured for cast only
130 auto hitScenario = ProcScenarioBuilder()
132 .OnHit();
133 EXPECT_PROC_DOES_NOT_TRIGGER(procEntry, hitScenario);
134}
@ PROC_SPELL_PHASE_CAST
Definition SpellMgr.h:248
ProcScenarioBuilder & OnSpellDamage()
Definition AuraScriptTestFramework.h:282
ProcScenarioBuilder & OnCast()
Definition AuraScriptTestFramework.h:403

References SpellProcEntryBuilder::Build(), EXPECT_PROC_DOES_NOT_TRIGGER, EXPECT_PROC_TRIGGERS, ProcScenarioBuilder::OnCast(), ProcScenarioBuilder::OnHit(), ProcScenarioBuilder::OnSpellDamage(), PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG, PROC_SPELL_PHASE_CAST, SpellProcEntryBuilder::WithProcFlags(), and SpellProcEntryBuilder::WithSpellPhaseMask().

◆ TEST_F() [23/27]

◆ TEST_F() [24/27]

TEST_F ( SpellProcIntegrationTest  ,
SpellFamilyMatch_DifferentFamily   
)
344{
345 // Create a Warrior spell (family 4)
346 auto* triggerSpell = CreateSpellInfo(6343, 4, 0x00000001); // Thunder Clap
347
348 auto procEntry = SpellProcEntryBuilder()
349 .WithSpellFamilyName(3) // SPELLFAMILY_MAGE - should NOT match
350 .WithSpellFamilyMask(flag96(0x00000001, 0, 0))
351 .Build();
352
353 EXPECT_FALSE(TestSpellFamilyMatch(procEntry.SpellFamilyName, procEntry.SpellFamilyMask, triggerSpell));
354}
SpellProcEntryBuilder & WithSpellFamilyMask(flag96 familyMask)
Definition ProcEventInfoHelper.h:160
SpellProcEntryBuilder & WithSpellFamilyName(uint32 familyName)
Definition ProcEventInfoHelper.h:154
Definition Util.h:442

References SpellProcEntryBuilder::Build(), SpellProcEntryBuilder::WithSpellFamilyMask(), and SpellProcEntryBuilder::WithSpellFamilyName().

◆ TEST_F() [25/27]

TEST_F ( SpellProcIntegrationTest  ,
SpellFamilyMatch_FlagMismatch   
)
370{
371 // Create a Mage spell with specific flags
372 auto* triggerSpell = CreateSpellInfo(133, 3, 0x00000001); // Fireball flag
373
374 auto procEntry = SpellProcEntryBuilder()
375 .WithSpellFamilyName(3) // SPELLFAMILY_MAGE
376 .WithSpellFamilyMask(flag96(0x00000002, 0, 0)) // Different flag
377 .Build();
378
379 EXPECT_FALSE(TestSpellFamilyMatch(procEntry.SpellFamilyName, procEntry.SpellFamilyMask, triggerSpell));
380}

References SpellProcEntryBuilder::Build(), SpellProcEntryBuilder::WithSpellFamilyMask(), and SpellProcEntryBuilder::WithSpellFamilyName().

◆ TEST_F() [26/27]

TEST_F ( SpellProcIntegrationTest  ,
SpellFamilyMatch_NoFamilyFilter   
)
357{
358 // Create any spell
359 auto* triggerSpell = CreateSpellInfo(133, 3, 0x00000001);
360
361 // Proc with no family filter should match any spell
362 auto procEntry = SpellProcEntryBuilder()
363 .WithSpellFamilyName(0) // No family filter
364 .Build();
365
366 EXPECT_TRUE(TestSpellFamilyMatch(procEntry.SpellFamilyName, procEntry.SpellFamilyMask, triggerSpell));
367}

References SpellProcEntryBuilder::Build(), and SpellProcEntryBuilder::WithSpellFamilyName().

◆ TEST_F() [27/27]

TEST_F ( SpellProcIntegrationTest  ,
SpellFamilyMatch_SameFamily   
)
329{
330 // Create a Mage spell (family 3)
331 auto* triggerSpell = CreateSpellInfo(133, 3, 0x00000001); // Fireball
332
333 auto procEntry = SpellProcEntryBuilder()
335 .WithSpellFamilyName(3) // SPELLFAMILY_MAGE
336 .WithSpellFamilyMask(flag96(0x00000001, 0, 0))
337 .Build();
338
339 // Test family match logic
340 EXPECT_TRUE(TestSpellFamilyMatch(procEntry.SpellFamilyName, procEntry.SpellFamilyMask, triggerSpell));
341}

References SpellProcEntryBuilder::Build(), PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG, SpellProcEntryBuilder::WithProcFlags(), SpellProcEntryBuilder::WithSpellFamilyMask(), and SpellProcEntryBuilder::WithSpellFamilyName().