From d6782fa826508920f8de22709a32e83611bfdffe Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 4 Jul 2011 14:46:48 +0100 Subject: Core/Misc: Refactor SendPlaySpellVisual and SendPlaySpellImpact and move them to Unit (from Spell) --- src/server/game/Server/Protocol/Handlers/NPCHandler.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/server/game/Server') diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index cbe9896065a..3332632d25e 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -279,16 +279,9 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) return; _player->ModifyMoney(-int32(nSpellCost)); - - WorldPacket data(SMSG_PLAY_SPELL_VISUAL, 12); // visual effect on trainer - data << uint64(guid); - data << uint32(0xB3); // index from SpellVisualKit.dbc - SendPacket(&data); - - data.Initialize(SMSG_PLAY_SPELL_IMPACT, 12); // visual effect on player - data << uint64(_player->GetGUID()); - data << uint32(0x016A); // index from SpellVisualKit.dbc - SendPacket(&data); + + unit->SendPlaySpellVisual(179); // 53 SpellCastDirected + unit->SendPlaySpellImpact(_player->GetGUID(), 362); // 113 EmoteSalute // learn explicitly or cast explicitly if (trainer_spell->IsCastable()) @@ -296,7 +289,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) else _player->learnSpell(spellId, false); - data.Initialize(SMSG_TRAINER_BUY_SUCCEEDED, 12); + WorldPacket data(SMSG_TRAINER_BUY_SUCCEEDED, 12); data << uint64(guid); data << uint32(spellId); // should be same as in packet from client SendPacket(&data); -- cgit v1.2.3