diff options
| author | QAston <none@none> | 2009-03-22 16:24:53 +0100 | 
|---|---|---|
| committer | QAston <none@none> | 2009-03-22 16:24:53 +0100 | 
| commit | a0530658ff452996cc56126d972f97b9a515559d (patch) | |
| tree | a76966560d7a3e15021695d668b88618f8a2c26d /src/game/Spell.cpp | |
| parent | f4d3a583bd6a7d35f250be6ad18a8f1cc2f959fb (diff) | |
*Fix blood frenzy remove (and possibly some other SPELL_AURA_ADD_TARGET_TRIGGER auras too).
*Fix some problems with Cut to the Chase.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
| -rw-r--r-- | src/game/Spell.cpp | 19 | 
1 files changed, 16 insertions, 3 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 4ae1e693a55..ea0aaeebd35 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1183,10 +1183,23 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)      if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->IsAIEnabled)          ((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo); -    for(ChanceTriggerSpells::const_iterator i = m_ChanceTriggerSpells.begin(); i != m_ChanceTriggerSpells.end(); ++i) +    if (m_ChanceTriggerSpells.size())      { -        if(roll_chance_i(i->second)) -            m_caster->CastSpell(unit, i->first, true); +        int _duration=0; +        for(ChanceTriggerSpells::const_iterator i = m_ChanceTriggerSpells.begin(); i != m_ChanceTriggerSpells.end(); ++i) +        { +            if(roll_chance_i(i->second)) +            { +                m_caster->CastSpell(unit, i->first, true); +                // SPELL_AURA_ADD_TARGET_TRIGGER auras shouldn't trigger auras without duration +                // set duration equal to triggering spell +                if (GetSpellDuration(i->first)==-1) +                    // get duration from aura-only once +                    if (!_duration) +                        _duration = unit->GetAuraByCasterSpell(m_spellInfo->Id, m_caster->GetGUID())->GetAuraDuration(); +                    unit->SetAurasDurationByCasterSpell(i->first->Id, m_caster->GetGUID(), _duration); +            } +        }      }      if(m_customAttr & SPELL_ATTR_CU_LINK_HIT)  | 
