aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGildor <gildor55@gmail.com>2021-08-09 22:36:14 +0200
committerGitHub <noreply@github.com>2021-08-09 22:36:14 +0200
commitc7ae9d761a3c9a7523d4bd195979f294f8c9e7cd (patch)
treeceb875b80f4ae7a7bbab8c0427002179e89e63fc /src
parent0800ab20a8039620fd271a43c173c008af68c22a (diff)
Scripts/World: improve Training Dummy script (#26778)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/World/npcs_special.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 72f48524e02..45723bfdb58 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1464,11 +1464,16 @@ struct npc_training_dummy : NullCreatureAI
{
npc_training_dummy(Creature* creature) : NullCreatureAI(creature) { }
- void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
+ void JustEnteredCombat(Unit* who) override
+ {
+ _combatTimer[who->GetGUID()] = 5s;
+ }
+
+ void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damageType, SpellInfo const* /*spellInfo = nullptr*/) override
{
damage = 0;
- if (!attacker)
+ if (!attacker || damageType == DOT)
return;
_combatTimer[attacker->GetGUID()] = 5s;