[11512] Fixes for channeled spells casting.

* Set as expected caster channeling target to created dynamic object
  at persistent aura area spell casts for channeled spell.
* Select correct caster/target for triggered spell in case channeled perioding trigger aura.
This commit is contained in:
VladimirMangos 2011-05-20 22:42:36 +04:00
parent 489dc80875
commit 8022cef6a7
3 changed files with 48 additions and 8 deletions

View file

@ -695,7 +695,7 @@ void Spell::prepareDataForTriggerSystem()
switch (m_spellInfo->SpellFamilyName)
{
case SPELLFAMILY_MAGE:
// Arcane Missles / Blizzard triggers need do it
// Arcane Missiles / Blizzard triggers need do it
if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000200080))
m_canTrigger = true;
// Clearcasting trigger need do it
@ -3166,16 +3166,16 @@ void Spell::cast(bool skipCheck)
void Spell::handle_immediate()
{
// start channeling if applicable
// process immediate effects (items, ground, etc.) also initialize some variables
_handle_immediate_phase();
// start channeling if applicable (after _handle_immediate_phase for get persistent effect dynamic object for channel target
if (IsChanneledSpell(m_spellInfo) && m_duration)
{
m_spellState = SPELL_STATE_CASTING;
SendChannelStart(m_duration);
}
// process immediate effects (items, ground, etc.) also initialize some variables
_handle_immediate_phase();
for(TargetList::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
DoAllEffectOnTarget(&(*ihit));
@ -4010,8 +4010,11 @@ void Spell::SendChannelStart(uint32 duration)
{
WorldObject* target = NULL;
// select dynobject created by first effect if any
if (m_spellInfo->Effect[EFFECT_INDEX_0] == SPELL_EFFECT_PERSISTENT_AREA_AURA)
target = m_caster->GetDynObject(m_spellInfo->Id, EFFECT_INDEX_0);
// select first not resisted target from target list for _0_ effect
if (!m_UniqueTargetInfo.empty())
else if (!m_UniqueTargetInfo.empty())
{
for(TargetList::const_iterator itr = m_UniqueTargetInfo.begin(); itr != m_UniqueTargetInfo.end(); ++itr)
{