mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[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:
parent
b8b907c138
commit
970f049799
2 changed files with 7 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "12169"
|
||||
#define REVISION_NR "12170"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue