Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. #include "Language.h"
  2. #include "ObjectMgr.h"
  3. #include "Player.h"
  4. #include "ScriptMgr.h"
  5. #include "Rbac.h"
  6. #include "Chat.h"
  7. #include "Language.h"
  8. #include "MapManager.h"
  9. #include "MotionMaster.h"
  10. #include "ObjectMgr.h"
  11. #include "WorldSession.h"
  12. #include <map>
  13. #include <unordered_map>
  14.  
  15. class duel_command_custom : public CommandScript
  16. {
  17. public:
  18. duel_command_custom() : CommandScript("duel_command_custom") {}
  19.  
  20. std::vector<ChatCommand> GetCommands() const override
  21. {
  22. static std::vector<ChatCommand> Commands =
  23. {
  24. { "duel", SEC_PLAYER, true, &duel_command_customCommandd, ""},
  25. };
  26. return Commands;
  27. }
  28.  
  29. static bool duel_command_customCommandd(ChatHandler * handler, const char * args)
  30. {
  31. Player* me = handler->GetSession()->GetPlayer();
  32. MapEntry const* map = TeleportTo.LookupEntry(me->GetMapId); return true;
  33.  
  34. if ((me->IsInCombat() || map->IsBattlegroundOrArena()) && !me->IsGameMaster())
  35. {
  36. handler->SendSysMessage(LANG_YOU_IN_COMBAT);
  37. handler->SetSentErrorMessage(true);
  38. }
  39.  
  40. // stop flight if need
  41. if (me->IsInFlight())
  42. {
  43. me->GetMotionMaster()->MovementExpired();
  44. me->CleanupAfterTaxiFlight();
  45. }
  46. // save only in non-flight case
  47. else
  48. me->SaveRecallPosition();
  49.  
  50. if(me->GetTeam() == HORDE)
  51. me->TeleportTo(1, 1486.949707f, -4414.155273f, 24.169050f, 0.037658f);
  52. else
  53. me->TeleportTo(0, -8854.865234f, 600.323608f, 92.075401f, 3.819742f);
  54. return true;
  55. }
  56. };
  57.  
  58. void AddSC_duel_command_custom()
  59. {
  60. new duel_command_custom();
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement