示例#1
0
 public void StopCapture()
 {
     Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(BattleGround,
                                                               BattleGroundInfoMessageType.FailedToTemporarilyOccuptyTheNumOccupationPoints, Id, null,
                                                               CapturingCharacter.Asda2FactionId);
     Asda2BattlegroundHandler.SendOccupyingPointStartedResponse(CapturingCharacter.Client, Id,
                                                                OcupationPointStartedStatus.Fail);
     CapturingCharacter.CurrentCapturingPoint = null;
     CapturingCharacter = null;
     _isCapturing       = false;
 }
示例#2
0
 public void StopCapture()
 {
     Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this.BattleGround,
                                                               BattleGroundInfoMessageType.FailedToTemporarilyOccuptyTheNumOccupationPoints, this.Id, (Character)null,
                                                               new short?(this.CapturingCharacter.Asda2FactionId));
     Asda2BattlegroundHandler.SendOccupyingPointStartedResponse(this.CapturingCharacter.Client, this.Id,
                                                                OcupationPointStartedStatus.Fail);
     this.CapturingCharacter.CurrentCapturingPoint = (Asda2WarPoint)null;
     this.CapturingCharacter = (Character)null;
     this._isCapturing       = false;
 }
示例#3
0
 public void SendCurrentProgress(Character character)
 {
     if (DateTime.Now < StartTime.AddMinutes(2))
     {
         Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this, BattleGroundInfoMessageType.WarStartsInNumMins,
                                                                   (short)(StartTime.AddMinutes(2) - DateTime.Now).TotalMinutes, character);
     }
     else
     {
         Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this, BattleGroundInfoMessageType.WarStarted, 0,
                                                                   character);
     }
 }
示例#4
0
        private void SendWarTimeMotofocation()
        {
            if (!IsRunning)
            {
                return;
            }
            switch (WarNotofocationStep)
            {
            case 0:
                Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this, BattleGroundInfoMessageType.WarStartsInNumMins,
                                                                          1);
                World.TaskQueue.CallDelayed(60000, SendWarTimeMotofocation);
                break;

            case 1:
                Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this, BattleGroundInfoMessageType.WarStarted, 0);
                World.TaskQueue.CallDelayed(23 * 60000, SendWarTimeMotofocation);
                IsStarted = true;
                break;

            case 2:
                Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this, BattleGroundInfoMessageType.WarEndsInNumMins,
                                                                          5);
                World.TaskQueue.CallDelayed(60000, SendWarTimeMotofocation);
                break;

            case 3:
                Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this, BattleGroundInfoMessageType.WarEndsInNumMins,
                                                                          4);
                World.TaskQueue.CallDelayed(60000, SendWarTimeMotofocation);
                break;

            case 4:
                Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this, BattleGroundInfoMessageType.WarEndsInNumMins,
                                                                          3);
                World.TaskQueue.CallDelayed(60000, SendWarTimeMotofocation);
                break;

            case 5:
                Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this, BattleGroundInfoMessageType.WarEndsInNumMins,
                                                                          2);
                World.TaskQueue.CallDelayed(60000, SendWarTimeMotofocation);
                break;

            case 6:
                Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this, BattleGroundInfoMessageType.WarEndsInNumMins,
                                                                          1);
                break;
            }
            WarNotofocationStep++;
        }
示例#5
0
        public void Update(int dt)
        {
            if (this.Status == Asda2WarPointStatus.Owned)
            {
                this._timeToNextGainPoints -= dt;
                if (this._timeToNextGainPoints <= 0)
                {
                    this.BattleGround.GainScores(this.OwnedFaction,
                                                 CharacterFormulas.FactionWarPointsPerTicForCapturedPoints);
                    this._timeToNextGainPoints += CharacterFormulas.DefaultTimeGainExpReward;
                }
            }

            if (this._isCapturing)
            {
                this._tomeToCaprute -= dt;
                if (this._tomeToCaprute > 0)
                {
                    return;
                }
                this.Status = Asda2WarPointStatus.Owned;
                Asda2BattlegroundHandler.SendUpdatePointInfoResponse((IRealmClient)null, this);
                Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this.BattleGround,
                                                                          BattleGroundInfoMessageType.SuccessToCompletelyOccuptyTheNumOccupationPoints, this.Id,
                                                                          (Character)null, new short?(this.OwnedFaction));
                Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this.BattleGround,
                                                                          BattleGroundInfoMessageType.TheOtherSideHasTemporarilyOccupiedTheNumOccupationPoint, this.Id,
                                                                          (Character)null, new short?(this.OwnedFaction == (short)0 ? (short)1 : (short)0));
                this.BattleGround.GainScores(this.OwnedFaction,
                                             CharacterFormulas.FactionWarPointsPerTicForCapturedPoints);
                this._isCapturing = false;
            }
            else
            {
                if (this.CapturingCharacter == null || !this.BattleGround.IsStarted)
                {
                    return;
                }
                this._timeToStartCapturing -= dt;
                if (this._timeToStartCapturing > 0)
                {
                    return;
                }
                this._tomeToCaprute = CharacterFormulas.DefaultCaptureTime;
                this._isCapturing   = true;
                this.OwnedFaction   = this.CapturingCharacter.Asda2FactionId;
                this.CapturingCharacter.GainActPoints((short)1);
                this.BattleGround.GainScores(this.CapturingCharacter, (short)1);
                this.Status = Asda2WarPointStatus.Capturing;
                Asda2BattlegroundHandler.SendUpdatePointInfoResponse((IRealmClient)null, this);
                Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this.BattleGround,
                                                                          BattleGroundInfoMessageType.SuccessToTemporarilyOccuptyTheNumOccupationPoints, this.Id,
                                                                          (Character)null, new short?(this.CapturingCharacter.Asda2FactionId));
                Asda2BattlegroundHandler.SendWarCurrentActionInfoResponse(this.BattleGround,
                                                                          BattleGroundInfoMessageType.TheOtherSideHasTemporarilyOccupiedTheNumOccupationPoint, this.Id,
                                                                          (Character)null,
                                                                          new short?(this.CapturingCharacter.Asda2FactionId == (short)1 ? (short)0 : (short)1));
                Asda2BattlegroundHandler.SendOccupyingPointStartedResponse(this.CapturingCharacter.Client, this.Id,
                                                                           OcupationPointStartedStatus.Fail);
                this.CapturingCharacter.CurrentCapturingPoint = (Asda2WarPoint)null;
                this.CapturingCharacter    = (Character)null;
                this._timeToNextGainPoints = CharacterFormulas.DefaultTimeGainExpReward;
            }
        }