mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 00:23:48 +00:00
fix(Core/Spells): Do not apply diminishing return on spells casted by mobs. (#9536)
Fixes #9028
This commit is contained in:
@@ -1451,10 +1451,10 @@ public:
|
||||
void CleanupBeforeRemoveFromMap(bool finalCleanup);
|
||||
void CleanupsBeforeDelete(bool finalCleanup = true) override; // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units)
|
||||
|
||||
DiminishingLevels GetDiminishing(DiminishingGroup group);
|
||||
DiminishingLevels GetDiminishing(DiminishingGroup group);
|
||||
void IncrDiminishing(DiminishingGroup group);
|
||||
float ApplyDiminishingToDuration(DiminishingGroup group, int32& duration, Unit* caster, DiminishingLevels Level, int32 limitduration);
|
||||
void ApplyDiminishingAura(DiminishingGroup group, bool apply);
|
||||
float ApplyDiminishingToDuration(DiminishingGroup group, int32& duration, Unit* caster, DiminishingLevels Level, int32 limitduration);
|
||||
void ApplyDiminishingAura(DiminishingGroup group, bool apply);
|
||||
void ClearDiminishings() { m_Diminishing.clear(); }
|
||||
|
||||
// target dependent range checks
|
||||
|
||||
@@ -2879,10 +2879,15 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
uint32 flagsExtra = unit->GetTypeId() == TYPEID_UNIT ? unit->ToCreature()->GetCreatureTemplate()->flags_extra : 0;
|
||||
|
||||
// Increase Diminishing on unit, current informations for actually casts will use values above
|
||||
if ((type == DRTYPE_PLAYER && (
|
||||
unit->GetCharmerOrOwnerPlayerOrPlayerItself() || flagsExtra & CREATURE_FLAG_EXTRA_ALL_DIMINISH || (m_diminishGroup == DIMINISHING_TAUNT && (flagsExtra & CREATURE_FLAG_EXTRA_OBEYS_TAUNT_DIMINISHING_RETURNS))
|
||||
)) || type == DRTYPE_ALL)
|
||||
unit->IncrDiminishing(m_diminishGroup);
|
||||
if ((type == DRTYPE_PLAYER && (unit->IsCharmedOwnedByPlayerOrPlayer() || flagsExtra & CREATURE_FLAG_EXTRA_ALL_DIMINISH ||
|
||||
(m_diminishGroup == DIMINISHING_TAUNT && (flagsExtra & CREATURE_FLAG_EXTRA_OBEYS_TAUNT_DIMINISHING_RETURNS)))) || type == DRTYPE_ALL)
|
||||
{
|
||||
// Do not apply diminish return if caster is NPC
|
||||
if (m_caster->IsCharmedOwnedByPlayerOrPlayer())
|
||||
{
|
||||
unit->IncrDiminishing(m_diminishGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_caster != unit && m_caster->IsHostileTo(unit) && !m_spellInfo->IsPositive() && !m_triggeredByAuraSpell && !m_spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH))
|
||||
|
||||
Reference in New Issue
Block a user