mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
* Add support for .gobj target to output phaseMask
* Thanks to Aokromes for the original idea of adding it to .npc info output. --HG-- branch : trunk
This commit is contained in:
@@ -448,14 +448,14 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
|
||||
uint32 id = atol(cId);
|
||||
|
||||
if(id)
|
||||
result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, orientation, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE map = '%i' AND id = '%u' ORDER BY order_ ASC LIMIT 1",
|
||||
result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE map = '%i' AND id = '%u' ORDER BY order_ ASC LIMIT 1",
|
||||
pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), pl->GetMapId(),id);
|
||||
else
|
||||
{
|
||||
std::string name = cId;
|
||||
WorldDatabase.escape_string(name);
|
||||
result = WorldDatabase.PQuery(
|
||||
"SELECT guid, id, position_x, position_y, position_z, orientation, map, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ "
|
||||
"SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ "
|
||||
"FROM gameobject,gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'")" ORDER BY order_ ASC LIMIT 1",
|
||||
pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), pl->GetMapId(),name.c_str());
|
||||
}
|
||||
@@ -482,7 +482,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
|
||||
else
|
||||
eventFilter << ")";
|
||||
|
||||
result = WorldDatabase.PQuery("SELECT gameobject.guid, id, position_x, position_y, position_z, orientation, map, "
|
||||
result = WorldDatabase.PQuery("SELECT gameobject.guid, id, position_x, position_y, position_z, orientation, map, phaseMask, "
|
||||
"(POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ FROM gameobject "
|
||||
"LEFT OUTER JOIN game_event_gameobject on gameobject.guid=game_event_gameobject.guid WHERE map = '%i' %s ORDER BY order_ ASC LIMIT 10",
|
||||
m_session->GetPlayer()->GetPositionX(), m_session->GetPlayer()->GetPositionY(), m_session->GetPlayer()->GetPositionZ(), m_session->GetPlayer()->GetMapId(),eventFilter.str().c_str());
|
||||
@@ -497,7 +497,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
|
||||
bool found = false;
|
||||
float x, y, z, o;
|
||||
uint32 lowguid, id;
|
||||
uint16 mapid, pool_id;
|
||||
uint16 mapid, pool_id, phase;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -509,6 +509,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
|
||||
z = fields[4].GetFloat();
|
||||
o = fields[5].GetFloat();
|
||||
mapid = fields[6].GetUInt16();
|
||||
phase = fields[7].GetUInt16();
|
||||
pool_id = poolhandler.IsPartOfAPool(lowguid, TYPEID_GAMEOBJECT);
|
||||
if (!pool_id || (pool_id && poolhandler.IsSpawnedObject(pool_id, lowguid, TYPEID_GAMEOBJECT)))
|
||||
found = true;
|
||||
@@ -532,7 +533,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
|
||||
|
||||
GameObject* target = m_session->GetPlayer()->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid,id,HIGHGUID_GAMEOBJECT));
|
||||
|
||||
PSendSysMessage(LANG_GAMEOBJECT_DETAIL, lowguid, goI->name, lowguid, id, x, y, z, mapid, o);
|
||||
PSendSysMessage(LANG_GAMEOBJECT_DETAIL, lowguid, goI->name, lowguid, id, x, y, z, mapid, o, phase);
|
||||
|
||||
if(target)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user