* Ticket system update;

- Add map, x, y, z coordinate data to ticket upon creation
- Add command .go ticket to teleport to the coordinates where the ticket was created
- Move InitTicketID() to the class constructor instead of at every LoadGMTickets call
- Minor code cleanup

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2009-04-14 17:48:58 +02:00
parent e7ac066211
commit ecbaf6483d
8 changed files with 72 additions and 14 deletions

View File

@@ -34,7 +34,7 @@
#include "SpellMgr.h"
#include "PoolHandler.h"
#include "AccountMgr.h"
//#include "GMTicketMgr.h"
#include "TicketMgr.h"
#include "WaypointManager.h"
#include "Util.h"
#include <cctype>
@@ -158,6 +158,48 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
return true;
}
bool ChatHandler::HandleGoTicketCommand(const char * args)
{
if(!*args)
return false;
char *cstrticket_id = strtok((char*)args, " ");
if(!cstrticket_id)
return false;
uint64 ticket_id = atoi(cstrticket_id);
if(!ticket_id)
return false;
GM_Ticket *ticket = ticketmgr.GetGMTicket(ticket_id);
if(!ticket)
{
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
return true;
}
float x, y, z;
int mapid;
x = ticket->pos_x;
y = ticket->pos_y;
z = ticket->pos_z;
mapid = ticket->map;
Player* _player = m_session->GetPlayer();
if(_player->isInFlight())
{
_player->GetMotionMaster()->MovementExpired();
_player->m_taxi.ClearTaxiDestinations();
}
else
_player->SaveRecallPosition();
_player->TeleportTo(mapid, x, y, z, 1, 0);
return true;
}
bool ChatHandler::HandleGoTriggerCommand(const char* args)
{
Player* _player = m_session->GetPlayer();