*Fix Improved Insect Swarm - original patch by Zor

*Use target as source of area auras in Unit::AddAura(uint32 spellId, Unit *target)

--HG--
branch : trunk
This commit is contained in:
QAston
2009-08-28 14:03:18 +02:00
parent f2dc36be29
commit dc83c7759b
3 changed files with 32 additions and 8 deletions
+3 -3
View File
@@ -1192,9 +1192,9 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell
( 51474, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Astral Shift (Rank 1)
( 51478, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Astral Shift (Rank 2)
( 51479, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0, 0, 0), -- Astral Shift (Rank 3)
(51483, 0x00000001, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000001, 0.000000, 0.000000, 0),
(51485, 0x00000001, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000001, 0.000000, 0.000000, 0),
(51486, 0x00000001, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000001, 0.000000, 0.000000, 0),
( 51483, 0x01, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000001, 0, 0, 0), -- Storm, Earth and Fire
( 51485, 0x01, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000001, 0, 0, 0), -- Storm, Earth and Fire
( 51486, 0x01, 11, 0x20000000, 0x00000000, 0x00000000, 0x00004000, 0x00000001, 0, 0, 0), -- Storm, Earth and Fire
( 51521, 0x00, 11, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Stormstrike
( 51522, 0x00, 11, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Stormstrike
( 51528, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 2.5, 0, 0), -- Maelstrom Weapon (Rank 1)
+8
View File
@@ -521,6 +521,14 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
damage += int32(energy * multiple);
damage += int32(((Player*)m_caster)->GetComboPoints() * ap * 7 / 100);
}
// Wrath
else if (m_spellInfo->SpellFamilyFlags[0] & 0x00000001)
{
// Improved Insect Swarm
if (AuraEffect const * aurEff = m_caster->GetDummyAura(SPELLFAMILY_DRUID, 1771, 0))
if (unitTarget->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00200000))
damage = int32(damage*(100.0f+aurEff->GetAmount())/100.0f);
}
break;
}
case SPELLFAMILY_ROGUE:
+21 -5
View File
@@ -5888,10 +5888,10 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
{
if (procSpell->SpellVisual[0] == 750 && procSpell->EffectApplyAuraName[1] == 3)
{
if (target->GetTypeId() == TYPEID_UNIT)
if (target->GetTypeId() == TYPEID_UNIT)
{
triggered_spell_id = 54820;
break;
break;
}
}
return false;
@@ -9568,10 +9568,22 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
// Custom crit by class
switch(spellProto->SpellFamilyName)
{
case SPELLFAMILY_DRUID:
// Starfire
if (spellProto->SpellFamilyFlags[0] & 0x4 && spellProto->SpellIconID == 1485)
{
// Improved Insect Swarm
if (AuraEffect const * aurEff = GetDummyAura(SPELLFAMILY_DRUID, 1771, 0))
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00000002))
crit_chance+=aurEff->GetAmount();
break;
}
break;
case SPELLFAMILY_PALADIN:
// Sacred Shield
// Flash of light
if (spellProto->SpellFamilyFlags[0] & 0x40000000)
{
// Sacred Shield
AuraEffect const* aura = pVictim->GetAuraEffect(58597,1);
if (aura && aura->GetCasterGUID() == GetGUID())
crit_chance+=aura->GetAmount();
@@ -9599,7 +9611,6 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
break;
}
break;
}
}
break;
@@ -14499,11 +14510,16 @@ void Unit::AddAura(uint32 spellId, Unit *target)
return;
uint8 eff_mask=0;
Unit * source = this;
for(uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if(spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA || IsAreaAuraEffect(spellInfo->Effect[i]))
{
// Area auras applied as linked should have target as source (otherwise they'll be removed after first aura update)
if (spellInfo->Effect[i] != SPELL_EFFECT_APPLY_AURA)
source = target;
if(target->IsImmunedToSpellEffect(spellInfo, i))
continue;
eff_mask|=1<<i;
@@ -14514,7 +14530,7 @@ void Unit::AddAura(uint32 spellId, Unit *target)
return;
// Because source is not give, use caster as source
Aura *Aur = new Aura(spellInfo, eff_mask, target, this, this);
Aura *Aur = new Aura(spellInfo, eff_mask, target, source, this);
target->AddAura(Aur);
}