Exemple #1
0
        static bool HandleArenaDisbandCommand(StringArguments args, CommandHandler handler)
        {
            if (args.Empty())
            {
                return(false);
            }

            uint teamId = args.NextUInt32();

            if (teamId == 0)
            {
                return(false);
            }

            ArenaTeam arena = Global.ArenaTeamMgr.GetArenaTeamById(teamId);

            if (arena == null)
            {
                handler.SendSysMessage(CypherStrings.ArenaErrorNotFound, teamId);
                return(false);
            }

            if (arena.IsFighting())
            {
                handler.SendSysMessage(CypherStrings.ArenaErrorCombat);
                return(false);
            }

            string name = arena.GetName();

            arena.Disband();
            if (handler.GetSession() != null)
            {
                Log.outDebug(LogFilter.Arena, "GameMaster: {0} [GUID: {1}] disbanded arena team type: {2} [Id: {3}].",
                             handler.GetSession().GetPlayer().GetName(), handler.GetSession().GetPlayer().GetGUID().ToString(), arena.GetArenaType(), teamId);
            }
            else
            {
                Log.outDebug(LogFilter.Arena, "Console: disbanded arena team type: {0} [Id: {1}].", arena.GetArenaType(), teamId);
            }

            handler.SendSysMessage(CypherStrings.ArenaDisband, name, teamId);
            return(true);
        }