- Timestamp:
- 11/22/08 02:05:14 (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Spell.cpp
r284 r285 49 49 #include "BattleGround.h" 50 50 #include "Util.h" 51 #include "TemporarySummon.h" 51 52 52 53 #define SPELL_CHANNEL_UPDATE_INTERVAL 1000 … … 2188 2189 } 2189 2190 2191 // Unsummon summon as possessed creatures on spell cancel 2192 for (int i = 0; i < 3; i++) 2193 { 2194 if (m_spellInfo->Effect[i] == SPELL_EFFECT_SUMMON && 2195 (m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED || 2196 m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 || 2197 m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3)) 2198 { 2199 // Possession is removed in the UnSummon function 2200 if (m_caster->GetCharm()) 2201 ((TemporarySummon*)m_caster->GetCharm())->UnSummon(); 2202 } 2203 } 2204 2190 2205 finish(false); 2191 2206 m_caster->RemoveDynObject(m_spellInfo->Id); -
trunk/src/game/SpellHandler.cpp
r284 r285 359 359 return; 360 360 361 // Remove possess/charm/sight aura from the possessed/charmed as well362 // TODO: Remove this once the ability to cancel aura sets at once is implemented363 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 cancel373 _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 function386 ((TemporarySummon*)_player->GetCharm())->UnSummon();387 }388 }389 }390 391 361 // not allow remove non positive spells and spells with attr SPELL_ATTR_CANT_CANCEL 392 362 if(!IsPositiveSpell(spellId) || (spellInfo->Attributes & SPELL_ATTR_CANT_CANCEL)) 393 363 return; 394 364 365 // channeled spell case (it currently casted then) 366 if(IsChanneledSpell(spellInfo)) 367 { 368 if(Spell* spell = _player->m_currentSpells[CURRENT_CHANNELED_SPELL]) 369 { 370 if(spell->m_spellInfo->Id==spellId) 371 { 372 spell->cancel(); 373 spell->SetReferencedFromCurrent(false); 374 _player->m_currentSpells[CURRENT_CHANNELED_SPELL] = NULL; 375 } 376 } 377 return; 378 } 379 380 // non channeled case 395 381 _player->RemoveAurasDueToSpellByCancel(spellId); 396 397 if (spellId == 2584) // Waiting to resurrect spell cancel, we must remove player from resurrect queue398 {399 BattleGround *bg = _player->GetBattleGround();400 if(!bg)401 return;402 bg->RemovePlayerFromResurrectQueue(_player->GetGUID());403 }404 382 } 405 383 -
trunk/src/game/Unit.cpp
r284 r285 47 47 #include "CellImpl.h" 48 48 #include "Path.h" 49 #include "TemporarySummon.h"50 49 51 50 #include <math.h> … … 3413 3412 if (m_currentSpells[CURRENT_CHANNELED_SPELL] && (!spell_id || m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id==spell_id)) 3414 3413 { 3415 // Unsummon any summoned as possessed creatures on channel interrupt3416 SpellEntry const *spellInfo = m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo;3417 for (int i = 0; i < 3; i++)3418 {3419 if (spellInfo->Effect[i] == SPELL_EFFECT_SUMMON &&3420 (spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED ||3421 spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 ||3422 spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3))3423 {3424 // Possession is removed in the UnSummon function3425 if (GetCharm())3426 ((TemporarySummon*)GetCharm())->UnSummon();3427 }3428 }3429 3430 3414 if (m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED) 3431 3415 m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel();