diff options
-rwxr-xr-x | src/server/game/Entities/Creature/Creature.cpp | 147 | ||||
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 38 | ||||
-rw-r--r-- | src/server/game/Server/Protocol/Opcodes.cpp | 16 | ||||
-rwxr-xr-x | src/server/game/Server/Protocol/Opcodes.h | 23 |
4 files changed, 194 insertions, 30 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 9fd48bfc320..6d0dee92e38 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2480,9 +2480,52 @@ bool Creature::SetWalk(bool enable) if (!Unit::SetWalk(enable)) return false; - WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_WALK_MODE : SMSG_SPLINE_MOVE_SET_RUN_MODE, 9); - data.append(GetPackGUID()); - SendMessageToSet(&data, false); + ObjectGuid guid = GetGUID(); + if (enable) + { + WorldPacket data(SMSG_SPLINE_MOVE_SET_WALK_MODE, 9); + data.WriteBit(guid[7]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[4]); + data.WriteBit(guid[2]); + data.WriteBit(guid[0]); + data.FlushBits(); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); + SendMessageToSet(&data, false); + } + else + { + WorldPacket data(SMSG_SPLINE_MOVE_SET_RUN_MODE, 9); + data.WriteBit(guid[5]); + data.WriteBit(guid[6]); + data.WriteBit(guid[3]); + data.WriteBit(guid[2]); + data.WriteBit(guid[0]); + data.WriteBit(guid[7]); + data.WriteBit(guid[4]); + data.WriteBit(guid[1]); + data.FlushBits(); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + SendMessageToSet(&data, false); + } + return true; } @@ -2496,9 +2539,52 @@ bool Creature::SetDisableGravity(bool disable, bool packetOnly/*=false*/) if (!movespline->Initialized()) return true; - WorldPacket data(disable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); - data.append(GetPackGUID()); - SendMessageToSet(&data, false); + ObjectGuid guid = GetGUID(); + if (disable) + { + WorldPacket data(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, 9); + data.WriteBit(guid[7]); + data.WriteBit(guid[3]); + data.WriteBit(guid[4]); + data.WriteBit(guid[2]); + data.WriteBit(guid[5]); + data.WriteBit(guid[1]); + data.WriteBit(guid[0]); + data.WriteBit(guid[6]); + data.FlushBits(); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[0]); + SendMessageToSet(&data, false); + } + else + { + WorldPacket data(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); + data.WriteBit(guid[7]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[6]); + data.WriteBit(guid[2]); + data.WriteBit(guid[0]); + data.FlushBits(); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[5]); + SendMessageToSet(&data, false); + } + return true; } @@ -2517,8 +2603,51 @@ bool Creature::SetHover(bool enable) return true; //! Not always a packet is sent - WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_HOVER : SMSG_SPLINE_MOVE_UNSET_HOVER, 9); - data.append(GetPackGUID()); - SendMessageToSet(&data, false); + ObjectGuid guid = GetGUID(); + if (enable) + { + WorldPacket data(SMSG_SPLINE_MOVE_SET_HOVER, 9); + data.WriteBit(guid[3]); + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[4]); + data.WriteBit(guid[6]); + data.WriteBit(guid[2]); + data.WriteBit(guid[5]); + data.FlushBits(); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[6]); + SendMessageToSet(&data, false); + } + else + { + WorldPacket data(SMSG_SPLINE_MOVE_UNSET_HOVER, 9); + data.WriteBit(guid[6]); + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[4]); + data.WriteBit(guid[5]); + data.WriteBit(guid[2]); + data.FlushBits(); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[1]); + SendMessageToSet(&data, false); + } + return true; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5a5f5c358b2..ad8510a2775 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16304,8 +16304,25 @@ void Unit::SetRooted(bool apply) } else { + ObjectGuid guid = GetGUID(); WorldPacket data(SMSG_SPLINE_MOVE_ROOT, 8); - data.append(GetPackGUID()); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); + data.WriteBit(guid[6]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[7]); + data.WriteBit(guid[2]); + data.WriteBit(guid[0]); + data.FlushBits(); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[4]); SendMessageToSet(&data, true); StopMoving(); } @@ -16323,8 +16340,25 @@ void Unit::SetRooted(bool apply) } else { + ObjectGuid guid = GetGUID(); WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8); - data.append(GetPackGUID()); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[3]); + data.WriteBit(guid[2]); + data.WriteBit(guid[7]); + data.WriteBit(guid[4]); + data.FlushBits(); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[4]); SendMessageToSet(&data, true); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d56bc0ff97e..5a53b637a99 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1290,32 +1290,32 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 12316532a10..4bbe2f70712 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1070,33 +1070,34 @@ enum Opcodes SMSG_SPELL_START = 0x6415, SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x0000, SMSG_SPIRIT_HEALER_CONFIRM = 0x0000, - SMSG_SPLINE_MOVE_COLLISION_DISABLE = 0x0000, - SMSG_SPLINE_MOVE_COLLISION_ENABLE = 0x0000, - SMSG_SPLINE_MOVE_GRAVITY_DISABLE = 0x0000, - SMSG_SPLINE_MOVE_GRAVITY_ENABLE = 0x0000, - SMSG_SPLINE_MOVE_ROOT = 0x0000, + SMSG_SPLINE_MOVE_COLLISION_DISABLE = 0x35B1, + SMSG_SPLINE_MOVE_COLLISION_ENABLE = 0x3CB0, + SMSG_SPLINE_MOVE_GRAVITY_DISABLE = 0x5DB5, + SMSG_SPLINE_MOVE_GRAVITY_ENABLE = 0x3CA6, + SMSG_SPLINE_MOVE_ROOT = 0x51B4, SMSG_SPLINE_MOVE_SET_FEATHER_FALL = 0x3DA5, SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_FLYING = 0x31B5, - SMSG_SPLINE_MOVE_SET_HOVER = 0x0000, + SMSG_SPLINE_MOVE_SET_HOVER = 0x14B6, SMSG_SPLINE_MOVE_SET_LAND_WALK = 0x3DA7, SMSG_SPLINE_MOVE_SET_NORMAL_FALL = 0x38B2, SMSG_SPLINE_MOVE_SET_PITCH_RATE = 0x0000, SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x0000, + SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x75A7, SMSG_SPLINE_MOVE_SET_RUN_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x51B7, SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x0000, - SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x0000, + SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x54B6, SMSG_SPLINE_MOVE_SET_WALK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_WATER_WALK = 0x0000, - SMSG_SPLINE_MOVE_START_SWIM = 0x0000, - SMSG_SPLINE_MOVE_STOP_SWIM = 0x0000, - SMSG_SPLINE_MOVE_UNROOT = 0x0000, + SMSG_SPLINE_MOVE_START_SWIM = 0x31A5, + SMSG_SPLINE_MOVE_STOP_SWIM = 0x1DA2, + SMSG_SPLINE_MOVE_UNROOT = 0x75B6, SMSG_SPLINE_MOVE_UNSET_FLYING = 0x58A6, SMSG_SPLINE_MOVE_UNSET_HOVER = 0x7DA5, + SMSG_SPLINE_MOVE_WATER_WALK = 0x50A2, SMSG_STABLE_RESULT = 0x2204, SMSG_STANDSTATE_UPDATE = 0x6F04, SMSG_START_MIRROR_TIMER = 0x0000, |