Advertisement
randy336

[Trinity] Mall Command

Feb 20th, 2013
783
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.81 KB | None | 0 0
  1. /*
  2. <--------------------------------------------------------------------------->
  3.  - Developer(s): Ghostcrawler336
  4.  - Complete: 100%
  5.  - ScriptName: 'Custom Mall Command'
  6.  - Comment: Tested & Working
  7. <--------------------------------------------------------------------------->
  8. */
  9. #include "ScriptPCH.h"
  10.      
  11.     class mall_tele_commandscript : public CommandScript
  12.     {
  13.     public:
  14.         mall_tele_commandscript() : CommandScript("mall_tele_commandscript") { }
  15.      
  16.                 ChatCommand* GetCommands() const
  17.         {
  18.             static ChatCommand mallTeleCommandTable[] =
  19.             {
  20.                             { "mall",       rbac::RBAC_PERM_COMMAND_MALL,  false, &HandlemallTeleCommand,             "", NULL },
  21.                 { NULL,             0,                  false, NULL,                              "", NULL }
  22.             };
  23.                      return mallTeleCommandTable;
  24.         }
  25.      
  26.             static bool HandlemallTeleCommand(ChatHandler* handler, const char* /*args*/)
  27.         {
  28.                 Player* player = handler->GetSession()->GetPlayer();
  29.                 if (player->IsInCombat())
  30.                 {
  31.                         player->GetSession()->SendNotification("You cannot use this in combat!");
  32.                         return false;
  33.                 }
  34.  
  35.                 if (player->GetTeam() == ALLIANCE)
  36.                         player->TeleportTo(530, -703.369568f, 2732.057129f, 94.733597f, 4.716630f);             // Alliance mall coords (MAP, X, Y, Z, O)
  37.                 else
  38.                         player->TeleportTo(530, 236.090576f, 2697.517090f, 90.588188f, 3.134510f);              // Horde mall coords (MAP, X, Y, Z, O)
  39.                 return true;
  40.         }
  41. };
  42.     void AddSC_mall_commandscript()
  43.     {
  44.         new mall_tele_commandscript();
  45.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement