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 "ChatCommand.h"
28#include "Containers.h"
29#include "DB2Stores.h"
30#include "Language.h"
31#include "MapManager.h"
32#include "ObjectMgr.h"
33#include "PhasingHandler.h"
34#include "Player.h"
35#include "RBAC.h"
36#include "SupportMgr.h"
37#include "TerrainMgr.h"
38#include "Transport.h"
39#include "Util.h"
40#include "WorldSession.h"
41
42using namespace Trinity::ChatCommands;
43
45{
46public:
47 go_commandscript() : CommandScript("go_commandscript") { }
48
49 std::span<ChatCommandBuilder const> GetCommands() const override
50 {
51 static ChatCommandTable goCommandTable =
52 {
54 { "creature id", HandleGoCreatureCIdCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
56 { "gameobject id", HandleGoGameObjectGOIdCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
57 { "graveyard", HandleGoGraveyardCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
58 { "grid", HandleGoGridCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
59 { "quest", HandleGoQuestCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
60 { "taxinode", HandleGoTaxinodeCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
61 { "areatrigger", HandleGoAreaTriggerCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
62 { "zonexy", HandleGoZoneXYCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
63 { "xyz", HandleGoXYZCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
64 { "bugticket", HandleGoTicketCommand<BugTicket>, rbac::RBAC_PERM_COMMAND_GO, Console::No },
65 { "complaintticket", HandleGoTicketCommand<ComplaintTicket>, rbac::RBAC_PERM_COMMAND_GO, Console::No },
66 { "suggestionticket", HandleGoTicketCommand<SuggestionTicket>,rbac::RBAC_PERM_COMMAND_GO, Console::No },
67 { "offset", HandleGoOffsetCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
68 { "instance", HandleGoInstanceCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
69 { "boss", HandleGoBossCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No }
70 };
71
72 static ChatCommandTable commandTable =
73 {
74 { "go", goCommandTable },
75 };
76 return commandTable;
77 }
78
79 static bool DoTeleport(ChatHandler* handler, Position pos, uint32 mapId = MAPID_INVALID)
80 {
81 Player* player = handler->GetSession()->GetPlayer();
82
83 if (mapId == MAPID_INVALID)
84 mapId = player->GetMapId();
85 if (!MapManager::IsValidMapCoord(mapId, pos) || sObjectMgr->IsTransportMap(mapId))
86 {
88 handler->SetSentErrorMessage(true);
89 return false;
90 }
91
92 // stop flight if need
93 if (player->IsInFlight())
94 player->FinishTaxiFlight();
95 else
96 player->SaveRecallPosition(); // save only in non-flight case
97
98 player->TeleportTo({ mapId, pos });
99 return true;
100 }
101
103 {
104 CreatureData const* spawnpoint = sObjectMgr->GetCreatureData(spawnId);
105 if (!spawnpoint)
106 {
108 handler->SetSentErrorMessage(true);
109 return false;
110 }
111
112 return DoTeleport(handler, spawnpoint->spawnPoint, spawnpoint->mapId);
113 }
114
116 {
117 CreatureData const* spawnpoint = nullptr;
118 for (auto const& pair : sObjectMgr->GetAllCreatureData())
119 {
120 if (pair.second.id != *cId)
121 continue;
122
123 if (!spawnpoint)
124 spawnpoint = &pair.second;
125 else
126 {
128 break;
129 }
130 }
131
132 if (!spawnpoint)
133 {
135 handler->SetSentErrorMessage(true);
136 return false;
137 }
138
139 return DoTeleport(handler, spawnpoint->spawnPoint, spawnpoint->mapId);
140 }
141
143 {
144 GameObjectData const* spawnpoint = sObjectMgr->GetGameObjectData(spawnId);
145 if (!spawnpoint)
146 {
148 handler->SetSentErrorMessage(true);
149 return false;
150 }
151
152 return DoTeleport(handler, spawnpoint->spawnPoint, spawnpoint->mapId);
153 }
154
156 {
157 GameObjectData const* spawnpoint = nullptr;
158 for (auto const& pair : sObjectMgr->GetAllGameObjectData())
159 {
160 if (pair.second.id != *goId)
161 continue;
162
163 if (!spawnpoint)
164 spawnpoint = &pair.second;
165 else
166 {
168 break;
169 }
170 }
171
172 if (!spawnpoint)
173 {
175 handler->SetSentErrorMessage(true);
176 return false;
177 }
178
179 return DoTeleport(handler, spawnpoint->spawnPoint, spawnpoint->mapId);
180 }
181
182 static bool HandleGoGraveyardCommand(ChatHandler* handler, uint32 gyId)
183 {
184 WorldSafeLocsEntry const* gy = sObjectMgr->GetWorldSafeLoc(gyId);
185 if (!gy)
186 {
188 handler->SetSentErrorMessage(true);
189 return false;
190 }
191
193 {
195 handler->SetSentErrorMessage(true);
196 return false;
197 }
198
199 Player* player = handler->GetSession()->GetPlayer();
200 // stop flight if need
201 if (player->IsInFlight())
202 player->FinishTaxiFlight();
203 else
204 player->SaveRecallPosition(); // save only in non-flight case
205
206 player->TeleportTo(gy->Loc);
207 return true;
208 }
209
210 //teleport to grid
211 static bool HandleGoGridCommand(ChatHandler* handler, float gridX, float gridY, Optional<uint32> oMapId)
212 {
213 Player* player = handler->GetSession()->GetPlayer();
214 uint32 mapId = oMapId.value_or(player->GetMapId());
215
216 // center of grid
217 float x = (gridX - CENTER_GRID_ID + 0.5f) * SIZE_OF_GRIDS;
218 float y = (gridY - CENTER_GRID_ID + 0.5f) * SIZE_OF_GRIDS;
219
220 if (!MapManager::IsValidMapCoord(mapId, x, y))
221 {
222 handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
223 handler->SetSentErrorMessage(true);
224 return false;
225 }
226
227 // stop flight if need
228 if (player->IsInFlight())
229 player->FinishTaxiFlight();
230 else
231 player->SaveRecallPosition(); // save only in non-flight case
232
233 std::shared_ptr<TerrainInfo> terrain = sTerrainMgr.LoadTerrain(mapId);
234 float z = std::max(terrain->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), mapId, x, y, MAX_HEIGHT), terrain->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), mapId, x, y));
235
236 player->TeleportTo(mapId, x, y, z, player->GetOrientation());
237 return true;
238 }
239
241 {
242 Player* player = handler->GetSession()->GetPlayer();
243
244 uint32 questID;
245 if (questData.holds_alternative<uint32>())
246 {
247 questID = questData.get<uint32>();
248
249 if (!sObjectMgr->GetQuestTemplate(questID))
250 {
252 handler->SetSentErrorMessage(true);
253 return false;
254 }
255 }
256 else
257 questID = questData.get<Hyperlink<quest>>()->Quest->GetQuestId();
258
259 float x, y, z;
260 uint32 mapId;
261
262 if (QuestPOIData const* poiData = sObjectMgr->GetQuestPOIData(questID))
263 {
264 QuestPOIBlobData const& data = poiData->Blobs.front();
265
266 mapId = data.MapID;
267
268 x = data.Points.front().X;
269 y = data.Points.front().Y;
270 z = data.Points.front().Z;
271 }
272 else
273 {
275 handler->SetSentErrorMessage(true);
276 return false;
277 }
278
279 if (!MapManager::IsValidMapCoord(mapId, x, y) || sObjectMgr->IsTransportMap(mapId))
280 {
281 handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
282 handler->SetSentErrorMessage(true);
283 return false;
284 }
285
286 // stop flight if need
287 if (player->IsInFlight())
288 player->FinishTaxiFlight();
289 else
290 player->SaveRecallPosition(); // save only in non-flight case
291
292 std::shared_ptr<TerrainInfo> terrain = sTerrainMgr.LoadTerrain(mapId);
293 z = std::max(terrain->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), mapId, x, y, MAX_HEIGHT), terrain->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), mapId, x, y));
294
295 player->TeleportTo(mapId, x, y, z, 0.0f);
296 return true;
297 }
298
300 {
301 TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(nodeId);
302 if (!node)
303 {
305 handler->SetSentErrorMessage(true);
306 return false;
307 }
308 return DoTeleport(handler, { node->Pos.X, node->Pos.Y, node->Pos.Z }, node->ContinentID);
309 }
310
312 {
313 AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(areaTriggerId);
314 if (!at)
315 {
316 handler->PSendSysMessage(LANG_COMMAND_GOAREATRNOTFOUND, *areaTriggerId);
317 handler->SetSentErrorMessage(true);
318 return false;
319 }
320 return DoTeleport(handler, { at->Pos.X, at->Pos.Y, at->Pos.Z }, at->ContinentID);
321 }
322
323 //teleport at coordinates
324 static bool HandleGoZoneXYCommand(ChatHandler* handler, float x, float y, Optional<Variant<Hyperlink<area>, uint32>> areaIdArg)
325 {
326 Player* player = handler->GetSession()->GetPlayer();
327
328 uint32 areaId = areaIdArg ? *areaIdArg : player->GetZoneId();
329
330 AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(areaId);
331
332 if (x < 0 || x > 100 || y < 0 || y > 100 || !areaEntry)
333 {
334 handler->PSendSysMessage(LANG_INVALID_ZONE_COORD, x, y, areaId);
335 handler->SetSentErrorMessage(true);
336 return false;
337 }
338
339 // update to parent zone if exist (client map show only zones without parents)
340 AreaTableEntry const* zoneEntry = areaEntry->ParentAreaID && areaEntry->GetFlags().HasFlag(AreaFlags::IsSubzone)
341 ? sAreaTableStore.LookupEntry(areaEntry->ParentAreaID)
342 : areaEntry;
343 ASSERT(zoneEntry);
344
345 x /= 100.0f;
346 y /= 100.0f;
347
348 std::shared_ptr<TerrainInfo> terrain = sTerrainMgr.LoadTerrain(zoneEntry->ContinentID);
349 if (!sDB2Manager.Zone2MapCoordinates(zoneEntry->ID, x, y))
350 {
351 handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaId, areaEntry->AreaName[handler->GetSessionDbcLocale()], terrain->GetId(), terrain->GetMapName());
352 handler->SetSentErrorMessage(true);
353 return false;
354 }
355
356 if (!MapManager::IsValidMapCoord(zoneEntry->ContinentID, x, y))
357 {
358 handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, uint32(zoneEntry->ContinentID));
359 handler->SetSentErrorMessage(true);
360 return false;
361 }
362
363 // stop flight if need
364 if (player->IsInFlight())
365 player->FinishTaxiFlight();
366 else
367 player->SaveRecallPosition(); // save only in non-flight case
368
369 float z = std::max(terrain->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), zoneEntry->ContinentID, x, y, MAX_HEIGHT), terrain->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), zoneEntry->ContinentID, x, y));
370
371 player->TeleportTo(zoneEntry->ContinentID, x, y, z, player->GetOrientation());
372 return true;
373 }
374
375 //teleport at coordinates, including Z and orientation
376 static bool HandleGoXYZCommand(ChatHandler* handler, float x, float y, Optional<float> z, Optional<uint32> id, Optional<float> o)
377 {
378 Player* player = handler->GetSession()->GetPlayer();
379 uint32 mapId = id.value_or(player->GetMapId());
380 if (z)
381 {
382 if (!MapManager::IsValidMapCoord(mapId, x, y, *z))
383 {
384 handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
385 handler->SetSentErrorMessage(true);
386 return false;
387 }
388 }
389 else
390 {
391 if (!MapManager::IsValidMapCoord(mapId, x, y))
392 {
393 handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
394 handler->SetSentErrorMessage(true);
395 return false;
396 }
397 std::shared_ptr<TerrainInfo> terrain = sTerrainMgr.LoadTerrain(mapId);
398 z = std::max(terrain->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), mapId, x, y, MAX_HEIGHT), terrain->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), mapId, x, y));
399 }
400
401 return DoTeleport(handler, { x, y, *z, o.value_or(0.0f) }, mapId);
402 }
403
404 template<typename T>
405 static bool HandleGoTicketCommand(ChatHandler* handler, uint32 ticketId)
406 {
407 T* ticket = sSupportMgr->GetTicket<T>(ticketId);
408 if (!ticket)
409 {
411 return true;
412 }
413
414 Player* player = handler->GetSession()->GetPlayer();
415
416 // stop flight if need
417 if (player->IsInFlight())
418 player->FinishTaxiFlight();
419 else
420 player->SaveRecallPosition(); // save only in non-flight case
421
422 ticket->TeleportTo(player);
423 return true;
424 }
425
427 {
428 Position loc = handler->GetSession()->GetPlayer()->GetPosition();
429 loc.RelocateOffset({ dX, dY.value_or(0.0f), dZ.value_or(0.0f), dO.value_or(0.0f) });
430
431 return DoTeleport(handler, loc);
432 }
433
434 static bool HandleGoInstanceCommand(ChatHandler* handler, std::vector<std::string_view> labels)
435 {
436 if (labels.empty())
437 return false;
438
439 // #matched labels -> (mapid, scriptname)
440 std::multimap<uint32, std::tuple<uint16, char const*, char const*>> matches;
441 for (auto const& pair : sObjectMgr->GetInstanceTemplates())
442 {
443 uint32 count = 0;
444 std::string const& scriptName = sObjectMgr->GetScriptName(pair.second.ScriptId);
445 char const* mapName = ASSERT_NOTNULL(sMapStore.LookupEntry(pair.first))->MapName[handler->GetSessionDbcLocale()];
446 for (std::string_view label : labels)
447 if (StringContainsStringI(scriptName, label))
448 ++count;
449
450 if (count)
451 matches.emplace(count, decltype(matches)::mapped_type(pair.first, mapName, scriptName.c_str()));
452 }
453 if (matches.empty())
454 {
456 handler->SetSentErrorMessage(true);
457 return false;
458 }
459
460 auto it = matches.crbegin(), end = matches.crend();
461 uint32 const maxCount = it->first;
462 if ((++it) != end && it->first == maxCount)
463 {
465 --it;
466 do
467 handler->PSendSysMessage(LANG_COMMAND_MULTIPLE_INSTANCES_ENTRY, std::get<1>(it->second), std::get<0>(it->second), std::get<2>(it->second));
468 while (((++it) != end) && (it->first == maxCount));
469 handler->SetSentErrorMessage(true);
470 return false;
471 }
472
473 it = matches.crbegin();
474 uint32 const mapId = std::get<0>(it->second);
475 char const* const mapName = std::get<1>(it->second);
476
477 Player* player = handler->GetSession()->GetPlayer();
478 if (player->IsInFlight())
479 player->FinishTaxiFlight();
480 else
481 player->SaveRecallPosition();
482
483 // try going to entrance
484 if (AreaTriggerTeleport const* exit = sObjectMgr->GetGoBackTrigger(mapId))
485 {
486 if (player->TeleportTo(exit->Loc.GetMapId(), exit->Loc.GetPositionX(), exit->Loc.GetPositionY(), exit->Loc.GetPositionZ(), exit->Loc.GetOrientation() + M_PI))
487 {
488 handler->PSendSysMessage(LANG_COMMAND_WENT_TO_INSTANCE_GATE, mapName, mapId);
489 return true;
490 }
491 else
492 {
493 uint32 const parentMapId = exit->Loc.GetMapId();
494 char const* const parentMapName = ASSERT_NOTNULL(sMapStore.LookupEntry(parentMapId))->MapName[handler->GetSessionDbcLocale()];
495 handler->PSendSysMessage(LANG_COMMAND_GO_INSTANCE_GATE_FAILED, mapName, mapId, parentMapName, parentMapId);
496 }
497 }
498 else
499 handler->PSendSysMessage(LANG_COMMAND_INSTANCE_NO_EXIT, mapName, mapId);
500
501 // try going to start
502 if (AreaTriggerTeleport const* entrance = sObjectMgr->GetMapEntranceTrigger(mapId))
503 {
504 if (player->TeleportTo(entrance->Loc))
505 {
507 return true;
508 }
509 else
511 }
512 else
513 handler->PSendSysMessage(LANG_COMMAND_INSTANCE_NO_ENTRANCE, mapName, mapId);
514
515 handler->SetSentErrorMessage(true);
516 return false;
517 }
518
519 static bool HandleGoBossCommand(ChatHandler* handler, std::vector<std::string_view> needles)
520 {
521 if (needles.empty())
522 return false;
523
524 std::multimap<uint32, CreatureTemplate const*, std::greater<uint32>> matches;
525 std::unordered_map<uint32, std::vector<CreatureData const*>> spawnLookup;
526
527 // find all boss flagged mobs that match our needles
528 for (auto const& pair : sObjectMgr->GetCreatureTemplates())
529 {
530 CreatureTemplate const& data = pair.second;
531 uint32 count = 0;
532 std::string const& scriptName = sObjectMgr->GetScriptName(data.ScriptID);
533 for (std::string_view label : needles)
534 if (StringContainsStringI(scriptName, label) || StringContainsStringI(data.Name, label))
535 ++count;
536
537 if (count)
538 {
539 matches.emplace(count, &data);
540 spawnLookup.try_emplace(data.Entry); // inserts default-constructed vector
541 }
542 }
543
544 if (!matches.empty())
545 {
546 // find the spawn points of any matches
547 for (auto const& pair : sObjectMgr->GetAllCreatureData())
548 {
549 CreatureData const& data = pair.second;
550 auto it = spawnLookup.find(data.id);
551 if (it != spawnLookup.end())
552 it->second.push_back(&data);
553 }
554
555 // remove any matches without spawns
556 Trinity::Containers::EraseIf(matches, [&spawnLookup](decltype(matches)::value_type const& pair) { return spawnLookup[pair.second->Entry].empty(); });
557 }
558
559 // check if we even have any matches left
560 if (matches.empty())
561 {
563 handler->SetSentErrorMessage(true);
564 return false;
565 }
566
567 // see if we have multiple equal matches left
568 auto it = matches.cbegin(), end = matches.cend();
569 uint32 const maxCount = it->first;
570 if ((++it) != end && it->first == maxCount)
571 {
573 --it;
574 do
575 handler->PSendSysMessage(LANG_COMMAND_MULTIPLE_BOSSES_ENTRY, it->second->Entry, it->second->Name.c_str(), sObjectMgr->GetScriptName(it->second->ScriptID).c_str());
576 while (((++it) != end) && (it->first == maxCount));
577 handler->SetSentErrorMessage(true);
578 return false;
579 }
580
581 CreatureTemplate const* const boss = matches.cbegin()->second;
582 std::vector<CreatureData const*> const& spawns = spawnLookup[boss->Entry];
583 ASSERT(!spawns.empty());
584
585 if (spawns.size() > 1)
586 {
587 handler->PSendSysMessage(LANG_COMMAND_BOSS_MULTIPLE_SPAWNS, boss->Name.c_str(), boss->Entry);
588 for (CreatureData const* spawn : spawns)
589 {
590 uint32 const mapId = spawn->mapId;
591 MapEntry const* const map = ASSERT_NOTNULL(sMapStore.LookupEntry(mapId));
592 handler->PSendSysMessage(LANG_COMMAND_BOSS_MULTIPLE_SPAWN_ETY, spawn->spawnId, mapId, map->MapName[handler->GetSessionDbcLocale()], spawn->spawnPoint.ToString().c_str());
593 }
594 handler->SetSentErrorMessage(true);
595 return false;
596 }
597
598 Player* player = handler->GetSession()->GetPlayer();
599 if (player->IsInFlight())
600 player->FinishTaxiFlight();
601 else
602 player->SaveRecallPosition();
603
604 CreatureData const* const spawn = spawns.front();
605 uint32 const mapId = spawn->mapId;
606 if (!player->TeleportTo({ mapId, spawn->spawnPoint }))
607 {
608 char const* const mapName = ASSERT_NOTNULL(sMapStore.LookupEntry(mapId))->MapName[handler->GetSessionDbcLocale()];
609 handler->PSendSysMessage(LANG_COMMAND_GO_BOSS_FAILED, spawn->spawnId, boss->Name.c_str(), boss->Entry, mapName);
610 handler->SetSentErrorMessage(true);
611 return false;
612 }
613
614 handler->PSendSysMessage(LANG_COMMAND_WENT_TO_BOSS, boss->Name.c_str(), boss->Entry, spawn->spawnId);
615 return true;
616 }
617};
618
620{
621 new go_commandscript();
622}
#define M_PI
Definition Common.h:118
DB2Storage< MapEntry > sMapStore("Map.db2", &MapLoadInfo::Instance)
DB2Storage< TaxiNodesEntry > sTaxiNodesStore("TaxiNodes.db2", &TaxiNodesLoadInfo::Instance)
DB2Storage< AreaTriggerEntry > sAreaTriggerStore("AreaTrigger.db2", &AreaTriggerLoadInfo::Instance)
DB2Storage< AreaTableEntry > sAreaTableStore("AreaTable.db2", &AreaTableLoadInfo::Instance)
#define sDB2Manager
Definition DB2Stores.h:569
uint32_t uint32
Definition Define.h:154
#define ASSERT_NOTNULL(pointer)
Definition Errors.h:82
#define ASSERT
Definition Errors.h:80
#define SIZE_OF_GRIDS
Definition GridDefines.h:40
#define MAX_HEIGHT
Definition GridDefines.h:60
#define CENTER_GRID_ID
Definition GridDefines.h:41
@ 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:1036
@ LANG_COMMAND_WENT_TO_BOSS
Definition Language.h:990
@ LANG_INVALID_ZONE_COORD
Definition Language.h:315
@ LANG_COMMAND_QUEST_NOTFOUND
Definition Language.h:535
@ LANG_COMMAND_GO_INSTANCE_GATE_FAILED
Definition Language.h:973
@ LANG_COMMAND_MULTIPLE_BOSSES_ENTRY
Definition Language.h:986
#define sObjectMgr
Definition ObjectMgr.h:1885
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
#define MAPID_INVALID
Definition Position.h:189
Role Based Access Control related classes definition.
#define sSupportMgr
Definition SupportMgr.h:327
#define sTerrainMgr
Definition TerrainMgr.h:167
bool StringContainsStringI(std::string_view haystack, std::string_view needle)
Definition Util.cpp:854
WorldSession * GetSession()
Definition Chat.h:42
virtual LocaleConstant GetSessionDbcLocale() const
Definition Chat.cpp:593
void SetSentErrorMessage(bool val)
Definition Chat.h:127
void PSendSysMessage(char const *fmt, Args &&... args)
Definition Chat.h:62
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition Chat.cpp:111
static bool IsValidMapCoord(uint32 mapid, float x, float y)
Definition MapManager.h:83
uint64 LowType
Definition ObjectGuid.h:321
static PhaseShift const & GetEmptyPhaseShift()
void SaveRecallPosition()
Definition Player.h:2681
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, TeleportToOptions options=TELE_TO_NONE, Optional< uint32 > instanceId={}, uint32 teleportSpellId=0)
Definition Player.cpp:1226
void FinishTaxiFlight()
Definition Player.cpp:23356
uint32 GetQuestId() const
Definition QuestDef.h:637
bool IsInFlight() const
Definition Unit.h:1027
constexpr uint32 GetMapId() const
Definition Position.h:216
uint32 GetZoneId() const
Definition Object.h:332
Player * GetPlayer() const
static bool HandleGoAreaTriggerCommand(ChatHandler *handler, Variant< Hyperlink< areatrigger >, uint32 > areaTriggerId)
Definition cs_go.cpp:311
static bool HandleGoGameObjectSpawnIdCommand(ChatHandler *handler, Variant< Hyperlink< gameobject >, ObjectGuid::LowType > spawnId)
Definition cs_go.cpp:142
static bool HandleGoGraveyardCommand(ChatHandler *handler, uint32 gyId)
Definition cs_go.cpp:182
static bool HandleGoInstanceCommand(ChatHandler *handler, std::vector< std::string_view > labels)
Definition cs_go.cpp:434
static bool HandleGoGameObjectGOIdCommand(ChatHandler *handler, Variant< Hyperlink< gameobject_entry >, uint32 > goId)
Definition cs_go.cpp:155
static bool HandleGoOffsetCommand(ChatHandler *handler, float dX, Optional< float > dY, Optional< float > dZ, Optional< float > dO)
Definition cs_go.cpp:426
static bool HandleGoTaxinodeCommand(ChatHandler *handler, Variant< Hyperlink< taxinode >, uint32 > nodeId)
Definition cs_go.cpp:299
static bool DoTeleport(ChatHandler *handler, Position pos, uint32 mapId=MAPID_INVALID)
Definition cs_go.cpp:79
static bool HandleGoQuestCommand(ChatHandler *handler, Variant< Hyperlink< quest >, uint32 > questData)
Definition cs_go.cpp:240
static bool HandleGoBossCommand(ChatHandler *handler, std::vector< std::string_view > needles)
Definition cs_go.cpp:519
static bool HandleGoGridCommand(ChatHandler *handler, float gridX, float gridY, Optional< uint32 > oMapId)
Definition cs_go.cpp:211
static bool HandleGoTicketCommand(ChatHandler *handler, uint32 ticketId)
Definition cs_go.cpp:405
std::span< ChatCommandBuilder const > GetCommands() const override
Definition cs_go.cpp:49
static bool HandleGoCreatureSpawnIdCommand(ChatHandler *handler, Variant< Hyperlink< creature >, ObjectGuid::LowType > spawnId)
Definition cs_go.cpp:102
static bool HandleGoZoneXYCommand(ChatHandler *handler, float x, float y, Optional< Variant< Hyperlink< area >, uint32 > > areaIdArg)
Definition cs_go.cpp:324
static bool HandleGoXYZCommand(ChatHandler *handler, float x, float y, Optional< float > z, Optional< uint32 > id, Optional< float > o)
Definition cs_go.cpp:376
static bool HandleGoCreatureCIdCommand(ChatHandler *handler, Variant< Hyperlink< creature_entry >, uint32 > cId)
Definition cs_go.cpp:115
void AddSC_go_commandscript()
Definition cs_go.cpp:619
ChatCommandBuilder const [] ChatCommandTable
Definition ChatCommand.h:49
constexpr void EraseIf(Container &c, Predicate p)
Definition Containers.h:283
@ RBAC_PERM_COMMAND_GO
Definition RBAC.h:249
EnumFlag< AreaFlags > GetFlags() const
LocalizedString AreaName
DBCPosition3D Pos
std::string Name
LocalizedString MapName
constexpr float GetPositionX() const
Definition Position.h:87
constexpr float GetPositionY() const
Definition Position.h:88
constexpr void GetPosition(float &x, float &y) const
Definition Position.h:92
void RelocateOffset(Position const &offset)
Definition Position.cpp:34
constexpr float GetOrientation() const
Definition Position.h:90
std::vector< QuestPOIBlobPoint > Points
Definition ObjectMgr.h:806
uint32 id
Definition SpawnData.h:135
Position spawnPoint
Definition SpawnData.h:136
uint64 spawnId
Definition SpawnData.h:121
DBCPosition3D Pos
WorldLocation Loc
Definition ObjectMgr.h:836