Jump to content

[alt fix in 10367] [fix] reload CreatureAddon in AggressorAI


pasdVn

Recommended Posts

Don't know, if this is done out of intention, but currently e.g. auras defined in creature_addon or creature_template_addon are lost, if the creature evades the first time. In EventAI they get reloaded when creature reaches home. I think we sould do this also for AgressorAI!

From c83a0c51b0f277305de04e894a9de96d04e0797d Mon Sep 17 00:00:00 2001
From: pasdVn <[email protected]>
Date: Fri, 12 Mar 2010 18:13:40 +0100
Subject: [PATCH] Reload CreatureAddon at reaching home in AggressorAI

---
src/game/AggressorAI.cpp |    5 +++++
src/game/AggressorAI.h   |    1 +
2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/game/AggressorAI.cpp b/src/game/AggressorAI.cpp
index 4ab9a7a..51d3ec8 100644
--- a/src/game/AggressorAI.cpp
+++ b/src/game/AggressorAI.cpp
@@ -40,6 +40,11 @@ AggressorAI::AggressorAI(Creature *c) : CreatureAI(c), i_victimGuid(0), i_state(
{
}

+void AggressorAI::JustReachedHome()
+{
+    m_creature->LoadCreaturesAddon();
+}
+
void
AggressorAI::MoveInLineOfSight(Unit *u)
{
diff --git a/src/game/AggressorAI.h b/src/game/AggressorAI.h
index 7b8feed..28b562c 100644
--- a/src/game/AggressorAI.h
+++ b/src/game/AggressorAI.h
@@ -36,6 +36,7 @@ class MANGOS_DLL_DECL AggressorAI : public CreatureAI

        explicit AggressorAI(Creature *c);

+        void JustReachedHome();
        void MoveInLineOfSight(Unit *);
        void AttackStart(Unit *);
        void EnterEvadeMode();
-- 
1.6.5.1.1367.gcd48

Link to comment
Share on other sites

... In EventAI they get reloaded when creature reaches home.

...which is basically just a "hack" from old SD2 script :) The problem you will face with this way, is that you have to call the function for _every_ time script side use JustReachedHome(). We don't want this of course, but instead find a better place to call it from Mangos without making things harder for script side to maintain.

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