mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[11959] Implement spell effect 131 - SPELL_EFFECT_PLAY_SOUND
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
9fd41d0508
commit
067942a978
4 changed files with 25 additions and 10 deletions
|
|
@ -702,7 +702,7 @@ enum SpellEffects
|
|||
SPELL_EFFECT_APPLY_AREA_AURA_FRIEND = 128,
|
||||
SPELL_EFFECT_APPLY_AREA_AURA_ENEMY = 129,
|
||||
SPELL_EFFECT_REDIRECT_THREAT = 130,
|
||||
SPELL_EFFECT_131 = 131,
|
||||
SPELL_EFFECT_PLAY_SOUND = 131,
|
||||
SPELL_EFFECT_PLAY_MUSIC = 132,
|
||||
SPELL_EFFECT_UNLEARN_SPECIALIZATION = 133,
|
||||
SPELL_EFFECT_KILL_CREDIT_GROUP = 134,
|
||||
|
|
|
|||
|
|
@ -347,6 +347,7 @@ class Spell
|
|||
void EffectTeachTaxiNode(SpellEffectIndex eff_idx);
|
||||
void EffectTitanGrip(SpellEffectIndex eff_idx);
|
||||
void EffectEnchantItemPrismatic(SpellEffectIndex eff_idx);
|
||||
void EffectPlaySound(SpellEffectIndex eff_idx);
|
||||
void EffectPlayMusic(SpellEffectIndex eff_idx);
|
||||
void EffectSpecCount(SpellEffectIndex eff_idx);
|
||||
void EffectActivateSpec(SpellEffectIndex eff_idx);
|
||||
|
|
|
|||
|
|
@ -191,7 +191,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::EffectUnused, //131 SPELL_EFFECT_131 used in some test spells
|
||||
&Spell::EffectPlaySound, //131 SPELL_EFFECT_PLAY_SOUND 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::EffectKillCreditGroup, //134 SPELL_EFFECT_KILL_CREDIT_GROUP misc value is creature entry
|
||||
|
|
@ -9355,21 +9355,35 @@ void Spell::EffectRenamePet(SpellEffectIndex /*eff_idx*/)
|
|||
unitTarget->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED);
|
||||
}
|
||||
|
||||
void Spell::EffectPlayMusic(SpellEffectIndex eff_idx)
|
||||
void Spell::EffectPlaySound(SpellEffectIndex eff_idx)
|
||||
{
|
||||
if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 soundid = m_spellInfo->EffectMiscValue[eff_idx];
|
||||
|
||||
if (!sSoundEntriesStore.LookupEntry(soundid))
|
||||
uint32 soundId = m_spellInfo->EffectMiscValue[eff_idx];
|
||||
if (!sSoundEntriesStore.LookupEntry(soundId))
|
||||
{
|
||||
sLog.outError("EffectPlayMusic: Sound (Id: %u) not exist in spell %u.",soundid,m_spellInfo->Id);
|
||||
sLog.outError("EffectPlaySound: Sound (Id: %u) in spell %u does not exist.", soundId, m_spellInfo->Id);
|
||||
return;
|
||||
}
|
||||
|
||||
unitTarget->PlayDirectSound(soundId, (Player*)unitTarget);
|
||||
}
|
||||
|
||||
void Spell::EffectPlayMusic(SpellEffectIndex eff_idx)
|
||||
{
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
uint32 soundId = m_spellInfo->EffectMiscValue[eff_idx];
|
||||
if (!sSoundEntriesStore.LookupEntry(soundId))
|
||||
{
|
||||
sLog.outError("EffectPlayMusic: Sound (Id: %u) in spell %u does not exist.", soundId, m_spellInfo->Id);
|
||||
return;
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_PLAY_MUSIC, 4);
|
||||
data << uint32(soundid);
|
||||
data << uint32(soundId);
|
||||
((Player*)unitTarget)->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11958"
|
||||
#define REVISION_NR "11959"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue