[svn] * PlaySound changed to SendPlaySound, moved to WorldObject and used everywhere instead of hard-coding packet
--HG-- branch : trunk
This commit is contained in:
@@ -1853,10 +1853,7 @@ void ProcessScriptText(uint32 id, WorldObject* pSource, Unit* target)
|
||||
{
|
||||
if(GetSoundEntriesStore()->LookupEntry((*i).second.SoundId))
|
||||
{
|
||||
WorldPacket data(4);
|
||||
data.SetOpcode(SMSG_PLAY_SOUND);
|
||||
data << uint32((*i).second.SoundId);
|
||||
pSource->SendMessageToSet(&data,false);
|
||||
pSource->SendPlaySound((*i).second.SoundId, false);
|
||||
}
|
||||
else
|
||||
error_log("TSCR: ProcessScriptText id %u tried to process invalid soundid %u.",id,(*i).second.SoundId);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "precompiled.h"
|
||||
#include "Item.h"
|
||||
#include "Spell.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
// Spell summary for ScriptedAI::SelectSpell
|
||||
struct TSpellSummary {
|
||||
@@ -202,10 +201,7 @@ void ScriptedAI::DoPlaySoundToSet(Unit* unit, uint32 sound)
|
||||
return;
|
||||
}
|
||||
|
||||
WorldPacket data(4);
|
||||
data.SetOpcode(SMSG_PLAY_SOUND);
|
||||
data << uint32(sound);
|
||||
unit->SendMessageToSet(&data,false);
|
||||
unit->SendPlaySound(sound, false);
|
||||
}
|
||||
|
||||
Creature* ScriptedAI::DoSpawnCreature(uint32 id, float x, float y, float z, float angle, uint32 type, uint32 despawntime)
|
||||
|
||||
@@ -583,14 +583,14 @@ struct MANGOS_DLL_DECL cthunAI : public Scripted_NoMovementAI
|
||||
//Play random sound to the zone
|
||||
switch (rand()%8)
|
||||
{
|
||||
case 0: (*i)->PlaySound(RND_WISPER_1, true); break;
|
||||
case 1: (*i)->PlaySound(RND_WISPER_2, true); break;
|
||||
case 2: (*i)->PlaySound(RND_WISPER_3, true); break;
|
||||
case 3: (*i)->PlaySound(RND_WISPER_4, true); break;
|
||||
case 4: (*i)->PlaySound(RND_WISPER_5, true); break;
|
||||
case 5: (*i)->PlaySound(RND_WISPER_6, true); break;
|
||||
case 6: (*i)->PlaySound(RND_WISPER_7, true); break;
|
||||
case 7: (*i)->PlaySound(RND_WISPER_8, true); break;
|
||||
case 0: (*i)->SendPlaySound(RND_WISPER_1, true); break;
|
||||
case 1: (*i)->SendPlaySound(RND_WISPER_2, true); break;
|
||||
case 2: (*i)->SendPlaySound(RND_WISPER_3, true); break;
|
||||
case 3: (*i)->SendPlaySound(RND_WISPER_4, true); break;
|
||||
case 4: (*i)->SendPlaySound(RND_WISPER_5, true); break;
|
||||
case 5: (*i)->SendPlaySound(RND_WISPER_6, true); break;
|
||||
case 6: (*i)->SendPlaySound(RND_WISPER_7, true); break;
|
||||
case 7: (*i)->SendPlaySound(RND_WISPER_8, true); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user