mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 04:59:41 -04:00
@@ -37,12 +37,60 @@
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "QueryPackets.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "Transport.h"
|
||||
#include "World.h"
|
||||
#include <G3D/Quat.h>
|
||||
|
||||
void GameObjectTemplate::InitializeQueryData()
|
||||
{
|
||||
WorldPacket queryTemp;
|
||||
for (uint8 loc = LOCALE_enUS; loc < TOTAL_LOCALES; ++loc)
|
||||
{
|
||||
queryTemp = BuildQueryData(static_cast<LocaleConstant>(loc));
|
||||
QueryData[loc] = queryTemp;
|
||||
}
|
||||
}
|
||||
|
||||
WorldPacket GameObjectTemplate::BuildQueryData(LocaleConstant loc) const
|
||||
{
|
||||
WorldPackets::Query::QueryGameObjectResponse queryTemp;
|
||||
|
||||
queryTemp.GameObjectID = entry;
|
||||
|
||||
queryTemp.Allow = true;
|
||||
WorldPackets::Query::GameObjectStats& stats = queryTemp.Stats;
|
||||
|
||||
stats.Type = type;
|
||||
stats.DisplayID = displayId;
|
||||
|
||||
stats.Name[0] = name;
|
||||
stats.IconName = IconName;
|
||||
stats.CastBarCaption = castBarCaption;
|
||||
stats.UnkString = unk1;
|
||||
|
||||
if (loc != LOCALE_enUS)
|
||||
if (GameObjectLocale const* gameObjectLocale = sObjectMgr->GetGameObjectLocale(entry))
|
||||
{
|
||||
ObjectMgr::GetLocaleString(gameObjectLocale->Name, loc, stats.Name[0]);
|
||||
ObjectMgr::GetLocaleString(gameObjectLocale->CastBarCaption, loc, stats.CastBarCaption);
|
||||
ObjectMgr::GetLocaleString(gameObjectLocale->Unk1, loc, stats.UnkString);
|
||||
}
|
||||
|
||||
stats.Size = size;
|
||||
|
||||
if (std::vector<uint32> const* items = sObjectMgr->GetGameObjectQuestItemList(entry))
|
||||
for (int32 item : *items)
|
||||
stats.QuestItems.push_back(item);
|
||||
|
||||
memcpy(stats.Data, raw.data, MAX_GAMEOBJECT_DATA * sizeof(int32));
|
||||
stats.RequiredLevel = RequiredLevel;
|
||||
|
||||
return *queryTemp.Write();
|
||||
}
|
||||
|
||||
bool QuaternionData::isUnit() const
|
||||
{
|
||||
return fabs(x * x + y * y + z * z + w * w - 1.0f) < 1e-5;
|
||||
|
||||
Reference in New Issue
Block a user