361 | | // Remove possess/charm/sight aura from the possessed/charmed as well |
362 | | // TODO: Remove this once the ability to cancel aura sets at once is implemented |
363 | | if(_player->GetCharm() || _player->GetFarsightTarget()) |
364 | | { |
365 | | for (int i = 0; i < 3; ++i) |
366 | | { |
367 | | if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS || |
368 | | spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_POSSESS_PET || |
369 | | spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_CHARM || |
370 | | spellInfo->EffectApplyAuraName[i] == SPELL_AURA_BIND_SIGHT) |
371 | | { |
372 | | // Fix me: creature may be killed during player aura cancel |
373 | | _player->RemoveAurasDueToSpellByCancel(spellId); |
374 | | if (_player->GetCharm()) |
375 | | _player->GetCharm()->RemoveAurasDueToSpellByCancel(spellId); |
376 | | else if (_player->GetFarsightTarget() && _player->GetFarsightTarget()->GetTypeId() != TYPEID_DYNAMICOBJECT) |
377 | | ((Unit*)_player->GetFarsightTarget())->RemoveAurasDueToSpellByCancel(spellId); |
378 | | return; |
379 | | } |
380 | | else if (spellInfo->Effect[i] == SPELL_EFFECT_SUMMON && |
381 | | (spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED || |
382 | | spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 || |
383 | | spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3)) |
384 | | { |
385 | | // Possession is removed in the UnSummon function |
386 | | ((TemporarySummon*)_player->GetCharm())->UnSummon(); |
387 | | } |
388 | | } |
389 | | } |
390 | | |