Jump to content

11376[Patch] Enable creature_template_addon to fallback to normal mode


Schmoozerd

Recommended Posts

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

With current c_t_addon system, every mob with difficulties needs own entries for every difficulty.

With this patch the npcs will take the c_t_addon information of normal mode, if they have no own entries

For which repository revision was the patch created?

11327+TomRus

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

don't hink so

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

me

Only rough tested..

diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 6f0012f..e0a3212 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -1894,7 +1894,14 @@ CreatureDataAddon const* Creature::GetCreatureAddon() const
        return addon;

    // dependent from difficulty mode entry
-    return ObjectMgr::GetCreatureTemplateAddon(GetCreatureInfo()->Entry);
+    if (GetEntry() != GetCreatureInfo()->Entry)
+    {
+        if (CreatureDataAddon const* addon =  ObjectMgr::GetCreatureTemplateAddon(GetCreatureInfo()->Entry))
+            return addon;
+    }
+
+    // fallback to entry of normal mode
+    return ObjectMgr::GetCreatureTemplateAddon(GetEntry());
}

//creature_addon table

Link to comment
Share on other sites

  • 2 months 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