From 970f0497998f3d5ea6522b8f0a51715be80a21b2 Mon Sep 17 00:00:00 2001 From: Schmoozerd Date: Sun, 2 Sep 2012 16:13:13 +0200 Subject: [PATCH] [12170] Add support to link summoned npcs with following Thanks to crackm for insisting that this needs a core change and testing --- src/game/Object.cpp | 7 ++++++- src/shared/revision_nr.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 71f5692a1..1a0a3c603 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -42,6 +42,7 @@ #include "ObjectPosSelector.h" #include "TemporarySummon.h" #include "movement/packet_builder.h" +#include "CreatureLinkingMgr.h" Object::Object() { @@ -1723,11 +1724,15 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa // Active state set before added to map pCreature->SetActiveObjectState(asActiveObject); - pCreature->Summon(spwtype, despwtime); + pCreature->Summon(spwtype, despwtime); // Also initializes the AI and MMGen if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->AI()) ((Creature*)this)->AI()->JustSummoned(pCreature); + // Creature Linking, Initial load is handled like respawn + if (pCreature->IsLinkingEventTrigger()) + GetMap()->GetCreatureLinkingHolder()->DoCreatureLinkingEvent(LINKING_EVENT_RESPAWN, pCreature); + // return the creature therewith the summoner has access to it return pCreature; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 88fe3e03f..6bde0571e 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12169" + #define REVISION_NR "12170" #endif // __REVISION_NR_H__