-
-
Save MiLk/89a05d89e5b472aed6cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 356dfb54cb307e638d95392ee8828e4c21db7288 Mon Sep 17 00:00:00 2001 | |
From: MiLk <milk@world-of-ysera.com> | |
Date: Tue, 8 Jun 2010 17:06:19 +0200 | |
Subject: [PATCH] 12. Aura Stack | |
--- | |
src/game/Pet.cpp | 2 +- | |
src/game/Player.cpp | 12 +- | |
src/game/Spell.cpp | 3 +- | |
src/game/SpellAuras.cpp | 251 ++++++++++++++++++++------------------------- | |
src/game/SpellAuras.h | 4 +- | |
src/game/SpellEffects.cpp | 16 +-- | |
src/game/StatSystem.cpp | 10 +- | |
src/game/Unit.cpp | 120 +++++++++++++--------- | |
8 files changed, 205 insertions(+), 213 deletions(-) | |
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp | |
index 07941ca..e98b2a4 100644 | |
--- a/src/game/Pet.cpp | |
+++ b/src/game/Pet.cpp | |
@@ -635,7 +635,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 5ad150e..90140a2 100644 | |
--- a/src/game/Player.cpp | |
+++ b/src/game/Player.cpp | |
@@ -860,7 +860,7 @@ int32 Player::getMaxTimer(MirrorTimerType timer) | |
int32 UnderWaterTime = sWorld.getConfig(CONFIG_UINT32_TIMERBAR_BREATH_MAX)*IN_MILLISECONDS; | |
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); | |
return UnderWaterTime; | |
} | |
case FIRE_TIMER: | |
@@ -1964,7 +1964,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) | |
@@ -2005,7 +2005,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; | |
@@ -2311,7 +2311,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; | |
@@ -6653,7 +6653,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); | |
} | |
} | |
@@ -6687,7 +6687,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 a89161c..7b851c0 100644 | |
--- a/src/game/Spell.cpp | |
+++ b/src/game/Spell.cpp | |
@@ -2752,7 +2752,8 @@ void Spell::finish(bool ok) | |
int32 auraBasePoints = (*i)->GetBasePoints(); | |
int32 chance = m_caster->CalculateSpellDamage(unit, auraSpellInfo, auraSpellIdx, &auraBasePoints); | |
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 93b78bd..848ac2e 100644 | |
--- a/src/game/SpellAuras.cpp | |
+++ b/src/game/SpellAuras.cpp | |
@@ -314,7 +314,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= | |
}; | |
Aura::Aura(SpellEntry const* spellproto, SpellEffectIndex 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_removeMode(AURA_REMOVE_BY_DEFAULT), m_isRemovedOnShapeLost(true), m_deleted(false), | |
@@ -847,7 +847,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; | |
@@ -861,15 +860,13 @@ void Aura::_AddAura() | |
if(itr->second->GetCasterGUID()==GetCasterGUID()) | |
{ | |
// Check for coexisting Weapon-proced Auras | |
- samespell = !isWeaponBuffCoexistableWith(itr->second); | |
- if (m_effIndex > itr->second->GetEffIndex()) | |
- secondaura = true; | |
+ secondaura = !isWeaponBuffCoexistableWith(itr->second); | |
slot = itr->second->GetAuraSlot(); | |
break; | |
} | |
} | |
- if(samespell) | |
+ if(secondaura) | |
break; | |
} | |
@@ -905,7 +902,7 @@ void Aura::_AddAura() | |
if (IsNeedVisibleSlot(caster)) | |
{ | |
- if(!samespell) // new slot need | |
+ if(!secondaura) // new slot need | |
{ | |
if (IsPositive()) // empty positive slot | |
{ | |
@@ -933,29 +930,23 @@ 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_UINT32_MAX_PLAYER_LEVEL)); | |
- UpdateAuraCharges(); | |
- | |
- // update for out of range group members | |
- m_target->UpdateAuraForGroup(slot); | |
- } | |
+ SetAura(slot, false); | |
+ SetAuraFlag(slot, true); | |
+ SetAuraLevel(slot,caster ? caster->getLevel() : sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL)); | |
+ UpdateAuraCharges(); | |
- UpdateAuraDuration(); | |
+ // 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()) ) | |
@@ -1007,7 +998,6 @@ bool Aura::_RemoveAura() | |
return false; | |
bool samespell = false; | |
- bool sameaura = false; | |
// find other aura in same slot (current already removed from list) | |
for(int i = 0; i < MAX_EFFECT_INDEX; ++i) | |
@@ -1018,10 +1008,6 @@ bool Aura::_RemoveAura() | |
if(itr->second->GetAuraSlot() == slot) | |
{ | |
samespell = true; | |
- | |
- if(GetEffIndex()==i) | |
- sameaura = true; | |
- | |
break; | |
} | |
} | |
@@ -1032,9 +1018,6 @@ bool Aura::_RemoveAura() | |
// only remove icon when the last aura of the spell is removed (current aura already removed from list) | |
if (samespell) | |
{ | |
- if(sameaura) // decrease count for spell, only for same aura effect, or this spell auras in remove process. | |
- UpdateSlotCounterAndDuration(false); | |
- | |
return false; | |
} | |
@@ -1142,35 +1125,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(); | |
} | |
@@ -1327,7 +1288,7 @@ void Aura::HandleAddModifier(bool apply, bool Real) | |
m_spellmod = new SpellModifier( | |
SpellModOp(m_modifier.m_miscvalue), | |
SpellModType(m_modifier.m_auraname), // SpellModType value == spell aura types | |
- m_modifier.m_amount, | |
+ (m_modifier.m_amount * m_stackAmount), | |
this, | |
m_procCharges > 0 ? m_procCharges : 0); | |
} | |
@@ -1999,8 +1960,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; | |
} | |
} | |
@@ -3062,7 +3023,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) | |
@@ -3161,7 +3122,7 @@ void Aura::HandleAuraTrackStealthed(bool apply, bool /*Real*/) | |
void Aura::HandleAuraModScale(bool apply, bool /*Real*/) | |
{ | |
- m_target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X, float(m_modifier.m_amount), apply); | |
+ m_target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X, float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
void Aura::HandleModPossess(bool apply, bool Real) | |
@@ -3769,15 +3730,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); | |
} | |
} | |
@@ -3829,7 +3786,7 @@ void Aura::HandleModThreat(bool apply, bool Real) | |
if (m_target->GetTypeId() == TYPEID_PLAYER) | |
for(int8 x=0;x < MAX_SPELL_SCHOOL;x++) | |
if (m_modifier.m_miscvalue & int32(1<<x)) | |
- ApplyPercentModFloatVar(m_target->m_threatModifier[x], float(m_modifier.m_amount), apply); | |
+ ApplyPercentModFloatVar(m_target->m_threatModifier[x], float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
void Aura::HandleAuraModTotalThreat(bool apply, bool Real) | |
@@ -3846,7 +3803,7 @@ void Aura::HandleAuraModTotalThreat(bool apply, bool Real) | |
if (!caster || !caster->isAlive()) | |
return; | |
- float threatMod = apply ? float(m_modifier.m_amount) : float(-m_modifier.m_amount); | |
+ float threatMod = apply ? float(m_modifier.m_amount * m_stackAmount) : float(-m_modifier.m_amount * m_stackAmount); | |
m_target->getHostileRefManager().threatAssist(caster, threatMod, GetSpellProto()); | |
} | |
@@ -4483,9 +4440,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, float(m_modifier.m_amount), apply); | |
+ m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
} | |
} | |
@@ -4496,9 +4453,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, float(m_modifier.m_amount), apply); | |
+ m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
} | |
@@ -4518,14 +4475,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); | |
} | |
} | |
} | |
@@ -4536,11 +4493,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, float(m_modifier.m_amount), apply); | |
- m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, float(m_modifier.m_amount), apply); | |
+ m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), true, float(m_modifier.m_amount * m_stackAmount), apply); | |
+ m_target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
} | |
} | |
@@ -4553,13 +4510,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); | |
} | |
} | |
@@ -4581,9 +4538,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), float(m_modifier.m_amount), apply); | |
+ m_target->ApplyStatBuffMod(Stats(i), float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
} | |
} | |
@@ -4603,7 +4560,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); | |
} | |
} | |
@@ -4681,9 +4638,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), float(m_modifier.m_amount), apply ); | |
+ m_target->ApplyStatPercentBuffMod(Stats(i), float(m_modifier.m_amount * m_stackAmount), apply ); | |
} | |
} | |
@@ -4781,7 +4738,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) | |
{ | |
@@ -4880,16 +4837,16 @@ void Aura::HandleAuraModIncreaseHealth(bool apply, bool Real) | |
{ | |
if(apply) | |
{ | |
- m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); | |
- m_target->ModifyHealth(m_modifier.m_amount); | |
+ m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply); | |
+ m_target->ModifyHealth(m_modifier.m_amount * m_stackAmount); | |
} | |
else | |
{ | |
- if (int32(m_target->GetHealth()) > m_modifier.m_amount) | |
- m_target->ModifyHealth(-m_modifier.m_amount); | |
+ if (int32(m_target->GetHealth()) > (m_modifier.m_amount * m_stackAmount)) | |
+ m_target->ModifyHealth(-(m_modifier.m_amount * m_stackAmount)); | |
else | |
m_target->SetHealth(1); | |
- 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); | |
} | |
} | |
return; | |
@@ -4897,7 +4854,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*/) | |
@@ -4905,7 +4862,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) | |
@@ -4926,7 +4883,7 @@ void Aura::HandleAuraModIncreaseEnergy(bool apply, bool /*Real*/) | |
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType); | |
- m_target->HandleStatModifier(unitMod, TOTAL_VALUE, float(m_modifier.m_amount), apply); | |
+ m_target->HandleStatModifier(unitMod, TOTAL_VALUE, float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
void Aura::HandleAuraModIncreaseEnergyPercent(bool apply, bool /*Real*/) | |
@@ -4937,12 +4894,12 @@ void Aura::HandleAuraModIncreaseEnergyPercent(bool apply, bool /*Real*/) | |
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType); | |
- m_target->HandleStatModifier(unitMod, TOTAL_PCT, float(m_modifier.m_amount), apply); | |
+ m_target->HandleStatModifier(unitMod, TOTAL_PCT, float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
void Aura::HandleAuraModIncreaseHealthPercent(bool apply, bool /*Real*/) | |
{ | |
- 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); | |
} | |
/********************************/ | |
@@ -5006,9 +4963,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 | |
{ | |
@@ -5025,8 +4982,8 @@ void Aura::HandleModHitChance(bool apply, bool /*Real*/) | |
} | |
else | |
{ | |
- 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); | |
} | |
} | |
@@ -5054,7 +5011,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); | |
} | |
} | |
@@ -5078,46 +5035,46 @@ void Aura::HandleModSpellCritChanceShool(bool /*apply*/, bool Real) | |
void Aura::HandleModCastingSpeed(bool apply, bool /*Real*/) | |
{ | |
- m_target->ApplyCastTimePercentMod(float(m_modifier.m_amount),apply); | |
+ m_target->ApplyCastTimePercentMod(float(m_modifier.m_amount * m_stackAmount),apply); | |
} | |
void Aura::HandleModMeleeRangedSpeedPct(bool apply, bool /*Real*/) | |
{ | |
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount), apply); | |
- m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount), apply); | |
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply); | |
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount * m_stackAmount), apply); | |
+ m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount * m_stackAmount), apply); | |
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
void Aura::HandleModCombatSpeedPct(bool apply, bool /*Real*/) | |
{ | |
- m_target->ApplyCastTimePercentMod(float(m_modifier.m_amount), apply); | |
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount), apply); | |
- m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount), apply); | |
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply); | |
+ m_target->ApplyCastTimePercentMod(float(m_modifier.m_amount * m_stackAmount), apply); | |
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount * m_stackAmount), apply); | |
+ m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount * m_stackAmount), apply); | |
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
void Aura::HandleModAttackSpeed(bool apply, bool /*Real*/) | |
{ | |
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK,float(m_modifier.m_amount),apply); | |
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK,float(m_modifier.m_amount * m_stackAmount),apply); | |
} | |
void Aura::HandleHaste(bool apply, bool /*Real*/) | |
{ | |
- m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount), apply); | |
- m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount), apply); | |
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply); | |
+ m_target->ApplyAttackTimePercentMod(BASE_ATTACK, float(m_modifier.m_amount * m_stackAmount), apply); | |
+ m_target->ApplyAttackTimePercentMod(OFF_ATTACK, float(m_modifier.m_amount * m_stackAmount), apply); | |
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
void Aura::HandleAuraModRangedHaste(bool apply, bool /*Real*/) | |
{ | |
- m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount), apply); | |
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(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, float(m_modifier.m_amount), apply); | |
+ m_target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(m_modifier.m_amount * m_stackAmount), apply); | |
} | |
/********************************/ | |
@@ -5126,7 +5083,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*/) | |
@@ -5134,13 +5091,13 @@ 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::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*/) | |
@@ -5149,7 +5106,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) | |
@@ -5192,9 +5149,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 | |
{ | |
@@ -5204,9 +5161,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); | |
} | |
} | |
@@ -5232,7 +5189,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 | |
@@ -5240,7 +5197,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(); | |
@@ -5275,9 +5232,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 | |
{ | |
@@ -5285,7 +5242,7 @@ void Aura::HandleModDamagePercentDone(bool apply, bool Real) | |
} | |
// For show in client | |
if(m_target->GetTypeId() == TYPEID_PLAYER) | |
- m_target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, m_modifier.m_amount/100.0f, apply); | |
+ m_target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, m_modifier.m_amount * m_stackAmount/100.0f, apply); | |
} | |
// Skip non magic case for speedup | |
@@ -5305,7 +5262,7 @@ void Aura::HandleModDamagePercentDone(bool apply, bool Real) | |
// Send info to client | |
if(m_target->GetTypeId() == TYPEID_PLAYER) | |
for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) | |
- m_target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i, m_modifier.m_amount/100.0f, apply); | |
+ m_target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i, m_modifier.m_amount * m_stackAmount/100.0f, apply); | |
} | |
void Aura::HandleModOffhandDamagePercent(bool apply, bool Real) | |
@@ -5316,7 +5273,7 @@ void Aura::HandleModOffhandDamagePercent(bool apply, bool Real) | |
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "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); | |
} | |
/********************************/ | |
@@ -5329,7 +5286,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); | |
@@ -5343,7 +5300,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); | |
} | |
/*********************************************************/ | |
@@ -5641,7 +5598,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) | |
@@ -5672,11 +5629,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); | |
} | |
void Aura::HandleShieldBlockValue(bool apply, bool /*Real*/) | |
@@ -5686,7 +5643,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) | |
@@ -5704,7 +5661,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 ) | |
@@ -5922,6 +5879,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) | |
@@ -6036,6 +5995,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 | |
@@ -6103,6 +6064,8 @@ void Aura::PeriodicTick() | |
pdamage = amount; | |
pdamage = pCaster->SpellHealingBonus(GetSpellProto(), pdamage, DOT, m_target); | |
+ | |
+ pdamage *= m_stackAmount; | |
DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "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()); | |
@@ -6182,6 +6145,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; | |
DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "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()); | |
@@ -6224,6 +6189,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; | |
DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "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()); | |
@@ -6255,6 +6222,8 @@ void Aura::PeriodicTick() | |
uint32 amount = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0; | |
uint32 pdamage = uint32(m_target->GetMaxPower(POWER_MANA) * amount / 100); | |
+ | |
+ pdamage *= m_stackAmount; | |
DETAIL_FILTER_LOG(LOG_FILTER_PERIODIC_AFFECTS, "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()); | |
@@ -6287,6 +6256,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 5e33d83..46d45d4 100644 | |
--- a/src/game/SpellAuras.h | |
+++ b/src/game/SpellAuras.h | |
@@ -235,6 +235,7 @@ class MANGOS_DLL_SPEC Aura | |
time_t GetAuraApplyTime() { return m_applyTime; } | |
void UpdateAuraDuration(); | |
void SendAuraDurationForCaster(Player* caster); | |
+ void UpdateSlotCounterAndDuration(); | |
uint32 GetAuraTicks() const { return m_periodicTick; } | |
uint32 GetAuraMaxTicks() const { return m_maxduration > 0 && m_modifier.periodictime > 0 ? m_maxduration / m_modifier.periodictime : 0; } | |
@@ -305,6 +306,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 | |
@@ -368,7 +371,6 @@ class MANGOS_DLL_SPEC Aura | |
uint32 m_in_use; // > 0 while in Aura::ApplyModifier call/Aura::Update/etc | |
private: | |
- void UpdateSlotCounterAndDuration(bool add); | |
void CleanupTriggeredSpells(); | |
bool IsNeedVisibleSlot(Unit const* caster) const; // helper for check req. visibility slot | |
void SetAura(uint32 slot, bool remove) { m_target->SetUInt32Value(UNIT_FIELD_AURA + slot, remove ? 0 : GetId()); } | |
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp | |
index bd96263..2dec545 100644 | |
--- a/src/game/SpellEffects.cpp | |
+++ b/src/game/SpellEffects.cpp | |
@@ -883,16 +883,12 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) | |
} | |
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; | |
} | |
@@ -2301,7 +2297,7 @@ void Spell::EffectHeal(SpellEffectIndex /*eff_idx*/) | |
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 abedac9..cf7bdd6 100644 | |
--- a/src/game/StatSystem.cpp | |
+++ b/src/game/StatSystem.cpp | |
@@ -152,7 +152,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); | |
@@ -316,7 +316,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)->GetModifier()->m_amount / 100.0f); | |
} | |
} | |
@@ -594,10 +594,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) | |
@@ -627,7 +627,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 67742b8..6c22598 100644 | |
--- a/src/game/Unit.cpp | |
+++ b/src/game/Unit.cpp | |
@@ -2630,7 +2630,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool | |
Unit::AuraList const& mReflectSpellsSchool = pVictim->GetAurasByType(SPELL_AURA_REFLECT_SPELLS_SCHOOL); | |
for(Unit::AuraList::const_iterator i = mReflectSpellsSchool.begin(); i != mReflectSpellsSchool.end(); ++i) | |
if((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spell)) | |
- reflectchance += (*i)->GetModifier()->m_amount; | |
+ reflectchance += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; | |
if (reflectchance > 0 && roll_chance_i(reflectchance)) | |
{ | |
// Start triggers for remove charges if need (trigger only for victim, and mark as active spell) | |
@@ -3220,7 +3220,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; | |
} | |
@@ -3231,7 +3231,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; | |
} | |
@@ -3242,8 +3242,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; | |
} | |
@@ -3254,8 +3257,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) | |
+ modifier = amount; | |
+ } | |
return modifier; | |
} | |
@@ -3269,7 +3275,7 @@ int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) | |
{ | |
Modifier* mod = (*i)->GetModifier(); | |
if (mod->m_miscvalue & misc_mask) | |
- modifier += mod->m_amount; | |
+ modifier += mod->m_amount * (*i)->m_stackAmount; | |
} | |
return modifier; | |
} | |
@@ -3283,7 +3289,7 @@ float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask | |
{ | |
Modifier* mod = (*i)->GetModifier(); | |
if (mod->m_miscvalue & misc_mask) | |
- multiplier *= (100.0f + mod->m_amount)/100.0f; | |
+ multiplier *= (100.0f + mod->m_amount * (*i)->m_stackAmount)/100.0f; | |
} | |
return multiplier; | |
} | |
@@ -3296,8 +3302,9 @@ int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_ | |
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) | |
{ | |
Modifier* mod = (*i)->GetModifier(); | |
- if (mod->m_miscvalue & misc_mask && mod->m_amount > modifier) | |
- modifier = mod->m_amount; | |
+ int32 amount = mod->m_amount * (*i)->m_stackAmount; | |
+ if (mod->m_miscvalue & misc_mask && amount > modifier) | |
+ modifier = amount; | |
} | |
return modifier; | |
@@ -3311,8 +3318,9 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_ | |
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) | |
{ | |
Modifier* mod = (*i)->GetModifier(); | |
- if (mod->m_miscvalue & misc_mask && mod->m_amount < modifier) | |
- modifier = mod->m_amount; | |
+ int32 amount = mod->m_amount * (*i)->m_stackAmount; | |
+ if (mod->m_miscvalue & misc_mask && amount < modifier) | |
+ modifier = amount; | |
} | |
return modifier; | |
@@ -3327,7 +3335,7 @@ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) | |
{ | |
Modifier* mod = (*i)->GetModifier(); | |
if (mod->m_miscvalue == misc_value) | |
- modifier += mod->m_amount; | |
+ modifier += mod->m_amount * (*i)->m_stackAmount; | |
} | |
return modifier; | |
} | |
@@ -3341,7 +3349,7 @@ float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_valu | |
{ | |
Modifier* mod = (*i)->GetModifier(); | |
if (mod->m_miscvalue == misc_value) | |
- multiplier *= (100.0f + mod->m_amount)/100.0f; | |
+ multiplier *= (100.0f + mod->m_amount * (*i)->m_stackAmount)/100.0f; | |
} | |
return multiplier; | |
} | |
@@ -3354,8 +3362,9 @@ int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_ | |
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) | |
{ | |
Modifier* mod = (*i)->GetModifier(); | |
- if (mod->m_miscvalue == misc_value && mod->m_amount > modifier) | |
- modifier = mod->m_amount; | |
+ int32 amount = mod->m_amount * (*i)->m_stackAmount; | |
+ if (mod->m_miscvalue == misc_value && amount > modifier) | |
+ modifier = amount; | |
} | |
return modifier; | |
@@ -3369,8 +3378,9 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_ | |
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) | |
{ | |
Modifier* mod = (*i)->GetModifier(); | |
- if (mod->m_miscvalue == misc_value && mod->m_amount < modifier) | |
- modifier = mod->m_amount; | |
+ int32 amount = mod->m_amount * (*i)->m_stackAmount; | |
+ if (mod->m_miscvalue == misc_value && amount < modifier) | |
+ modifier = amount; | |
} | |
return modifier; | |
@@ -3412,8 +3422,10 @@ bool Unit::AddAura(Aura *Aur) | |
// replace aura if next will > spell StackAmount | |
if(aurSpellInfo->StackAmount) | |
{ | |
- if(m_Auras.count(spair) >= aurSpellInfo->StackAmount) | |
- RemoveAura(i,AURA_REMOVE_BY_STACK); | |
+ Aur->m_stackAmount = i->second->m_stackAmount; | |
+ if(Aur->m_stackAmount < aurSpellInfo->StackAmount) | |
+ ++Aur->m_stackAmount; | |
+ RemoveAura(i,AURA_REMOVE_BY_STACK); | |
} | |
// if StackAmount==0 not allow auras from same caster | |
else | |
@@ -3885,7 +3897,18 @@ void Unit::RemoveSingleAuraFromStack(uint32 spellId, SpellEffectIndex effindex, | |
{ | |
AuraMap::iterator iter = m_Auras.find(spellEffectPair(spellId, effindex)); | |
if(iter != m_Auras.end()) | |
+ { | |
+ if(iter->second->m_stackAmount > 1) | |
+ { | |
+ // reapply modifier with reduced stack amount | |
+ iter->second->ApplyModifier(false,true); | |
+ --iter->second->m_stackAmount; | |
+ iter->second->ApplyModifier(true,true); | |
+ iter->second->UpdateSlotCounterAndDuration(); | |
+ return; // not remove aura if stack amount > 1 | |
+ } | |
RemoveAura(iter,mode); | |
+ } | |
} | |
void Unit::RemoveSingleSpellAurasByCasterSpell(uint32 spellId, uint64 casterGUID, AuraRemoveMode mode) | |
@@ -3908,7 +3931,6 @@ void Unit::RemoveSingleAuraByCasterSpell(uint32 spellId, SpellEffectIndex effind | |
} | |
} | |
- | |
void Unit::RemoveAurasDueToSpell(uint32 spellId, Aura* except) | |
{ | |
for (int i = 0; i < MAX_EFFECT_INDEX; ++i) | |
@@ -4023,6 +4045,8 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) | |
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Aura %u now is remove mode %d",Aur->GetModifier()->m_auraname, mode); | |
if (mode != AURA_REMOVE_BY_DELETE) // not unapply if target will deleted | |
Aur->ApplyModifier(false,true); | |
+ | |
+ Aur->m_stackAmount = 0; | |
if (Aur->_RemoveAura()) | |
{ | |
@@ -6110,13 +6134,11 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB | |
// stacking | |
CastSpell(this, 37658, true, NULL, triggeredByAura); | |
// counting | |
- int32 count = 0; | |
- AuraList const& dummyAura = GetAurasByType(SPELL_AURA_DUMMY); | |
- for(AuraList::const_iterator itr = dummyAura.begin(); itr != dummyAura.end(); ++itr) | |
- if((*itr)->GetId()==37658) | |
- ++count; | |
+ Aura * dummy = GetDummyAura(37658); | |
+ if (!dummy) | |
+ return false; | |
// release at 3 aura in stack (cont contain in basepoint of trigger aura) | |
- if(count < triggerAmount) | |
+ if(dummy->m_stackAmount < triggerAmount) | |
return false; | |
RemoveAurasDueToSpell(37658); | |
@@ -7220,7 +7242,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 | |
(*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0 ) | |
// 0 == any inventory type (not wand then) | |
{ | |
- DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; | |
+ DoneTotalMod *= ((*i)->GetModifier()->m_amount * (*i)->m_stackAmount +100.0f)/100.0f; | |
} | |
} | |
@@ -7228,13 +7250,13 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 | |
AuraList const& mDamageDoneVersus = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS); | |
for(AuraList::const_iterator i = mDamageDoneVersus.begin();i != mDamageDoneVersus.end(); ++i) | |
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue)) | |
- DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; | |
+ DoneTotalMod *= ((*i)->GetModifier()->m_amount * (*i)->m_stackAmount +100.0f)/100.0f; | |
// ..taken | |
AuraList const& mModDamagePercentTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN); | |
for(AuraList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i) | |
if( (*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto) ) | |
- TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; | |
+ TakenTotalMod *= ((*i)->GetModifier()->m_amount * (*i)->m_stackAmount +100.0f)/100.0f; | |
// .. taken pct: scripted (increases damage of * against targets *) | |
AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); | |
@@ -7553,7 +7575,7 @@ int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask) | |
// -1 == any item class (not wand then) | |
(*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0 ) | |
// 0 == any inventory type (not wand then) | |
- DoneAdvertisedBenefit += (*i)->GetModifier()->m_amount; | |
+ DoneAdvertisedBenefit += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; | |
if (GetTypeId() == TYPEID_PLAYER) | |
{ | |
@@ -7565,14 +7587,14 @@ int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask) | |
{ | |
// stat used stored in miscValueB for this aura | |
Stats usedStat = Stats((*i)->GetMiscBValue()); | |
- DoneAdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetModifier()->m_amount / 100.0f); | |
+ DoneAdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetModifier()->m_amount * (*i)->GetModifier()->m_amount / 100.0f); | |
} | |
} | |
// ... and attack power | |
AuraList const& mDamageDonebyAP = GetAurasByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER); | |
for(AuraList::const_iterator i =mDamageDonebyAP.begin();i != mDamageDonebyAP.end(); ++i) | |
if ((*i)->GetModifier()->m_miscvalue & schoolMask) | |
- DoneAdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetModifier()->m_amount / 100.0f); | |
+ DoneAdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetModifier()->m_amount * (*i)->GetModifier()->m_amount / 100.0f); | |
} | |
return DoneAdvertisedBenefit; | |
@@ -7587,13 +7609,13 @@ int32 Unit::SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit *pVic | |
AuraList const& mDamageDoneCreature = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE); | |
for(AuraList::const_iterator i = mDamageDoneCreature.begin();i != mDamageDoneCreature.end(); ++i) | |
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue)) | |
- TakenAdvertisedBenefit += (*i)->GetModifier()->m_amount; | |
+ TakenAdvertisedBenefit += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; | |
// ..taken | |
AuraList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_TAKEN); | |
for(AuraList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i) | |
if(((*i)->GetModifier()->m_miscvalue & schoolMask) != 0) | |
- TakenAdvertisedBenefit += (*i)->GetModifier()->m_amount; | |
+ TakenAdvertisedBenefit += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; | |
return TakenAdvertisedBenefit; | |
} | |
@@ -7878,7 +7900,7 @@ uint32 Unit::SpellHealingBonus(SpellEntry const *spellProto, uint32 healamount, | |
// Healing done percent | |
AuraList const& mHealingDonePct = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT); | |
for(AuraList::const_iterator i = mHealingDonePct.begin();i != mHealingDonePct.end(); ++i) | |
- heal *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f; | |
+ heal *= (100.0f + (*i)->GetModifier()->m_amount * (*i)->m_stackAmount) / 100.0f; | |
// apply spellmod to Done amount | |
if(Player* modOwner = GetSpellModOwner()) | |
@@ -7910,7 +7932,7 @@ int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask) | |
AuraList const& mHealingDone = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE); | |
for(AuraList::const_iterator i = mHealingDone.begin();i != mHealingDone.end(); ++i) | |
if(((*i)->GetModifier()->m_miscvalue & schoolMask) != 0) | |
- AdvertisedBenefit += (*i)->GetModifier()->m_amount; | |
+ AdvertisedBenefit += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; | |
// Healing bonus of spirit, intellect and strength | |
if (GetTypeId() == TYPEID_PLAYER) | |
@@ -7921,14 +7943,14 @@ int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask) | |
{ | |
// stat used dependent from misc value (stat index) | |
Stats usedStat = Stats((*i)->GetSpellProto()->EffectMiscValue[(*i)->GetEffIndex()]); | |
- AdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetModifier()->m_amount / 100.0f); | |
+ AdvertisedBenefit += int32(GetStat(usedStat) * (*i)->GetModifier()->m_amount * (*i)->m_stackAmount / 100.0f); | |
} | |
// ... and attack power | |
AuraList const& mHealingDonebyAP = GetAurasByType(SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER); | |
for(AuraList::const_iterator i = mHealingDonebyAP.begin();i != mHealingDonebyAP.end(); ++i) | |
if ((*i)->GetModifier()->m_miscvalue & schoolMask) | |
- AdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetModifier()->m_amount / 100.0f); | |
+ AdvertisedBenefit += int32(GetTotalAttackPowerValue(BASE_ATTACK) * (*i)->GetModifier()->m_amount * (*i)->m_stackAmount / 100.0f); | |
} | |
return AdvertisedBenefit; | |
} | |
@@ -7939,7 +7961,7 @@ int32 Unit::SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit *pVi | |
AuraList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_HEALING); | |
for(AuraList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i) | |
if ((*i)->GetModifier()->m_miscvalue & schoolMask) | |
- AdvertisedBenefit += (*i)->GetModifier()->m_amount; | |
+ AdvertisedBenefit += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; | |
return AdvertisedBenefit; | |
} | |
@@ -8065,7 +8087,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT | |
AuraList const& mDamageDoneCreature = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE); | |
for(AuraList::const_iterator i = mDamageDoneCreature.begin();i != mDamageDoneCreature.end(); ++i) | |
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue)) | |
- DoneFlatBenefit += (*i)->GetModifier()->m_amount; | |
+ DoneFlatBenefit += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; | |
// ..done | |
// SPELL_AURA_MOD_DAMAGE_DONE included in weapon damage | |
@@ -8080,7 +8102,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT | |
AuraList const& mCreatureAttackPower = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS); | |
for(AuraList::const_iterator i = mCreatureAttackPower.begin();i != mCreatureAttackPower.end(); ++i) | |
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue)) | |
- APbonus += (*i)->GetModifier()->m_amount; | |
+ APbonus += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; | |
} | |
else | |
{ | |
@@ -8090,7 +8112,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT | |
AuraList const& mCreatureAttackPower = GetAurasByType(SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS); | |
for(AuraList::const_iterator i = mCreatureAttackPower.begin();i != mCreatureAttackPower.end(); ++i) | |
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue)) | |
- APbonus += (*i)->GetModifier()->m_amount; | |
+ APbonus += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; | |
} | |
if (APbonus!=0) // Can be negative | |
@@ -8115,7 +8137,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT | |
AuraList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_TAKEN); | |
for(AuraList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i) | |
if((*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask()) | |
- TakenFlatBenefit += (*i)->GetModifier()->m_amount; | |
+ TakenFlatBenefit += (*i)->GetModifier()->m_amount * (*i)->m_stackAmount; | |
if(attType!=RANGED_ATTACK) | |
TakenFlatBenefit += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN); | |
@@ -8133,13 +8155,13 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT | |
AuraList const& mDamageDoneVersus = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS); | |
for(AuraList::const_iterator i = mDamageDoneVersus.begin();i != mDamageDoneVersus.end(); ++i) | |
if(creatureTypeMask & uint32((*i)->GetModifier()->m_miscvalue)) | |
- DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; | |
+ DoneTotalMod *= ((*i)->GetModifier()->m_amount * (*i)->m_stackAmount+100.0f)/100.0f; | |
// ..taken | |
AuraList const& mModDamagePercentTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN); | |
for(AuraList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i) | |
if((*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask()) | |
- TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; | |
+ TakenTotalMod *= ((*i)->GetModifier()->m_amount * (*i)->m_stackAmount+100.0f)/100.0f; | |
// .. taken pct: dummy auras | |
AuraList const& mDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY); | |
@@ -8198,13 +8220,13 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT | |
{ | |
AuraList const& mModMeleeDamageTakenPercent = pVictim->GetAurasByType(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT); | |
for(AuraList::const_iterator i = mModMeleeDamageTakenPercent.begin(); i != mModMeleeDamageTakenPercent.end(); ++i) | |
- TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; | |
+ TakenTotalMod *= ((*i)->GetModifier()->m_amount * (*i)->m_stackAmount+100.0f)/100.0f; | |
} | |
else | |
{ | |
AuraList const& mModRangedDamageTakenPercent = pVictim->GetAurasByType(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT); | |
for(AuraList::const_iterator i = mModRangedDamageTakenPercent.begin(); i != mModRangedDamageTakenPercent.end(); ++i) | |
- TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; | |
+ TakenTotalMod *= ((*i)->GetModifier()->m_amount * (*i)->m_stackAmount+100.0f)/100.0f; | |
} | |
// Mod damage taken from AoE spells | |
-- | |
1.6.4.4+GitX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment