Jump to content

[11145] Miss and Resist should have same combat-reactive as any other


Recommended Posts

Posted

Not sure if It was made already but couldn't find on forum so...

(Used same way to set reaction as normal-hit handling does)

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 0a15b32..8a1e69e 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1137,6 +1137,20 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
            DoSpellHitOnUnit(m_caster, mask);
    }

+    if(missInfo == SPELL_MISS_MISS || missInfo == SPELL_MISS_RESIST)
+    {
+        Unit* realCaster = GetAffectiveCaster();
+        if(realCaster && realCaster != unit)
+        {
+            if (!unit->isInCombat() && unit->GetTypeId() != TYPEID_PLAYER && ((Creature*)unit)->AI())
+                ((Creature*)unit)->AI()->AttackedBy(realCaster);
+
+            unit->AddThreat(realCaster);
+            unit->SetInCombatWith(realCaster);
+            realCaster->SetInCombatWith(unit);
+        }
+    }
+
    // All calculated do it!
    // Do healing and triggers
    if (m_healing)

  • 5 weeks later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use