Skip to content

Commit

Permalink
[10996] Move set max original aura stack cases to aura holder creating
Browse files Browse the repository at this point in the history
This will avoid show unexpected "gain Name Name(2) Name(N)" spam in log.

Maybe exist more nice way seelct like spells instead raw listing but i not see currently it.
  • Loading branch information
VladimirMangos committed Jan 10, 2011
1 parent 8e3ef13 commit 01b46af
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 49 deletions.
63 changes: 33 additions & 30 deletions src/game/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2035,6 +2035,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
// Pet will be following owner, this makes him stop
target->addUnitState(UNIT_STAT_STUNNED);
return;
case 58914: // Kill Command
target->CastSpell(target, 34027, true, NULL, this);
return;
case 62061: // Festive Holiday Mount
if (target->HasAuraType(SPELL_AURA_MOUNTED))
// Reindeer Transformation
Expand All @@ -2053,6 +2056,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
case 71342: // Big Love Rocket
Spell::SelectMountByAreaAndSkill(target, 71344, 71345, 71346, 71347, 0);
return;
case 71563: // Deadly Precision
target->CastSpell(target, 71564, true, NULL, this);
return;
case 72286: // Invincible
Spell::SelectMountByAreaAndSkill(target, 72281, 72282, 72283, 72284, 0);
return;
Expand Down Expand Up @@ -2117,17 +2123,8 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
switch(GetId())
{
case 55198: // Tidal Force
{
// apply max stack bufs
SpellEntry const* buffEntry = sSpellStore.LookupEntry(55166);
if (!buffEntry)
return;

for(uint32 k = 0; k < buffEntry->StackAmount; ++k)
target->CastSpell(target, buffEntry, true, NULL, this);

target->CastSpell(target, 55166, true, NULL, this);
return;
}
}

// Earth Shield
Expand Down Expand Up @@ -2361,38 +2358,30 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return;
case 24658: // Unstable Power
{
uint32 spellId = 24659;
if (apply)
{
SpellEntry const *spell = sSpellStore.LookupEntry(spellId);
Unit* caster = GetCaster();
if (!spell || !caster)
if (!caster)
return;

for (uint32 i = 0; i < spell->StackAmount; ++i)
caster->CastSpell(target, spellId, true, NULL, NULL, GetCasterGuid());

return;
caster->CastSpell(target, 24659, true, NULL, NULL, GetCasterGuid());
}
target->RemoveAurasDueToSpell(spellId);
else
target->RemoveAurasDueToSpell(24659);
return;
}
case 24661: // Restless Strength
{
uint32 spellId = 24662;
if (apply)
{
SpellEntry const* spell = sSpellStore.LookupEntry(spellId);
Unit* caster = GetCaster();
if (!spell || !caster)
if (!caster)
return;

for (uint32 i=0; i < spell->StackAmount; ++i)
caster->CastSpell(target, spell->Id, true, NULL, NULL, GetCasterGuid());

return;
caster->CastSpell(target, 24662, true, NULL, NULL, GetCasterGuid());
}
target->RemoveAurasDueToSpell(spellId);
else
target->RemoveAurasDueToSpell(24662);
return;
}
case 29266: // Permanent Feign Death
Expand Down Expand Up @@ -8035,11 +8024,25 @@ m_permanent(false), m_isRemovedOnShapeLost(true), m_deleted(false), m_in_use(0)
if(modOwner)
modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, m_procCharges);

if (caster && caster->GetObjectGuid().IsUnit() && m_spellProto->Id == 22959) // Improved Scorch
// some custom stack values at aura holder create
switch (m_spellProto->Id)
{
// Glyph of Improved Scorch
if (Aura* glyph = ((Unit*)caster)->GetDummyAura(56371))
m_stackAmount = glyph->GetModifier()->m_amount;
case 22959: // Improved Scorch
if (caster && caster->GetObjectGuid().IsUnit())
// Glyph of Improved Scorch
if (Aura* glyph = ((Unit*)caster)->GetDummyAura(56371))
m_stackAmount = glyph->GetModifier()->m_amount;
break;
// some auras applied with max stack
case 24575: // Brittle Armor
case 24662: // Restless Strength
case 24659: // Unstable Power
case 26464: // Mercurial Shield
case 34027: // Kill Command
case 55166: // Tidal Force
case 71564: // Deadly Precision
m_stackAmount = m_spellProto->StackAmount;
break;
}

for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
Expand Down
20 changes: 2 additions & 18 deletions src/game/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2887,28 +2887,12 @@ void Spell::EffectTriggerSpell(SpellEffectIndex effIndex)
return;
// Brittle Armor - (need add max stack of 24575 Brittle Armor)
case 29284:
{
// Brittle Armor
SpellEntry const* spell = sSpellStore.LookupEntry(24575);
if (!spell)
return;

for (uint32 j=0; j < spell->StackAmount; ++j)
m_caster->CastSpell(unitTarget, spell->Id, true, m_CastItem, NULL, m_originalCasterGUID);
m_caster->CastSpell(unitTarget, 24575, true, m_CastItem, NULL, m_originalCasterGUID);
return;
}
// Mercurial Shield - (need add max stack of 26464 Mercurial Shield)
case 29286:
{
// Mercurial Shield
SpellEntry const* spell = sSpellStore.LookupEntry(26464);
if (!spell)
return;

for (uint32 j=0; j < spell->StackAmount; ++j)
m_caster->CastSpell(unitTarget, spell->Id, true, m_CastItem, NULL, m_originalCasterGUID);
m_caster->CastSpell(unitTarget, 26464, true, m_CastItem, NULL, m_originalCasterGUID);
return;
}
// Righteous Defense
case 31980:
{
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10995"
#define REVISION_NR "10996"
#endif // __REVISION_NR_H__

0 comments on commit 01b46af

Please sign in to comment.