Core/Misc: converted quest, creature and quest query packets to packet class and ported query data caching from 335 branch
This commit is contained in:
1 parent
8c4491f3a0
commit
64c4b4f529
22 files changed
+924
-387
No files matched your search
@@ -19,6 +19,88 @@
|
||||
#include "Player.h"
|
||||
#include "QueryPackets.h"
|
||||
|
||||
void WorldPackets::Query::QueryCreature::Read()
|
||||
{
|
||||
_worldPacket >> CreatureID;
|
||||
_worldPacket >> GUID;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Query::QueryCreatureResponse::Write()
|
||||
{
|
||||
_worldPacket << uint32(CreatureID | (Allow ? 0x00000000 : 0x80000000)); // creature entry
|
||||
|
||||
if (Allow)
|
||||
{
|
||||
for (std::size_t i = 0; i < Stats.Name.size(); ++i)
|
||||
_worldPacket << Stats.Name[i];
|
||||
|
||||
for (std::size_t i = 0; i < Stats.NameAlt.size(); ++i)
|
||||
_worldPacket << Stats.NameAlt[i];
|
||||
|
||||
_worldPacket << Stats.Title;
|
||||
|
||||
_worldPacket << Stats.CursorName; // "Directions" for guard, string for Icons 2.3.0
|
||||
_worldPacket.append(Stats.Flags.data(), Stats.Flags.size()); // flags
|
||||
_worldPacket << uint32(Stats.CreatureType); // CreatureType.dbc
|
||||
_worldPacket << uint32(Stats.CreatureFamily); // CreatureFamily.dbc
|
||||
_worldPacket << uint32(Stats.Classification); // Creature Rank (elite, boss, etc)
|
||||
_worldPacket.append(Stats.ProxyCreatureID.data(), Stats.ProxyCreatureID.size());
|
||||
_worldPacket.append(Stats.CreatureDisplayID.data(), Stats.CreatureDisplayID.size()); // Modelid
|
||||
_worldPacket << float(Stats.HpMulti); // dmg/hp modifier
|
||||
_worldPacket << float(Stats.EnergyMulti); // dmg/mana modifier
|
||||
_worldPacket << uint8(Stats.Leader);
|
||||
_worldPacket.append(Stats.QuestItems.data(), Stats.QuestItems.size());
|
||||
_worldPacket << uint32(Stats.CreatureMovementInfoID); // CreatureMovementInfo.dbc
|
||||
_worldPacket << uint32(Stats.RequiredExpansion);
|
||||
}
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
void WorldPackets::Query::QueryGameObject::Read()
|
||||
{
|
||||
_worldPacket >> GameObjectID;
|
||||
_worldPacket >> GUID;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Query::QueryGameObjectResponse::Write()
|
||||
{
|
||||
_worldPacket << uint32(GameObjectID | (Allow ? 0x00000000 : 0x80000000));
|
||||
|
||||
if (Allow)
|
||||
{
|
||||
_worldPacket << uint32(Stats.Type);
|
||||
_worldPacket << uint32(Stats.DisplayID);
|
||||
|
||||
for (std::size_t i = 0; i < Stats.Name.size(); ++i)
|
||||
_worldPacket << Stats.Name[i];
|
||||
|
||||
_worldPacket << Stats.IconName; // 2.0.3, string. Icon name to use instead of default icon for go's (ex: "Attack" makes sword)
|
||||
_worldPacket << Stats.CastBarCaption; // 2.0.3, string. Text will appear in Cast Bar when using GO (ex: "Collecting")
|
||||
_worldPacket << Stats.UnkString; // 2.0.3, string
|
||||
_worldPacket.append(Stats.Data.data(), Stats.Data.size());
|
||||
_worldPacket << float(Stats.Size); // go size
|
||||
_worldPacket.append(Stats.QuestItems.data(), Stats.QuestItems.size());
|
||||
_worldPacket << int32(Stats.RequiredLevel);
|
||||
}
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
void WorldPackets::Query::QuestPOIQuery::Read()
|
||||
{
|
||||
_worldPacket >> MissingQuestCount;
|
||||
|
||||
MissingQuestPOIs.fill(0);
|
||||
if (MissingQuestCount <= MAX_QUEST_LOG_SIZE)
|
||||
{
|
||||
for (std::size_t i = 0; i < MissingQuestCount; ++i)
|
||||
_worldPacket >> MissingQuestPOIs[i];
|
||||
}
|
||||
else
|
||||
_worldPacket.rfinish();
|
||||
}
|
||||
|
||||
void WorldPackets::Query::DBQueryBulk::Read()
|
||||
{
|
||||
_worldPacket >> TableHash;
|
||||
|
||||
Reference in new issue
Block a user