-
Notifications
You must be signed in to change notification settings - Fork 0
/
12_aura_stack.patch
1330 lines (1187 loc) · 68.4 KB
/
12_aura_stack.patch
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
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index caa1297..2dba984 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -619,7 +619,7 @@ void Pet::RegenerateFocus()
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue == POWER_FOCUS)
- addvalue *= ((*i)->GetModifier()->m_amount + 100) / 100.0f;
+ addvalue *= ((*i)->GetModifier()->m_amount * (*i)->m_stackAmount + 100) / 100.0f;
ModifyPower(POWER_FOCUS, (int32)addvalue);
}
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 9b2fc9d..f015c0c 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -766,7 +766,7 @@ void Player::HandleDrowning()
AuraList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING);
for(AuraList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
- UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetModifier()->m_amount) / 100.0f);
+ UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetModifier()->m_amount * (*i)->m_stackAmount) / 100.0f);
if ((m_isunderwater & 0x01) && !(m_isunderwater & 0x80) && isAlive())
{
@@ -1796,7 +1796,7 @@ void Player::Regenerate(Powers power)
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue == power)
- addvalue *= ((*i)->GetModifier()->m_amount + 100) / 100.0f;
+ addvalue *= ((*i)->GetModifier()->m_amount * (*i)->m_stackAmount + 100) / 100.0f;
}
if (power != POWER_RAGE)
@@ -1837,7 +1837,7 @@ void Player::RegenerateHealth()
{
AuraList const& mModHealthRegenPct = GetAurasByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT);
for(AuraList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i)
- addvalue *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f;
+ addvalue *= (100.0f + (*i)->GetModifier()->m_amount * (*i)->m_stackAmount) / 100.0f;
}
else if(HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT))
addvalue *= GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT) / 100.0f;
@@ -2034,7 +2034,7 @@ void Player::GiveXP(uint32 xp, Unit* victim)
// handle SPELL_AURA_MOD_XP_PCT auras
Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
for(Unit::AuraList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
- xp = uint32(xp*(1.0f + (*i)->GetModifier()->m_amount / 100.0f));
+ xp = uint32(xp*(1.0f + (*i)->GetModifier()->m_amount * (*i)->m_stackAmount / 100.0f));
// XP resting bonus for kill
uint32 rested_bonus_xp = victim ? GetXPRestBonus(xp) : 0;
@@ -6608,7 +6608,7 @@ void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attac
if (item->IsFitToSpellRequirements(aura->GetSpellProto()))
{
- HandleBaseModValue(mod, FLAT_MOD, float (aura->GetModifier()->m_amount), apply);
+ HandleBaseModValue(mod, FLAT_MOD, float (aura->GetModifier()->m_amount * aura->m_stackAmount), apply);
}
}
@@ -6642,7 +6642,7 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType att
if (item->IsFitToSpellRequirements(aura->GetSpellProto()))
{
- HandleStatModifier(unitMod, unitModType, float(modifier->m_amount),apply);
+ HandleStatModifier(unitMod, unitModType, float(modifier->m_amount * aura->m_stackAmount),apply);
}
}
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 544432d..2ece2f6 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2499,7 +2499,8 @@ void Spell::finish(bool ok)
int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(),unit);
if(roll_chance_i(chance))
- m_caster->CastSpell(unit, auraSpellInfo->EffectTriggerSpell[auraSpellIdx], true, NULL, (*i));
+ for ( int j=0; j != (*i)->m_stackAmount; ++j)
+ m_caster->CastSpell(unit, auraSpellInfo->EffectTriggerSpell[auraSpellIdx], true, NULL, (*i));
}
}
}
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 2f29cfc..f9a1124 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -315,7 +315,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
};
Aura::Aura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem) :
-m_procCharges(0), m_spellmod(NULL), m_effIndex(eff), m_caster_guid(0), m_target(target),
+m_procCharges(0), m_stackAmount(1), m_spellmod(NULL), m_effIndex(eff), m_caster_guid(0), m_target(target),
m_timeCla(1000), m_castItemGuid(castItem?castItem->GetGUID():0), m_auraSlot(MAX_AURAS),
m_positive(false), m_permanent(false), m_isPeriodic(false), m_isTrigger(false), m_isAreaAura(false),
m_isPersistent(false), m_updated(false), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_isRemovedOnShapeLost(true), m_in_use(false),
@@ -858,7 +858,6 @@ void Aura::_AddAura()
return;
// we can found aura in NULL_AURA_SLOT and then need store state instead check slot != NULL_AURA_SLOT
- bool samespell = false;
bool secondaura = false;
uint8 slot = NULL_AURA_SLOT;
@@ -870,15 +869,13 @@ void Aura::_AddAura()
// allow use single slot only by auras from same caster
if(itr->second->GetCasterGUID()==GetCasterGUID())
{
- samespell = true;
- if (m_effIndex > itr->second->GetEffIndex())
- secondaura = true;
+ secondaura = true;
slot = itr->second->GetAuraSlot();
break;
}
}
- if(samespell)
+ if(secondaura)
break;
}
@@ -907,7 +904,7 @@ void Aura::_AddAura()
if((!m_isPassive || (caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem())) &&
(m_spellProto->Effect[GetEffIndex()] != SPELL_EFFECT_APPLY_AREA_AURA_ENEMY || m_target != caster))
{
- if(!samespell) // new slot need
+ if(!secondaura) // new slot need
{
if (IsPositive()) // empty positive slot
{
@@ -935,30 +932,24 @@ void Aura::_AddAura()
SetAuraSlot( slot );
// Not update fields for not first spell's aura, all data already in fields
- if(!secondaura)
+ if(slot < MAX_AURAS) // slot found
{
- if(slot < MAX_AURAS) // slot found
- {
- SetAura(slot, false);
- SetAuraFlag(slot, true);
- SetAuraLevel(slot,caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
- UpdateAuraCharges();
-
- // update for out of range group members
- m_target->UpdateAuraForGroup(slot);
- }
-
- UpdateAuraDuration();
+ SetAura(slot, false);
+ SetAuraFlag(slot, true);
+ SetAuraLevel(slot,caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
+ UpdateAuraCharges();
+
+ // update for out of range group members
+ m_target->UpdateAuraForGroup(slot);
}
}
else // use found slot
{
SetAuraSlot( slot );
- // Not recalculate stack count for second aura of the same spell
- if (!secondaura)
- UpdateSlotCounterAndDuration(true);
}
+ UpdateSlotCounterAndDuration();
+
// Update Seals information
if( IsSealSpell(GetSpellProto()) )
m_target->ModifyAuraState(AURA_STATE_JUDGEMENT, true);
@@ -1009,7 +1000,6 @@ void Aura::_RemoveAura()
return;
bool samespell = false;
- bool sameaura = false;
// find other aura in same slot (current already removed from list)
for(uint8 i = 0; i < 3; i++)
@@ -1020,10 +1010,6 @@ void Aura::_RemoveAura()
if(itr->second->GetAuraSlot()==slot)
{
samespell = true;
-
- if(GetEffIndex()==i)
- sameaura = true;
-
break;
}
}
@@ -1075,8 +1061,6 @@ void Aura::_RemoveAura()
((Player*)caster)->SendCooldownEvent(GetSpellProto());
}
}
- else if(sameaura) // decrease count for spell, only for same aura effect, or this spell auras in remove process.
- UpdateSlotCounterAndDuration(false);
}
void Aura::SetAuraFlag(uint32 slot, bool add)
@@ -1115,35 +1099,13 @@ void Aura::SetAuraApplication(uint32 slot, int8 count)
m_target->SetUInt32Value(UNIT_FIELD_AURAAPPLICATIONS + index, val);
}
-void Aura::UpdateSlotCounterAndDuration(bool add)
+void Aura::UpdateSlotCounterAndDuration()
{
uint8 slot = GetAuraSlot();
if(slot >= MAX_AURAS)
return;
- // calculate amount of similar auras by same effect index (similar different spells)
- int8 count = 0;
-
- // calculate auras and update durations in case aura adding
- Unit::AuraList const& aura_list = m_target->GetAurasByType(GetModifier()->m_auraname);
- for(Unit::AuraList::const_iterator i = aura_list.begin();i != aura_list.end(); ++i)
- {
- if( (*i)->GetId()==GetId() && (*i)->GetEffIndex()==m_effIndex &&
- (*i)->GetCasterGUID()==GetCasterGUID() )
- {
- ++count;
-
- if(add)
- (*i)->SetAuraDuration(GetAuraDuration());
- }
- }
-
- // at aura add aura not added yet, at aura remove aura already removed
- // in field stored (count-1)
- if(!add)
- --count;
-
- SetAuraApplication(slot, count);
+ SetAuraApplication(slot, m_stackAmount - 1);
UpdateAuraDuration();
}
@@ -1177,7 +1139,7 @@ void Aura::HandleAddModifier(bool apply, bool Real)
SpellModifier *mod = new SpellModifier;
mod->op = SpellModOp(m_modifier.m_miscvalue);
- mod->value = m_modifier.m_amount;
+ mod->value = m_modifier.m_amount * m_stackAmount;
mod->type = SpellModType(m_modifier.m_auraname); // SpellModType value == spell aura types
mod->spellId = GetId();
mod->effectId = m_effIndex;
@@ -1867,8 +1829,8 @@ void Aura::TriggerSpell()
{
switch((*i)->GetModifier()->m_miscvalue)
{
- case STAT_INTELLECT: intelectLoss += (*i)->GetModifier()->m_amount; break;
- case STAT_SPIRIT: spiritLoss += (*i)->GetModifier()->m_amount; break;
+ case STAT_INTELLECT: intelectLoss += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; break;
+ case STAT_SPIRIT: spiritLoss += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; break;
default: break;
}
}
@@ -2785,7 +2747,7 @@ void Aura::HandleAuraModSkill(bool apply, bool Real)
return;
uint32 prot=GetSpellProto()->EffectMiscValue[m_effIndex];
- int32 points = GetModifier()->m_amount;
+ int32 points = GetModifier()->m_amount * m_stackAmount;
((Player*)m_target)->ModifySkillBonus(prot,(apply ? points: -points),m_modifier.m_auraname==SPELL_AURA_MOD_SKILL_TALENT);
if(prot == SKILL_DEFENSE)
@@ -2874,7 +2836,7 @@ void Aura::HandleAuraTrackStealthed(bool apply, bool Real)
void Aura::HandleAuraModScale(bool apply, bool Real)
{
- m_target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X,m_modifier.m_amount,apply);
+ m_target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X,m_modifier.m_amount * m_stackAmount,apply);
}
void Aura::HandleModPossess(bool apply, bool Real)
@@ -3486,15 +3448,11 @@ void Aura::HandleAuraModSilence(bool apply, bool Real)
return;
// Search Mana Tap auras on caster
- int32 energy = 0;
- Unit::AuraList const& m_dummyAuras = caster->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator i = m_dummyAuras.begin(); i != m_dummyAuras.end(); ++i)
- if ((*i)->GetId() == 28734)
- ++energy;
- if (energy)
+ Aura * dummy = caster->GetDummyAura(28734);
+ if (dummy)
{
- energy *= 10;
- caster->CastCustomSpell(caster, 25048, &energy, NULL, NULL, true);
+ int32 bp = dummy->m_stackAmount * 10;
+ caster->CastCustomSpell(caster, 25048, &bp, NULL, NULL, true);
caster->RemoveAurasDueToSpell(28734);
}
}
@@ -3547,7 +3505,7 @@ void Aura::HandleModThreat(bool apply, bool Real)
if(m_modifier.m_miscvalue & int32(1<<x))
{
if(m_target->GetTypeId() == TYPEID_PLAYER)
- ApplyPercentModFloatVar(m_target->m_threatModifier[x], m_positive ? m_modifier.m_amount : -m_modifier.m_amount, apply);
+ ApplyPercentModFloatVar(m_target->m_threatModifier[x], m_positive ? m_modifier.m_amount * m_stackAmount : -m_modifier.m_amount * m_stackAmount, apply);
}
}
}
@@ -3568,9 +3526,9 @@ void Aura::HandleAuraModTotalThreat(bool apply, bool Real)
float threatMod = 0.0f;
if(apply)
- threatMod = float(m_modifier.m_amount);
+ threatMod = float(m_modifier.m_amount * m_stackAmount);
else
- threatMod = float(-m_modifier.m_amount);
+ threatMod = float(-m_modifier.m_amount * m_stackAmount);
m_target->getHostilRefManager().threatAssist(caster, threatMod);
}
@@ -4225,9 +4183,9 @@ void Aura::HandleAuraModResistanceExclusive(bool apply, bool Real)
{
if(m_modifier.m_miscvalue & int32(1<<x))
{
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
if(m_target->GetTypeId() == TYPEID_PLAYER)
- m_target->ApplyResistanceBuffModsMod(SpellSchools(x),m_positive,m_modifier.m_amount, apply);
+ m_target->ApplyResistanceBuffModsMod(SpellSchools(x),m_positive,m_modifier.m_amount * m_stackAmount, apply);
}
}
}
@@ -4238,9 +4196,9 @@ void Aura::HandleAuraModResistance(bool apply, bool Real)
{
if(m_modifier.m_miscvalue & int32(1<<x))
{
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), TOTAL_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
- m_target->ApplyResistanceBuffModsMod(SpellSchools(x),m_positive,m_modifier.m_amount, apply);
+ m_target->ApplyResistanceBuffModsMod(SpellSchools(x),m_positive,m_modifier.m_amount * m_stackAmount, apply);
}
}
@@ -4260,14 +4218,14 @@ void Aura::HandleAuraModBaseResistancePCT(bool apply, bool Real)
{
//pets only have base armor
if(((Creature*)m_target)->isPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL))
- m_target->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
}
else
{
for(int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL;x++)
{
if(m_modifier.m_miscvalue & int32(1<<x))
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_PCT, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
}
}
}
@@ -4278,11 +4236,11 @@ void Aura::HandleModResistancePercent(bool apply, bool Real)
{
if(m_modifier.m_miscvalue & int32(1<<i))
{
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_PCT, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
{
- m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i),true,m_modifier.m_amount, apply);
- m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i),false,m_modifier.m_amount, apply);
+ m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i),true,m_modifier.m_amount * m_stackAmount, apply);
+ m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i),false,m_modifier.m_amount * m_stackAmount, apply);
}
}
}
@@ -4295,13 +4253,13 @@ void Aura::HandleModBaseResistance(bool apply, bool Real)
{
//only pets have base stats
if(((Creature*)m_target)->isPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL))
- m_target->HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
}
else
{
for(int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
if(m_modifier.m_miscvalue & (1<<i))
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
}
}
@@ -4323,9 +4281,9 @@ void Aura::HandleAuraModStat(bool apply, bool Real)
if (m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue == i)
{
//m_target->ApplyStatMod(Stats(i), m_modifier.m_amount,apply);
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
- m_target->ApplyStatBuffMod(Stats(i),m_modifier.m_amount,apply);
+ m_target->ApplyStatBuffMod(Stats(i),m_modifier.m_amount * m_stackAmount,apply);
}
}
}
@@ -4345,7 +4303,7 @@ void Aura::HandleModPercentStat(bool apply, bool Real)
for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
{
if(m_modifier.m_miscvalue == i || m_modifier.m_miscvalue == -1)
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), BASE_PCT, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), BASE_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
}
}
@@ -4423,9 +4381,9 @@ void Aura::HandleModTotalPercentStat(bool apply, bool Real)
{
if(m_modifier.m_miscvalue == i || m_modifier.m_miscvalue == -1)
{
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet())
- m_target->ApplyStatPercentBuffMod(Stats(i), m_modifier.m_amount, apply );
+ m_target->ApplyStatPercentBuffMod(Stats(i), m_modifier.m_amount * m_stackAmount, apply );
}
}
@@ -4523,7 +4481,7 @@ void Aura::HandleModRegen(bool apply, bool Real) // eating
if(m_periodicTimer <= 0)
{
m_periodicTimer += 5000;
- int32 gain = m_target->ModifyHealth(m_modifier.m_amount);
+ int32 gain = m_target->ModifyHealth(m_modifier.m_amount * m_stackAmount);
Unit *caster = GetCaster();
if (caster)
{
@@ -4639,7 +4597,7 @@ void Aura::HandleAuraModIncreaseHealth(bool apply, bool Real)
}
// generic case
- m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
}
void Aura::HandleAuraModIncreaseMaxHealth(bool apply, bool Real)
@@ -4647,7 +4605,7 @@ void Aura::HandleAuraModIncreaseMaxHealth(bool apply, bool Real)
uint32 oldhealth = m_target->GetHealth();
double healthPercentage = (double)oldhealth / (double)m_target->GetMaxHealth();
- m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
// refresh percentage
if(oldhealth > 0)
@@ -4666,7 +4624,7 @@ void Aura::HandleAuraModIncreaseEnergy(bool apply, bool Real)
if(int32(powerType) != m_modifier.m_miscvalue)
return;
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_POWER_START + powerType), TOTAL_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_POWER_START + powerType), TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
}
void Aura::HandleAuraModIncreaseEnergyPercent(bool apply, bool Real)
@@ -4675,13 +4633,13 @@ void Aura::HandleAuraModIncreaseEnergyPercent(bool apply, bool Real)
if(int32(powerType) != m_modifier.m_miscvalue)
return;
- m_target->HandleStatModifier(UnitMods(UNIT_MOD_POWER_START + powerType), TOTAL_PCT, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UnitMods(UNIT_MOD_POWER_START + powerType), TOTAL_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
}
void Aura::HandleAuraModIncreaseHealthPercent(bool apply, bool Real)
{
//m_target->ApplyMaxHealthPercentMod(m_modifier.m_amount,apply);
- m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
}
/********************************/
@@ -4745,9 +4703,9 @@ void Aura::HandleAuraModCritPercent(bool apply, bool Real)
if (GetSpellProto()->EquippedItemClass == -1)
{
- ((Player*)m_target)->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (m_modifier.m_amount), apply);
- ((Player*)m_target)->HandleBaseModValue(OFFHAND_CRIT_PERCENTAGE, FLAT_MOD, float (m_modifier.m_amount), apply);
- ((Player*)m_target)->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float (m_modifier.m_amount), apply);
+ ((Player*)m_target)->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (m_modifier.m_amount * m_stackAmount), apply);
+ ((Player*)m_target)->HandleBaseModValue(OFFHAND_CRIT_PERCENTAGE, FLAT_MOD, float (m_modifier.m_amount * m_stackAmount), apply);
+ ((Player*)m_target)->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float (m_modifier.m_amount * m_stackAmount), apply);
}
else
{
@@ -4757,13 +4715,13 @@ void Aura::HandleAuraModCritPercent(bool apply, bool Real)
void Aura::HandleModHitChance(bool apply, bool Real)
{
- m_target->m_modMeleeHitChance += apply ? m_modifier.m_amount : (-m_modifier.m_amount);
- m_target->m_modRangedHitChance += apply ? m_modifier.m_amount : (-m_modifier.m_amount);
+ m_target->m_modMeleeHitChance += apply ? m_modifier.m_amount * m_stackAmount : (-m_modifier.m_amount * m_stackAmount);
+ m_target->m_modRangedHitChance += apply ? m_modifier.m_amount * m_stackAmount : (-m_modifier.m_amount * m_stackAmount);
}
void Aura::HandleModSpellHitChance(bool apply, bool Real)
{
- m_target->m_modSpellHitChance += apply ? m_modifier.m_amount: (-m_modifier.m_amount);
+ m_target->m_modSpellHitChance += apply ? m_modifier.m_amount * m_stackAmount: (-m_modifier.m_amount * m_stackAmount);
}
void Aura::HandleModSpellCritChance(bool apply, bool Real)
@@ -4778,7 +4736,7 @@ void Aura::HandleModSpellCritChance(bool apply, bool Real)
}
else
{
- m_target->m_baseSpellCritChance += apply ? m_modifier.m_amount:(-m_modifier.m_amount);
+ m_target->m_baseSpellCritChance += apply ? m_modifier.m_amount * m_stackAmount:(-m_modifier.m_amount * m_stackAmount);
}
}
@@ -4802,22 +4760,22 @@ void Aura::HandleModSpellCritChanceShool(bool apply, bool Real)
void Aura::HandleModCastingSpeed(bool apply, bool Real)
{
- m_target->ApplyCastTimePercentMod(m_modifier.m_amount,apply);
+ m_target->ApplyCastTimePercentMod(m_modifier.m_amount * m_stackAmount,apply);
}
void Aura::HandleModMeleeRangedSpeedPct(bool apply, bool Real)
{
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_modifier.m_amount,apply);
- m_target->ApplyAttackTimePercentMod(OFF_ATTACK,m_modifier.m_amount,apply);
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply);
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_modifier.m_amount * m_stackAmount,apply);
+ m_target->ApplyAttackTimePercentMod(OFF_ATTACK,m_modifier.m_amount * m_stackAmount,apply);
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount * m_stackAmount, apply);
}
void Aura::HandleModCombatSpeedPct(bool apply, bool Real)
{
- m_target->ApplyCastTimePercentMod(m_modifier.m_amount,apply);
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_modifier.m_amount,apply);
- m_target->ApplyAttackTimePercentMod(OFF_ATTACK,m_modifier.m_amount,apply);
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply);
+ m_target->ApplyCastTimePercentMod(m_modifier.m_amount * m_stackAmount,apply);
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_modifier.m_amount * m_stackAmount,apply);
+ m_target->ApplyAttackTimePercentMod(OFF_ATTACK,m_modifier.m_amount * m_stackAmount,apply);
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount * m_stackAmount, apply);
}
void Aura::HandleModAttackSpeed(bool apply, bool Real)
@@ -4825,26 +4783,26 @@ void Aura::HandleModAttackSpeed(bool apply, bool Real)
if(!m_target->isAlive() )
return;
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_modifier.m_amount,apply);
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_modifier.m_amount * m_stackAmount,apply);
}
void Aura::HandleHaste(bool apply, bool Real)
{
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK, m_modifier.m_amount,apply);
- m_target->ApplyAttackTimePercentMod(OFF_ATTACK, m_modifier.m_amount,apply);
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK,m_modifier.m_amount,apply);
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK, m_modifier.m_amount * m_stackAmount,apply);
+ m_target->ApplyAttackTimePercentMod(OFF_ATTACK, m_modifier.m_amount * m_stackAmount,apply);
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK,m_modifier.m_amount * m_stackAmount,apply);
}
void Aura::HandleAuraModRangedHaste(bool apply, bool Real)
{
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount, apply);
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, m_modifier.m_amount * m_stackAmount, apply);
}
void Aura::HandleRangedAmmoHaste(bool apply, bool Real)
{
if(m_target->GetTypeId() != TYPEID_PLAYER)
return;
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK,m_modifier.m_amount, apply);
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK,m_modifier.m_amount * m_stackAmount, apply);
}
/********************************/
@@ -4853,7 +4811,7 @@ void Aura::HandleRangedAmmoHaste(bool apply, bool Real)
void Aura::HandleAuraModAttackPower(bool apply, bool Real)
{
- m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
}
void Aura::HandleAuraModRangedAttackPower(bool apply, bool Real)
@@ -4861,7 +4819,7 @@ void Aura::HandleAuraModRangedAttackPower(bool apply, bool Real)
if((m_target->getClassMask() & CLASSMASK_WAND_USERS)!=0)
return;
- m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
}
void Aura::HandleAuraAttackPowerAttacker(bool apply, bool Real)
@@ -4900,7 +4858,7 @@ void Aura::HandleAuraAttackPowerAttacker(bool apply, bool Real)
void Aura::HandleAuraModAttackPowerPercent(bool apply, bool Real)
{
//UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
- m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
}
void Aura::HandleAuraModRangedAttackPowerPercent(bool apply, bool Real)
@@ -4909,7 +4867,7 @@ void Aura::HandleAuraModRangedAttackPowerPercent(bool apply, bool Real)
return;
//UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1
- m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_PCT, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
}
void Aura::HandleAuraModRangedAttackPowerOfStatPercent(bool apply, bool Real)
@@ -4959,9 +4917,9 @@ void Aura::HandleModDamageDone(bool apply, bool Real)
// apply generic physical damage bonuses including wand case
if (GetSpellProto()->EquippedItemClass == -1 || m_target->GetTypeId() != TYPEID_PLAYER)
{
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, float(m_modifier.m_amount), apply);
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(m_modifier.m_amount), apply);
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply);
}
else
{
@@ -4971,9 +4929,9 @@ void Aura::HandleModDamageDone(bool apply, bool Real)
if(m_target->GetTypeId() == TYPEID_PLAYER)
{
if(m_positive)
- m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS,m_modifier.m_amount,apply);
+ m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS,m_modifier.m_amount * m_stackAmount,apply);
else
- m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG,m_modifier.m_amount,apply);
+ m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG,m_modifier.m_amount * m_stackAmount,apply);
}
}
@@ -4999,7 +4957,7 @@ void Aura::HandleModDamageDone(bool apply, bool Real)
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
{
if((m_modifier.m_miscvalue & (1<<i)) != 0)
- m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i,m_modifier.m_amount,apply);
+ m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i,m_modifier.m_amount * m_stackAmount,apply);
}
}
else
@@ -5007,7 +4965,7 @@ void Aura::HandleModDamageDone(bool apply, bool Real)
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
{
if((m_modifier.m_miscvalue & (1<<i)) != 0)
- m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+i,m_modifier.m_amount,apply);
+ m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+i,m_modifier.m_amount * m_stackAmount,apply);
}
}
Pet* pet = m_target->GetPet();
@@ -5042,9 +5000,9 @@ void Aura::HandleModDamagePercentDone(bool apply, bool Real)
// apply generic physical damage bonuses including wand case
if (GetSpellProto()->EquippedItemClass == -1 || m_target->GetTypeId() != TYPEID_PLAYER)
{
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float(m_modifier.m_amount), apply);
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(m_modifier.m_amount), apply);
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_PCT, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
}
else
{
@@ -5083,7 +5041,7 @@ void Aura::HandleModOffhandDamagePercent(bool apply, bool Real)
sLog.outDebug("AURA MOD OFFHAND DAMAGE");
- m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(m_modifier.m_amount), apply);
+ m_target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(m_modifier.m_amount * m_stackAmount), apply);
}
/********************************/
@@ -5096,7 +5054,7 @@ void Aura::HandleModPowerCostPCT(bool apply, bool Real)
if(!Real)
return;
- float amount = m_modifier.m_amount/100.0f;
+ float amount = m_modifier.m_amount * m_stackAmount /100.0f;
for(int i = 0; i < MAX_SPELL_SCHOOL; ++i)
if(m_modifier.m_miscvalue & (1<<i))
m_target->ApplyModSignedFloatValue(UNIT_FIELD_POWER_COST_MULTIPLIER+i,amount,apply);
@@ -5110,7 +5068,7 @@ void Aura::HandleModPowerCost(bool apply, bool Real)
for(int i = 0; i < MAX_SPELL_SCHOOL; ++i)
if(m_modifier.m_miscvalue & (1<<i))
- m_target->ApplyModInt32Value(UNIT_FIELD_POWER_COST_MODIFIER+i,m_modifier.m_amount,apply);
+ m_target->ApplyModInt32Value(UNIT_FIELD_POWER_COST_MODIFIER+i,m_modifier.m_amount * m_stackAmount,apply);
}
/*********************************************************/
@@ -5331,7 +5289,7 @@ void Aura::HandleModRating(bool apply, bool Real)
for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
if (m_modifier.m_miscvalue & (1 << rating))
- ((Player*)m_target)->ApplyRatingMod(CombatRating(rating), m_modifier.m_amount, apply);
+ ((Player*)m_target)->ApplyRatingMod(CombatRating(rating), m_modifier.m_amount * m_stackAmount, apply);
}
void Aura::HandleForceMoveForward(bool apply, bool Real)
@@ -5362,11 +5320,11 @@ void Aura::HandleModTargetResistance(bool apply, bool Real)
// show armor penetration
if (m_target->GetTypeId() == TYPEID_PLAYER && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL))
- m_target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE,m_modifier.m_amount, apply);
+ m_target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE,m_modifier.m_amount * m_stackAmount, apply);
// show as spell penetration only full spell penetration bonuses (all resistances except armor and holy
if (m_target->GetTypeId() == TYPEID_PLAYER && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_SPELL)==SPELL_SCHOOL_MASK_SPELL)
- m_target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE,m_modifier.m_amount, apply);
+ m_target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE,m_modifier.m_amount * m_stackAmount, apply);
}
//HandleNoImmediateEffect auras implementation to support new stat system
@@ -5387,7 +5345,7 @@ void Aura::HandleShieldBlockValue(bool apply, bool Real)
modType = PCT_MOD;
if(m_target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)m_target)->HandleBaseModValue(SHIELD_BLOCK_VALUE, modType, float(m_modifier.m_amount), apply);
+ ((Player*)m_target)->HandleBaseModValue(SHIELD_BLOCK_VALUE, modType, float(m_modifier.m_amount * m_stackAmount), apply);
}
void Aura::HandleAuraRetainComboPoints(bool apply, bool Real)
@@ -5405,7 +5363,7 @@ void Aura::HandleAuraRetainComboPoints(bool apply, bool Real)
// remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
if( !apply && m_duration==0 && target->GetComboTarget())
if(Unit* unit = ObjectAccessor::GetUnit(*m_target,target->GetComboTarget()))
- target->AddComboPoints(unit, -m_modifier.m_amount);
+ target->AddComboPoints(unit, -m_modifier.m_amount * m_stackAmount);
}
void Aura::HandleModUnattackable( bool Apply, bool Real )
@@ -5614,6 +5572,8 @@ void Aura::PeriodicTick()
else
pdamage = uint32(m_target->GetMaxHealth()*amount/100);
+ pdamage *= m_stackAmount;
+
//As of 2.2 resilience reduces damage from DoT ticks as much as the chance to not be critically hit
// Reduce dot damage from resilience for players
if (m_target->GetTypeId()==TYPEID_PLAYER)
@@ -5732,6 +5692,8 @@ void Aura::PeriodicTick()
}
}
+ pdamage *= m_stackAmount;
+
//As of 2.2 resilience reduces damage from DoT ticks as much as the chance to not be critically hit
// Reduce dot damage from resilience for players
if (m_target->GetTypeId()==TYPEID_PLAYER)
@@ -5801,6 +5763,8 @@ void Aura::PeriodicTick()
pdamage = pCaster->SpellHealingBonus(GetSpellProto(), pdamage, DOT, m_target);
+ pdamage *= m_stackAmount;
+
sLog.outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
@@ -5882,6 +5846,8 @@ void Aura::PeriodicTick()
// ignore non positive values (can be result apply spellmods to aura damage
uint32 pdamage = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
+ pdamage *= m_stackAmount;
+
sLog.outDetail("PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
@@ -5937,6 +5903,8 @@ void Aura::PeriodicTick()
// ignore non positive values (can be result apply spellmods to aura damage
uint32 pdamage = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
+ pdamage *= m_stackAmount;
+
sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
@@ -5971,6 +5939,8 @@ void Aura::PeriodicTick()
uint32 pdamage = uint32(m_target->GetMaxPower(POWER_MANA) * amount/100);
+ pdamage *= m_stackAmount;
+
sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u mana inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());
@@ -6005,6 +5975,8 @@ void Aura::PeriodicTick()
int32 pdamage = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
+ pdamage *= m_stackAmount;
+
Powers powerType = Powers(m_modifier.m_miscvalue);
if(!m_target->isAlive() || m_target->getPowerType() != powerType)
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index 295981a..5d897ef 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -231,6 +231,7 @@ class MANGOS_DLL_SPEC Aura
time_t GetAuraApplyTime() { return m_applyTime; }
void UpdateAuraDuration();
void SendAuraDurationForCaster(Player* caster);
+ void UpdateSlotCounterAndDuration();
uint64 const& GetCasterGUID() const { return m_caster_guid; }
Unit* GetCaster() const;
@@ -284,6 +285,8 @@ class MANGOS_DLL_SPEC Aura
int32 m_procCharges;
+ int32 m_stackAmount;
+
virtual Unit* GetTriggerTarget() const { return m_target; }
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
@@ -331,7 +334,6 @@ class MANGOS_DLL_SPEC Aura
uint32 m_PeriodicEventId;
DiminishingGroup m_AuraDRGroup;
private:
- void UpdateSlotCounterAndDuration(bool add);
void CleanupTriggeredSpells();
void SetAura(uint32 slot, bool remove) { m_target->SetUInt32Value(UNIT_FIELD_AURA + slot, remove ? 0 : GetId()); }
void SetAuraFlag(uint32 slot, bool add);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 614d6d2..8866148 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -915,16 +915,12 @@ void Spell::EffectDummy(uint32 i)
}
case 28730: // Arcane Torrent (Mana)
{
- int32 count = 0;
- Unit::AuraList const& m_dummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
- for(Unit::AuraList::const_iterator i = m_dummyAuras.begin(); i != m_dummyAuras.end(); ++i)
- if ((*i)->GetId() == 28734)
- ++count;
- if (count)
- {
- m_caster->RemoveAurasDueToSpell(28734);
- int32 bp = damage * count;
+ Aura * dummy = m_caster->GetDummyAura(28734);
+ if (dummy)
+ {
+ int32 bp = damage * dummy->m_stackAmount;
m_caster->CastCustomSpell(m_caster, 28733, &bp, NULL, NULL, true);
+ m_caster->RemoveAurasDueToSpell(28734);
}
return;
}
@@ -2331,7 +2327,7 @@ void Spell::EffectHeal( uint32 /*i*/ )
Unit::AuraList const& mDummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
if((*i)->GetId() == 45062)
- damageAmount+=(*i)->GetModifier()->m_amount;
+ damageAmount+=(*i)->GetModifier()->m_amount * (*i)->m_stackAmount;
if (damageAmount)
m_caster->RemoveAurasDueToSpell(45062);
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index f215701..ba98d77 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -153,7 +153,7 @@ void Player::UpdateArmor()
{
Modifier* mod = (*i)->GetModifier();
if(mod->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)
- value += int32(GetStat(Stats((*i)->GetMiscBValue())) * mod->m_amount / 100.0f);
+ value += int32(GetStat(Stats((*i)->GetMiscBValue())) * mod->m_amount * (*i)->m_stackAmount / 100.0f);
}
value *= GetModifierValue(unitMod, TOTAL_PCT);
@@ -311,7 +311,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
{
AuraList const& mRAPbyIntellect = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
for(AuraList::const_iterator i = mRAPbyIntellect.begin();i != mRAPbyIntellect.end(); ++i)
- attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifier()->m_amount / 100.0f);
+ attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifier()->m_amount * (*i)->m_stackAmount / 100.0f);
}
float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
@@ -570,10 +570,10 @@ void Player::UpdateExpertise(WeaponAttackType attack)
{
// item neutral spell
if((*itr)->GetSpellProto()->EquippedItemClass == -1)
- expertise += (*itr)->GetModifier()->m_amount;
+ expertise += (*itr)->GetModifier()->m_amount * (*itr)->m_stackAmount;
// item dependent spell
else if(weapon && weapon->IsFitToSpellRequirements((*itr)->GetSpellProto()))
- expertise += (*itr)->GetModifier()->m_amount;
+ expertise += (*itr)->GetModifier()->m_amount * (*itr)->m_stackAmount;
}
if(expertise < 0)
@@ -603,7 +603,7 @@ void Player::UpdateManaRegen()
for(AuraList::const_iterator i = regenAura.begin();i != regenAura.end(); ++i)
{
Modifier* mod = (*i)->GetModifier();
- power_regen_mp5 += GetStat(Stats(mod->m_miscvalue)) * mod->m_amount / 500.0f;
+ power_regen_mp5 += GetStat(Stats(mod->m_miscvalue)) * mod->m_amount * (*i)->m_stackAmount / 500.0f;
}
// Bonus from some dummy auras
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 339a590..04eabf8 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1129,7 +1129,7 @@ void Unit::DealFlatDamage(Unit *pVictim, SpellEntry const *spellInfo, uint32 *da
AuraList const& mDamageDoneVersus = GetAurasByType(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS);
for(AuraList::const_iterator i = mDamageDoneVersus.begin();i != mDamageDoneVersus.end(); ++i)
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
- bonusDmg = uint32(bonusDmg * ((*i)->GetModifier()->m_amount+100.0f)/100.0f);
+ bonusDmg = uint32(bonusDmg * ((*i)->GetModifier()->m_amount * (*i)->m_stackAmount +100.0f)/100.0f);
*damage += bonusDmg;
@@ -1807,7 +1807,7 @@ void Unit::DoAttackDamage (Unit *pVictim, uint32 *damage, CleanDamage *cleanDama
AuraList const& mDamageDoneVersus = GetAurasByType(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS);
for(AuraList::const_iterator i = mDamageDoneVersus.begin();i != mDamageDoneVersus.end(); ++i)
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue))
- crit_bonus = uint32(crit_bonus * ((*i)->GetModifier()->m_amount+100.0f)/100.0f);
+ crit_bonus = uint32(crit_bonus * ((*i)->GetModifier()->m_amount * (*i)->m_stackAmount +100.0f)/100.0f);
}
*damage += crit_bonus;
@@ -2142,7 +2142,7 @@ void Unit::DoAttackDamage (Unit *pVictim, uint32 *damage, CleanDamage *cleanDama
if (alreadyDone.find(*i) == alreadyDone.end())
{
alreadyDone.insert(*i);
- pVictim->SpellNonMeleeDamageLog(this, (*i)->GetId(), (*i)->GetModifier()->m_amount, false, false);
+ pVictim->SpellNonMeleeDamageLog(this, (*i)->GetId(), (*i)->GetModifier()->m_amount * (*i)->m_stackAmount, false, false);
if (pVictim->m_removedAuras > removedAuras)
{
removedAuras = pVictim->m_removedAuras;
@@ -2815,7 +2815,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool
{
if((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spell))
{
- int32 reflectchance = (*i)->GetModifier()->m_amount;
+ int32 reflectchance = (*i)->GetModifier()->m_amount * (*i)->m_stackAmount;
if (reflectchance > 0 && roll_chance_i(reflectchance))
{
if((*i)->m_procCharges > 0)
@@ -2833,7 +2833,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool
Unit::AuraList const& mReflectSpells = pVictim->GetAurasByType(SPELL_AURA_REFLECT_SPELLS);
for(Unit::AuraList::const_iterator i = mReflectSpells.begin(); i != mReflectSpells.end(); ++i)
{
- int32 reflectchance = (*i)->GetModifier()->m_amount;
+ int32 reflectchance = (*i)->GetModifier()->m_amount * (*i)->m_stackAmount;
if (reflectchance > 0 && roll_chance_i(reflectchance))
{
if((*i)->m_procCharges > 0)
@@ -3448,7 +3448,7 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype) const
AuraList const& mTotalAuraList = GetAurasByType(auratype);
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
- modifier += (*i)->GetModifier()->m_amount;
+ modifier += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount;
return modifier;
}
@@ -3459,7 +3459,7 @@ float Unit::GetTotalAuraMultiplier(AuraType auratype) const
AuraList const& mTotalAuraList = GetAurasByType(auratype);
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
- multiplier *= (100.0f + (*i)->GetModifier()->m_amount)/100.0f;
+ multiplier *= (100.0f + (*i)->GetModifier()->m_amount * (*i)->m_stackAmount)/100.0f;
return multiplier;
}
@@ -3470,8 +3470,11 @@ int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype) const
AuraList const& mTotalAuraList = GetAurasByType(auratype);
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
- if ((*i)->GetModifier()->m_amount > modifier)
- modifier = (*i)->GetModifier()->m_amount;
+ {
+ int32 amount = (*i)->GetModifier()->m_amount * (*i)->m_stackAmount;
+ if (amount > modifier)
+ modifier = amount;
+ }
return modifier;
}
@@ -3482,8 +3485,11 @@ int32 Unit::GetMaxNegativeAuraModifier(AuraType auratype) const
AuraList const& mTotalAuraList = GetAurasByType(auratype);
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
- if ((*i)->GetModifier()->m_amount < modifier)
- modifier = (*i)->GetModifier()->m_amount;
+ {
+ int32 amount = (*i)->GetModifier()->m_amount * (*i)->m_stackAmount;
+ if (amount < modifier)