From c1a538fa5a667f885e60d084ffeb3f86f1e82612 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sun, 22 Mar 2009 20:02:45 +0300 Subject: [PATCH] [7518] Implement new script command SCRIPT_COMMAND_PLAY_SOUND (look in World.h for args) * Also rewrite use SMSG_PLAY_OBJECT_SOUND/SMSG_PLAY_SOUND Now WorldObject have 2 function for sound level dependent from distance (PlayDistanceSound) and for not depednet (PlayDirectSound) * Old Player::PlaySound function removed and uses need to be updated to WorldObject functions Note: function called for _source_ of sound in different from old function. * chat command .debug ps removed and .debug playsound can used for bother packects test: if no selection used SMSG_PLAY_SOUND, if selection exist including self then SMSG_PLAY_OBJECT_SOUND. --- contrib/extractor/ad.exe | Bin 163840 -> 163328 bytes src/game/Chat.cpp | 1 - src/game/Chat.h | 1 - src/game/Level1.cpp | 29 ----------------------------- src/game/Object.cpp | 21 +++++++++++++++++++++ src/game/Object.h | 3 +++ src/game/Player.cpp | 10 ---------- src/game/Player.h | 2 -- src/game/SpellAuras.cpp | 3 +-- src/game/World.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ src/game/World.h | 1 + src/game/debugcmds.cpp | 36 ++++++++++++++++++++++++++++++++---- src/shared/revision_nr.h | 2 +- 13 files changed, 100 insertions(+), 50 deletions(-) diff --git a/contrib/extractor/ad.exe b/contrib/extractor/ad.exe index 208eb2da03065891ec5012d36de6dc24c8c1b530..6c6c2c9969b626a1ec76dc1259e1dee17ed3788c 100755 GIT binary patch delta 5810 zcwX(8eOOf2oyX7bFyIV=j5z2ZLUj&VOkM*bCcSaGqzbC%_mTrJfDxF0@qKtVx%-OS8KWdb>E&UH_bR|DIpHsIi zGS`yP^+V=7P6;l@iYXMTsx^8Lzp57ZM^*9Fl`S-UWuTocaj)LRn6tOIMO$(sZ}1W+ z%ay(Q&qVEVR@T$xmQQ7w>5BYKRtIV2V{0ytU|KtKZ(ZQcVnf)m5Lk`#NJjbi+BFm_ zk6l+mnevf!+ehT8{Vt~X`b8Y~_PZgK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~NoT$BA^ zQH^M~iBqsJ-QT5N+D&*;Sr6*E_Dale(SyZDpdGzPO%yhrM~=9!TO>~B|A=G#%5*;2 z!*8+ldQ`B`nYdQO%;0_=32udX2G{u)E|y%eN+2u6h8g@>k9v1^`wX7pqgmqaP8SoC z`GiON7C$&#bs*QFbK=t9GO_WVa+s>anos7FMpeUGHEV$ET%sm8narQ1KD9So=!{%P zdJ$#harmf!i1h#dz8EE9myst@wW~*T8F>Uwe%F1d3HJtZ#f1Az6A!`^<38L+_4I^i zy}PU0#N*XDFsXBpGc+chh?n4!AfA!#2@_P|wyu%5E`%*} z56^gexU`O(p$XK8UWsdbbjyYYcu(TV6eFgm@CiQVW$xff;$jLPEp(~ePwY)W^8MmS z3ZLv#GuU6L_D}HWTQ*!{L@JN)*}vR9`FX;W$|nTJE_ctSie_-~^%lAq4cdidw8=6`#}cg5ow zJpBJ(j{i3=N9EWYzQRj+YAx?2k+F(LdmhDCWVM)*$rHn>pK@=tsmZ2nQ)=dl)oTm# zjYd2{u`83W$F}$;lZWHyiBA?6Bhfsz3TI8V(zJ@()n6?|`P`fPTM=Z4YGvOVK8d1+ z+C$enWMV}XjBTlKFDa{X(ZXNjo=Nz@5~Jj==Ud3r?SHv|FZ9IM)Z?4^AAAR9^0&w4F6_G^}k9LkiKdHNF78+vcyI~RzU_rmOze%%!CYujDQS-?3*F6 zG3pY9RR1ef3K;>J133;d2{ID0bGpRzkVhe-7)xL$lCaL9&_Zri1L4Jt-=yq15A=O{`jft+sFXk2Ti6XZMd%3WP$BtG9b|=FKPHvqb}uLaTR}ar0t?6mnIHogK|F{BF+dOe09&9u_jCT1_kRK^ C(*wBx diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index e0aa19ae..458d2349 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -118,7 +118,6 @@ ChatCommand * ChatHandler::getCommandTable() { "sendopcode", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendOpcodeCommand, "", NULL }, { "spawnvehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpawnVehicle, "", NULL }, { "uws", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdateWorldStateCommand, "", NULL }, - { "ps", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugPlaySound2Command, "", NULL }, { "scn", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendChannelNotifyCommand, "", NULL }, { "scm", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendChatMsgCommand, "", NULL }, { "sps", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendSetPhaseShiftCommand, "", NULL }, diff --git a/src/game/Chat.h b/src/game/Chat.h index cfcebc35..0e06b327 100644 --- a/src/game/Chat.h +++ b/src/game/Chat.h @@ -417,7 +417,6 @@ class ChatHandler bool HandleDebugSellErrorCommand(const char* args); bool HandleDebugBuyErrorCommand(const char* args); bool HandleDebugUpdateWorldStateCommand(const char* args); - bool HandleDebugPlaySound2Command(const char* args); bool HandleDebugSendChannelNotifyCommand(const char* args); bool HandleDebugSendChatMsgCommand(const char* args); bool HandleRenameCommand(const char * args); diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index 7935f59e..88584604 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -1971,35 +1971,6 @@ bool ChatHandler::HandleWhispersCommand(const char* args) return false; } -//Play sound -bool ChatHandler::HandleDebugPlaySoundCommand(const char* args) -{ - // USAGE: .debug playsound #soundid - // #soundid - ID decimal number from SoundEntries.dbc (1st column) - // this file have about 5000 sounds. - // In this realization only caller can hear this sound. - if( *args ) - { - uint32 dwSoundId = atoi((char*)args); - - if( !sSoundEntriesStore.LookupEntry(dwSoundId) ) - { - PSendSysMessage(LANG_SOUND_NOT_EXIST, dwSoundId); - SetSentErrorMessage(true); - return false; - } - - WorldPacket data(SMSG_PLAY_OBJECT_SOUND,4+8); - data << uint32(dwSoundId) << m_session->GetPlayer()->GetGUID(); - m_session->SendPacket(&data); - - PSendSysMessage(LANG_YOU_HEAR_SOUND, dwSoundId); - return true; - } - - return false; -} - //Save all players in the world bool ChatHandler::HandleSaveAllCommand(const char* /*args*/) { diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 571cb482..c09d94cd 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1688,3 +1688,24 @@ void WorldObject::SetPhaseMask(uint32 newPhaseMask, bool update) if(update && IsInWorld()) ObjectAccessor::UpdateObjectVisibility(this); } + +void WorldObject::PlayDistanceSound( uint32 sound_id, Player* target /*= NULL*/ ) +{ + WorldPacket data(SMSG_PLAY_OBJECT_SOUND,4+8); + data << uint32(sound_id); + data << GetGUID(); + if (target) + target->SendDirectMessage( &data ); + else + SendMessageToSet( &data, true ); +} + +void WorldObject::PlayDirectSound( uint32 sound_id, Player* target /*= NULL*/ ) +{ + WorldPacket data(SMSG_PLAY_SOUND, 4); + data << uint32(sound_id); + if (target) + target->SendDirectMessage( &data ); + else + SendMessageToSet( &data, true ); +} diff --git a/src/game/Object.h b/src/game/Object.h index 03e329b0..cac13000 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -458,6 +458,9 @@ class MANGOS_DLL_SPEC WorldObject : public Object void MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper = false); void BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 TargetGuid) const; + void PlayDistanceSound(uint32 sound_id, Player* target = NULL); + void PlayDirectSound(uint32 sound_id, Player* target = NULL); + void SendObjectDeSpawnAnim(uint64 guid); virtual void SaveRespawnTime() {} diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 62af51a7..e12d440a 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -16363,16 +16363,6 @@ void Player::SendAutoRepeatCancel() 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) { WorldPacket data( SMSG_EXPLORATION_EXPERIENCE, 8 ); diff --git a/src/game/Player.h b/src/game/Player.h index 62a8210b..1004b5b5 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1603,8 +1603,6 @@ class MANGOS_DLL_SPEC Player : public Unit void SendDelayResponse(const uint32); void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP); - //Low Level Packets - void PlaySound(uint32 Sound, bool OnlySelf); //notifiers void SendAttackSwingCantAttack(); void SendAttackSwingCancelAttack(); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 71969e30..94a218a5 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2046,8 +2046,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) m_target->CastSpell(m_target, 51581, true, NULL, this); return; case 43873: // Headless Horseman Laugh - if(caster->GetTypeId() == TYPEID_PLAYER) - ((Player*)caster)->PlaySound(11965, false); + m_target->PlayDistanceSound(11965); return; case 46354: // Blood Elf Illusion if(caster) diff --git a/src/game/World.cpp b/src/game/World.cpp index 436f8c8f..d4341953 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -2237,6 +2237,47 @@ void World::ScriptsProcess() break; } + case SCRIPT_COMMAND_PLAY_SOUND: + { + if(!source) + { + sLog.outError("SCRIPT_COMMAND_PLAY_SOUND call for NULL creature."); + break; + } + + WorldObject* pSource = dynamic_cast(source); + if(!pSource) + { + sLog.outError("SCRIPT_COMMAND_PLAY_SOUND call for non-world object (TypeId: %u), skipping.",source->GetTypeId()); + break; + } + + // bitmask: 0/1=anyone/target, 0/2=with distance dependent + Player* pTarget = NULL; + if(step.script->datalong2 & 1) + { + if(!target) + { + sLog.outError("SCRIPT_COMMAND_PLAY_SOUND in targeted mode call for NULL target."); + break; + } + + if(target->GetTypeId()!=TYPEID_PLAYER) + { + sLog.outError("SCRIPT_COMMAND_PLAY_SOUND in targeted mode call for non-player (TypeId: %u), skipping.",target->GetTypeId()); + break; + } + + pTarget = (Player*)target; + } + + // bitmask: 0/1=anyone/target, 0/2=with distance dependent + if(step.script->datalong2 & 2) + pSource->PlayDistanceSound(step.script->datalong,pTarget); + else + pSource->PlayDirectSound(step.script->datalong,pTarget); + break; + } default: sLog.outError("Unknown script command %u called.",step.script->command); break; diff --git a/src/game/World.h b/src/game/World.h index 55c0649a..17fd9b47 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -322,6 +322,7 @@ enum RealmZone #define SCRIPT_COMMAND_ACTIVATE_OBJECT 13 // source = unit, target=GO #define SCRIPT_COMMAND_REMOVE_AURA 14 // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id #define SCRIPT_COMMAND_CAST_SPELL 15 // source/target cast spell at target/source (script->datalong2: 0: s->t 1: s->s 2: t->t 3: t->s +#define SCRIPT_COMMAND_PLAY_SOUND 16 // source = any object, target=any/player, datalong (sound_id), datalong2 (bitmask: 0/1=anyone/target, 0/2=with distance dependent, so 1|2 = 3 is target with distance dependent) /// Storage class for commands issued for delayed execution struct CliCommandHolder diff --git a/src/game/debugcmds.cpp b/src/game/debugcmds.cpp index 1e870468..dbc8f4b2 100644 --- a/src/game/debugcmds.cpp +++ b/src/game/debugcmds.cpp @@ -213,13 +213,41 @@ bool ChatHandler::HandleDebugUpdateWorldStateCommand(const char* args) return true; } -bool ChatHandler::HandleDebugPlaySound2Command(const char* args) +//Play sound +bool ChatHandler::HandleDebugPlaySoundCommand(const char* args) { - if(!args) + // USAGE: .debug playsound #soundid + // #soundid - ID decimal number from SoundEntries.dbc (1st column) + if( !*args ) + { + SendSysMessage(LANG_BAD_VALUE); + SetSentErrorMessage(true); + return false; + } + + uint32 dwSoundId = atoi((char*)args); + + if(!sSoundEntriesStore.LookupEntry(dwSoundId)) + { + PSendSysMessage(LANG_SOUND_NOT_EXIST, dwSoundId); + SetSentErrorMessage(true); return false; + } + + Unit* unit = getSelectedUnit(); + if(!unit) + { + SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + SetSentErrorMessage(true); + return false; + } + + if(m_session->GetPlayer()->GetSelection()) + unit->PlayDistanceSound(dwSoundId,m_session->GetPlayer()); + else + unit->PlayDirectSound(dwSoundId,m_session->GetPlayer()); - uint32 soundid = atoi(args); - m_session->GetPlayer()->PlaySound(soundid, false); + PSendSysMessage(LANG_YOU_HEAR_SOUND, dwSoundId); return true; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c2ffceca..742cbec3 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7517" + #define REVISION_NR "7518" #endif // __REVISION_NR_H__ -- 2.11.4.GIT