// This functions checks if the NPC has linked NPCs for dynamic action bool CreatureLinkingMgr::IsLinkedEventTrigger(Creature* pCreature) { // Entry case if (m_eventTriggers.find(pCreature->GetEntry()) != m_eventTriggers.end()) return true; // Guid case if (m_eventGuidTriggers.find(pCreature->GetGUIDLow()) != m_eventGuidTriggers.end()) return true; // Also return true for npcs that trigger reverse actions, or for followers(needed in respawn) if (CreatureLinkingInfo const* pInfo = GetLinkedTriggerInformation(pCreature)) return pInfo->linkingFlag & EVENT_MASK_TRIGGER_TO; return false; }
// This gives the information of a linked NPC (describes action when its ActionTrigger triggers) // Depends of the map CreatureLinkingInfo const* CreatureLinkingMgr::GetLinkedTriggerInformation(Creature* pCreature) const { return GetLinkedTriggerInformation(pCreature->GetEntry(), pCreature->GetGUIDLow(), pCreature->GetMapId()); }
// This function checks if the spawning of this NPC is dependend on other NPCs bool CreatureLinkingMgr::IsSpawnedByLinkedMob(Creature* pCreature) const { return IsSpawnedByLinkedMob(GetLinkedTriggerInformation(pCreature)); }