Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Language.h"
- #include "ObjectMgr.h"
- #include "Player.h"
- #include "ScriptMgr.h"
- #include "Rbac.h"
- #include "Chat.h"
- #include "Language.h"
- #include "MapManager.h"
- #include "MotionMaster.h"
- #include "ObjectMgr.h"
- #include "WorldSession.h"
- #include <map>
- #include <unordered_map>
- class duel_command_custom : public CommandScript
- {
- public:
- duel_command_custom() : CommandScript("duel_command_custom") {}
- std::vector<ChatCommand> GetCommands() const override
- {
- static std::vector<ChatCommand> Commands =
- {
- { "duel", SEC_PLAYER, true, &duel_command_customCommandd, ""},
- };
- return Commands;
- }
- static bool duel_command_customCommandd(ChatHandler * handler, const char * args)
- {
- Player* me = handler->GetSession()->GetPlayer();
- MapEntry const* map = TeleportTo.LookupEntry(me->GetMapId); return true;
- if ((me->IsInCombat() || map->IsBattlegroundOrArena()) && !me->IsGameMaster())
- {
- handler->SendSysMessage(LANG_YOU_IN_COMBAT);
- handler->SetSentErrorMessage(true);
- }
- // stop flight if need
- if (me->IsInFlight())
- {
- me->GetMotionMaster()->MovementExpired();
- me->CleanupAfterTaxiFlight();
- }
- // save only in non-flight case
- else
- me->SaveRecallPosition();
- if(me->GetTeam() == HORDE)
- me->TeleportTo(1, 1486.949707f, -4414.155273f, 24.169050f, 0.037658f);
- else
- me->TeleportTo(0, -8854.865234f, 600.323608f, 92.075401f, 3.819742f);
- return true;
- }
- };
- void AddSC_duel_command_custom()
- {
- new duel_command_custom();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement