Exemplo n.º 1
0
 private void InformNearVictory(BattlegroundTeam team, int score)
 {
     Characters.SendSystemMessage(DefaultAddonLocalizer.Instance.GetTranslations(AddonMsgKey.ABNearVictory),
                                  team.Side.ToString(), score);
     MiscHandler.SendPlaySoundToMap(this, (uint)ABSounds.NearVictory);
     isInformatedNearVictory = true;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Begins the capturing process. A base will turn if not taken back
        /// </summary>
        /// <param name="chr"></param>
        public void BeginCapture(Character chr)
        {
            Capturer = chr;

            CaptureTimer.Start(CapturePointConversionDelayMillis, 0);
            SpawnContested();

            ABSounds sound;

            if (_side == BattlegroundSide.End)
            {
                sound = ABSounds.NodeContested;
                Instance.WorldStates.SetInt32(showIconNeutral, 0);
            }
            else if (_side == BattlegroundSide.Alliance)
            {
                sound = ABSounds.NodeAssaultedHorde;
            }
            else
            {
                sound = ABSounds.NodeAssaultedAlliance;
            }

            if (chr.Battlegrounds.Team.Side == BattlegroundSide.Alliance)
            {
                State = BaseState.ContestedAlliance;
                Instance.WorldStates.SetInt32(showIconAllianceContested, 1);
                Instance.WorldStates.SetInt32(showIconHordeControlled, 0);
            }
            else
            {
                State = BaseState.ContestedHorde;
                Instance.WorldStates.SetInt32(showIconHordeContested, 1);
                Instance.WorldStates.SetInt32(showIconAllianceControlled, 0);
            }

            var time = RealmLocalizer.FormatTimeSecondsMinutes(CapturePointConversionDelayMillis / 1000);

            foreach (Character character in Instance.Characters)
            {
                character.SendSystemMessage(DefaultAddonLocalizer.Instance.Translate(character.Locale, AddonMsgKey.ABBaseClaimed, chr.Name, Names[(int)character.Locale], chr.Battlegrounds.Team.Side, time));
            }

            MiscHandler.SendPlaySoundToMap(Instance, (uint)sound);

            var evt = BaseChallenged;

            if (evt != null)
            {
                evt(chr);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Finalizes a capture (Flag changes colour (de/respawns, casts spells, etc)
        /// </summary>
        public void Capture()
        {
            var stats = (ArathiStats)Capturer.Battlegrounds.Stats;

            stats.BasesAssaulted++;

            FlagStand.Delete();
            ActualAura.Delete();

            ABSounds sound;

            if (Capturer.Battlegrounds.Team.Side == BattlegroundSide.Horde)
            {
                BaseOwner = BattlegroundSide.Horde;
                State     = BaseState.CapturedHorde;
                SpawnHorde();
                sound = ABSounds.NodeCapturedHorde;
                Instance.WorldStates.SetInt32(showIconHordeControlled, 1);
                Instance.WorldStates.SetInt32(showIconHordeContested, 0);
            }
            else
            {
                BaseOwner = BattlegroundSide.Alliance;
                State     = BaseState.CapturedAlliance;
                SpawnAlliance();
                sound = ABSounds.NodeCapturedAlliance;
                Instance.WorldStates.SetInt32(showIconAllianceControlled, 1);
                Instance.WorldStates.SetInt32(showIconAllianceContested, 0);
            }

            // It takes a few minutes before a captured flag begins to give score.
            StartScoreTimer.Start(ScoreDelayMillis, 0);

            foreach (Character character in Instance.Characters)
            {
                character.SendSystemMessage(DefaultAddonLocalizer.Instance.Translate(character.Locale, AddonMsgKey.ABBaseTaken, BaseOwner, Names[(int)character.Locale]));
            }

            MiscHandler.SendPlaySoundToMap(Instance, (uint)sound);
            var evt = BaseCaptured;

            if (evt != null)
            {
                evt(Capturer);
            }
        }
Exemplo n.º 4
0
 protected virtual void OnFinish(bool disposing)
 {
     MiscHandler.SendPlaySoundToMap(this,
                                    Winner.Side == BattlegroundSide.Horde ? (uint)BattlegroundSounds.HordeWins
                                                                                                   : (uint)BattlegroundSounds.AllianceWins);
 }
Exemplo n.º 5
0
 protected virtual void OnStart()
 {
     MiscHandler.SendPlaySoundToMap(this, (uint)BattlegroundSounds.BgStart);
 }
Exemplo n.º 6
0
 protected virtual void OnFinish(bool disposing)
 {
     MiscHandler.SendPlaySoundToMap((Map)this, this.Winner.Side == BattlegroundSide.Horde ? 8454U : 8455U);
 }
Exemplo n.º 7
0
 protected virtual void OnStart()
 {
     MiscHandler.SendPlaySoundToMap((Map)this, 3439U);
 }