[12170] Add support to link summoned npcs with following

Thanks to crackm for insisting that this needs a core change and testing
This commit is contained in:
Schmoozerd 2012-09-02 16:13:13 +02:00 committed by Antz
parent b8b907c138
commit 970f049799
2 changed files with 7 additions and 2 deletions

View file

@ -42,6 +42,7 @@
#include "ObjectPosSelector.h" #include "ObjectPosSelector.h"
#include "TemporarySummon.h" #include "TemporarySummon.h"
#include "movement/packet_builder.h" #include "movement/packet_builder.h"
#include "CreatureLinkingMgr.h"
Object::Object() 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 // Active state set before added to map
pCreature->SetActiveObjectState(asActiveObject); pCreature->SetActiveObjectState(asActiveObject);
pCreature->Summon(spwtype, despwtime); pCreature->Summon(spwtype, despwtime); // Also initializes the AI and MMGen
if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->AI()) if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->AI())
((Creature*)this)->AI()->JustSummoned(pCreature); ((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 the creature therewith the summoner has access to it
return pCreature; return pCreature;
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "12169" #define REVISION_NR "12170"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__