mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +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
|
|
@ -301,15 +301,17 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
|||
SpellEntry const *spellproto = sSpellStore.LookupEntry(spellId);
|
||||
if (!spellproto) return false;
|
||||
|
||||
switch(spellId)
|
||||
{
|
||||
case 28441: // not positive dummy spell
|
||||
case 37675: // Chaos Blast
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(spellproto->Effect[effIndex])
|
||||
{
|
||||
case SPELL_EFFECT_DUMMY:
|
||||
// some explicitly required dummy effect sets
|
||||
switch(spellId)
|
||||
{
|
||||
case 28441: return false; // AB Effect 000
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
// always positive effects (check before target checks that provided non-positive result in some case for positive effects)
|
||||
case SPELL_EFFECT_HEAL:
|
||||
case SPELL_EFFECT_LEARN_SPELL:
|
||||
|
|
@ -349,15 +351,21 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
|||
break;
|
||||
}
|
||||
} break;
|
||||
case SPELL_AURA_MOD_STAT:
|
||||
case SPELL_AURA_MOD_DAMAGE_DONE: // dependent from bas point sign (negative -> negative)
|
||||
case SPELL_AURA_MOD_STAT:
|
||||
case SPELL_AURA_MOD_SKILL:
|
||||
case SPELL_AURA_MOD_HEALING_PCT:
|
||||
case SPELL_AURA_MOD_HEALING_DONE:
|
||||
if(spellproto->CalculateSimpleValue(effIndex) < 0)
|
||||
return false;
|
||||
break;
|
||||
case SPELL_AURA_MOD_DAMAGE_TAKEN: // dependent from bas point sign (positive -> negative)
|
||||
if(spellproto->CalculateSimpleValue(effIndex) > 0)
|
||||
return false;
|
||||
break;
|
||||
case SPELL_AURA_MOD_SPELL_CRIT_CHANCE:
|
||||
if(spellproto->CalculateSimpleValue(effIndex) > 0)
|
||||
return true; // some expected possitive spells have SPELL_ATTR_EX_NEGATIVE
|
||||
return true; // some expected positive spells have SPELL_ATTR_EX_NEGATIVE
|
||||
break;
|
||||
case SPELL_AURA_ADD_TARGET_TRIGGER:
|
||||
return true;
|
||||
|
|
@ -460,14 +468,6 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
|||
break;
|
||||
}
|
||||
} break;
|
||||
case SPELL_AURA_MOD_HEALING_PCT:
|
||||
if(spellproto->CalculateSimpleValue(effIndex) < 0)
|
||||
return false;
|
||||
break;
|
||||
case SPELL_AURA_MOD_SKILL:
|
||||
if(spellproto->CalculateSimpleValue(effIndex) < 0)
|
||||
return false;
|
||||
break;
|
||||
case SPELL_AURA_FORCE_REACTION:
|
||||
if(spellproto->Id==42792) // Recently Dropped Flag (prevent cancel)
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue