aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Spells/spell_item.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index d1c611dcd6e..b5b7af67161 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -22,6 +22,7 @@
*/
#include "ScriptMgr.h"
+#include "AzeritePackets.h"
#include "Battleground.h"
#include "CreatureAIImpl.h"
#include "DB2Stores.h"
@@ -4776,16 +4777,24 @@ class spell_item_heart_of_azeroth : public AuraScript
void SetEquippedFlag(AuraEffect const* /*effect*/, AuraEffectHandleModes /*mode*/)
{
- if (Player* target = GetTarget()->ToPlayer())
- if (Item* item = target->GetItemByGuid(GetAura()->GetCastItemGUID()))
- item->AddItemFlag2(ITEM_FIELD_FLAG2_HEART_OF_AZEROTH_EQUIPPED);
+ SetState(true);
}
void ClearEquippedFlag(AuraEffect const* /*effect*/, AuraEffectHandleModes /*mode*/)
{
+ SetState(false);
+ }
+
+ void SetState(bool equipped)
+ {
if (Player* target = GetTarget()->ToPlayer())
- if (Item* item = target->GetItemByGuid(GetAura()->GetCastItemGUID()))
- item->RemoveItemFlag2(ITEM_FIELD_FLAG2_HEART_OF_AZEROTH_EQUIPPED);
+ {
+ target->ApplyAllAzeriteEmpoweredItemMods(equipped);
+
+ WorldPackets::Azerite::AzeriteEmpoweredItemEquippedStatusChanged statusChanged;
+ statusChanged.IsHeartEquipped = equipped;
+ target->SendDirectMessage(statusChanged.Write());
+ }
}
void Register()