/
SpellCM.diff
2868 lines (2718 loc) · 149 KB
/
SpellCM.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Index: MaNGOS/src/game/SpellEffects.cpp
===================================================================
--- MaNGOS/src/game/SpellEffects.cpp (revision 1363)
+++ MaNGOS/src/game/SpellEffects.cpp (working copy)
@@ -306,7 +306,7 @@
{
if( unitTarget && unitTarget->isAlive())
{
- switch(m_spellInfo->SpellFamilyName)
+ switch(m_spellInfo->SpellClass)
{
case SPELLFAMILY_GENERIC:
{
@@ -357,7 +357,7 @@
case SPELLFAMILY_MAGE:
{
// Arcane Blast
- if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x20000000))
+ if (m_spellInfo->SpellClassMask.bits(CF_MAGE_ARCANE_BLAST))
{
m_caster->CastSpell(m_caster, 36032, true);
}
@@ -366,27 +366,27 @@
case SPELLFAMILY_WARRIOR:
{
// Bloodthirst
- if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x40000000000))
+ if (m_spellInfo->SpellClassMask.bits(CF_WARRIOR_BLOODTHIRST))
{
damage = uint32(damage * (m_caster->GetTotalAttackPowerValue(BASE_ATTACK)) / 100);
}
// Shield Slam
- else if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000020000000000)) && m_spellInfo->Category==1209)
+ else if ((m_spellInfo->SpellClassMask.bits(CF_WARRIOR_SHIELD_SLAM)) && m_spellInfo->Category==1209)
damage += int32(m_caster->GetShieldBlockValue());
// Victory Rush
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x10000000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_WARRIOR_VICTORY_RUSH))
{
damage = uint32(damage * m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
m_caster->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH, false);
}
// Revenge ${$m1+$AP*0.207} to ${$M1+$AP*0.207}
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000400))
+ else if (m_spellInfo->SpellClassMask.bits(CF_WARRIOR_REVENGE))
damage+= uint32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.207f);
// Heroic Throw ${$m1+$AP*.50}
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000100000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_WARRIOR_HEROIC_THROW))
damage+= uint32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.5f);
// Shockwave ${$m3/100*$AP}
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000800000000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_WARRIOR_SHOCKWAVE))
{
int32 pct = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget);
if (pct > 0)
@@ -394,7 +394,7 @@
break;
}
// Thunder Clap
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000080))
+ else if (m_spellInfo->SpellClassMask.bits(CF_WARRIOR_THUNDER_CLAP))
{
damage+=int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 12 / 100);
}
@@ -403,7 +403,7 @@
case SPELLFAMILY_WARLOCK:
{
// Incinerate Rank 1 & 2
- if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x00004000000000)) && m_spellInfo->SpellIconID==2128)
+ if ((m_spellInfo->SpellClassMask.bits(CF_WARLOCK_INCINERATE)) && m_spellInfo->SpellIconID==2128)
{
// Incinerate does more dmg (dmg*0.25) if the target have Immolate debuff.
// Check aura state for speed but aura state set not only for Immolate spell
@@ -413,8 +413,8 @@
for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
{
// Immolate
- if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK &&
- ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x00000000000004)))
+ if((*i)->GetSpellProto()->SpellClass == SPELLFAMILY_WARLOCK &&
+ ((*i)->GetSpellProto()->SpellClassMask.bits(CF_WARLOCK_IMMOLATE)))
{
damage += damage/4;
break;
@@ -423,7 +423,7 @@
}
}
// Shadowflame
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0001000000000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_WARLOCK_SHADOWFLAME1))
{
// Apply DOT part
switch(m_spellInfo->Id)
@@ -444,19 +444,19 @@
for(Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
{
// for caster applied auras only
- if ((*i)->GetSpellProto()->SpellFamilyName != SPELLFAMILY_WARLOCK ||
+ if ((*i)->GetSpellProto()->SpellClass != SPELLFAMILY_WARLOCK ||
(*i)->GetCasterGUID()!=m_caster->GetGUID())
continue;
// Immolate
- if ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004))
+ if ((*i)->GetSpellProto()->SpellClassMask.bits(CF_WARLOCK_IMMOLATE))
{
aura = *i; // it selected always if exist
break;
}
// Shadowflame
- if ((*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002)
+ if ((*i)->GetSpellProto()->SpellClassMask.bits(CF_WARLOCK_SHADOWFLAME2))
aura = *i; // remember but wait possible Immolate as primary priority
}
@@ -477,14 +477,14 @@
case SPELLFAMILY_PRIEST:
{
// Shadow Word: Death - deals damage equal to damage done to caster
- if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000200000000))
+ if (m_spellInfo->SpellClassMask.bits(CF_PRIEST_SHADOW_WORD_DEATH_TARGET))
m_caster->CastCustomSpell(m_caster, 32409, &damage, 0, 0, true);
break;
}
case SPELLFAMILY_DRUID:
{
// Ferocious Bite
- if (m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x000800000)) && m_spellInfo->SpellVisual[0]==6587)
+ if (m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellClassMask.bits(CF_DRUID_RIP_BITE)) && m_spellInfo->SpellVisual[0]==6587)
{
// converts each extra point of energy into ($f1+$AP/410) additional damage
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
@@ -504,13 +504,13 @@
damage += int32(damage * 0.03f);
}
// Rake
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000001000) && m_spellInfo->Effect[2]==SPELL_EFFECT_ADD_COMBO_POINTS)
+ else if (m_spellInfo->SpellClassMask.bits(CF_DRUID_RAKE_CLAW) && m_spellInfo->Effect[2]==SPELL_EFFECT_ADD_COMBO_POINTS)
{
// $AP*0.01 bonus
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
}
// Swipe
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0010000000000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_DRUID_SWIPE))
{
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.08f);
if(m_caster->HasAura(16949)) //Feral Instinct Rank 3
@@ -526,7 +526,7 @@
case SPELLFAMILY_ROGUE:
{
// Envenom
- if (m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x800000000)))
+ if (m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellClassMask.bits(CF_ROGUE_ENVENOM)))
{
// consume from stack dozes not more that have combo-points
if(uint32 combo = ((Player*)m_caster)->GetComboPoints())
@@ -535,8 +535,8 @@
// Lookup for Deadly poison (only attacker applied)
Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
- if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE &&
- ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x10000)) &&
+ if( (*itr)->GetSpellProto()->SpellClass==SPELLFAMILY_ROGUE &&
+ ((*itr)->GetSpellProto()->SpellClassMask.bits(CF_ROGUE_DEADLY_POISON)) &&
(*itr)->GetCasterGUID()==m_caster->GetGUID() )
{
poison = *itr;
@@ -560,7 +560,7 @@
}
}
// Eviscerate
- else if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x00020000)) && m_caster->GetTypeId()==TYPEID_PLAYER)
+ else if ((m_spellInfo->SpellClassMask.bits(CF_ROGUE_EVISCERATE)) && m_caster->GetTypeId()==TYPEID_PLAYER)
{
if(uint32 combo = ((Player*)m_caster)->GetComboPoints())
{
@@ -573,17 +573,17 @@
}
}
// Gouge
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000008))
+ else if (m_spellInfo->SpellClassMask.bits(CF_ROGUE_GOUGE))
{
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.21f);
}
// Instant Poison
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000002000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_ROGUE_INSTANT_POISON))
{
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.10f);
}
// Wound Poison
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000010000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_ROGUE_WOUND_POISON))
{
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.04f);
}
@@ -597,28 +597,28 @@
damage+= rand()%2 ? damage : 0;
}
// Mongoose Bite
- else if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x000000002)) && m_spellInfo->SpellVisual[0]==342)
+ else if ((m_spellInfo->SpellClassMask.bits(CF_HUNTER_MELEE_COMBAT)) && m_spellInfo->SpellVisual[0]==342)
{
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
}
// Counterattack
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0008000000000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_HUNTER_COUNTERATTACK))
{
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
}
// Arcane Shot
- else if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000800)) && m_spellInfo->maxLevel > 0)
+ else if ((m_spellInfo->SpellClassMask.bits(CF_HUNTER_ARCANE_SHOT)) && m_spellInfo->maxLevel > 0)
{
damage += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.15f);
}
// Steady Shot
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x100000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_HUNTER_STEADY_SHOT))
{
int32 base = irand((int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MINDAMAGE),(int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MAXDAMAGE));
damage += int32(float(base)/m_caster->GetAttackTime(RANGED_ATTACK)*2800 + m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.2f);
}
// Explosive Trap Effect
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000004))
+ else if (m_spellInfo->SpellClassMask.bits(CF_HUNTER_FIRE_TRAP_EFFECTS))
{
damage += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.1f);
}
@@ -627,7 +627,7 @@
case SPELLFAMILY_PALADIN:
{
// Judgement of Vengeance ${1+0.22*$SPH+0.14*$AP} + 10% for each application of Holy Vengeance on the target
- if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x800000000)) && m_spellInfo->SpellIconID==2292)
+ if ((m_spellInfo->SpellClassMask.bits(CF_PALADIN_JUDGEMENT_OF_CORRUPT_VENG)) && m_spellInfo->SpellIconID==2292)
{
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) +
@@ -647,7 +647,7 @@
damage += damage * stacks * 10 /100;
}
// Avenger's Shield ($m1+0.07*$SPH+0.07*$AP) - ranged sdb for future
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_PALADIN_AVENGERS_SHIELD))
{
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) +
@@ -655,7 +655,7 @@
damage += int32(ap * 0.07f) + int32(holy * 7 / 100);
}
// Hammer of Wrath ($m1+0.15*$SPH+0.15*$AP) - ranged type sdb future fix
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000008000000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_PALADIN_HAMMER_OF_WRATH))
{
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) +
@@ -663,7 +663,7 @@
damage += int32(ap * 0.15f) + int32(holy * 15 / 100);
}
// Hammer of the Righteous
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0004000000000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_PALADIN_HAMMER_OF_THE_RIGHTEOUS))
{
// Add main hand dps * effect[2] amount
float average = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2;
@@ -671,7 +671,7 @@
damage += count * int32(average * IN_MILISECONDS) / m_caster->GetAttackTime(BASE_ATTACK);
}
// Shield of Righteousness
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0010000000000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_PALADIN_SHIELD_OF_RIGHTEOUSNESS))
{
damage+=int32(m_caster->GetShieldBlockValue());
}
@@ -690,7 +690,7 @@
return;
// selection by spell family
- switch(m_spellInfo->SpellFamilyName)
+ switch(m_spellInfo->SpellClass)
{
case SPELLFAMILY_GENERIC:
{
@@ -1298,7 +1298,7 @@
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
- if( spellInfo->SpellFamilyName == SPELLFAMILY_MAGE &&
+ if( spellInfo->SpellClass == SPELLFAMILY_MAGE &&
(GetSpellSchoolMask(spellInfo) & SPELL_SCHOOL_MASK_FROST) &&
spellInfo->Id != 11958 && GetSpellRecoveryTime(spellInfo) > 0 )
{
@@ -1330,14 +1330,14 @@
break;
case SPELLFAMILY_WARRIOR:
// Charge
- if((m_spellInfo->SpellFamilyFlags & UI64LIT(0x1)) && m_spellInfo->SpellVisual[0] == 867)
+ if((m_spellInfo->SpellClassMask.bits(CF_WARRIOR_CHARGE)) && m_spellInfo->SpellVisual[0] == 867)
{
int32 chargeBasePoints0 = damage;
m_caster->CastCustomSpell(m_caster, 34846, &chargeBasePoints0, NULL, NULL, true);
return;
}
// Execute
- if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x20000000))
+ if(m_spellInfo->SpellClassMask.bits(CF_WARRIOR_EXECUTE))
{
if(!unitTarget)
return;
@@ -1354,7 +1354,7 @@
return;
}
// Slam
- if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000200000))
+ if(m_spellInfo->SpellClassMask.bits(CF_WARRIOR_SLAM))
{
if(!unitTarget)
return;
@@ -1363,7 +1363,7 @@
return;
}
// Concussion Blow
- if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000004000000))
+ if(m_spellInfo->SpellClassMask.bits(CF_WARRIOR_CONCUSSION_BLOW))
{
m_damage+= uint32(damage * m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
return;
@@ -1395,7 +1395,7 @@
break;
case SPELLFAMILY_WARLOCK:
// Life Tap
- if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000040000))
+ if (m_spellInfo->SpellClassMask.bits(CF_WARLOCK_LIFE_TAP))
{
// In 303 exist spirit depend
uint32 spirit = uint32(m_caster->GetStat(STAT_SPIRIT));
@@ -1425,7 +1425,7 @@
Unit::AuraList const& auraDummy = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = auraDummy.begin(); itr != auraDummy.end(); ++itr)
{
- if((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 208)
+ if((*itr)->GetSpellProto()->SpellClass==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 208)
mana = ((*itr)->GetModifier()->m_amount + 100)* mana / 100;
}
m_caster->CastCustomSpell(unitTarget, 31818, &mana, NULL, NULL, true);
@@ -1435,7 +1435,7 @@
Unit::AuraList const& mod = m_caster->GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER);
for(Unit::AuraList::const_iterator itr = mod.begin(); itr != mod.end(); ++itr)
{
- if((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 1982)
+ if((*itr)->GetSpellProto()->SpellClass==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 1982)
manaFeedVal+= (*itr)->GetModifier()->m_amount;
}
if(manaFeedVal > 0)
@@ -1461,7 +1461,7 @@
break;
case SPELLFAMILY_PRIEST:
// Penance
- if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0080000000000000))
+ if (m_spellInfo->SpellClassMask.bits(CF_PRIEST_PENANCE_BASE))
{
if (!unitTarget)
return;
@@ -1487,7 +1487,7 @@
break;
case SPELLFAMILY_DRUID:
// Starfall
- if (m_spellInfo->SpellFamilyFlags2 & UI64LIT(0x00000100))
+ if (m_spellInfo->SpellClassMask.bits(CF_DRUID_STARFALL2))
{
//Shapeshifting into an animal form or mounting cancels the effect.
if(m_caster->GetCreatureType() == CREATURE_TYPE_BEAST || m_caster->IsMounted())
@@ -1562,7 +1562,7 @@
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
- if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && (spellInfo->SpellFamilyFlags & UI64LIT(0x0000024000000860)))
+ if (spellInfo->SpellClass == SPELLFAMILY_ROGUE && (spellInfo->SpellClassMask & SpellCM(CM0_ROGUE_EVASION & CM0_ROGUE_SPRINT & CM0_ROGUE_VANISH, CM1_ROGUE_COLD_BLOOD & CM1_ROGUE_SHADOWSTEP, 0)))
((Player*)m_caster)->RemoveSpellCooldown((itr++)->first,true);
else
++itr;
@@ -1578,7 +1578,7 @@
break;
case SPELLFAMILY_HUNTER:
// Steady Shot
- if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x100000000))
+ if(m_spellInfo->SpellClassMask.bits(CF_HUNTER_STEADY_SHOT))
{
if( !unitTarget || !unitTarget->isAlive())
return;
@@ -1614,7 +1614,7 @@
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
- if (spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && spellInfo->Id != 23989 && GetSpellRecoveryTime(spellInfo) > 0 )
+ if (spellInfo->SpellClass == SPELLFAMILY_HUNTER && spellInfo->Id != 23989 && GetSpellRecoveryTime(spellInfo) > 0 )
((Player*)m_caster)->RemoveSpellCooldown((itr++)->first,true);
else
++itr;
@@ -1699,8 +1699,7 @@
mod->value = -50;
mod->type = SPELLMOD_PCT;
mod->spellId = m_spellInfo->Id;
- mod->mask = UI64LIT(0x0000020000000000);
- mod->mask2= UI64LIT(0x0);
+ mod->mask = SpellCM(0, CM1_PALADIN_JUDGEMENT_OF_COMMAND, 0);
((Player*)m_caster)->AddSpellMod(mod, true);
m_caster->CastSpell(unitTarget, spell_proto, true, NULL);
@@ -1781,7 +1780,7 @@
break;
case SPELLFAMILY_SHAMAN:
// Rockbiter Weapon
- if (m_spellInfo->SpellFamilyFlags & 0x400000)
+ if (m_spellInfo->SpellClassMask.bits(CF_SHAMAN_ROCKBITER_WEAPON))
{
// TODO: use expect spell for enchant (if exist talent)
// In 3.0.3 no mods present for rockbiter
@@ -1830,19 +1829,19 @@
return;
}
// Cleansing Totem
- if((m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000004000000)) && m_spellInfo->SpellIconID==1673)
+ if((m_spellInfo->SpellClassMask.bits(CF_SHAMAN_MISC_TOTEM_EFFECTS)) && m_spellInfo->SpellIconID==1673)
{
m_caster->CastSpell(unitTarget, 52025, true);
return;
}
// Healing Stream Totem
- if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000002000))
+ if(m_spellInfo->SpellClassMask.bits(CF_SHAMAN_HEALING_STREAM))
{
m_caster->CastCustomSpell(unitTarget, 52042, &damage, 0, 0, true, 0, 0, m_originalCasterGUID);
return;
}
// Mana Spring Totem
- if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000))
+ if(m_spellInfo->SpellClassMask.bits(CF_SHAMAN_MANA_SPRING))
{
if(unitTarget->getPowerType()!=POWER_MANA)
return;
@@ -1863,7 +1862,7 @@
return;
}
// Lava Lash
- if (m_spellInfo->SpellFamilyFlags2 & 0x00000004)
+ if (m_spellInfo->SpellClassMask.bits(CF_SHAMAN_LAVA_LASH))
{
if (m_caster->GetTypeId()!=TYPEID_PLAYER)
return;
@@ -1874,8 +1873,8 @@
Unit::AuraList const& auraDummy = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = auraDummy.begin(); itr != auraDummy.end(); ++itr)
{
- if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_SHAMAN &&
- ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000200000)) &&
+ if( (*itr)->GetSpellProto()->SpellClass==SPELLFAMILY_SHAMAN &&
+ ((*itr)->GetSpellProto()->SpellClassMask.bits(CF_SHAMAN_FLAMETONGUE_WEAPON)) &&
(*itr)->GetCastItemGUID() == item->GetGUID())
{
m_damage += m_damage * damage / 100;
@@ -1888,7 +1887,7 @@
break;
case SPELLFAMILY_DEATHKNIGHT:
// Death Coil
- if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x002000))
+ if(m_spellInfo->SpellClassMask.bits(CF_DEATHKNIGHT_DEATH_COIL))
{
if(m_caster->IsFriendlyTo(unitTarget))
{
@@ -1906,7 +1905,7 @@
return;
}
// Hungering Cold
- else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000100000000000))
+ else if (m_spellInfo->SpellClassMask.bits(CF_DEATHKNIGHT_UNK44))
{
m_caster->CastSpell(m_caster, 51209, true);
return;
@@ -2087,7 +2086,7 @@
if (!spellInfo)
continue;
- if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && spellInfo->SpellFamilyFlags & SPELLFAMILYFLAG_ROGUE_STEALTH)
+ if (spellInfo->SpellClass == SPELLFAMILY_ROGUE && spellInfo->SpellClassMask.bits(CF_ROGUE_STEALTH))
{
spellId = spellInfo->Id;
break;
@@ -2512,7 +2511,7 @@
return;
// Prayer of Mending (jump animation), we need formal caster instead original for correct animation
- if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x00002000000000)))
+ if( m_spellInfo->SpellClass == SPELLFAMILY_PRIEST && (m_spellInfo->SpellClassMask.bits(CF_PRIEST_PRAYER_OF_MENDING)))
m_caster->CastSpell(unitTarget, 41637, true, NULL, Aur, m_originalCasterGUID);
}
@@ -2666,9 +2665,8 @@
Aura *targetAura = NULL;
for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
{
- if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID &&
- // Regrowth or Rejuvenation 0x40 | 0x10
- ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000050)))
+ if((*i)->GetSpellProto()->SpellClass == SPELLFAMILY_DRUID
+ && ((*i)->GetSpellProto()->SpellClassMask & SpellCM(CM0_DRUID_REGROWTH & CM0_DRUID_REJUVENATION, 0, 0)) )
{
if(!targetAura || (*i)->GetAuraDuration() < targetAura->GetAuraDuration())
targetAura = *i;
@@ -2791,7 +2789,7 @@
uint32 num_to_add;
// TODO: maybe all this can be replaced by using correct calculated `damage` value
- if(pProto->Class != ITEM_CLASS_CONSUMABLE || m_spellInfo->SpellFamilyName != SPELLFAMILY_MAGE)
+ if(pProto->Class != ITEM_CLASS_CONSUMABLE || m_spellInfo->SpellClass != SPELLFAMILY_MAGE)
{
int32 basePoints = m_currentBasePoints[i];
int32 randomPoints = m_spellInfo->EffectDieSides[i];
@@ -3639,7 +3637,7 @@
// On succes dispel
// Devour Magic
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == SPELLCATEGORY_DEVOUR_MAGIC)
+ if (m_spellInfo->SpellClass == SPELLFAMILY_WARLOCK && m_spellInfo->Category == SPELLCATEGORY_DEVOUR_MAGIC)
{
uint32 heal_spell = 0;
switch (m_spellInfo->Id)
@@ -4197,10 +4195,10 @@
if(m_spellInfo->Id == 38615)
duration = 1800; // 30 mins
// other rogue family enchantments always 1 hour (some have spell damage=0, but some have wrong data in EffBasePoints)
- else if(m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE)
+ else if(m_spellInfo->SpellClass == SPELLFAMILY_ROGUE)
duration = 3600; // 1 hour
// shaman family enchantments
- else if(m_spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN)
+ else if(m_spellInfo->SpellClass == SPELLFAMILY_SHAMAN)
duration = 1800; // 30 mins
// other cases with this SpellVisual already selected
else if(m_spellInfo->SpellVisual[0] == 215)
@@ -4543,12 +4541,12 @@
bool normalized = false;
int32 spell_bonus = 0; // bonus specific for spell
- switch(m_spellInfo->SpellFamilyName)
+ switch(m_spellInfo->SpellClass)
{
case SPELLFAMILY_WARRIOR:
{
// Whirlwind, single only spell with 2 weapon white damage apply if have
- if(m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000400000000)))
+ if(m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellClassMask.bits(CF_WARRIOR_WHIRLWIND)))
{
if(((Player*)m_caster)->GetWeaponForAttack(OFF_ATTACK,true))
spell_bonus += m_caster->CalculateDamage (OFF_ATTACK, normalized);
@@ -4563,8 +4561,8 @@
for(Unit::AuraMap::iterator itr = suAuras.begin(); itr != suAuras.end(); ++itr)
{
spellInfo = (*itr).second->GetSpellProto();
- if( spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR &&
- (spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000)) &&
+ if( spellInfo->SpellClass == SPELLFAMILY_WARRIOR &&
+ (spellInfo->SpellClassMask.bits(CF_WARRIOR_SUNDER_ARMOR)) &&
(*itr).second->GetCasterGUID() == m_caster->GetGUID())
{
(*itr).second->RefreshAura();
@@ -4584,7 +4582,7 @@
case SPELLFAMILY_ROGUE:
{
// Mutilate (for each hand)
- if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x600000000))
+ if(m_spellInfo->SpellClassMask & SpellCM(0, CM1_ROGUE_MUTILATE1 & CM1_ROGUE_MUTILATE2, 0))
{
bool found = false;
// fast check
@@ -4612,7 +4610,7 @@
case SPELLFAMILY_PALADIN:
{
// Seal of Command - receive benefit from Spell Damage and Healing
- if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000002000000))
+ if(m_spellInfo->SpellClassMask.bits(CF_PALADIN_SEAL_OF_COMMAND))
{
spellBonusNeedWeaponDamagePercentMod = true;// apply weaponDamagePercentMod to spell_bonus (and then to all bonus, fixes and weapon already have applied)
spell_bonus += int32(0.23f*m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)));
@@ -4624,7 +4622,7 @@
{
// Skyshatter Harness item set bonus
// Stormstrike
- if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x001000000000))
+ if(m_spellInfo->SpellClassMask.bits(CF_SHAMAN_STORMSTRIKE1))
{
Unit::AuraList const& m_OverrideClassScript = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(Unit::AuraList::const_iterator citr = m_OverrideClassScript.begin(); citr != m_OverrideClassScript.end(); ++citr)
@@ -4701,14 +4699,14 @@
m_damage+= eff_damage;
// Hemorrhage
- if (m_spellInfo->SpellFamilyName==SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x2000000)))
+ if (m_spellInfo->SpellClass==SPELLFAMILY_ROGUE && (m_spellInfo->SpellClassMask.bits(CF_ROGUE_HEMORRHAGE)))
{
if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget, 1);
}
// Mangle (Cat): CP
- if (m_spellInfo->SpellFamilyName==SPELLFAMILY_DRUID && (m_spellInfo->SpellFamilyFlags==UI64LIT(0x0000040000000000)))
+ if (m_spellInfo->SpellClass==SPELLFAMILY_DRUID && (m_spellInfo->SpellClassMask.bits(CF_DRUID_MANGLE_CAT)))
{
if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget, 1);
@@ -4880,7 +4878,7 @@
{
// TODO: we must implement hunter pet summon at login there (spell 6962)
- switch(m_spellInfo->SpellFamilyName)
+ switch(m_spellInfo->SpellClass)
{
case SPELLFAMILY_GENERIC:
{
@@ -5269,8 +5267,8 @@
for(Unit::AuraMap::iterator itr = suAuras.begin(); itr != suAuras.end(); ++itr)
{
SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
- if(spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK &&
- (spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000002)) &&
+ if(spellInfo->SpellClass == SPELLFAMILY_WARLOCK &&
+ (spellInfo->SpellClassMask.bits(CF_WARLOCK_CORRUPTION)) &&
(*itr).second->GetCasterGUID()==m_caster->GetGUID())
(*itr).second->RefreshAura();
}
@@ -5309,8 +5307,8 @@
for(Unit::AuraMap::iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
- if (spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST &&
- (spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000008000)) &&
+ if (spellInfo->SpellClass == SPELLFAMILY_PRIEST &&
+ (spellInfo->SpellClassMask.bits(CF_PRIEST_SHADOW_WORD_PAIN)) &&
(*itr).second->GetCasterGUID() == m_caster->GetGUID())
{
(*itr).second->RefreshAura();
@@ -5340,26 +5338,26 @@
if (aura->GetCasterGUID() != m_caster->GetGUID())
continue;
// Search only Serpent Sting, Viper Sting, Scorpid Sting auras
- uint64 familyFlag = aura->GetSpellProto()->SpellFamilyFlags;
- if (!(familyFlag & UI64LIT(0x000000800000C000)))
+ SpellCM classMask = aura->GetSpellProto()->SpellClassMask;
+ if (!(classMask & SpellCM(CM0_HUNTER_SERPENT_STING & CM0_HUNTER_SCORPID_STING, CM1_HUNTER_VIPER_STING, 0)))
continue;
// Refresh aura duration
aura->RefreshAura();
// Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
- if ((familyFlag & UI64LIT(0x0000000000004000)) && aura->GetEffIndex() == 0)
+ if (classMask.bits(CF_HUNTER_SERPENT_STING) && aura->GetEffIndex() == 0)
{
spellId = 53353; // 53353 Chimera Shot - Serpent
basePoint = aura->GetModifier()->m_amount * 5 * 40 / 100;
}
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
- if ((familyFlag & UI64LIT(0x0000008000000000)) && aura->GetEffIndex() == 0)
+ if (classMask.bits(CF_HUNTER_VIPER_STING) && aura->GetEffIndex() == 0)
{
spellId = 53358; // 53358 Chimera Shot - Viper
basePoint = aura->GetModifier()->m_amount * 4 * 60 / 100;
}
// Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
- if (familyFlag & UI64LIT(0x0000000000008000))
+ if (classMask.bits(CF_HUNTER_SCORPID_STING))
spellId = 53359; // 53359 Chimera Shot - Scorpid
// ?? nothing say in spell desc (possibly need addition check)
//if ((familyFlag & UI64LIT(0x0000010000000000)) || // dot
@@ -5380,7 +5378,7 @@
case SPELLFAMILY_PALADIN:
{
// Judgement
- if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000800000))
+ if (m_spellInfo->SpellClassMask.bits(CF_PALADIN_JUDGEMENT_ACTIVATE))
{
if(!unitTarget || !unitTarget->isAlive())
return;
@@ -5486,7 +5484,7 @@
unitTarget->CombatStop();
unitTarget->getHostilRefManager().deleteReferences(); // stop all fighting
// Vanish allows to remove all threat and cast regular stealth so other spells can be used
- if(m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags & SPELLFAMILYFLAG_ROGUE_VANISH))
+ if(m_spellInfo->SpellClass == SPELLFAMILY_ROGUE && m_spellInfo->SpellClassMask.bits(CF_ROGUE_VANISH))
{
((Player *)m_caster)->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
}
Index: MaNGOS/src/game/Level3.cpp
===================================================================
--- MaNGOS/src/game/Level3.cpp (revision 1363)
+++ MaNGOS/src/game/Level3.cpp (working copy)
@@ -1814,7 +1814,7 @@
continue;
// skip other spell families
- if( spellInfo->SpellFamilyName != family)
+ if( spellInfo->SpellClass != family)
continue;
// skip spells with first rank learned as talent (and all talents then also)
Index: MaNGOS/src/game/DBCStructure.h
===================================================================
--- MaNGOS/src/game/DBCStructure.h (revision 1363)
+++ MaNGOS/src/game/DBCStructure.h (working copy)
@@ -21,6 +21,7 @@
#include "DBCEnums.h"
#include "Platform/Define.h"
+#include "SpellClassMask.h"
#include <map>
#include <set>
@@ -1361,9 +1362,9 @@
int32 EffectMiscValueB[3]; // 116-118 m_effectMiscValueB
uint32 EffectTriggerSpell[3]; // 119-121 m_effectTriggerSpell
float EffectPointsPerComboPoint[3]; // 122-124 m_effectPointsPerCombo
- uint32 EffectSpellClassMaskA[3]; // 125-127 m_effectSpellClassMaskA
- uint32 EffectSpellClassMaskB[3]; // 128-130 m_effectSpellClassMaskB
- uint32 EffectSpellClassMaskC[3]; // 131-133 m_effectSpellClassMaskC
+ SpellCM EffectSpellClassMaskA; // 125-127 m_effectSpellClassMaskA
+ SpellCM EffectSpellClassMaskB; // 128-130 m_effectSpellClassMaskB
+ SpellCM EffectSpellClassMaskC; // 131-133 m_effectSpellClassMaskC
uint32 SpellVisual[2]; // 134-135 m_spellVisualID
uint32 SpellIconID; // 136 m_spellIconID
uint32 activeIconID; // 137 m_activeIconID
@@ -1380,9 +1381,8 @@
uint32 StartRecoveryCategory; // 208 m_startRecoveryCategory
uint32 StartRecoveryTime; // 209 m_startRecoveryTime
uint32 MaxTargetLevel; // 210 m_maxTargetLevel
- uint32 SpellFamilyName; // 211 m_spellClassSet
- uint64 SpellFamilyFlags; // 212-213 m_spellClassMask NOTE: size is 12 bytes!!!
- uint32 SpellFamilyFlags2; // 214 addition to m_spellClassMask
+ uint32 SpellClass; // 211 m_spellClassSet
+ SpellCM SpellClassMask; // 212-214 m_spellClassMask NOTE: size is 12 bytes!!!
uint32 MaxAffectedTargets; // 215 m_maxTargets
uint32 DmgClass; // 216 m_defenseType
uint32 PreventionType; // 217 m_preventionType
Index: MaNGOS/src/game/Unit.h
===================================================================
--- MaNGOS/src/game/Unit.h (revision 1363)
+++ MaNGOS/src/game/Unit.h (working copy)
@@ -1361,7 +1361,7 @@
uint8 GetVisibleAurasCount() { return m_visibleAuras.size(); }
Aura* GetAura(uint32 spellId, uint32 effindex);
- Aura* GetAura(AuraType type, uint32 family, uint64 familyFlag, uint32 familyFlag2 = 0, uint64 casterGUID = 0);
+ Aura* GetAura(AuraType type, uint32 spClass, SpellCM classMask, uint64 casterGUID = 0);
AuraMap & GetAuras() { return m_Auras; }
AuraMap const& GetAuras() const { return m_Auras; }
Index: MaNGOS/src/game/SpellAuras.h
===================================================================
--- MaNGOS/src/game/SpellAuras.h (revision 1363)
+++ MaNGOS/src/game/SpellAuras.h (working copy)
@@ -322,7 +322,19 @@
void PeriodicTick();
void PeriodicDummyTick();
- uint32 const *getAuraSpellClassMask() const { return m_spellProto->EffectSpellClassMaskA + m_effIndex * 3; }
+ const SpellCM getAuraSpellClassMask() const {
+ switch (m_effIndex) {
+ case 0:
+ return m_spellProto->EffectSpellClassMaskA;
+ break;
+ case 1:
+ return m_spellProto->EffectSpellClassMaskB;
+ break;
+ case 2:
+ return m_spellProto->EffectSpellClassMaskC;
+ break;
+ }
+ }
bool isAffectedOnSpell(SpellEntry const *spell) const;
protected:
Aura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
Index: MaNGOS/src/game/SpellAuras.cpp
===================================================================
--- MaNGOS/src/game/SpellAuras.cpp (revision 1363)
+++ MaNGOS/src/game/SpellAuras.cpp (working copy)
@@ -985,27 +985,23 @@
m_target->ModifyAuraState(AURA_STATE_JUDGEMENT, true);
// Conflagrate aura state on Immolate and Shadowflame
- if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK &&
- // Immolate
- ((m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) ||
- // Shadowflame
- (m_spellProto->SpellFamilyFlags2 & 0x00000002)))
+ if (m_spellProto->SpellClass == SPELLFAMILY_WARLOCK && (m_spellProto->SpellClassMask & (CM0_WARLOCK_IMMOLATE, 0, CM2_WARLOCK_SHADOWFLAME2)))
m_target->ModifyAuraState(AURA_STATE_CONFLAGRATE, true);
// Faerie Fire (druid versions)
- if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000400)))
+ if (m_spellProto->SpellClass == SPELLFAMILY_DRUID && (m_spellProto->SpellClassMask.bits(CF_DRUID_FAERIE_FIRE) ))
m_target->ModifyAuraState(AURA_STATE_FAERIE_FIRE, true);
// Victorious
- if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR && (m_spellProto->SpellFamilyFlags & UI64LIT(0x0004000000000000)))
+ if (m_spellProto->SpellClass == SPELLFAMILY_WARRIOR && (m_spellProto->SpellClassMask.bits(CF_WARRIOR_VICTORIOUS)))
m_target->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH, true);
// Swiftmend state on Regrowth & Rejuvenation
- if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && (m_spellProto->SpellFamilyFlags & UI64LIT(0x50)))
+ if (m_spellProto->SpellClass == SPELLFAMILY_DRUID && (m_spellProto->SpellClassMask & SpellCM(CM0_DRUID_REJUVENATION & CM0_DRUID_REGROWTH, 0, 0)))
m_target->ModifyAuraState(AURA_STATE_SWIFTMEND, true);
// Deadly poison aura state
- if(m_spellProto->SpellFamilyName == SPELLFAMILY_ROGUE && (m_spellProto->SpellFamilyFlags & UI64LIT(0x10000)))
+ if(m_spellProto->SpellClass == SPELLFAMILY_ROGUE && (m_spellProto->SpellClassMask.bits(CF_ROGUE_DEADLY_POISON)))
m_target->ModifyAuraState(AURA_STATE_DEADLY_POISON, true);
// Enrage aura state
@@ -1085,9 +1081,9 @@
m_target->ModifyAuraState(AURA_STATE_ENRAGE, false);
uint32 removeState = 0;
- uint64 removeFamilyFlag = m_spellProto->SpellFamilyFlags;
- uint32 removeFamilyFlag2 = m_spellProto->SpellFamilyFlags2;
- switch(m_spellProto->SpellFamilyName)
+
+ SpellCM removeFamilyFlag = m_spellProto->SpellClassMask;
+ switch(m_spellProto->SpellClass)
{
case SPELLFAMILY_PALADIN:
if (IsSealSpell(m_spellProto))
@@ -1095,33 +1091,29 @@
break;
case SPELLFAMILY_WARLOCK:
// Conflagrate aura state on Immolate and Shadowflame,
- if ((m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) ||
- (m_spellProto->SpellFamilyFlags2 & 0x00000002))
- {
- removeFamilyFlag = UI64LIT(0x0000000000000004);
- removeFamilyFlag2 = 0x00000002;
- removeState = AURA_STATE_CONFLAGRATE;
- }
+ if(m_spellProto->SpellClassMask & SpellCM(CM0_WARLOCK_IMMOLATE, 0, CM2_WARLOCK_SHADOWFLAME2))
+ removeState = AURA_STATE_CONFLAGRATE; // Conflagrate aura state
+
break;
case SPELLFAMILY_DRUID:
- if(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000400))
+ if(m_spellProto->SpellClassMask.bits(CF_DRUID_FAERIE_FIRE))
removeState = AURA_STATE_FAERIE_FIRE; // Faerie Fire (druid versions)
- else if(m_spellProto->SpellFamilyFlags & UI64LIT(0x50))
+ else if(m_spellProto->SpellClassMask & SpellCM(CM0_DRUID_REJUVENATION & CM0_DRUID_REGROWTH, 0, 0))
{
- removeFamilyFlag = 0x50;
+ removeFamilyFlag = SpellCM(CM0_DRUID_REJUVENATION & CM0_DRUID_REGROWTH, 0, 0);
removeState = AURA_STATE_SWIFTMEND; // Swiftmend aura state
}
break;
case SPELLFAMILY_WARRIOR:
- if(m_spellProto->SpellFamilyFlags & UI64LIT(0x0004000000000000))
+ if(m_spellProto->SpellClassMask.bits(CF_WARRIOR_VICTORIOUS))
removeState = AURA_STATE_WARRIOR_VICTORY_RUSH; // Victorious
break;
case SPELLFAMILY_ROGUE:
- if(m_spellProto->SpellFamilyFlags & UI64LIT(0x10000))
+ if(m_spellProto->SpellClassMask.bits(CF_ROGUE_DEADLY_POISON))
removeState = AURA_STATE_DEADLY_POISON; // Deadly poison aura state
break;
case SPELLFAMILY_HUNTER:
- if(m_spellProto->SpellFamilyFlags & UI64LIT(0x1000000000000000))
+ if(m_spellProto->SpellClassMask.bits(CF_HUNTER_PET_SPELLS))
removeState = AURA_STATE_FAERIE_FIRE; // Sting (hunter versions)
}
@@ -1133,8 +1125,10 @@
for(Unit::AuraMap::iterator i = Auras.begin(); i != Auras.end(); ++i)
{
SpellEntry const *auraSpellInfo = (*i).second->GetSpellProto();
- if(auraSpellInfo->SpellFamilyName == m_spellProto->SpellFamilyName &&
- (auraSpellInfo->SpellFamilyFlags & removeFamilyFlag || auraSpellInfo->SpellFamilyFlags2 & removeFamilyFlag2))
+
+ if(auraSpellInfo->SpellClass == m_spellProto->SpellClass &&
+ (auraSpellInfo->SpellClassMask & removeFamilyFlag))
+
{
found = true;
break;
@@ -1279,14 +1273,11 @@
bool Aura::isAffectedOnSpell(SpellEntry const *spell) const
{
// Check family name
- if (spell->SpellFamilyName != m_spellProto->SpellFamilyName)
+ if (spell->SpellClass != m_spellProto->SpellClass)
return false;
// Check EffectClassMask
- uint32 const *ptr = getAuraSpellClassMask();
- if (((uint64*)ptr)[0] & spell->SpellFamilyFlags)
+ if (getAuraSpellClassMask() & spell->SpellClassMask)
return true;
- if (ptr[2] & spell->SpellFamilyFlags2)
- return true;
return false;
}
@@ -1325,29 +1316,28 @@
mod->type = SpellModType(m_modifier.m_auraname); // SpellModType value == spell aura types
mod->spellId = GetId();
- uint32 const *ptr;
+ SpellCM classMask;
switch (m_effIndex)
{
- case 0: ptr = &m_spellProto->EffectSpellClassMaskA[0]; break;
- case 1: ptr = &m_spellProto->EffectSpellClassMaskB[0]; break;
- case 2: ptr = &m_spellProto->EffectSpellClassMaskC[0]; break;
+ case 0: classMask = m_spellProto->EffectSpellClassMaskA; break;
+ case 1: classMask = m_spellProto->EffectSpellClassMaskB; break;
+ case 2: classMask = m_spellProto->EffectSpellClassMaskC; break;
default:
return;
}
- mod->mask = (uint64)ptr[0] | (uint64)ptr[1]<<32;
- mod->mask2= (uint64)ptr[2];
+ mod->mask = classMask;
mod->charges = m_procCharges;
m_spellmod = mod;
}
- uint64 spellFamilyMask = m_spellmod->mask;
+ SpellCM spellClassMask = m_spellmod->mask;
((Player*)m_target)->AddSpellMod(m_spellmod, apply);
// reapply some passive spells after add/remove related spellmods
- if(m_spellProto->SpellFamilyName==SPELLFAMILY_WARRIOR && (spellFamilyMask & UI64LIT(0x0000100000000000)))
+ if(m_spellProto->SpellClass==SPELLFAMILY_WARRIOR && (spellClassMask.bits(CF_WARRIOR_DEFIANCE_PASSIVE)))
{
m_target->RemoveAurasDueToSpell(45471);
@@ -1365,18 +1355,18 @@
SpellModifier *mod = new SpellModifier;
mod->spellId = GetId();
- uint32 const *ptr;
+ SpellCM classMask;
switch (m_effIndex)
{
- case 0: ptr = &m_spellProto->EffectSpellClassMaskA[0]; break;
- case 1: ptr = &m_spellProto->EffectSpellClassMaskB[0]; break;
- case 2: ptr = &m_spellProto->EffectSpellClassMaskC[0]; break;
+ case 0: classMask = m_spellProto->EffectSpellClassMaskA; break;
+ case 1: classMask = m_spellProto->EffectSpellClassMaskB; break;
+ case 2: classMask = m_spellProto->EffectSpellClassMaskC; break;
default:
return;
}
- mod->mask = (uint64)ptr[0] | (uint64)ptr[1]<<32;
- mod->mask2= (uint64)ptr[2];
+
+ mod->mask = classMask;
m_spellmod = mod;
}
else
@@ -1404,7 +1394,7 @@
// specific code for cases with no trigger spell provided in field
if (triggeredSpellInfo == NULL)
{
- switch(auraSpellInfo->SpellFamilyName)
+ switch(auraSpellInfo->SpellClass)
{
case SPELLFAMILY_GENERIC:
{
@@ -2009,8 +1999,8 @@
for(Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
SpellEntry const* spell = itr->second->GetSpellProto();
- if( spell->SpellFamilyName == SPELLFAMILY_SHAMAN &&
- (spell->SpellFamilyFlags & UI64LIT(0x0000000000000400)))
+ if( spell->SpellClass == SPELLFAMILY_SHAMAN &&
+ (spell->SpellClassMask.bits(CF_SHAMAN_LIGHTNING_SHIELD)))
return;
}
target->RemoveAurasDueToSpell(28820);
@@ -2224,7 +2214,7 @@
}
// Earth Shield
- if ( caster && GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN && (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x40000000000)))
+ if ( caster && GetSpellProto()->SpellClass == SPELLFAMILY_SHAMAN && (GetSpellProto()->SpellClassMask.bits(CF_SHAMAN_EARTH_SHIELD)))
{
// prevent double apply bonuses
if(m_target->GetTypeId() != TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading())
@@ -2314,15 +2304,15 @@
if (caster && m_removeMode == AURA_REMOVE_BY_DEATH)