Changeset 12 for trunk

Show
Ignore:
Timestamp:
11/19/08 13:22:59 (17 years ago)
Author:
yumileroy
Message:

[svn] * PlaySound? changed to SendPlaySound?, moved to WorldObject? and used everywhere instead of hard-coding packet

Original author: Neo2003
Date: 2008-10-05 11:38:24-05:00

Location:
trunk/src
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/ScriptMgr.cpp

    r6 r12  
    18541854        if(GetSoundEntriesStore()->LookupEntry((*i).second.SoundId)) 
    18551855        { 
    1856             WorldPacket data(4); 
    1857             data.SetOpcode(SMSG_PLAY_SOUND); 
    1858             data << uint32((*i).second.SoundId); 
    1859             pSource->SendMessageToSet(&data,false); 
     1856            pSource->SendPlaySound((*i).second.SoundId, false); 
    18601857        } 
    18611858        else 
  • trunk/src/bindings/scripts/include/sc_creature.cpp

    r6 r12  
    66#include "Item.h" 
    77#include "Spell.h" 
    8 #include "WorldPacket.h" 
    98 
    109// Spell summary for ScriptedAI::SelectSpell 
     
    203202    } 
    204203 
    205     WorldPacket data(4); 
    206     data.SetOpcode(SMSG_PLAY_SOUND); 
    207     data << uint32(sound); 
    208     unit->SendMessageToSet(&data,false); 
     204    unit->SendPlaySound(sound, false); 
    209205} 
    210206 
  • trunk/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp

    r6 r12  
    584584                    switch (rand()%8) 
    585585                    { 
    586                         case 0: (*i)->PlaySound(RND_WISPER_1, true); break; 
    587                         case 1: (*i)->PlaySound(RND_WISPER_2, true); break; 
    588                         case 2: (*i)->PlaySound(RND_WISPER_3, true); break; 
    589                         case 3: (*i)->PlaySound(RND_WISPER_4, true); break; 
    590                         case 4: (*i)->PlaySound(RND_WISPER_5, true); break; 
    591                         case 5: (*i)->PlaySound(RND_WISPER_6, true); break; 
    592                         case 6: (*i)->PlaySound(RND_WISPER_7, true); break; 
    593                         case 7: (*i)->PlaySound(RND_WISPER_8, true); break; 
     586                        case 0: (*i)->SendPlaySound(RND_WISPER_1, true); break; 
     587                        case 1: (*i)->SendPlaySound(RND_WISPER_2, true); break; 
     588                        case 2: (*i)->SendPlaySound(RND_WISPER_3, true); break; 
     589                        case 3: (*i)->SendPlaySound(RND_WISPER_4, true); break; 
     590                        case 4: (*i)->SendPlaySound(RND_WISPER_5, true); break; 
     591                        case 5: (*i)->SendPlaySound(RND_WISPER_6, true); break; 
     592                        case 6: (*i)->SendPlaySound(RND_WISPER_7, true); break; 
     593                        case 7: (*i)->SendPlaySound(RND_WISPER_8, true); break; 
    594594                    } 
    595595                } 
  • trunk/src/game/Object.cpp

    r2 r12  
    11671167} 
    11681168 
     1169void WorldObject::SendPlaySound(uint32 Sound, bool OnlySelf) 
     1170{ 
     1171    WorldPacket data(SMSG_PLAY_SOUND, 4); 
     1172    data << Sound; 
     1173    if (OnlySelf && GetTypeId() == TYPEID_PLAYER ) 
     1174        ((Player*)this)->GetSession()->SendPacket( &data ); 
     1175    else 
     1176        SendMessageToSet( &data, true ); // ToSelf ignored in this case 
     1177} 
     1178 
    11691179namespace MaNGOS 
    11701180{ 
  • trunk/src/game/Object.h

    r2 r12  
    438438        virtual bool isVisibleForInState(Player const* u, bool inVisibleList) const = 0; 
    439439 
     440        // Low Level Packets 
     441        void SendPlaySound(uint32 Sound, bool OnlySelf); 
     442 
    440443        Map      * GetMap() const; 
    441444        Map const* GetBaseMap() const; 
  • trunk/src/game/Player.cpp

    r9 r12  
    1538115381} 
    1538215382 
    15383 void Player::PlaySound(uint32 Sound, bool OnlySelf) 
    15384 { 
    15385     WorldPacket data(SMSG_PLAY_SOUND, 4); 
    15386     data << Sound; 
    15387     if (OnlySelf) 
    15388         GetSession()->SendPacket( &data ); 
    15389     else 
    15390         SendMessageToSet( &data, true ); 
    15391 } 
    15392  
    1539315383void Player::SendExplorationExperience(uint32 Area, uint32 Experience) 
    1539415384{ 
  • trunk/src/game/Player.h

    r9 r12  
    15931593        void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP); 
    15941594 
    1595         //Low Level Packets 
    1596         void PlaySound(uint32 Sound, bool OnlySelf); 
    15971595        //notifiers 
    15981596        void SendAttackSwingCantAttack(); 
  • trunk/src/game/debugcmds.cpp

    r9 r12  
    217217 
    218218    uint32 soundid = atoi(args); 
    219     m_session->GetPlayer()->PlaySound(soundid, false); 
     219    m_session->GetPlayer()->SendPlaySound(soundid, false); 
    220220    return true; 
    221221}