aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp2
-rw-r--r--src/game/SpellEffects.cpp2
-rw-r--r--src/game/SpellMgr.cpp2
-rw-r--r--src/game/Unit.cpp23
-rw-r--r--src/game/Unit.h2
5 files changed, 17 insertions, 14 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 0a88010a6c8..66f2eded6ac 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2289,7 +2289,7 @@ void Spell::handle_immediate()
if (duration)
{
//apply haste mods
- m_caster->ModSpellCastTime(m_spellInfo, duration);
+ m_caster->ModSpellCastTime(m_spellInfo, duration, this);
// Apply duration mod
if(Player* modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 7ad958590f5..6d50338c9d6 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2256,7 +2256,7 @@ void Spell::EffectApplyAura(uint32 i)
//mod duration of channeled aura by spell haste
if (IsChanneledSpell(m_spellInfo))
- caster->ModSpellCastTime(m_spellInfo, duration);
+ caster->ModSpellCastTime(m_spellInfo, duration, this);
// if Aura removed and deleted, do not continue.
if(duration== 0 && !(Aur->IsPermanent()))
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 388ace02ae1..e294742e5c1 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -245,7 +245,7 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell)
int32 castTime = spellCastTimeEntry->CastTime;
if (spell && spell->GetCaster())
- spell->GetCaster()->ModSpellCastTime(spellInfo, castTime);
+ spell->GetCaster()->ModSpellCastTime(spellInfo, castTime, spell);
if (spellInfo->Attributes & SPELL_ATTR_RANGED && (!spell || !(spell->IsAutoRepeat())))
castTime += 500;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 1002318f79e..049991d229e 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -487,7 +487,7 @@ void Unit::RemoveSpellsCausingAuraWithDispel(AuraType auraType, Spell * spell)
if (*iter)
{
- if (!(*iter)->GetDispelChance(spell))
+ if (!(*iter)->GetDispelChance( spell))
continue;
RemoveAurasDueToSpell((*iter)->GetId());
if (!m_modAuras[auraType].empty())
@@ -4197,7 +4197,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
&& AurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()]!= SPELL_AURA_DUMMY)
//don't stop channeling of scripted spells (this is actually a hack)
{
- caster->InterruptSpell(CURRENT_CHANNELED_SPELL);
+ caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel();
}
}
}
@@ -6344,23 +6344,27 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{
if (dummySpell->Id == 17619)
{
- if (procSpell->SpellFamilyName == SPELLFAMILY_POTION)
+ if (procSpell->Category==4) //potion category
{
for (uint8 i=0;i<3;i++)
{
if (procSpell->Effect[i]==SPELL_EFFECT_HEAL)
{
+ basepoints0 = damage * 0.4f;
triggered_spell_id = 21399;
}
else if (procSpell->Effect[i]==SPELL_EFFECT_ENERGIZE)
{
- triggered_spell_id = 21400;
+ basepoints0 = CalculateSpellDamage(procSpell,i,procSpell->EffectBasePoints[i],this) * 0.4f;
+ triggered_spell_id = 21400;
}
else continue;
- basepoints0 = CalculateSpellDamage(procSpell,i,procSpell->EffectBasePoints[i],this) * 0.4f;
+
CastCustomSpell(this,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
}
- return true;
+ if (triggered_spell_id)
+ return true;
+ return false;
}
}
}
@@ -10308,13 +10312,13 @@ int32 Unit::ModSpellDuration(SpellEntry const* spellProto, uint8 effect_index, U
return duration>0 ? duration : 0;
}
-void Unit::ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime)
+void Unit::ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime, Spell const * spell)
{
if (!spellProto || castTime<0)
return;
//called from caster
if(Player* modOwner = GetSpellModOwner())
- modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CASTING_TIME, castTime);
+ modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CASTING_TIME, castTime, spell);
if( !(spellProto->Attributes & (SPELL_ATTR_UNK4|SPELL_ATTR_UNK5)) )
castTime = int32( float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED));
@@ -11280,12 +11284,11 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
continue;
procTriggered.push_back( ProcTriggeredData(spellProcEvent, itr->second) );
- }
+ }
// Nothing found
if (procTriggered.empty())
return;
-
// Handle effects proceed this time
for(ProcTriggeredList::iterator i = procTriggered.begin(); i != procTriggered.end(); ++i)
{
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 449df62109e..8d08f793eac 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1477,7 +1477,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
int32 CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_index, int32 basePoints, Unit const* target);
int32 CalcSpellDuration(SpellEntry const* spellProto);
int32 ModSpellDuration(SpellEntry const* spellProto, uint8 effect_index, Unit const* target, int32 duration);
- void ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime);
+ void ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime, Spell const * spell=NULL);
float CalculateLevelPenalty(SpellEntry const* spellProto) const;
void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); }