[svn] * PlaySound changed to SendPlaySound, moved to WorldObject and used everywhere instead of hard-coding packet
--HG-- branch : trunk
This commit is contained in:
1 parent
9245de8138
commit
1fc73ff41b
8 files changed
+24
-30
No files matched your search
@@ -1853,10 +1853,7 @@ void ProcessScriptText(uint32 id, WorldObject* pSource, Unit* target)
|
|||||||
{
|
{
|
||||||
if(GetSoundEntriesStore()->LookupEntry((*i).second.SoundId))
|
if(GetSoundEntriesStore()->LookupEntry((*i).second.SoundId))
|
||||||
{
|
{
|
||||||
WorldPacket data(4);
|
pSource->SendPlaySound((*i).second.SoundId, false);
|
||||||
data.SetOpcode(SMSG_PLAY_SOUND);
|
|
||||||
data << uint32((*i).second.SoundId);
|
|
||||||
pSource->SendMessageToSet(&data,false);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
error_log("TSCR: ProcessScriptText id %u tried to process invalid soundid %u.",id,(*i).second.SoundId);
|
error_log("TSCR: ProcessScriptText id %u tried to process invalid soundid %u.",id,(*i).second.SoundId);
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
#include "Spell.h"
|
#include "Spell.h"
|
||||||
#include "WorldPacket.h"
|
|
||||||
|
|
||||||
// Spell summary for ScriptedAI::SelectSpell
|
// Spell summary for ScriptedAI::SelectSpell
|
||||||
struct TSpellSummary {
|
struct TSpellSummary {
|
||||||
@@ -202,10 +201,7 @@ void ScriptedAI::DoPlaySoundToSet(Unit* unit, uint32 sound)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WorldPacket data(4);
|
unit->SendPlaySound(sound, false);
|
||||||
data.SetOpcode(SMSG_PLAY_SOUND);
|
|
||||||
data << uint32(sound);
|
|
||||||
unit->SendMessageToSet(&data,false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Creature* ScriptedAI::DoSpawnCreature(uint32 id, float x, float y, float z, float angle, uint32 type, uint32 despawntime)
|
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
|
//Play random sound to the zone
|
||||||
switch (rand()%8)
|
switch (rand()%8)
|
||||||
{
|
{
|
||||||
case 0: (*i)->PlaySound(RND_WISPER_1, true); break;
|
case 0: (*i)->SendPlaySound(RND_WISPER_1, true); break;
|
||||||
case 1: (*i)->PlaySound(RND_WISPER_2, true); break;
|
case 1: (*i)->SendPlaySound(RND_WISPER_2, true); break;
|
||||||
case 2: (*i)->PlaySound(RND_WISPER_3, true); break;
|
case 2: (*i)->SendPlaySound(RND_WISPER_3, true); break;
|
||||||
case 3: (*i)->PlaySound(RND_WISPER_4, true); break;
|
case 3: (*i)->SendPlaySound(RND_WISPER_4, true); break;
|
||||||
case 4: (*i)->PlaySound(RND_WISPER_5, true); break;
|
case 4: (*i)->SendPlaySound(RND_WISPER_5, true); break;
|
||||||
case 5: (*i)->PlaySound(RND_WISPER_6, true); break;
|
case 5: (*i)->SendPlaySound(RND_WISPER_6, true); break;
|
||||||
case 6: (*i)->PlaySound(RND_WISPER_7, true); break;
|
case 6: (*i)->SendPlaySound(RND_WISPER_7, true); break;
|
||||||
case 7: (*i)->PlaySound(RND_WISPER_8, true); break;
|
case 7: (*i)->SendPlaySound(RND_WISPER_8, true); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1166,6 +1166,16 @@ void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossW
|
|||||||
player->GetSession()->SendPacket(&data);
|
player->GetSession()->SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WorldObject::SendPlaySound(uint32 Sound, bool OnlySelf)
|
||||||
|
{
|
||||||
|
WorldPacket data(SMSG_PLAY_SOUND, 4);
|
||||||
|
data << Sound;
|
||||||
|
if (OnlySelf && GetTypeId() == TYPEID_PLAYER )
|
||||||
|
((Player*)this)->GetSession()->SendPacket( &data );
|
||||||
|
else
|
||||||
|
SendMessageToSet( &data, true ); // ToSelf ignored in this case
|
||||||
|
}
|
||||||
|
|
||||||
namespace MaNGOS
|
namespace MaNGOS
|
||||||
{
|
{
|
||||||
class MessageChatLocaleCacheDo
|
class MessageChatLocaleCacheDo
|
||||||
|
|||||||
@@ -437,6 +437,9 @@ class MANGOS_DLL_SPEC WorldObject : public Object
|
|||||||
// low level function for visibility change code, must be define in all main world object subclasses
|
// low level function for visibility change code, must be define in all main world object subclasses
|
||||||
virtual bool isVisibleForInState(Player const* u, bool inVisibleList) const = 0;
|
virtual bool isVisibleForInState(Player const* u, bool inVisibleList) const = 0;
|
||||||
|
|
||||||
|
// Low Level Packets
|
||||||
|
void SendPlaySound(uint32 Sound, bool OnlySelf);
|
||||||
|
|
||||||
Map * GetMap() const;
|
Map * GetMap() const;
|
||||||
Map const* GetBaseMap() const;
|
Map const* GetBaseMap() const;
|
||||||
Creature* SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime);
|
Creature* SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime);
|
||||||
|
|||||||
@@ -15380,16 +15380,6 @@ void Player::SendAutoRepeatCancel()
|
|||||||
GetSession()->SendPacket( &data );
|
GetSession()->SendPacket( &data );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::PlaySound(uint32 Sound, bool OnlySelf)
|
|
||||||
{
|
|
||||||
WorldPacket data(SMSG_PLAY_SOUND, 4);
|
|
||||||
data << Sound;
|
|
||||||
if (OnlySelf)
|
|
||||||
GetSession()->SendPacket( &data );
|
|
||||||
else
|
|
||||||
SendMessageToSet( &data, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Player::SendExplorationExperience(uint32 Area, uint32 Experience)
|
void Player::SendExplorationExperience(uint32 Area, uint32 Experience)
|
||||||
{
|
{
|
||||||
WorldPacket data( SMSG_EXPLORATION_EXPERIENCE, 8 );
|
WorldPacket data( SMSG_EXPLORATION_EXPERIENCE, 8 );
|
||||||
|
|||||||
@@ -1592,8 +1592,6 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||||||
void SendDelayResponse(const uint32);
|
void SendDelayResponse(const uint32);
|
||||||
void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP);
|
void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP);
|
||||||
|
|
||||||
//Low Level Packets
|
|
||||||
void PlaySound(uint32 Sound, bool OnlySelf);
|
|
||||||
//notifiers
|
//notifiers
|
||||||
void SendAttackSwingCantAttack();
|
void SendAttackSwingCantAttack();
|
||||||
void SendAttackSwingCancelAttack();
|
void SendAttackSwingCancelAttack();
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ bool ChatHandler::HandlePlaySound2Command(const char* args)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 soundid = atoi(args);
|
uint32 soundid = atoi(args);
|
||||||
m_session->GetPlayer()->PlaySound(soundid, false);
|
m_session->GetPlayer()->SendPlaySound(soundid, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user