diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 14 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 1 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3a588fe10f3..d972d9a5cc5 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -781,8 +781,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam if (damagetype == DIRECT_DAMAGE || damagetype == SPELL_DIRECT_DAMAGE) { victim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DIRECT_DAMAGE, spellProto ? spellProto->Id : 0); - if (victim->GetTypeId() == TYPEID_UNIT && !victim->IsPet()) - victim->SetLastDamagedTime(time(NULL)); + victim->UpdateLastDamagedTime(spellProto); } if (victim->GetTypeId() != TYPEID_PLAYER) @@ -15908,6 +15907,17 @@ int32 Unit::GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const* aurEf return val; } +void Unit::UpdateLastDamagedTime(SpellInfo const* spellProto) +{ + if (GetTypeId() != TYPEID_UNIT || IsPet()) + return; + + if (spellProto && spellProto->HasAura(DIFFICULTY_NONE, SPELL_AURA_DAMAGE_SHIELD)) + return; + + SetLastDamagedTime(time(NULL)); +} + bool Unit::IsHighestExclusiveAura(Aura const* aura, bool removeOtherAuraApplications /*= false*/) { for (AuraEffect* aurEff : aura->GetAuraEffects()) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 310cdc51886..f296d54abc9 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2271,6 +2271,7 @@ class TC_GAME_API Unit : public WorldObject // Part of Evade mechanics time_t GetLastDamagedTime() const { return _lastDamagedTime; } + void UpdateLastDamagedTime(SpellInfo const* spellProto); void SetLastDamagedTime(time_t val) { _lastDamagedTime = val; } int32 GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const* aurEff, AuraType auraType, bool checkMiscValue = false, int32 miscValue = 0) const; |