[8220] Implement SPELL_EFFECT_PLAY_MUSIC(132)

Thanks to GriffonHeart for help in reseach.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
evilstar 2009-07-20 13:11:59 +04:00 committed by VladimirMangos
parent a6b1334ba1
commit 0a7f878eb8
4 changed files with 23 additions and 4 deletions

View file

@ -189,7 +189,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectApplyAreaAura, //129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY
&Spell::EffectNULL, //130 SPELL_EFFECT_REDIRECT_THREAT
&Spell::EffectUnused, //131 SPELL_EFFECT_131 used in some test spells
&Spell::EffectNULL, //132 SPELL_EFFECT_PLAY_MUSIC 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
&Spell::EffectNULL, //135 SPELL_EFFECT_CALL_PET
@ -6696,3 +6696,21 @@ void Spell::EffectRenamePet(uint32 /*eff_idx*/)
unitTarget->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED);
}
void Spell::EffectPlayMusic(uint32 i)
{
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
uint32 soundid = m_spellInfo->EffectMiscValue[i];
if (!sSoundEntriesStore.LookupEntry(soundid))
{
sLog.outError("EffectPlayMusic: Sound (Id: %u) not exist in spell %u.",soundid,m_spellInfo->Id);
return;
}
WorldPacket data(SMSG_PLAY_MUSIC, 4);
data << uint32(soundid);
((Player*)unitTarget)->GetSession()->SendPacket(&data);
}