コード例 #1
0
        // used to create the BG templates
        bool CreateBattleground(BattlegroundTemplate bgTemplate)
        {
            Battleground bg = GetBattlegroundTemplate(bgTemplate.Id);

            if (!bg)
            {
                // Create the BG
                switch (bgTemplate.Id)
                {
                //case BattlegroundTypeId.AV:
                // bg = new BattlegroundAV();
                //break;
                case BattlegroundTypeId.WS:
                    bg = new BgWarsongGluch();
                    break;

                case BattlegroundTypeId.AB:
                    bg = new BgArathiBasin();
                    break;

                case BattlegroundTypeId.NA:
                    bg = new NagrandArena();
                    break;

                case BattlegroundTypeId.BE:
                    bg = new BladesEdgeArena();
                    break;

                case BattlegroundTypeId.EY:
                    bg = new BgEyeofStorm();
                    break;

                case BattlegroundTypeId.RL:
                    bg = new RuinsofLordaeronArena();
                    break;

                case BattlegroundTypeId.SA:
                    bg = new BgStrandOfAncients();
                    break;

                case BattlegroundTypeId.DS:
                    bg = new DalaranSewersArena();
                    break;

                case BattlegroundTypeId.RV:
                    bg = new RingofValorArena();
                    break;

                //case BattlegroundTypeId.IC:
                //bg = new BattlegroundIC();
                //break;
                case BattlegroundTypeId.AA:
                    bg = new Battleground();
                    break;

                case BattlegroundTypeId.RB:
                    bg = new Battleground();
                    bg.SetRandom(true);
                    break;

                /*
                 * case BattlegroundTypeId.TP:
                 * bg = new BattlegroundTP();
                 * break;
                 * case BattlegroundTypeId.BFG:
                 * bg = new BattlegroundBFG();
                 * break;
                 */
                default:
                    return(false);
                }
                bg.SetTypeID(bgTemplate.Id);
            }

            bg.SetMapId((uint)bgTemplate.BattlemasterEntry.MapId[0]);
            bg.SetName(bgTemplate.BattlemasterEntry.Name[Global.WorldMgr.GetDefaultDbcLocale()]);
            bg.SetInstanceID(0);
            bg.SetArenaorBGType(bgTemplate.IsArena());
            bg.SetMinPlayersPerTeam(bgTemplate.MinPlayersPerTeam);
            bg.SetMaxPlayersPerTeam(bgTemplate.MaxPlayersPerTeam);
            bg.SetMinPlayers(bgTemplate.MinPlayersPerTeam * 2);
            bg.SetMaxPlayers(bgTemplate.MaxPlayersPerTeam * 2);
            bg.SetTeamStartPosition(TeamId.Alliance, bgTemplate.StartLocation[TeamId.Alliance]);
            bg.SetTeamStartPosition(TeamId.Horde, bgTemplate.StartLocation[TeamId.Horde]);
            bg.SetStartMaxDist(bgTemplate.StartMaxDist);
            bg.SetLevelRange(bgTemplate.MinLevel, bgTemplate.MaxLevel);
            bg.SetScriptId(bgTemplate.scriptId);
            bg.SetQueueId((ulong)bgTemplate.Id | 0x1F10000000000000);

            if (!bgDataStore.ContainsKey(bg.GetTypeID()))
            {
                bgDataStore[bg.GetTypeID()] = new BattlegroundData();
            }

            bgDataStore[bg.GetTypeID()].Template = bg;

            return(true);
        }
コード例 #2
0
        // used to create the BG templates
        bool CreateBattleground(BattlegroundTemplate bgTemplate)
        {
            Battleground bg = GetBattlegroundTemplate(bgTemplate.Id);

            if (!bg)
            {
                // Create the BG
                switch (bgTemplate.Id)
                {
                //case BattlegroundTypeId.AV:
                // bg = new BattlegroundAV(bgTemplate);
                //break;
                case BattlegroundTypeId.WS:
                    bg = new BgWarsongGluch(bgTemplate);
                    break;

                case BattlegroundTypeId.AB:
                    bg = new BgArathiBasin(bgTemplate);
                    break;

                case BattlegroundTypeId.NA:
                    bg = new NagrandArena(bgTemplate);
                    break;

                case BattlegroundTypeId.BE:
                    bg = new BladesEdgeArena(bgTemplate);
                    break;

                case BattlegroundTypeId.EY:
                    bg = new BgEyeofStorm(bgTemplate);
                    break;

                case BattlegroundTypeId.RL:
                    bg = new RuinsofLordaeronArena(bgTemplate);
                    break;

                case BattlegroundTypeId.SA:
                    bg = new BgStrandOfAncients(bgTemplate);
                    break;

                case BattlegroundTypeId.DS:
                    bg = new DalaranSewersArena(bgTemplate);
                    break;

                case BattlegroundTypeId.RV:
                    bg = new RingofValorArena(bgTemplate);
                    break;

                //case BattlegroundTypeId.IC:
                //bg = new BattlegroundIC(bgTemplate);
                //break;
                case BattlegroundTypeId.AA:
                    bg = new Battleground(bgTemplate);
                    break;

                case BattlegroundTypeId.RB:
                    bg = new Battleground(bgTemplate);
                    bg.SetRandom(true);
                    break;

                /*
                 * case BattlegroundTypeId.TP:
                 * bg = new BattlegroundTP(bgTemplate);
                 * break;
                 * case BattlegroundTypeId.BFG:
                 * bg = new BattlegroundBFG(bgTemplate);
                 * break;
                 */
                default:
                    return(false);
                }
            }

            bg.SetInstanceID(0);

            if (!bgDataStore.ContainsKey(bg.GetTypeID()))
            {
                bgDataStore[bg.GetTypeID()] = new BattlegroundData();
            }

            bgDataStore[bg.GetTypeID()].Template = bg;

            return(true);
        }