aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMachiavelli <machiavelli.trinity@gmail.com>2011-03-07 21:13:18 +0100
committerMachiavelli <machiavelli.trinity@gmail.com>2011-03-07 21:13:18 +0100
commite1ac75afe2ae8269983baa808ebc25ffa48e6ed3 (patch)
treeb4bd10d4347166bbb904d3d67540cc62997a4e7b /src
parent28b14f36c8c7f1acb15d2a11a276de107d772fc9 (diff)
Core/Spells: Proper implementation of SPELL_EFFECT_PLAYER_NOTIFICATION (131) - should send SMSG_PLAY_SOUND with EffectMiscValue as soundId.
Research by Kaelima
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 97e05cdad26..7b26a4dccfd 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -195,7 +195,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectApplyAreaAura, //128 SPELL_EFFECT_APPLY_AREA_AURA_FRIEND
&Spell::EffectApplyAreaAura, //129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY
&Spell::EffectRedirectThreat, //130 SPELL_EFFECT_REDIRECT_THREAT
- &Spell::EffectPlayerNotification, //131 SPELL_EFFECT_PLAYER_NOTIFICATION
+ &Spell::EffectPlayerNotification, //131 SPELL_EFFECT_PLAYER_NOTIFICATION sound id in misc value (SoundEntries.dbc)
&Spell::EffectPlayMusic, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value (SoundEntries.dbc)
&Spell::EffectUnlearnSpecialization, //133 SPELL_EFFECT_UNLEARN_SPECIALIZATION unlearn profession specialization
&Spell::EffectKillCredit, //134 SPELL_EFFECT_KILL_CREDIT misc value is creature entry
@@ -7037,7 +7037,7 @@ void Spell::EffectActivateSpec(SpellEffIndex /*effIndex*/)
unitTarget->ToPlayer()->ActivateSpec(damage-1); // damage is 1 or 2, spec is 0 or 1
}
-void Spell::EffectPlayerNotification(SpellEffIndex /*effIndex*/)
+void Spell::EffectPlayerNotification(SpellEffIndex effIndex)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
@@ -7049,6 +7049,18 @@ void Spell::EffectPlayerNotification(SpellEffIndex /*effIndex*/)
unitTarget->ToPlayer()->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE);
break;
}
+
+ uint32 soundid = m_spellInfo->EffectMiscValue[effIndex];
+
+ if (!sSoundEntriesStore.LookupEntry(soundid))
+ {
+ sLog->outError("EffectPlayerNotification: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
+ return;
+ }
+
+ WorldPacket data(SMSG_PLAY_SOUND, 4);
+ data << uint32(soundid);
+ unitTarget->ToPlayer()->GetSession()->SendPacket(&data);
}
void Spell::EffectRemoveAura(SpellEffIndex effIndex)