diff options
author | QAston <none@none> | 2009-04-10 14:35:17 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-04-10 14:35:17 +0200 |
commit | 9ba44b7eb8416fe5f32f5ba9b6827cb36cb655de (patch) | |
tree | 6d047c74dd292773b81ed9a161203e5994325f20 | |
parent | ef5c5110877a79f1fb84727e246908ac40ac1b55 (diff) |
*Make shattered barrier and prayer of mending work again, Refresh aura when recasted on target with full stackamount.
--HG--
branch : trunk
-rw-r--r-- | src/game/SpellAuras.cpp | 27 | ||||
-rw-r--r-- | src/game/Unit.cpp | 19 |
2 files changed, 21 insertions, 25 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index c4857fc9ccf..063450b471a 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1192,22 +1192,23 @@ void Aura::SetStackAmount(uint8 stackAmount) { Unit *target = GetTarget(); Unit *caster = GetCaster(); - if (!target || !caster) - return; - m_stackAmount = stackAmount; - for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i) + if (target && caster) { - if (AuraEffect * part = GetPartAura(i)) + m_stackAmount = stackAmount; + for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i) { - int32 amount = m_stackAmount * caster->CalculateSpellDamage(m_spellProto, part->GetEffIndex(), part->GetBasePoints(), target); - // Reapply if amount change - if (amount!=part->GetAmount()) + if (AuraEffect * part = GetPartAura(i)) { - bool Real = bool (part->m_spellmod); - // Auras which are applying spellmod should have removed spellmods for real - part->ApplyModifier(false,Real); - part->SetAmount(amount); - part->ApplyModifier(true, Real); + int32 amount = m_stackAmount * caster->CalculateSpellDamage(m_spellProto, part->GetEffIndex(), part->GetBasePoints(), target); + // Reapply if amount change + if (amount!=part->GetAmount()) + { + bool Real = bool (part->m_spellmod); + // Auras which are applying spellmod should have removed spellmods for real + part->ApplyModifier(false,Real); + part->SetAmount(amount); + part->ApplyModifier(true, Real); + } } } } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index d9f4ca101fa..cd73c5083fe 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2081,7 +2081,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe if (auraeff->GetAmount()<=0) { uint32 removedAuras = pVictim->m_removedAuras.size(); - pVictim->RemoveAura(aura); + pVictim->RemoveAura(aura, AURA_REMOVE_BY_ENEMY_SPELL); if (removedAuras+1<pVictim->m_removedAuras.size()) i=vSchoolAbsorb.begin(); } @@ -2118,7 +2118,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe (*i)->SetAmount((*i)->GetAmount()-currentAbsorb); if((*i)->GetAmount() <= 0) { - pVictim->RemoveAurasDueToSpell((*i)->GetId()); + pVictim->RemoveAura((*i)->GetParentAura(), AURA_REMOVE_BY_ENEMY_SPELL); next = vManaShield.begin(); } @@ -3756,6 +3756,8 @@ bool Unit::AddAura(Aura *Aur) { if(foundAura->GetStackAmount() < aurSpellInfo->StackAmount) foundAura->SetStackAmount(foundAura->GetStackAmount()+1); + else + foundAura->RefreshAura(); delete Aur; return true; } @@ -12363,8 +12365,6 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue( AuraEffect* triggeredByAura ) else radius = GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() ,sSpellRangeStore.LookupEntry(spellProto->rangeIndex)); - //Get max possible jumps for aura to get proper charges amount for target - if(Player* caster = ((Player*)triggeredByAura->GetCaster())) { caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius,NULL); @@ -12372,7 +12372,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue( AuraEffect* triggeredByAura ) if (Unit* target= GetNextRandomRaidMemberOrPet(radius)) { CastCustomSpell(target,spellProto->Id,&heal,NULL,NULL,true,NULL,triggeredByAura,caster->GetGUID()); - if (Aura * aur = GetAura(spellProto->Id, caster->GetGUID())) + if (Aura * aur = target->GetAura(spellProto->Id, caster->GetGUID())) aur->SetAuraCharges(jumps); //bonus must be applied after aura cast on target @@ -12426,19 +12426,14 @@ bool Unit::HandleAuraRaidProcFromCharge( AuraEffect* triggeredByAura ) else radius = GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() ,sSpellRangeStore.LookupEntry(spellProto->rangeIndex)); - //Get max possible jumps for aura to get proper charges amount for target - int32 maxJumps = spellProto->procCharges; - if(Player* caster = ((Player*)triggeredByAura->GetCaster())) { caster->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius,NULL); - caster->ApplySpellMod(spellProto->Id, SPELLMOD_CHARGES, maxJumps, NULL); - if (Unit* target= GetNextRandomRaidMemberOrPet(radius)) { - CastSpell(this, spellProto, true,NULL,triggeredByAura,caster_guid); - if (Aura * aur = GetAura(spellProto->Id, caster->GetGUID())) + CastSpell(target, spellProto, true,NULL,triggeredByAura,caster_guid); + if (Aura * aur = target->GetAura(spellProto->Id, caster->GetGUID())) aur->SetAuraCharges(jumps); } } |