aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2019-12-05 00:12:35 +0100
committerShauren <shauren.trinity@gmail.com>2019-12-05 00:12:35 +0100
commitd934824421c83598853487c5cc9e4cbb3c5d0006 (patch)
treea63415c891a43c417747edeae37ac15ecb4a2389 /src/server/scripts/Spells
parent65b91375e0a3b01eaacab77f973429b544c63a61 (diff)
Core/Items: Implement azerite empowered items
Diffstat (limited to 'src/server/scripts/Spells')
-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()