[8322] Fixed work spells with ..NOT_BREAK_STEALTH and without ..NO_INITIAL_AGGRO

* Target don't must lost stealth at hit by NOT_BREAK_STEALTH spell also.
* Target don't must aggro at hit not NO_INITIAL_AGGRO spell
  if caster still not detected by aggro. This possoble in case when cast not remove
  stealth (spell have NOT_BREAK_STEALTH)
* This fixed spell 921 wrong lost stealth at success and possible some other spells.
This commit is contained in:
VladimirMangos 2009-08-06 12:16:45 +04:00
parent a1973ced28
commit 0449aadc74
2 changed files with 14 additions and 3 deletions

View file

@ -1200,10 +1200,21 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
return;
}
unit->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
// not break stealth by cast targeting
if (!(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_BREAK_STEALTH))
unit->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
if (!(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NO_INITIAL_AGGRO))
// can cause back attack (if detected)
if (!(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NO_INITIAL_AGGRO) &&
m_caster->isVisibleForOrDetect(unit,false)) // stealth removed at Spell::cast if spell break it
{
// use speedup check to avoid re-remove after above lines
if (m_spellInfo->AttributesEx & SPELL_ATTR_EX_NOT_BREAK_STEALTH)
unit->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
// caster can be detected but have stealth aura
m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
if (!unit->IsStandState() && !unit->hasUnitState(UNIT_STAT_STUNNED))
unit->SetStandState(UNIT_STAND_STATE_STAND);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8321"
#define REVISION_NR "8322"
#endif // __REVISION_NR_H__