mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[8346] Avoid aggro at positive spells for non friendly targets.
* Not all positive spell have SPELL_ATTR_EX_NO_INITIAL_AGGRO (for react at assistance). Avoid aggro at positive spell without this flag for non frindly target. * Some cleanups and better checks in IsPositiveEffect.
This commit is contained in:
parent
dddacab0dd
commit
99f74411a0
3 changed files with 27 additions and 23 deletions
|
|
@ -1205,7 +1205,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
|
|||
unit->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||
|
||||
// can cause back attack (if detected)
|
||||
if (!(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NO_INITIAL_AGGRO) &&
|
||||
if (!(m_spellInfo->AttributesEx & SPELL_ATTR_EX_NO_INITIAL_AGGRO) && !IsPositiveSpell(m_spellInfo->Id) &&
|
||||
m_caster->isVisibleForOrDetect(unit,false)) // stealth removed at Spell::cast if spell break it
|
||||
{
|
||||
// use speedup check to avoid re-remove after above lines
|
||||
|
|
@ -2783,12 +2783,16 @@ void Spell::finish(bool ok)
|
|||
// Not drop combopoints if negative spell and if any miss on enemy exist
|
||||
bool needDrop = true;
|
||||
if (!IsPositiveSpell(m_spellInfo->Id))
|
||||
for(std::list<TargetInfo>::const_iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
|
||||
if (ihit->missCondition != SPELL_MISS_NONE && ihit->targetGUID!=m_caster->GetGUID())
|
||||
{
|
||||
for(std::list<TargetInfo>::const_iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
|
||||
{
|
||||
needDrop = false;
|
||||
break;
|
||||
if (ihit->missCondition != SPELL_MISS_NONE && ihit->targetGUID!=m_caster->GetGUID())
|
||||
{
|
||||
needDrop = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (needDrop)
|
||||
((Player*)m_caster)->ClearComboPoints();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue