diff options
author | megamage <none@none> | 2009-06-13 13:28:41 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-13 13:28:41 -0500 |
commit | 4aa530e48f5d999a6b78483e7edbc4b8d89658b8 (patch) | |
tree | ea570702e91015012983ee60310fc42da1cdaf4a /src | |
parent | d55cc087ee0ca06569ad07d8228369188c5bd94e (diff) |
*Move some aura-proc-when-reaching-stacks cases to Unit::AddAura
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Spell.cpp | 32 | ||||
-rw-r--r-- | src/game/Unit.cpp | 52 |
2 files changed, 43 insertions, 41 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index c4047a56226..115419245d0 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1274,38 +1274,6 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) if(m_spellInfo->SpellFamilyFlags[1] & 0x000020) m_caster->CastSpell(unit, 41637, true, NULL, NULL, m_originalCasterGUID); } - else - { - // spell is triggered with only stackamount change but no amount change - switch(m_spellInfo->Id) - { - case 28832: // Mark of Korth'azz - case 28833: // Mark of Blaumeux - case 28834: // Mark of Rivendare - case 28835: // Mark of Zeliek - { - Aura *aur = unit->GetAura(m_spellInfo->Id); - if(!aur) break; - //int8 stack = GetParentAura()->GetStackAmount(); - int8 stack = aur->GetStackAmount(); - ++stack; - int32 damage; - switch(stack) - { - case 1: damage = 0; break; - case 2: damage = 500; break; - case 3: damage = 1000; break; - case 4: damage = 1500; break; - case 5: damage = 4000; break; - case 6: damage = 12000; break; - default:damage = 20000 + 1000 * (stack - 7); break; - } - if(damage) - m_caster->CastCustomSpell(28836, SPELLVALUE_BASE_POINT0, damage, unit); - break; - } - } - } } // Set aura only when successfully applied if (unit->AddAura(Aur, false)) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 703201c59d9..569d9e5a5ce 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3857,13 +3857,14 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects) return false; } - SpellEntry const* aurSpellInfo = Aur->GetSpellProto(); + SpellEntry const * aurSpellInfo = Aur->GetSpellProto(); + uint32 aurId = aurSpellInfo->Id; // passive and persistent and Incanter's Absorption auras can stack with themselves any number of times - if (!Aur->IsPassive() && !Aur->IsPersistent() && aurSpellInfo->Id != 44413) + if (!Aur->IsPassive() && !Aur->IsPersistent() && aurId != 44413) { // find current aura from spell and change it's stackamount - if (Aura * foundAura = GetAura(aurSpellInfo->Id, Aur->GetCasterGUID())) + if (Aura * foundAura = GetAura(aurId, Aur->GetCasterGUID())) { if(aurSpellInfo->StackAmount) { @@ -3871,7 +3872,40 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects) if (stackAmount > aurSpellInfo->StackAmount) stackAmount = aurSpellInfo->StackAmount; Aur->SetStackAmount(stackAmount, false); + + // spell is triggered with only stackamount change but no amount change + switch(aurId) + { + case 28832: // Mark of Korth'azz + case 28833: // Mark of Blaumeux + case 28834: // Mark of Rivendare + case 28835: // Mark of Zeliek + if(Unit *caster = Aur->GetCaster()) // actually we can also use cast(this, originalcasterguid) + { + int32 damage; + switch(stackAmount) + { + case 1: damage = 0; break; + case 2: damage = 500; break; + case 3: damage = 1000; break; + case 4: damage = 1500; break; + case 5: damage = 4000; break; + case 6: damage = 12000; break; + default:damage = 20000 + 1000 * (stackAmount - 7); break; + } + if(damage) + caster->CastCustomSpell(28836, SPELLVALUE_BASE_POINT0, damage, this); + } + break; + case 64821: // Fuse Armor (Razorscale) + if(stackAmount == aurSpellInfo->StackAmount) + CastSpell(this, 64774, true, NULL, NULL, Aur->GetCasterGUID()); + break; + } } + + // Use the new one to replace the old one + // This is the only place where AURA_REMOVE_BY_STACK should be used RemoveAura(foundAura, AURA_REMOVE_BY_STACK); } } @@ -3917,16 +3951,16 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects) // add aura, register in lists and arrays Aur->_AddAura(); - m_Auras.insert(AuraMap::value_type(Aur->GetId(), Aur)); + m_Auras.insert(AuraMap::value_type(aurId, Aur)); - if(Aur->GetSpellProto()->AuraInterruptFlags) + if(aurSpellInfo->AuraInterruptFlags) { m_interruptableAuras.push_back(Aur); - AddInterruptMask(Aur->GetSpellProto()->AuraInterruptFlags); + AddInterruptMask(aurSpellInfo->AuraInterruptFlags); } - if((Aur->GetSpellProto()->Attributes & SPELL_ATTR_BREAKABLE_BY_DAMAGE + if((aurSpellInfo->Attributes & SPELL_ATTR_BREAKABLE_BY_DAMAGE && !Aur->IsAuraType(SPELL_AURA_MOD_POSSESS)) //only dummy aura is breakable - || ((GetAllSpellMechanicMask(Aur->GetSpellProto()) & 1<<MECHANIC_KNOCKOUT) && Aur->IsAuraType(SPELL_AURA_MOD_STUN))) + || ((GetAllSpellMechanicMask(aurSpellInfo) & 1<<MECHANIC_KNOCKOUT) && Aur->IsAuraType(SPELL_AURA_MOD_STUN))) { m_ccAuras.push_back(Aur); } @@ -3934,7 +3968,7 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects) if (handleEffects) Aur->HandleEffects(true); - sLog.outDebug("Aura %u now is in use", Aur->GetId()); + sLog.outDebug("Aura %u now is in use", aurId); return true; } |