Jump to content

[11275] [Patch] Add calling CreatureAI::JustSummoned for Guardians


Schmoozerd

Recommended Posts

What bug does the patch fix? What features does the patch add?

Adds support for calling JustSummoned for guardians

Example is spell 40276

For which repository revision was the patch created?

11260

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

no

Who has been writing this patch? Please include either forum user names or email addresses.

me

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index edd7347..7d41744 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -4510,8 +4510,6 @@ void Spell::DoSummon(SpellEffectIndex eff_idx)
        if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
            spawnCreature->Relocate(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, -m_caster->GetOrientation());

-
-
        // set timer for unsummon
        if (duration > 0)
            spawnCreature->SetDuration(duration);
@@ -5014,6 +5012,10 @@ void Spell::DoSummonGuardian(SpellEffectIndex eff_idx, uint32 forceFaction)
        m_caster->AddGuardian(spawnCreature);

        map->Add((Creature*)spawnCreature);
+
+        // Notify Summoner
+        if (m_caster->GetTypeId() == TYPEID_UNIT)
+            ((Creature*)m_caster)->AI()->JustSummoned(spawnCreature);
    }
}

@@ -8147,6 +8149,8 @@ void Spell::DoSummonCritter(SpellEffectIndex eff_idx, uint32 forceFaction)
    m_caster->SetMiniPet(critter);

    map->Add((Creature*)critter);
+
+    // No need to inform summoner of critter(?)
}

void Spell::EffectKnockBack(SpellEffectIndex eff_idx)

Link to comment
Share on other sites

×
×
  • 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