diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 78ae1145a06..48a84a0cded 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -577,43 +577,41 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvdata*/) GetPlayer()->SendMessageToSet(&data, false); } -void WorldSession::HandleMoveKnockBackAck( WorldPacket & /*recv_data*/ ) +void WorldSession::HandleMoveKnockBackAck( WorldPacket & recv_data ) { sLog.outDebug("CMSG_MOVE_KNOCK_BACK_ACK"); - // Currently not used but maybe use later for recheck final player position - // (must be at call same as into "recv_data >> x >> y >> z >> orientation;" - /* - uint32 flags, time; - float x, y, z, orientation; - uint64 guid; - uint32 sequence; - uint32 ukn1; - float xdirection,ydirection,hspeed,vspeed; + recv_data.read_skip(); // guid + recv_data.read_skip(); // unk - recv_data >> guid; - recv_data >> sequence; - recv_data >> flags >> time; - recv_data >> x >> y >> z >> orientation; - recv_data >> ukn1; //unknown - recv_data >> vspeed >> xdirection >> ydirection >> hspeed; - - // skip not personal message; - if(GetPlayer()->GetGUID()!=guid) - return; - - // check code - */ + MovementInfo movementInfo; + ReadMovementInfo(recv_data, &movementInfo); } -void WorldSession::HandleMoveHoverAck( WorldPacket& /*recv_data*/ ) +void WorldSession::HandleMoveHoverAck( WorldPacket& recv_data ) { sLog.outDebug("CMSG_MOVE_HOVER_ACK"); + + recv_data.read_skip(); // guid + recv_data.read_skip(); // unk + + MovementInfo movementInfo; + ReadMovementInfo(recv_data, &movementInfo); + + recv_data.read_skip(); // unk2 } -void WorldSession::HandleMoveWaterWalkAck(WorldPacket& /*recv_data*/) +void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recv_data) { sLog.outDebug("CMSG_MOVE_WATER_WALK_ACK"); + + recv_data.read_skip(); // guid + recv_data.read_skip(); // unk + + MovementInfo movementInfo; + ReadMovementInfo(recv_data, &movementInfo); + + recv_data.read_skip(); // unk2 } void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data) diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index e03239332c4..1037b65b624 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -703,7 +703,7 @@ enum SpellEffects SPELL_EFFECT_CALL_PET = 135, SPELL_EFFECT_HEAL_PCT = 136, SPELL_EFFECT_ENERGIZE_PCT = 137, - SPELL_EFFECT_138 = 138, + SPELL_EFFECT_LEAP_BACK = 138, SPELL_EFFECT_CLEAR_QUEST = 139, SPELL_EFFECT_FORCE_CAST = 140, SPELL_EFFECT_141 = 141, diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index b766f3d75af..e48251347b2 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2944,7 +2944,7 @@ void Spell::cast(bool skipCheck) case SPELL_EFFECT_CHARGE: case SPELL_EFFECT_JUMP: case SPELL_EFFECT_JUMP2: - case SPELL_EFFECT_138: + case SPELL_EFFECT_LEAP_BACK: HandleEffects(NULL,NULL,NULL,i); m_effectMask |= (1<SetCanBlock(true); } -void Spell::EffectMomentMove(uint32 i) +void Spell::EffectLeapForward(uint32 i) { if(unitTarget->isInFlight()) return; @@ -6444,26 +6444,10 @@ void Spell::EffectSendTaxi(uint32 i) void Spell::EffectPlayerPull(uint32 i) { - if(!unitTarget || !m_caster) + if(!unitTarget) return; - // Effect only works on players - if(unitTarget->GetTypeId()!=TYPEID_PLAYER) - return; - - float vsin = sin(unitTarget->GetAngle(m_caster)); - float vcos = cos(unitTarget->GetAngle(m_caster)); - - WorldPacket data(SMSG_MOVE_KNOCK_BACK, 8+4+4+4+4+4); - data.append(unitTarget->GetPackGUID()); - data << uint32(0); // Sequence - data << float(vcos); // x direction - data << float(vsin); // y direction - // Horizontal speed - data << float(damage ? damage : unitTarget->GetDistance2d(m_caster)); - data << float(m_spellInfo->EffectMiscValue[i])/-10; // Z Movement speed - - ((Player*)unitTarget)->GetSession()->SendPacket(&data); + unitTarget->KnockbackFrom(m_caster->GetPositionX(), m_caster->GetPositionY(), float(damage ? damage : unitTarget->GetDistance2d(m_caster)), float(m_spellInfo->EffectMiscValue[i])/10); } void Spell::EffectDispelMechanic(uint32 i) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 373459f4015..d34f611b7a7 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -84,7 +84,7 @@ SpellMgr::SpellMgr() case SPELL_EFFECT_CHARGE: case SPELL_EFFECT_JUMP: case SPELL_EFFECT_JUMP2: - case SPELL_EFFECT_138: + case SPELL_EFFECT_LEAP_BACK: EffectTargetType[i] = SPELL_REQUIRE_CASTER; break; //case SPELL_EFFECT_WMO_DAMAGE: @@ -3578,7 +3578,7 @@ void SpellMgr::LoadSpellCustomAttr() case SPELL_EFFECT_CHARGE: case SPELL_EFFECT_JUMP: case SPELL_EFFECT_JUMP2: - case SPELL_EFFECT_138: + case SPELL_EFFECT_LEAP_BACK: if(!spellInfo->speed && !spellInfo->SpellFamilyName) spellInfo->speed = SPEED_CHARGE; mSpellCustomAttr[i] |= SPELL_ATTR_CU_CHARGE;