diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp index 2595455bc..c40e0ee0b 100644 --- a/src/game/CreatureAI.cpp +++ b/src/game/CreatureAI.cpp @@ -163,11 +163,12 @@ void CreatureAI::HandleMovementOnAttackStart(Unit* victim) class AiDelayEventAround : public BasicEvent { public: - AiDelayEventAround(AIEventType eventType, ObjectGuid invokerGuid, Creature& owner, std::list const& receivers) : + AiDelayEventAround(AIEventType eventType, ObjectGuid invokerGuid, Creature& owner, std::list const& receivers, uint32 miscValue) : BasicEvent(), m_eventType(eventType), m_invokerGuid(invokerGuid), - m_owner(owner) + m_owner(owner), + m_miscValue(miscValue) { // Pushing guids because in delay can happen some creature gets despawned => invalid pointer m_receiverGuids.reserve(receivers.size()); @@ -183,7 +184,7 @@ class AiDelayEventAround : public BasicEvent { if (Creature* pReceiver = m_owner.GetMap()->GetAnyTypeCreature(*itr)) { - pReceiver->AI()->ReceiveAIEvent(m_eventType, &m_owner, pInvoker); + pReceiver->AI()->ReceiveAIEvent(m_eventType, &m_owner, pInvoker, m_miscValue); // Special case for type 0 (call-assistance) if (m_eventType == AI_EVENT_CALL_ASSISTANCE && pInvoker && pReceiver->CanAssistTo(&m_owner, pInvoker)) { @@ -205,9 +206,10 @@ class AiDelayEventAround : public BasicEvent Creature& m_owner; AIEventType m_eventType; + uint32 m_miscValue; }; -void CreatureAI::SendAIEvent(AIEventType eventType, Unit* pInvoker, uint32 uiDelay, float fRadius) const +void CreatureAI::SendAIEvent(AIEventType eventType, Unit* pInvoker, uint32 uiDelay, float fRadius, uint32 miscValue /*=0*/) const { if (fRadius > 0) { @@ -220,14 +222,14 @@ void CreatureAI::SendAIEvent(AIEventType eventType, Unit* pInvoker, uint32 uiDel if (!receiverList.empty()) { - AiDelayEventAround* e = new AiDelayEventAround(eventType, pInvoker ? pInvoker->GetObjectGuid() : ObjectGuid(), *m_creature, receiverList); + AiDelayEventAround* e = new AiDelayEventAround(eventType, pInvoker ? pInvoker->GetObjectGuid() : ObjectGuid(), *m_creature, receiverList, miscValue); m_creature->m_Events.AddEvent(e, m_creature->m_Events.CalculateTime(uiDelay)); } } } -void CreatureAI::SendAIEvent(AIEventType eventType, Unit* pInvoker, Creature* pReceiver) const +void CreatureAI::SendAIEvent(AIEventType eventType, Unit* pInvoker, Creature* pReceiver, uint32 miscValue /*=0*/) const { MANGOS_ASSERT(pReceiver); - pReceiver->AI()->ReceiveAIEvent(eventType, m_creature, pInvoker); + pReceiver->AI()->ReceiveAIEvent(eventType, m_creature, pInvoker, miscValue); } diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index 6881a45bc..a6a9fe866 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -317,7 +317,7 @@ class MANGOS_DLL_SPEC CreatureAI * @param uiDelay delay time until the Event will be triggered * @param fRadius range in which for receiver is searched */ - void SendAIEvent(AIEventType eventType, Unit* pInvoker, uint32 uiDelay, float fRadius) const; + void SendAIEvent(AIEventType eventType, Unit* pInvoker, uint32 uiDelay, float fRadius, uint32 miscValue = 0) const; /** * Send an AI Event to a Creature @@ -325,7 +325,7 @@ class MANGOS_DLL_SPEC CreatureAI * @param pInvoker Unit that triggered this event (like an attacker) * @param pReceiver Creature to receive this event */ - void SendAIEvent(AIEventType eventType, Unit* pInvoker, Creature* pReceiver) const; + void SendAIEvent(AIEventType eventType, Unit* pInvoker, Creature* pReceiver, uint32 miscValue = 0) const; /** * Called when an AI Event is received @@ -333,7 +333,7 @@ class MANGOS_DLL_SPEC CreatureAI * @param pSender Creature that sent this event * @param pInvoker Unit that triggered this event (like an attacker) */ - virtual void ReceiveAIEvent(AIEventType /*eventType*/, Creature* /*pSender*/, Unit* /*pInvoker*/) {} + virtual void ReceiveAIEvent(AIEventType /*eventType*/, Creature* /*pSender*/, Unit* /*pInvoker*/, uint32 /*miscValue*/) {} protected: void HandleMovementOnAttackStart(Unit* victim); diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index a9e6f7d91..dbbab9f18 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -1077,7 +1077,7 @@ void CreatureEventAI::SummonedCreatureDespawn(Creature* pUnit) } } -void CreatureEventAI::ReceiveAIEvent(AIEventType eventType, Creature* pSender, Unit* pInvoker) +void CreatureEventAI::ReceiveAIEvent(AIEventType eventType, Creature* pSender, Unit* pInvoker, uint32 miscValue) { if (m_bEmptyList || !pSender) return; diff --git a/src/game/CreatureEventAI.h b/src/game/CreatureEventAI.h index 22a6c69d3..83e15480d 100644 --- a/src/game/CreatureEventAI.h +++ b/src/game/CreatureEventAI.h @@ -625,7 +625,7 @@ class MANGOS_DLL_SPEC CreatureEventAI : public CreatureAI void ReceiveEmote(Player* pPlayer, uint32 text_emote) override; void SummonedCreatureJustDied(Creature* unit) override; void SummonedCreatureDespawn(Creature* unit) override; - void ReceiveAIEvent(AIEventType eventType, Creature* pSender, Unit* pInvoker) override; + void ReceiveAIEvent(AIEventType eventType, Creature* pSender, Unit* pInvoker, uint32 miscValue) override; static int Permissible(const Creature*); diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index ca1e6b5af..2ba370ed3 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -499,7 +499,7 @@ enum SummonPropFlags SUMMON_PROP_FLAG_UNK7 = 0x0040, // 12 spells in 3.0.3, no idea SUMMON_PROP_FLAG_UNK8 = 0x0080, // 4 spells in 3.0.3, no idea SUMMON_PROP_FLAG_UNK9 = 0x0100, // 51 spells in 3.0.3, no idea, many quest related - SUMMON_PROP_FLAG_UNK10 = 0x0200, // 51 spells in 3.0.3, something defensive + SUMMON_PROP_FLAG_INHERIT_FACTION = 0x0200, // 51 spells in 3.0.3, something defensive SUMMON_PROP_FLAG_UNK11 = 0x0400, // 3 spells, requires something near? SUMMON_PROP_FLAG_UNK12 = 0x0800, // 30 spells in 3.0.3, no idea SUMMON_PROP_FLAG_UNK13 = 0x1000, // 8 spells in 3.0.3, siege vehicle diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3a4d6c15b..23dcbd02f 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 "12701" + #define REVISION_NR "12702" #endif // __REVISION_NR_H__