Files
TCPlayerbotCore/src/server/scripts/Commands/cs_go.cpp
T

645 lines
22 KiB
C++
Raw Normal View History

/*
2015-01-01 00:27:46 +01:00
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
Name: go_commandscript
%Complete: 100
Comment: All go related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "MapManager.h"
#include "SupportMgr.h"
#include "Chat.h"
#include "Language.h"
#include "Player.h"
#include "Transport.h"
class go_commandscript : public CommandScript
{
public:
go_commandscript() : CommandScript("go_commandscript") { }
ChatCommand* GetCommands() const override
{
static ChatCommand goCommandTable[] =
{
{ "creature", rbac::RBAC_PERM_COMMAND_GO_CREATURE, false, &HandleGoCreatureCommand, "", NULL },
{ "graveyard", rbac::RBAC_PERM_COMMAND_GO_GRAVEYARD, false, &HandleGoGraveyardCommand, "", NULL },
{ "grid", rbac::RBAC_PERM_COMMAND_GO_GRID, false, &HandleGoGridCommand, "", NULL },
{ "object", rbac::RBAC_PERM_COMMAND_GO_OBJECT, false, &HandleGoObjectCommand, "", NULL },
{ "quest", rbac::RBAC_PERM_COMMAND_GO_QUEST, false, &HandleGoQuestCommand, "", NULL },
{ "taxinode", rbac::RBAC_PERM_COMMAND_GO_TAXINODE, false, &HandleGoTaxinodeCommand, "", NULL },
{ "trigger", rbac::RBAC_PERM_COMMAND_GO_TRIGGER, false, &HandleGoTriggerCommand, "", NULL },
{ "zonexy", rbac::RBAC_PERM_COMMAND_GO_ZONEXY, false, &HandleGoZoneXYCommand, "", NULL },
{ "xyz", rbac::RBAC_PERM_COMMAND_GO_XYZ, false, &HandleGoXYZCommand, "", NULL },
{ "ticket", rbac::RBAC_PERM_COMMAND_GO_TICKET, false, &HandleGoTicketCommand<GmTicket>, "", NULL },
{ "bugticket", rbac::RBAC_PERM_COMMAND_GO_BUG_TICKET, false, &HandleGoTicketCommand<BugTicket>, "", NULL },
{ "complaintticket", rbac::RBAC_PERM_COMMAND_GO_COMPLAINT_TICKET, false, &HandleGoTicketCommand<ComplaintTicket>, "", NULL },
{ "suggestionticket", rbac::RBAC_PERM_COMMAND_GO_SUGGESTION_TICKET, false, &HandleGoTicketCommand<SuggestionTicket>, "", NULL },
{ "", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoXYZCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
2013-09-27 12:46:01 +02:00
{ "go", rbac::RBAC_PERM_COMMAND_GO, false, NULL, "", goCommandTable },
{ NULL, 0, false, NULL, "", NULL }
};
return commandTable;
}
2011-10-10 10:33:13 -03:00
/** \brief Teleport the GM to the specified creature
*
* .gocreature <GUID> --> TP using creature.guid
* .gocreature azuregos --> TP player to the mob with this name
* Warning: If there is more than one mob with this name
* you will be teleported to the first one that is found.
* .gocreature id 6109 --> TP player to the mob, that has this creature_template.entry
* Warning: If there is more than one mob with this "id"
* you will be teleported to the first one that is found.
*/
//teleport to creature
2011-10-10 10:33:13 -03:00
static bool HandleGoCreatureCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
2011-10-10 10:33:13 -03:00
Player* player = handler->GetSession()->GetPlayer();
// "id" or number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r
2011-10-10 10:33:13 -03:00
char* param1 = handler->extractKeyFromLink((char*)args, "Hcreature");
if (!param1)
return false;
std::ostringstream whereClause;
// User wants to teleport to the NPC's template entry
2011-10-10 10:33:13 -03:00
if (strcmp(param1, "id") == 0)
{
// Get the "creature_template.entry"
// number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r
2011-04-29 20:47:02 +02:00
char* tail = strtok(NULL, "");
if (!tail)
return false;
2011-10-10 10:33:13 -03:00
char* id = handler->extractKeyFromLink(tail, "Hcreature_entry");
if (!id)
return false;
2011-10-10 10:33:13 -03:00
int32 entry = atoi(id);
if (!entry)
return false;
2011-10-10 10:33:13 -03:00
whereClause << "WHERE id = '" << entry << '\'';
}
else
{
2011-10-10 10:33:13 -03:00
int32 guid = atoi(param1);
// Number is invalid - maybe the user specified the mob's name
if (!guid)
{
2011-10-10 10:33:13 -03:00
std::string name = param1;
WorldDatabase.EscapeString(name);
whereClause << ", creature_template WHERE creature.id = creature_template.entry AND creature_template.name " _LIKE_" '" << name << '\'';
}
else
whereClause << "WHERE guid = '" << guid << '\'';
}
QueryResult result = WorldDatabase.PQuery("SELECT position_x, position_y, position_z, orientation, map, guid, id FROM creature %s", whereClause.str().c_str());
if (!result)
{
handler->SendSysMessage(LANG_COMMAND_GOCREATNOTFOUND);
handler->SetSentErrorMessage(true);
return false;
}
if (result->GetRowCount() > 1)
handler->SendSysMessage(LANG_COMMAND_GOCREATMULTIPLE);
Field* fields = result->Fetch();
float x = fields[0].GetFloat();
float y = fields[1].GetFloat();
float z = fields[2].GetFloat();
float o = fields[3].GetFloat();
uint32 mapId = fields[4].GetUInt16();
ObjectGuid::LowType guid = fields[5].GetUInt64();
uint32 id = fields[6].GetUInt32();
Transport* transport = NULL;
if (!MapManager::IsValidMapCoord(mapId, x, y, z, o) || sObjectMgr->IsTransportMap(mapId))
{
2011-10-10 10:33:13 -03:00
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
2013-06-11 19:54:27 -02:30
if (player->IsInFlight())
{
2011-10-10 10:33:13 -03:00
player->GetMotionMaster()->MovementExpired();
player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
2011-10-10 10:33:13 -03:00
player->SaveRecallPosition();
if (player->TeleportTo(mapId, x, y, z, o))
{
if (transport)
transport->AddPassenger(player);
}
return true;
}
2011-10-10 10:33:13 -03:00
static bool HandleGoGraveyardCommand(ChatHandler* handler, char const* args)
{
2011-10-10 10:33:13 -03:00
Player* player = handler->GetSession()->GetPlayer();
if (!*args)
return false;
2011-10-10 10:33:13 -03:00
char* gyId = strtok((char*)args, " ");
if (!gyId)
return false;
2011-10-10 10:33:13 -03:00
int32 graveyardId = atoi(gyId);
2011-10-10 10:33:13 -03:00
if (!graveyardId)
return false;
2011-10-10 10:33:13 -03:00
WorldSafeLocsEntry const* gy = sWorldSafeLocsStore.LookupEntry(graveyardId);
if (!gy)
{
2011-10-10 10:33:13 -03:00
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNOEXIST, graveyardId);
handler->SetSentErrorMessage(true);
return false;
}
if (!MapManager::IsValidMapCoord(gy->MapID, gy->Loc.X, gy->Loc.Y, gy->Loc.Z))
{
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, gy->Loc.X, gy->Loc.Y, gy->MapID);
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
2013-06-11 19:54:27 -02:30
if (player->IsInFlight())
{
2011-10-10 10:33:13 -03:00
player->GetMotionMaster()->MovementExpired();
player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
2011-10-10 10:33:13 -03:00
player->SaveRecallPosition();
player->TeleportTo(gy->MapID, gy->Loc.X, gy->Loc.Y, gy->Loc.Z, (gy->Facing * M_PI) / 180); // Orientation is initially in degrees
return true;
}
2011-10-10 10:33:13 -03:00
//teleport to grid
2011-10-10 10:33:13 -03:00
static bool HandleGoGridCommand(ChatHandler* handler, char const* args)
{
2011-10-10 10:33:13 -03:00
if (!*args)
return false;
Player* player = handler->GetSession()->GetPlayer();
2011-10-10 10:33:13 -03:00
char* gridX = strtok((char*)args, " ");
char* gridY = strtok(NULL, " ");
char* id = strtok(NULL, " ");
2011-10-10 10:33:13 -03:00
if (!gridX || !gridY)
return false;
2011-10-10 10:33:13 -03:00
uint32 mapId = id ? (uint32)atoi(id) : player->GetMapId();
// center of grid
2011-10-10 10:33:13 -03:00
float x = ((float)atof(gridX) - CENTER_GRID_ID + 0.5f) * SIZE_OF_GRIDS;
float y = ((float)atof(gridY) - CENTER_GRID_ID + 0.5f) * SIZE_OF_GRIDS;
2011-10-10 10:33:13 -03:00
if (!MapManager::IsValidMapCoord(mapId, x, y))
{
2011-10-10 10:33:13 -03:00
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
2013-06-11 19:54:27 -02:30
if (player->IsInFlight())
{
2011-10-10 10:33:13 -03:00
player->GetMotionMaster()->MovementExpired();
player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
2011-10-10 10:33:13 -03:00
player->SaveRecallPosition();
2011-10-10 10:33:13 -03:00
Map const* map = sMapMgr->CreateBaseMap(mapId);
float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
2011-10-10 10:33:13 -03:00
player->TeleportTo(mapId, x, y, z, player->GetOrientation());
return true;
}
2011-10-10 10:33:13 -03:00
//teleport to gameobject
2011-10-10 10:33:13 -03:00
static bool HandleGoObjectCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
2011-10-10 10:33:13 -03:00
Player* player = handler->GetSession()->GetPlayer();
// number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r
2011-10-10 10:33:13 -03:00
char* id = handler->extractKeyFromLink((char*)args, "Hgameobject");
if (!id)
return false;
ObjectGuid::LowType guid = strtoull(id, nullptr, 10);
if (!guid)
return false;
float x, y, z, o;
uint32 mapId;
// by DB guid
2011-10-10 10:33:13 -03:00
if (GameObjectData const* goData = sObjectMgr->GetGOData(guid))
{
2011-10-10 10:33:13 -03:00
x = goData->posX;
y = goData->posY;
z = goData->posZ;
o = goData->orientation;
2011-10-10 10:33:13 -03:00
mapId = goData->mapid;
}
else
{
handler->SendSysMessage(LANG_COMMAND_GOOBJNOTFOUND);
handler->SetSentErrorMessage(true);
return false;
}
if (!MapManager::IsValidMapCoord(mapId, x, y, z, o) || sObjectMgr->IsTransportMap(mapId))
{
2011-10-10 10:33:13 -03:00
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
2013-06-11 19:54:27 -02:30
if (player->IsInFlight())
{
2011-10-10 10:33:13 -03:00
player->GetMotionMaster()->MovementExpired();
player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
2011-10-10 10:33:13 -03:00
player->SaveRecallPosition();
player->TeleportTo(mapId, x, y, z, o);
return true;
}
2011-10-10 10:33:13 -03:00
static bool HandleGoQuestCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
Player* player = handler->GetSession()->GetPlayer();
char* id = handler->extractKeyFromLink((char*)args, "Hquest");
if (!id)
return false;
uint32 questID = atoi(id);
if (!questID)
return false;
if (!sObjectMgr->GetQuestTemplate(questID))
{
handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, questID);
handler->SetSentErrorMessage(true);
return false;
}
float x, y, z;
uint32 mapId;
if (QuestPOIVector const* poiData = sObjectMgr->GetQuestPOIVector(questID))
{
auto data = poiData->front();
mapId = data.MapID;
x = data.points.front().X;
y = data.points.front().Y;
}
else
{
handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, questID);
handler->SetSentErrorMessage(true);
return false;
}
if (!MapManager::IsValidMapCoord(mapId, x, y) || sObjectMgr->IsTransportMap(mapId))
{
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
if (player->IsInFlight())
{
player->GetMotionMaster()->MovementExpired();
player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
player->SaveRecallPosition();
Map const* map = sMapMgr->CreateBaseMap(mapId);
z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
player->TeleportTo(mapId, x, y, z, 0.0f);
return true;
}
2011-10-10 10:33:13 -03:00
static bool HandleGoTaxinodeCommand(ChatHandler* handler, char const* args)
{
2011-10-10 10:33:13 -03:00
Player* player = handler->GetSession()->GetPlayer();
if (!*args)
return false;
2011-10-10 10:33:13 -03:00
char* id = handler->extractKeyFromLink((char*)args, "Htaxinode");
if (!id)
return false;
2011-10-10 10:33:13 -03:00
int32 nodeId = atoi(id);
if (!nodeId)
return false;
2011-10-10 10:33:13 -03:00
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(nodeId);
if (!node)
{
2011-10-10 10:33:13 -03:00
handler->PSendSysMessage(LANG_COMMAND_GOTAXINODENOTFOUND, nodeId);
handler->SetSentErrorMessage(true);
return false;
}
if ((node->Pos.X == 0.0f && node->Pos.Y == 0.0f && node->Pos.Z == 0.0f) ||
!MapManager::IsValidMapCoord(node->MapID, node->Pos.X, node->Pos.Y, node->Pos.Z))
{
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, node->Pos.X, node->Pos.Y, node->MapID);
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
2013-06-11 19:54:27 -02:30
if (player->IsInFlight())
{
2011-10-10 10:33:13 -03:00
player->GetMotionMaster()->MovementExpired();
player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
2011-10-10 10:33:13 -03:00
player->SaveRecallPosition();
player->TeleportTo(node->MapID, node->Pos.X, node->Pos.Y, node->Pos.Z, player->GetOrientation());
return true;
}
2011-10-10 10:33:13 -03:00
static bool HandleGoTriggerCommand(ChatHandler* handler, char const* args)
{
2011-10-10 10:33:13 -03:00
Player* player = handler->GetSession()->GetPlayer();
if (!*args)
return false;
2011-10-10 10:33:13 -03:00
char* id = strtok((char*)args, " ");
if (!id)
return false;
2011-10-10 10:33:13 -03:00
int32 areaTriggerId = atoi(id);
2011-10-10 10:33:13 -03:00
if (!areaTriggerId)
return false;
2011-10-10 10:33:13 -03:00
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(areaTriggerId);
if (!at)
{
2011-10-10 10:33:13 -03:00
handler->PSendSysMessage(LANG_COMMAND_GOAREATRNOTFOUND, areaTriggerId);
handler->SetSentErrorMessage(true);
return false;
}
if (!MapManager::IsValidMapCoord(at->MapID, at->Pos.X, at->Pos.Y, at->Pos.Z))
{
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->Pos.X, at->Pos.Y, at->MapID);
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
2013-06-11 19:54:27 -02:30
if (player->IsInFlight())
{
2011-10-10 10:33:13 -03:00
player->GetMotionMaster()->MovementExpired();
player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
2011-10-10 10:33:13 -03:00
player->SaveRecallPosition();
player->TeleportTo(at->MapID, at->Pos.X, at->Pos.Y, at->Pos.Z, player->GetOrientation());
return true;
}
2011-10-10 10:33:13 -03:00
//teleport at coordinates
2011-10-10 10:33:13 -03:00
static bool HandleGoZoneXYCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
2011-10-10 10:33:13 -03:00
Player* player = handler->GetSession()->GetPlayer();
2011-10-10 10:33:13 -03:00
char* zoneX = strtok((char*)args, " ");
char* zoneY = strtok(NULL, " ");
2011-04-29 20:47:02 +02:00
char* tail = strtok(NULL, "");
2011-10-10 10:33:13 -03:00
char* id = handler->extractKeyFromLink(tail, "Harea"); // string or [name] Shift-click form |color|Harea:area_id|h[name]|h|r
2011-10-10 10:33:13 -03:00
if (!zoneX || !zoneY)
return false;
2011-10-10 10:33:13 -03:00
float x = (float)atof(zoneX);
float y = (float)atof(zoneY);
// prevent accept wrong numeric args
2011-10-10 10:33:13 -03:00
if ((x == 0.0f && *zoneX != '0') || (y == 0.0f && *zoneY != '0'))
return false;
2011-10-10 10:33:13 -03:00
uint32 areaId = id ? (uint32)atoi(id) : player->GetZoneId();
2011-10-10 10:33:13 -03:00
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId);
if (x < 0 || x > 100 || y < 0 || y > 100 || !areaEntry)
{
2011-10-10 10:33:13 -03:00
handler->PSendSysMessage(LANG_INVALID_ZONE_COORD, x, y, areaId);
handler->SetSentErrorMessage(true);
return false;
}
// update to parent zone if exist (client map show only zones without parents)
2014-11-13 02:30:19 +02:00
AreaTableEntry const* zoneEntry = areaEntry->ParentAreaID ? GetAreaEntryByAreaID(areaEntry->ParentAreaID) : areaEntry;
2014-03-31 20:59:33 +02:00
ASSERT(zoneEntry);
2014-11-13 02:30:19 +02:00
Map const* map = sMapMgr->CreateBaseMap(zoneEntry->MapID);
if (map->Instanceable())
{
2014-11-13 02:30:19 +02:00
handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->ZoneName, map->GetId(), map->GetMapName());
handler->SetSentErrorMessage(true);
return false;
}
2011-04-29 20:47:02 +02:00
Zone2MapCoordinates(x, y, zoneEntry->ID);
2014-11-13 02:30:19 +02:00
if (!MapManager::IsValidMapCoord(zoneEntry->MapID, x, y))
{
2014-11-13 02:30:19 +02:00
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, zoneEntry->MapID);
handler->SetSentErrorMessage(true);
return false;
}
// stop flight if need
2013-06-11 19:54:27 -02:30
if (player->IsInFlight())
{
2011-10-10 10:33:13 -03:00
player->GetMotionMaster()->MovementExpired();
player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
2011-10-10 10:33:13 -03:00
player->SaveRecallPosition();
float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
2014-11-13 02:30:19 +02:00
player->TeleportTo(zoneEntry->MapID, x, y, z, player->GetOrientation());
return true;
}
2011-10-10 10:33:13 -03:00
//teleport at coordinates, including Z and orientation
2011-10-10 10:33:13 -03:00
static bool HandleGoXYZCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
2011-10-10 10:33:13 -03:00
Player* player = handler->GetSession()->GetPlayer();
2011-10-10 10:33:13 -03:00
char* goX = strtok((char*)args, " ");
char* goY = strtok(NULL, " ");
char* goZ = strtok(NULL, " ");
char* id = strtok(NULL, " ");
char* port = strtok(NULL, " ");
2011-10-10 10:33:13 -03:00
if (!goX || !goY)
return false;
2011-10-10 10:33:13 -03:00
float x = (float)atof(goX);
float y = (float)atof(goY);
float z;
2011-10-10 10:33:13 -03:00
float ort = port ? (float)atof(port) : player->GetOrientation();
uint32 mapId = id ? (uint32)atoi(id) : player->GetMapId();
2011-10-10 10:33:13 -03:00
if (goZ)
{
2011-10-10 10:33:13 -03:00
z = (float)atof(goZ);
if (!MapManager::IsValidMapCoord(mapId, x, y, z))
{
2011-10-10 10:33:13 -03:00
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
handler->SetSentErrorMessage(true);
return false;
}
}
else
{
2011-10-10 10:33:13 -03:00
if (!MapManager::IsValidMapCoord(mapId, x, y))
{
2011-10-10 10:33:13 -03:00
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
handler->SetSentErrorMessage(true);
return false;
}
2011-10-10 10:33:13 -03:00
Map const* map = sMapMgr->CreateBaseMap(mapId);
z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
}
2011-09-29 12:43:05 +02:00
// stop flight if need
2013-06-11 19:54:27 -02:30
if (player->IsInFlight())
{
2011-10-10 10:33:13 -03:00
player->GetMotionMaster()->MovementExpired();
player->CleanupAfterTaxiFlight();
}
// save only in non-flight case
else
2011-10-10 10:33:13 -03:00
player->SaveRecallPosition();
2011-10-10 10:33:13 -03:00
player->TeleportTo(mapId, x, y, z, ort);
return true;
}
2011-10-10 10:33:13 -03:00
template<typename T>
2011-10-10 10:33:13 -03:00
static bool HandleGoTicketCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
2011-10-10 10:33:13 -03:00
char* id = strtok((char*)args, " ");
if (!id)
return false;
2011-10-10 10:33:13 -03:00
uint32 ticketId = atoi(id);
if (!ticketId)
return false;
T* ticket = sSupportMgr->GetTicket<T>(ticketId);
if (!ticket)
{
handler->SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
return true;
}
2011-10-10 10:33:13 -03:00
Player* player = handler->GetSession()->GetPlayer();
2013-06-11 19:54:27 -02:30
if (player->IsInFlight())
{
2011-10-10 10:33:13 -03:00
player->GetMotionMaster()->MovementExpired();
player->CleanupAfterTaxiFlight();
}
else
2011-10-10 10:33:13 -03:00
player->SaveRecallPosition();
2011-10-10 10:33:13 -03:00
ticket->TeleportTo(player);
return true;
}
};
void AddSC_go_commandscript()
{
new go_commandscript();
}