Core/Protocol: Process CMSG_UPDATE_MISSILE_TRAJECTORY packets
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user