public EpisodePointScaleVO GetCurrentEpisodePointScaleVO() { if (this.CurrentEpisodeData == null) { return(null); } StaticDataController staticDataController = Service.StaticDataController; EpisodePointScaleVO result = staticDataController.Get <EpisodePointScaleVO>(this.CurrentEpisodeData.PointScale); List <EpisodePointScheduleVO> list = new List <EpisodePointScheduleVO>(); foreach (EpisodePointScheduleVO current in staticDataController.GetAll <EpisodePointScheduleVO>()) { EpisodePointScheduleVO episodePointScheduleVO = current; if ((long)episodePointScheduleVO.EndTimeEpochSecs > (long)((ulong)ServerTime.Time)) { if ((long)episodePointScheduleVO.StartTimeEpochSecs <= (long)((ulong)ServerTime.Time)) { list.Add(episodePointScheduleVO); } } } if (list.Count > 0) { List <EpisodePointScheduleVO> arg_C9_0 = list; if (EpisodeController.< > f__mg$cache0 == null) { EpisodeController.< > f__mg$cache0 = new Comparison <EpisodePointScheduleVO>(EpisodeController.CompareSchedules); } arg_C9_0.Sort(EpisodeController.< > f__mg$cache0); EpisodePointScaleVO optional = staticDataController.GetOptional <EpisodePointScaleVO>(list[0].ScaleId); if (optional != null) { return(optional); } } return(result); }
private void RewardEpisodePointsForEvent(EventId id, int pointIndex) { if (pointIndex <= 0) { return; } EpisodeTaskManager episodeTaskManager = Service.EpisodeTaskManager; EpisodeTaskProgressInfo currentEpisodeTaskProgress = episodeTaskManager.GetCurrentEpisodeTaskProgress(); if (currentEpisodeTaskProgress == null || currentEpisodeTaskProgress.type != "EpisodePoint") { return; } EpisodePointScaleVO currentEpisodePointScaleVO = Service.EpisodeController.GetCurrentEpisodePointScaleVO(); if (currentEpisodePointScaleVO == null) { return; } int[] array = null; if (id != EventId.PvpBattleWon) { if (id != EventId.TournamentTierReached) { if (id != EventId.RaidComplete) { if (id != EventId.ObjectiveCompleted) { Service.Logger.ErrorFormat("Unknown event type {0} when awarding episode points", new object[] { id }); } else { array = currentEpisodePointScaleVO.Objective; } } else { array = currentEpisodePointScaleVO.Raid; } } else { array = currentEpisodePointScaleVO.Conflict; } } else { array = currentEpisodePointScaleVO.PvP; } if (array == null) { return; } int num = Math.Min(pointIndex, array.Length) - 1; int num2 = array[num]; CurrentPlayer currentPlayer = Service.CurrentPlayer; EpisodeProgressInfo episodeProgressInfo = currentPlayer.EpisodeProgressInfo; EpisodeProgressData cookie = new EpisodeProgressData(episodeProgressInfo.uid, currentEpisodeTaskProgress.uid, num2, episodeProgressInfo.currentTask.count, id, pointIndex); this.parent.Progress(this, num2, cookie); }