aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-08-07 19:40:34 +0200
committerShauren <shauren.trinity@gmail.com>2021-08-08 00:18:10 +0200
commitce1046a8fd0f04aad6c414786949269fffea88f3 (patch)
tree025a5a5ac6cbc886cf98897d0af814d33497bf8d /src/server/game/Spells/SpellEffects.cpp
parentcd5357dc185f95c6ef78089c5ab8bd2b885dd89f (diff)
Core/DataStores: 9.1.0 db2 structures
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index b546b1325d6..f2d6ea95ab5 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -30,6 +30,7 @@
#include "Conversation.h"
#include "Creature.h"
#include "CreatureAI.h"
+#include "CreatureTextMgr.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "DuelPackets.h"
@@ -363,6 +364,8 @@ NonDefaultConstructible<pEffect> SpellEffects[TOTAL_SPELL_EFFECTS] =
&Spell::EffectNULL, //281 SPELL_EFFECT_LEARN_SOULBIND_CONDUIT
&Spell::EffectNULL, //282 SPELL_EFFECT_CONVERT_ITEMS_TO_CURRENCY
&Spell::EffectNULL, //283 SPELL_EFFECT_COMPLETE_CAMPAIGN
+ &Spell::EffectSendChatMessage, //284 SPELL_EFFECT_SEND_CHAT_MESSAGE
+ &Spell::EffectNULL, //285 SPELL_EFFECT_MODIFY_KEYSTONE_2
};
void Spell::EffectNULL(SpellEffIndex /*effIndex*/)
@@ -5851,3 +5854,16 @@ void Spell::EffectCreatePrivateConversation(SpellEffIndex /*effIndex*/)
Conversation::CreateConversation(effectInfo->MiscValue, GetCaster(), unitTarget->GetPosition(), { unitTarget->GetGUID() }, GetSpellInfo());
}
+
+void Spell::EffectSendChatMessage(SpellEffIndex /*effIndex*/)
+{
+ if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT)
+ return;
+
+ uint32 broadcastTextId = effectInfo->MiscValue;
+ if (!sBroadcastTextStore.LookupEntry(broadcastTextId))
+ return;
+
+ ChatMsg chatType = ChatMsg(effectInfo->MiscValueB);
+ unitTarget->Talk(broadcastTextId, chatType, CreatureTextMgr::GetRangeForChatType(chatType), unitTarget);
+}