diff options
author | megamage <none@none> | 2009-05-26 16:00:19 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-26 16:00:19 -0500 |
commit | 38f4a60bebf840cc4000e1c16d1f7f35ac2beb12 (patch) | |
tree | 01d4a46ad51b87ca50b0ab9a337cfe9d535f8ae3 /src | |
parent | ce8b7a68398bab602d8a8f71c7c3dbab5af137ea (diff) |
*Correct some aura interrupt flags
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Spell.cpp | 15 | ||||
-rw-r--r-- | src/game/ThreatManager.cpp | 2 | ||||
-rw-r--r-- | src/game/Unit.cpp | 4 | ||||
-rw-r--r-- | src/game/Unit.h | 10 |
4 files changed, 21 insertions, 10 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 02c6083bde7..c6740e22765 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1184,8 +1184,9 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) } unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL); - if(m_customAttr & SPELL_ATTR_CU_AURA_CC) - unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CC); + //TODO: This is a hack. But we do not know what types of stealth should be interrupted by CC + if((m_customAttr & SPELL_ATTR_CU_AURA_CC) && unit->IsControlledByPlayer()) + unit->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); } else { @@ -2466,7 +2467,17 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect* triggeredByAura // stealth must be removed at cast starting (at show channel bar) // skip triggered spell (item equip spell casting and other not explicit character casts/item uses) if(isSpellBreakStealth(m_spellInfo) ) + { m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CAST); + for(uint32 i = 0; i < 3; ++i) + { + if(spellmgr.EffectTargetType[m_spellInfo->Effect[i]] == SPELL_REQUIRE_UNIT) + { + m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_SPELL_ATTACK); + break; + } + } + } m_caster->SetCurrentCastedSpell( this ); m_selfContainer = &(m_caster->m_currentSpells[GetCurrentContainer()]); diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index 33ca708a79f..a0459aa81dc 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -289,7 +289,7 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe assert(target); // if the ref has status online the target must be there ! // some units are prefered in comparison to others - if(!noPriorityTargetFound && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask()) || target->hasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_DAMAGE)) ) + if(!noPriorityTargetFound && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask()) || target->hasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_TAKE_DAMAGE)) ) { if(iter != lastRef) { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 608932b531a..e2db82879a4 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -579,7 +579,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa if (damagetype != NODAMAGE) { // interrupting auras with AURA_INTERRUPT_FLAG_DAMAGE before checking !damage (absorbed damage breaks that type of auras) - pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DAMAGE, spellProto ? spellProto->Id : 0); + pVictim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TAKE_DAMAGE, spellProto ? spellProto->Id : 0); pVictim->RemoveSpellbyDamageTaken(damage, spellProto ? spellProto->Id : 0); } @@ -2359,7 +2359,7 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex return; CombatStart(pVictim); - RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ATTACK); + RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MELEE_ATTACK); uint32 hitInfo; if (attType == BASE_ATTACK) diff --git a/src/game/Unit.h b/src/game/Unit.h index f92c5335b5b..477aaa334c2 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -60,8 +60,8 @@ enum SpellChannelInterruptFlags enum SpellAuraInterruptFlags { AURA_INTERRUPT_FLAG_HITBYSPELL = 0x00000001, // 0 removed when getting hit by a negative spell? - AURA_INTERRUPT_FLAG_DAMAGE = 0x00000002, // 1 removed by any damage - AURA_INTERRUPT_FLAG_CC = 0x00000004, // 2 crowd control + AURA_INTERRUPT_FLAG_TAKE_DAMAGE = 0x00000002, // 1 removed by any damage + AURA_INTERRUPT_FLAG_CAST = 0x00000004, // 2 cast any spells AURA_INTERRUPT_FLAG_MOVE = 0x00000008, // 3 removed by any movement AURA_INTERRUPT_FLAG_TURNING = 0x00000010, // 4 removed by any turning AURA_INTERRUPT_FLAG_JUMP = 0x00000020, // 5 removed by entering combat @@ -71,8 +71,8 @@ enum SpellAuraInterruptFlags AURA_INTERRUPT_FLAG_NOT_SHEATHED = 0x00000200, // 9 removed by unsheathing AURA_INTERRUPT_FLAG_TALK = 0x00000400, // 10 talk to npc / loot? action on creature AURA_INTERRUPT_FLAG_USE = 0x00000800, // 11 mine/use/open action on gameobject - AURA_INTERRUPT_FLAG_ATTACK = 0x00001000, // 12 removed by attacking - AURA_INTERRUPT_FLAG_CAST = 0x00002000, // 13 ??? + AURA_INTERRUPT_FLAG_MELEE_ATTACK = 0x00001000, // 12 removed by attacking + AURA_INTERRUPT_FLAG_SPELL_ATTACK = 0x00002000, // 13 ??? AURA_INTERRUPT_FLAG_UNK14 = 0x00004000, // 14 AURA_INTERRUPT_FLAG_TRANSFORM = 0x00008000, // 15 removed by transform? AURA_INTERRUPT_FLAG_UNK16 = 0x00010000, // 16 @@ -85,7 +85,7 @@ enum SpellAuraInterruptFlags AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT = 0x00800000, // 23 removed by entering pvp combat AURA_INTERRUPT_FLAG_DIRECT_DAMAGE = 0x01000000, // 24 removed by any direct damage - AURA_INTERRUPT_FLAG_NOT_VICTIM = (AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_DAMAGE | AURA_INTERRUPT_FLAG_DIRECT_DAMAGE), + AURA_INTERRUPT_FLAG_NOT_VICTIM = (AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE | AURA_INTERRUPT_FLAG_DIRECT_DAMAGE), }; enum SpellModOp |