aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Movement/Spline/MovementPacketBuilder.cpp22
-rw-r--r--src/server/game/Server/Packets/ItemPackets.cpp26
-rw-r--r--src/server/game/Server/Packets/ItemPackets.h40
-rw-r--r--src/server/game/Server/Packets/QuestPackets.cpp43
-rw-r--r--src/server/game/Server/Packets/QuestPackets.h75
-rw-r--r--src/server/game/Server/Packets/SpellPackets.cpp1
6 files changed, 191 insertions, 16 deletions
diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
index 2babbe65cbf..f13c69b97fd 100644
--- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
+++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp
@@ -25,23 +25,15 @@
namespace Movement
{
- void PacketBuilder::WriteStopMovement(Vector3 const& pos, uint32 splineId, ByteBuffer& data)
- {
- /*data << uint8(0); // sets/unsets MOVEMENTFLAG2_UNK7 (0x40)
- data << pos;
- data << splineId;
- data << uint8(MonsterMoveStop);*/
- }
-
void PacketBuilder::WriteMonsterMove(const MoveSpline& move_spline, WorldPackets::Movement::MovementMonsterSpline& movementMonsterSpline)
{
movementMonsterSpline.ID = move_spline.m_Id;
WorldPackets::Movement::MovementSpline& movementSpline = movementMonsterSpline.Move;
-
+
MoveSplineFlag splineflags = move_spline.splineflags;
splineflags.enter_cycle = move_spline.isCyclic();
movementSpline.Flags = uint32(splineflags & uint32(~MoveSplineFlag::Mask_No_Monster_Move));
-
+
switch (move_spline.splineflags & MoveSplineFlag::Mask_Final_Facing)
{
case MoveSplineFlag::Final_Point:
@@ -60,24 +52,24 @@ namespace Movement
movementSpline.Face = MONSTER_MOVE_NORMAL;
break;
}
-
+
if (splineflags.animation)
{
movementSpline.AnimTier = splineflags.getAnimationId();
movementSpline.TierTransStartTime = move_spline.effect_start_time;
}
-
+
movementSpline.MoveTime = move_spline.Duration();
-
+
if (splineflags.parabolic)
{
movementSpline.JumpGravity = move_spline.vertical_acceleration;
movementSpline.SpecialTime = move_spline.effect_start_time;
}
-
+
Spline<int32> const& spline = move_spline.spline;
std::vector<Vector3> const& array = spline.getPoints();
-
+
if (splineflags & MoveSplineFlag::UncompressedPath)
{
if (!splineflags.cyclic)
diff --git a/src/server/game/Server/Packets/ItemPackets.cpp b/src/server/game/Server/Packets/ItemPackets.cpp
new file mode 100644
index 00000000000..b89b7524f20
--- /dev/null
+++ b/src/server/game/Server/Packets/ItemPackets.cpp
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ItemPackets.h"
+
+WorldPacket const* WorldPackets::Item::SetProficiency::Write()
+{
+ _worldPacket << ProficiencyMask;
+ _worldPacket << ProficiencyClass;
+
+ return &_worldPacket;
+}
diff --git a/src/server/game/Server/Packets/ItemPackets.h b/src/server/game/Server/Packets/ItemPackets.h
new file mode 100644
index 00000000000..498bc939812
--- /dev/null
+++ b/src/server/game/Server/Packets/ItemPackets.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ItemPackets_h__
+#define ItemPackets_h__
+
+#include "Packet.h"
+
+namespace WorldPackets
+{
+ namespace Item
+ {
+ class SetProficiency final : public ServerPacket
+ {
+ public:
+ SetProficiency() : ServerPacket(SMSG_SET_PROFICIENCY, 5) { }
+
+ WorldPacket const* Write() override;
+
+ uint32 ProficiencyMask;
+ uint8 ProficiencyClass;
+ };
+ }
+}
+
+#endif // ItemPackets_h__
diff --git a/src/server/game/Server/Packets/QuestPackets.cpp b/src/server/game/Server/Packets/QuestPackets.cpp
new file mode 100644
index 00000000000..e20023d3dd2
--- /dev/null
+++ b/src/server/game/Server/Packets/QuestPackets.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "QuestPackets.h"
+
+void WorldPackets::Quest::QuestGiverStatusQuery::Read()
+{
+ _worldPacket >> QuestGiverGUID;
+}
+
+WorldPacket const* WorldPackets::Quest::QuestGiverStatus::Write()
+{
+ _worldPacket << QuestGiver.Guid;
+ _worldPacket << QuestGiver.Status;
+
+ return &_worldPacket;
+}
+
+WorldPacket const* WorldPackets::Quest::QuestGiverStatusMultiple::Write()
+{
+ _worldPacket << int32(QuestGiver.size());
+ for (QuestGiverInfo const& questGiver : QuestGiver)
+ {
+ _worldPacket << questGiver.Guid;
+ _worldPacket << questGiver.Status;
+ }
+
+ return &_worldPacket;
+}
diff --git a/src/server/game/Server/Packets/QuestPackets.h b/src/server/game/Server/Packets/QuestPackets.h
new file mode 100644
index 00000000000..c656662761d
--- /dev/null
+++ b/src/server/game/Server/Packets/QuestPackets.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef QuestPackets_h__
+#define QuestPackets_h__
+
+#include "Packet.h"
+#include "QuestDef.h"
+
+namespace WorldPackets
+{
+ namespace Quest
+ {
+ class QuestGiverStatusQuery final : public ClientPacket
+ {
+ public:
+ QuestGiverStatusQuery(WorldPacket&& packet) : ClientPacket(CMSG_QUESTGIVER_STATUS_QUERY, std::move(packet)) { }
+
+ void Read() override;
+
+ ObjectGuid QuestGiverGUID;
+ };
+
+ // Empty packet, server replies with quest giver status of visible creatures
+ class QuestGiverStatusMultipleQuery final : public ClientPacket
+ {
+ public:
+ QuestGiverStatusMultipleQuery(WorldPacket&& packet) : ClientPacket(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, std::move(packet)) { }
+
+ void Read() override {};
+ };
+
+ struct QuestGiverInfo
+ {
+ ObjectGuid Guid;
+ uint32 Status = DIALOG_STATUS_NONE;
+ };
+
+ class QuestGiverStatus final : public ServerPacket
+ {
+ public:
+ QuestGiverStatus() : ServerPacket(SMSG_QUESTGIVER_STATUS, 12) { }
+
+ WorldPacket const* Write() override;
+
+ QuestGiverInfo QuestGiver;
+ };
+
+ class QuestGiverStatusMultiple final : public ServerPacket
+ {
+ public:
+ QuestGiverStatusMultiple() : ServerPacket(SMSG_QUESTGIVER_STATUS_MULTIPLE, 24) { }
+
+ WorldPacket const* Write() override;
+
+ std::vector<QuestGiverInfo> QuestGiver;
+ };
+ }
+}
+
+#endif // QuestPackets_h__
diff --git a/src/server/game/Server/Packets/SpellPackets.cpp b/src/server/game/Server/Packets/SpellPackets.cpp
index 6ca1012a51c..37738f4033c 100644
--- a/src/server/game/Server/Packets/SpellPackets.cpp
+++ b/src/server/game/Server/Packets/SpellPackets.cpp
@@ -75,7 +75,6 @@ ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spell::SpellCastLogData&
data << powerData.PowerType;
data << powerData.Amount;
}
- data.FlushBits();
data.WriteBit(false);
// data << float // Unk data if bit is true
data.FlushBits();