Core/Protocol: Process CMSG_UPDATE_MISSILE_TRAJECTORY packets

This commit is contained in:
kaelima
2012-05-23 14:24:45 +02:00
parent f4c8f6ed73
commit 66d42b4f29
3 changed files with 47 additions and 1 deletions
+45
View File
@@ -51,6 +51,7 @@
#include "GameObjectAI.h"
#include "Group.h"
#include "AccountMgr.h"
#include "Spell.h"
void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data)
{
@@ -1714,3 +1715,47 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket)
_player->SetPendingBind(0, 0);
}
void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_UPDATE_MISSILE_TRAJECTORY");
uint64 guid;
uint32 spellId;
float elevation, speed;
float curX, curY, curZ;
float targetX, targetY, targetZ;
uint8 moveStop;
recvPacket >> guid >> spellId >> elevation >> speed;
recvPacket >> curX >> curY >> curZ;
recvPacket >> targetX >> targetY >> targetZ;
recvPacket >> moveStop;
Unit* caster = ObjectAccessor::GetUnit(*_player, guid);
Spell* spell = caster ? caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL) : NULL;
if (!spell || spell->m_spellInfo->Id != spellId || !spell->m_targets.HasDst())
{
recvPacket.rfinish();
return;
}
Position pos = *spell->m_targets.GetSrcPos();
pos.Relocate(curX, curY, curZ);
spell->m_targets.ModSrc(pos);
pos = *spell->m_targets.GetDstPos();
pos.Relocate(targetX, targetY, targetZ);
spell->m_targets.ModDst(pos);
spell->m_targets.SetElevation(elevation);
spell->m_targets.SetSpeed(speed);
if (moveStop)
{
uint32 opcode;
recvPacket >> opcode;
recvPacket.SetOpcode(opcode);
HandleMovementOpcodes(recvPacket);
}
}