244 result =
WorldDatabase.
PQuery(
"SELECT guid, id, position_x, position_y, position_z, orientation, map, PhaseId, PhaseGroup, (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",
245 player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), objectId);
248 std::string name = id;
251 "SELECT guid, id, position_x, position_y, position_z, orientation, map, PhaseId, PhaseGroup, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ "
252 "FROM gameobject, gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name " _LIKE_" " _CONCAT3_(
"'%%'",
"'%s'",
"'%%'")
" ORDER BY order_ ASC LIMIT 1",
253 player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), name.c_str());
258 std::ostringstream eventFilter;
259 eventFilter <<
" AND (eventEntry IS NULL ";
260 bool initString =
true;
262 for (GameEventMgr::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr)
266 eventFilter <<
"OR eventEntry IN (" << *itr;
270 eventFilter <<
',' << *itr;
278 result =
WorldDatabase.
PQuery(
"SELECT gameobject.guid, id, position_x, position_y, position_z, orientation, map, PhaseId, PhaseGroup, "
279 "(POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ FROM gameobject "
280 "LEFT OUTER JOIN game_event_gameobject on gameobject.guid = game_event_gameobject.guid WHERE map = '%i' %s ORDER BY order_ ASC LIMIT 10",
294 uint32 id, phaseId, phaseGroup;
300 Field* fields = result->Fetch();
313 }
while (result->NextRow() && !found);
329 GameObject* target = handler->
GetSession()->
GetPlayer()->GetMap()->GetGameObject(ObjectGuid::Create<HighGuid::GameObject>(mapId,
id, guidLow));
331 handler->
PSendSysMessage(
LANG_GAMEOBJECT_DETAIL, guidLow, objectInfo->
name.c_str(), guidLow, id,
x,
y,
z, mapId, o, phaseId, phaseGroup);
336 if (curRespawnDelay < 0)
uint64 GetUInt64() const
Definition: Field.h:184
std::string secsToTimeString(uint64 timeInSecs, bool shortText, bool hoursOnly)
Definition: Util.cpp:109
float GetFloat() const
Definition: Field.h:222
QueryResult PQuery(Format &&sql, T *conn, Args &&...args)
Definition: DatabaseWorkerPool.h:165
Class used to access individual fields of database query result.
Definition: Field.h:56
Definition: GameObject.h:34
Definition: Language.h:608
Definition: Language.h:536
Definition: Language.h:539
arena_t NULL
Definition: jemalloc_internal.h:624
WorldDatabaseWorkerPool WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
time_t GetRespawnTimeEx() const
Definition: GameObject.h:936
Player * GetPlayer() const
Definition: WorldSession.h:927
uint64 LowType
Definition: ObjectGuid.h:199
#define sObjectMgr
Definition: ObjectMgr.h:1567
uint32 GetRespawnDelay() const
Definition: GameObject.h:959
#define sPoolMgr
Definition: PoolMgr.h:166
unsigned long atoul(char const *str)
Definition: Common.h:90
G3D::int16 z
Definition: Vector3int16.h:46
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
void EscapeString(std::string &str)
Apply escape string'ing for current collation. (utf8)
Definition: DatabaseWorkerPool.cpp:231
std::shared_ptr< ResultSet > QueryResult
Definition: QueryResult.h:61
G3D::int16 y
Definition: Vector2int16.h:38
uint16_t uint16
Definition: Define.h:151
#define _LIKE_
Definition: DatabaseEnv.h:32
Definition: GameObject.h:880
uint16 GetUInt16() const
Definition: Field.h:108
Definition: Language.h:298
#define sGameEventMgr
Definition: GameEventMgr.h:184
#define _CONCAT3_(A, B, C)
Definition: DatabaseEnv.h:34
std::set< uint16 > ActiveEvents
Definition: GameEventMgr.h:106
std::string name
Definition: GameObject.h:39
uint32 GetUInt32() const
Definition: Field.h:146
int32_t int32
Definition: g3dmath.h:167
WorldSession * GetSession()
Definition: Chat.h:59
void PSendSysMessage(const char *fmt, Args &&...args)
Definition: Chat.h:72
G3D::int16 x
Definition: Vector2int16.h:37
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
char * extractKeyFromLink(char *text, char const *linkType, char **something1=NULL)
Definition: Chat.cpp:641