From a0530658ff452996cc56126d972f97b9a515559d Mon Sep 17 00:00:00 2001 From: QAston Date: Sun, 22 Mar 2009 16:24:53 +0100 Subject: *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 --- src/game/Spell.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/game/Spell.cpp') 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) -- cgit v1.2.3