TrinityCore
Loading...
Searching...
No Matches
cs_go.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ScriptData
19Name: go_commandscript
20%Complete: 100
21Comment: All go related commands
22Category: commandscripts
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "Chat.h"
27#include "Containers.h"
28#include "DatabaseEnv.h"
29#include "Language.h"
30#include "MapManager.h"
31#include "ObjectMgr.h"
32#include "Player.h"
33#include "RBAC.h"
34#include "TicketMgr.h"
35#include "Transport.h"
36#include "Util.h"
37#include "WorldSession.h"
38
39using namespace Trinity::ChatCommands;
40
42{
43public:
44 go_commandscript() : CommandScript("go_commandscript") { }
45
47 {
48 static ChatCommandTable goCommandTable =
49 {
51 { "creature id", HandleGoCreatureCIdCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
53 { "gameobject id", HandleGoGameObjectGOIdCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
54 { "graveyard", HandleGoGraveyardCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
55 { "grid", HandleGoGridCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
56 { "taxinode", HandleGoTaxinodeCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
57 { "areatrigger", HandleGoAreaTriggerCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
58 { "zonexy", HandleGoZoneXYCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
59 { "xyz", HandleGoXYZCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
60 { "ticket", HandleGoTicketCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
61 { "offset", HandleGoOffsetCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
62 { "instance", HandleGoInstanceCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
63 { "boss", HandleGoBossCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No }
64 };
65
66 static ChatCommandTable commandTable =
67 {
68 { "go", goCommandTable },
69 };
70 return commandTable;
71 }
72
73 static bool DoTeleport(ChatHandler* handler, Position pos, uint32 mapId = MAPID_INVALID)
74 {
75 Player* player = handler->GetSession()->GetPlayer();
76
77 if (mapId == MAPID_INVALID)
78 mapId = player->GetMapId();
79 if (!MapManager::IsValidMapCoord(mapId, pos) || sObjectMgr->IsTransportMap(mapId))
80 {
82 handler->SetSentErrorMessage(true);
83 return false;
84 }
85
86 // stop flight if need
87 if (player->IsInFlight())
88 player->FinishTaxiFlight();
89 else
90 player->SaveRecallPosition(); // save only in non-flight case
91
92 player->TeleportTo({ mapId, pos });
93 return true;
94 }
95
97 {
98 CreatureData const* spawnpoint = sObjectMgr->GetCreatureData(spawnId);
99 if (!spawnpoint)
100 {
102 handler->SetSentErrorMessage(true);
103 return false;
104 }
105
106 return DoTeleport(handler, spawnpoint->spawnPoint, spawnpoint->mapId);
107 }
108
110 {
111 CreatureData const* spawnpoint = nullptr;
112 for (auto const& pair : sObjectMgr->GetAllCreatureData())
113 {
114 if (pair.second.id != *cId)
115 continue;
116
117 if (!spawnpoint)
118 spawnpoint = &pair.second;
119 else
120 {
122 break;
123 }
124 }
125
126 if (!spawnpoint)
127 {
129 handler->SetSentErrorMessage(true);
130 return false;
131 }
132
133 return DoTeleport(handler, spawnpoint->spawnPoint, spawnpoint->mapId);
134 }
135
137 {
138 GameObjectData const* spawnpoint = sObjectMgr->GetGameObjectData(spawnId);
139 if (!spawnpoint)
140 {
142 handler->SetSentErrorMessage(true);
143 return false;
144 }
145
146 return DoTeleport(handler, spawnpoint->spawnPoint, spawnpoint->mapId);
147 }
148
150 {
151 GameObjectData const* spawnpoint = nullptr;
152 for (auto const& pair : sObjectMgr->GetAllGameObjectData())
153 {
154 if (pair.second.id != goId)
155 continue;
156
157 if (!spawnpoint)
158 spawnpoint = &pair.second;
159 else
160 {
162 break;
163 }
164 }
165
166 if (!spawnpoint)
167 {
169 handler->SetSentErrorMessage(true);
170 return false;
171 }
172
173 return DoTeleport(handler, spawnpoint->spawnPoint, spawnpoint->mapId);
174 }
175
176 static bool HandleGoGraveyardCommand(ChatHandler* handler, uint32 gyId)
177 {
178 WorldSafeLocsEntry const* gy = sWorldSafeLocsStore.LookupEntry(gyId);
179 if (!gy)
180 {
182 handler->SetSentErrorMessage(true);
183 return false;
184 }
185
186 if (!MapManager::IsValidMapCoord(gy->Continent, gy->Loc.X, gy->Loc.Y, gy->Loc.Z))
187 {
189 handler->SetSentErrorMessage(true);
190 return false;
191 }
192
193 Player* player = handler->GetSession()->GetPlayer();
194 // stop flight if need
195 if (player->IsInFlight())
196 player->FinishTaxiFlight();
197 else
198 player->SaveRecallPosition(); // save only in non-flight case
199
200 player->TeleportTo(gy->Continent, gy->Loc.X, gy->Loc.Y, gy->Loc.Z, player->GetOrientation());
201 return true;
202 }
203
204 //teleport to grid
205 static bool HandleGoGridCommand(ChatHandler* handler, float gridX, float gridY, Optional<uint32> oMapId)
206 {
207 Player* player = handler->GetSession()->GetPlayer();
208 uint32 mapId = oMapId.value_or(player->GetMapId());
209
210 // center of grid
211 float x = (gridX - CENTER_GRID_ID + 0.5f) * SIZE_OF_GRIDS;
212 float y = (gridY - CENTER_GRID_ID + 0.5f) * SIZE_OF_GRIDS;
213
214 if (!MapManager::IsValidMapCoord(mapId, x, y))
215 {
216 handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
217 handler->SetSentErrorMessage(true);
218 return false;
219 }
220
221 // stop flight if need
222 if (player->IsInFlight())
223 player->FinishTaxiFlight();
224 else
225 player->SaveRecallPosition(); // save only in non-flight case
226
227 Map const* map = sMapMgr->CreateBaseMap(mapId);
228 float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
229
230 player->TeleportTo(mapId, x, y, z, player->GetOrientation());
231 return true;
232 }
233
235 {
236 TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(nodeId);
237 if (!node)
238 {
240 handler->SetSentErrorMessage(true);
241 return false;
242 }
243 return DoTeleport(handler, { node->Pos.X, node->Pos.Y, node->Pos.Z }, node->ContinentID);
244 }
245
247 {
248 AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(areaTriggerId);
249 if (!at)
250 {
251 handler->PSendSysMessage(LANG_COMMAND_GOAREATRNOTFOUND, *areaTriggerId);
252 handler->SetSentErrorMessage(true);
253 return false;
254 }
255 return DoTeleport(handler, { at->Pos.X, at->Pos.Y, at->Pos.Z }, at->ContinentID);
256 }
257
258 //teleport at coordinates
259 static bool HandleGoZoneXYCommand(ChatHandler* handler, float x, float y, Optional<Variant<Hyperlink<area>, uint32>> areaIdArg)
260 {
261 Player* player = handler->GetSession()->GetPlayer();
262
263 uint32 areaId = areaIdArg ? *areaIdArg : player->GetZoneId();
264
265 AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(areaId);
266
267 if (x < 0 || x > 100 || y < 0 || y > 100 || !areaEntry)
268 {
269 handler->PSendSysMessage(LANG_INVALID_ZONE_COORD, x, y, areaId);
270 handler->SetSentErrorMessage(true);
271 return false;
272 }
273
274 // update to parent zone if exist (client map show only zones without parents)
275 AreaTableEntry const* zoneEntry = areaEntry->ParentAreaID ? sAreaTableStore.LookupEntry(areaEntry->ParentAreaID) : areaEntry;
276 ASSERT(zoneEntry);
277
278 Map const* map = sMapMgr->CreateBaseMap(zoneEntry->ContinentID);
279
280 if (map->Instanceable())
281 {
282 handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->AreaName[handler->GetSessionDbcLocale()], map->GetId(), map->GetMapName());
283 handler->SetSentErrorMessage(true);
284 return false;
285 }
286
287 Zone2MapCoordinates(x, y, zoneEntry->ID);
288
289 if (!MapManager::IsValidMapCoord(zoneEntry->ContinentID, x, y))
290 {
291 handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, zoneEntry->ContinentID);
292 handler->SetSentErrorMessage(true);
293 return false;
294 }
295
296 // stop flight if need
297 if (player->IsInFlight())
298 player->FinishTaxiFlight();
299 else
300 player->SaveRecallPosition(); // save only in non-flight case
301
302 float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
303
304 player->TeleportTo(zoneEntry->ContinentID, x, y, z, player->GetOrientation());
305 return true;
306 }
307
308 //teleport at coordinates, including Z and orientation
309 static bool HandleGoXYZCommand(ChatHandler* handler, float x, float y, Optional<float> z, Optional<uint32> id, Optional<float> o)
310 {
311 Player* player = handler->GetSession()->GetPlayer();
312 uint32 mapId = id.value_or(player->GetMapId());
313 if (z)
314 {
315 if (!MapManager::IsValidMapCoord(mapId, x, y, *z))
316 {
317 handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
318 handler->SetSentErrorMessage(true);
319 return false;
320 }
321 }
322 else
323 {
324 if (!MapManager::IsValidMapCoord(mapId, x, y))
325 {
326 handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
327 handler->SetSentErrorMessage(true);
328 return false;
329 }
330 Map const* map = sMapMgr->CreateBaseMap(mapId);
331 z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
332 }
333
334 return DoTeleport(handler, { x, y, *z, o.value_or(0.0f) }, mapId);
335 }
336
337 static bool HandleGoTicketCommand(ChatHandler* handler, uint32 ticketId)
338 {
339 GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
340 if (!ticket)
341 {
343 return true;
344 }
345
346 Player* player = handler->GetSession()->GetPlayer();
347
348 // stop flight if need
349 if (player->IsInFlight())
350 player->FinishTaxiFlight();
351 else
352 player->SaveRecallPosition(); // save only in non-flight case
353
354 ticket->TeleportTo(player);
355 return true;
356 }
357
359 {
360 Position loc = handler->GetSession()->GetPlayer()->GetPosition();
361 loc.RelocateOffset({ dX, dY.value_or(0.0f), dZ.value_or(0.0f), dO.value_or(0.0f) });
362
363 return DoTeleport(handler, loc);
364 }
365
366 static bool HandleGoInstanceCommand(ChatHandler* handler, std::vector<std::string_view> labels)
367 {
368 if (labels.empty())
369 return false;
370
371 // #matched labels -> (mapid, scriptname)
372 std::multimap<uint32, std::tuple<uint16, char const*, char const*>> matches;
373 for (auto const& pair : sObjectMgr->GetInstanceTemplates())
374 {
375 uint32 count = 0;
376 std::string const& scriptName = sObjectMgr->GetScriptName(pair.second.ScriptId);
377 char const* mapName = ASSERT_NOTNULL(sMapStore.LookupEntry(pair.first))->MapName[handler->GetSessionDbcLocale()];
378 for (std::string_view label : labels)
379 if (StringContainsStringI(scriptName, label))
380 ++count;
381
382 if (count)
383 matches.emplace(count, decltype(matches)::mapped_type(pair.first, mapName, scriptName.c_str()));
384 }
385 if (matches.empty())
386 {
388 handler->SetSentErrorMessage(true);
389 return false;
390 }
391
392 auto it = matches.crbegin(), end = matches.crend();
393 uint32 const maxCount = it->first;
394 if ((++it) != end && it->first == maxCount)
395 {
397 --it;
398 do
399 handler->PSendSysMessage(LANG_COMMAND_MULTIPLE_INSTANCES_ENTRY, std::get<1>(it->second), std::get<0>(it->second), std::get<2>(it->second));
400 while (((++it) != end) && (it->first == maxCount));
401 handler->SetSentErrorMessage(true);
402 return false;
403 }
404
405 it = matches.crbegin();
406 uint32 const mapId = std::get<0>(it->second);
407 char const* const mapName = std::get<1>(it->second);
408
409 Player* player = handler->GetSession()->GetPlayer();
410 if (player->IsInFlight())
411 player->FinishTaxiFlight();
412 else
413 player->SaveRecallPosition();
414
415 // try going to entrance
416 if (AreaTriggerTeleport const* exit = sObjectMgr->GetGoBackTrigger(mapId))
417 {
418 if (player->TeleportTo(exit->target_mapId, exit->target_X, exit->target_Y, exit->target_Z, exit->target_Orientation + M_PI))
419 {
420 handler->PSendSysMessage(LANG_COMMAND_WENT_TO_INSTANCE_GATE, mapName, mapId);
421 return true;
422 }
423 else
424 {
425 uint32 const parentMapId = exit->target_mapId;
426 char const* const parentMapName = ASSERT_NOTNULL(sMapStore.LookupEntry(parentMapId))->MapName[handler->GetSessionDbcLocale()];
427 handler->PSendSysMessage(LANG_COMMAND_GO_INSTANCE_GATE_FAILED, mapName, mapId, parentMapName, parentMapId);
428 }
429 }
430 else
431 handler->PSendSysMessage(LANG_COMMAND_INSTANCE_NO_EXIT, mapName, mapId);
432
433 // try going to start
434 if (AreaTriggerTeleport const* entrance = sObjectMgr->GetMapEntranceTrigger(mapId))
435 {
436 if (player->TeleportTo(entrance->target_mapId, entrance->target_X, entrance->target_Y, entrance->target_Z, entrance->target_Orientation))
437 {
439 return true;
440 }
441 else
443 }
444 else
445 handler->PSendSysMessage(LANG_COMMAND_INSTANCE_NO_ENTRANCE, mapName, mapId);
446
447 handler->SetSentErrorMessage(true);
448 return false;
449 }
450
451 static bool HandleGoBossCommand(ChatHandler* handler, std::vector<std::string_view> needles)
452 {
453 if (needles.empty())
454 return false;
455
456 std::multimap<uint32, CreatureTemplate const*> matches;
457 std::unordered_map<uint32, std::vector<CreatureData const*>> spawnLookup;
458
459 // find all boss flagged mobs that match our needles
460 for (auto const& pair : sObjectMgr->GetCreatureTemplates())
461 {
462 CreatureTemplate const& data = pair.second;
464 continue;
465
466 uint32 count = 0;
467 std::string const& scriptName = sObjectMgr->GetScriptName(data.ScriptID);
468 for (std::string_view label : needles)
469 if (StringContainsStringI(scriptName, label) || StringContainsStringI(data.Name, label))
470 ++count;
471
472 if (count)
473 {
474 matches.emplace(count, &data);
475 (void)spawnLookup[data.Entry]; // inserts default-constructed vector
476 }
477 }
478
479 if (!matches.empty())
480 {
481 // find the spawn points of any matches
482 for (auto const& pair : sObjectMgr->GetAllCreatureData())
483 {
484 CreatureData const& data = pair.second;
485 auto it = spawnLookup.find(data.id);
486 if (it != spawnLookup.end())
487 it->second.push_back(&data);
488 }
489
490 // remove any matches without spawns
491 Trinity::Containers::EraseIf(matches, [&spawnLookup](decltype(matches)::value_type const& pair) { return spawnLookup[pair.second->Entry].empty(); });
492 }
493
494 // check if we even have any matches left
495 if (matches.empty())
496 {
498 handler->SetSentErrorMessage(true);
499 return false;
500 }
501
502 // see if we have multiple equal matches left
503 auto it = matches.crbegin(), end = matches.crend();
504 uint32 const maxCount = it->first;
505 if ((++it) != end && it->first == maxCount)
506 {
508 --it;
509 do
510 handler->PSendSysMessage(LANG_COMMAND_MULTIPLE_BOSSES_ENTRY, it->second->Entry, it->second->Name.c_str(), sObjectMgr->GetScriptName(it->second->ScriptID).c_str());
511 while (((++it) != end) && (it->first == maxCount));
512 handler->SetSentErrorMessage(true);
513 return false;
514 }
515
516 CreatureTemplate const* const boss = matches.crbegin()->second;
517 std::vector<CreatureData const*> const& spawns = spawnLookup[boss->Entry];
518 ASSERT(!spawns.empty());
519
520 if (spawns.size() > 1)
521 {
522 handler->PSendSysMessage(LANG_COMMAND_BOSS_MULTIPLE_SPAWNS, boss->Name.c_str(), boss->Entry);
523 for (CreatureData const* spawn : spawns)
524 {
525 uint32 const mapId = spawn->mapId;
526 MapEntry const* const map = ASSERT_NOTNULL(sMapStore.LookupEntry(mapId));
527 handler->PSendSysMessage(LANG_COMMAND_BOSS_MULTIPLE_SPAWN_ETY, spawn->spawnId, mapId, map->MapName[handler->GetSessionDbcLocale()], spawn->spawnPoint.ToString().c_str());
528 }
529 handler->SetSentErrorMessage(true);
530 return false;
531 }
532
533 Player* player = handler->GetSession()->GetPlayer();
534 if (player->IsInFlight())
535 player->FinishTaxiFlight();
536 else
537 player->SaveRecallPosition();
538
539 CreatureData const* const spawn = spawns.front();
540 uint32 const mapId = spawn->mapId;
541 if (!player->TeleportTo({ mapId, spawn->spawnPoint }))
542 {
543 char const* const mapName = ASSERT_NOTNULL(sMapStore.LookupEntry(mapId))->MapName[handler->GetSessionDbcLocale()];
544 handler->PSendSysMessage(LANG_COMMAND_GO_BOSS_FAILED, spawn->spawnId, boss->Name.c_str(), boss->Entry, mapName);
545 handler->SetSentErrorMessage(true);
546 return false;
547 }
548
549 handler->PSendSysMessage(LANG_COMMAND_WENT_TO_BOSS, boss->Name.c_str(), boss->Entry, spawn->spawnId);
550 return true;
551 }
552};
553
555{
556 new go_commandscript();
557}
#define M_PI
Definition Common.h:72
@ CREATURE_FLAG_EXTRA_DUNGEON_BOSS
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsEntryfmt)
void Zone2MapCoordinates(float &x, float &y, uint32 zone)
DBCStorage< AreaTriggerEntry > sAreaTriggerStore(AreaTriggerEntryfmt)
DBCStorage< TaxiNodesEntry > sTaxiNodesStore(TaxiNodesEntryfmt)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTableEntryfmt)
uint32_t uint32
Definition Define.h:133
#define ASSERT_NOTNULL(pointer)
Definition Errors.h:84
#define ASSERT
Definition Errors.h:68
#define SIZE_OF_GRIDS
Definition GridDefines.h:38
#define CENTER_GRID_ID
Definition GridDefines.h:39
@ LANG_COMMAND_INSTANCE_NO_ENTRANCE
Definition Language.h:969
@ LANG_COMMAND_GO_INSTANCE_START_FAILED
Definition Language.h:974
@ LANG_COMMAND_NO_BOSSES_MATCH
Definition Language.h:984
@ LANG_COMMAND_GO_BOSS_FAILED
Definition Language.h:989
@ LANG_COMMAND_GOCREATNOTFOUND
Definition Language.h:319
@ LANG_COMMAND_BOSS_MULTIPLE_SPAWNS
Definition Language.h:987
@ LANG_COMMAND_GRAVEYARDNOEXIST
Definition Language.h:512
@ LANG_COMMAND_NO_INSTANCES_MATCH
Definition Language.h:965
@ LANG_COMMAND_GOAREATRNOTFOUND
Definition Language.h:313
@ LANG_COMMAND_WENT_TO_INSTANCE_GATE
Definition Language.h:971
@ LANG_COMMAND_MULTIPLE_INSTANCES_ENTRY
Definition Language.h:967
@ LANG_COMMAND_GOTAXINODENOTFOUND
Definition Language.h:402
@ LANG_COMMAND_MULTIPLE_INSTANCES_MATCH
Definition Language.h:966
@ LANG_INVALID_ZONE_MAP
Definition Language.h:316
@ LANG_COMMAND_GOOBJNOTFOUND
Definition Language.h:318
@ LANG_COMMAND_WENT_TO_INSTANCE_START
Definition Language.h:972
@ LANG_INVALID_TARGET_COORD
Definition Language.h:314
@ LANG_COMMAND_INSTANCE_NO_EXIT
Definition Language.h:970
@ LANG_COMMAND_MULTIPLE_BOSSES_MATCH
Definition Language.h:985
@ LANG_COMMAND_GOCREATMULTIPLE
Definition Language.h:320
@ LANG_COMMAND_BOSS_MULTIPLE_SPAWN_ETY
Definition Language.h:988
@ LANG_COMMAND_TICKETNOTEXIST
Definition Language.h:1030
@ LANG_COMMAND_WENT_TO_BOSS
Definition Language.h:990
@ LANG_INVALID_ZONE_COORD
Definition Language.h:315
@ LANG_COMMAND_GO_INSTANCE_GATE_FAILED
Definition Language.h:973
@ LANG_COMMAND_MULTIPLE_BOSSES_ENTRY
Definition Language.h:986
#define sMapMgr
Definition MapManager.h:211
#define MAX_HEIGHT
Definition Map.h:240
#define sObjectMgr
Definition ObjectMgr.h:1721
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
#define MAPID_INVALID
Definition Position.h:165
Role Based Access Control related classes definition.
#define sTicketMgr
Definition TicketMgr.h:248
bool StringContainsStringI(std::string_view haystack, std::string_view needle)
Definition Util.cpp:711
WorldSession * GetSession()
Definition Chat.h:46
virtual LocaleConstant GetSessionDbcLocale() const
Definition Chat.cpp:692
void SetSentErrorMessage(bool val)
Definition Chat.h:134
void PSendSysMessage(char const *fmt, Args &&... args)
Definition Chat.h:69
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition Chat.cpp:101
void TeleportTo(Player *player) const
static bool IsValidMapCoord(uint32 mapid, float x, float y)
Definition MapManager.h:90
Definition Map.h:281
float GetWaterLevel(float x, float y) const
Definition Map.cpp:2862
float GetHeight(float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
Definition Map.cpp:2484
bool Instanceable() const
Definition Map.cpp:4226
uint32 GetId() const
Definition Map.cpp:4216
char const * GetMapName() const
Definition Map.cpp:2924
uint32 LowType
Definition ObjectGuid.h:142
void SaveRecallPosition()
Definition Player.h:2078
void FinishTaxiFlight()
Definition Player.cpp:21202
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0)
Definition Player.cpp:1524
bool IsInFlight() const
Definition Unit.h:1119
uint32 GetMapId() const
Definition Position.h:193
uint32 GetZoneId() const
Definition Object.h:373
Player * GetPlayer() const
static bool HandleGoAreaTriggerCommand(ChatHandler *handler, Variant< Hyperlink< areatrigger >, uint32 > areaTriggerId)
Definition cs_go.cpp:246
static bool HandleGoGameObjectGOIdCommand(ChatHandler *handler, uint32 goId)
Definition cs_go.cpp:149
static bool HandleGoGraveyardCommand(ChatHandler *handler, uint32 gyId)
Definition cs_go.cpp:176
static bool HandleGoInstanceCommand(ChatHandler *handler, std::vector< std::string_view > labels)
Definition cs_go.cpp:366
ChatCommandTable GetCommands() const override
Definition cs_go.cpp:46
static bool HandleGoOffsetCommand(ChatHandler *handler, float dX, Optional< float > dY, Optional< float > dZ, Optional< float > dO)
Definition cs_go.cpp:358
static bool HandleGoTaxinodeCommand(ChatHandler *handler, Variant< Hyperlink< taxinode >, uint32 > nodeId)
Definition cs_go.cpp:234
static bool DoTeleport(ChatHandler *handler, Position pos, uint32 mapId=MAPID_INVALID)
Definition cs_go.cpp:73
static bool HandleGoBossCommand(ChatHandler *handler, std::vector< std::string_view > needles)
Definition cs_go.cpp:451
static bool HandleGoGridCommand(ChatHandler *handler, float gridX, float gridY, Optional< uint32 > oMapId)
Definition cs_go.cpp:205
static bool HandleGoTicketCommand(ChatHandler *handler, uint32 ticketId)
Definition cs_go.cpp:337
static bool HandleGoCreatureSpawnIdCommand(ChatHandler *handler, Variant< Hyperlink< creature >, ObjectGuid::LowType > spawnId)
Definition cs_go.cpp:96
static bool HandleGoZoneXYCommand(ChatHandler *handler, float x, float y, Optional< Variant< Hyperlink< area >, uint32 > > areaIdArg)
Definition cs_go.cpp:259
static bool HandleGoGameObjectSpawnIdCommand(ChatHandler *handler, uint32 spawnId)
Definition cs_go.cpp:136
static bool HandleGoXYZCommand(ChatHandler *handler, float x, float y, Optional< float > z, Optional< uint32 > id, Optional< float > o)
Definition cs_go.cpp:309
static bool HandleGoCreatureCIdCommand(ChatHandler *handler, Variant< Hyperlink< creature_entry >, uint32 > cId)
Definition cs_go.cpp:109
void AddSC_go_commandscript()
Definition cs_go.cpp:554
std::vector< ChatCommandBuilder > ChatCommandTable
Definition ChatCommand.h:50
void EraseIf(Container &c, Predicate p)
Definition Containers.h:231
@ RBAC_PERM_COMMAND_GO
Definition RBAC.h:251
char const * AreaName[16]
DBCPosition3D Pos
std::string Name
char const * MapName[16]
float GetOrientation() const
Definition Position.h:82
float GetPositionX() const
Definition Position.h:79
void GetPosition(float &x, float &y) const
Definition Position.h:84
float GetPositionY() const
Definition Position.h:80
void RelocateOffset(Position const &offset)
Definition Position.cpp:36
uint32 id
Definition SpawnData.h:96
Position spawnPoint
Definition SpawnData.h:97
uint32 spawnId
Definition SpawnData.h:85
uint32 mapId
Definition SpawnData.h:86
DBCPosition3D Pos
DBCPosition3D Loc