Пример #1
0
        //  public static List<RiftStats> DisposedRifts = new List<RiftStats>();
        // public static RiftType RiftType;

        public void StartRift(Enigma.D3.Quest Quest)
        {
            RiftType     = (RiftType)Quest.x000_QuestSnoId;
            RiftIsActive = true;

            CurrentRift = new Rift.RiftStats
            {
                StartTick  = Quest.x004_CreationTick,
                Started    = DateTime.Now.AddSeconds(-((GameManager.Instance.GameTicks - Quest.x004_CreationTick) / 60)),
                RiftType   = this.RiftType,
                RiftLevel  = -1,
                Legendary  = new List <int>(),
                Levels     = 1,
                Boss       = -1,
                Difficulty = (Difficulty)GameManagerAccountHelper.Current.DiabloIII.ObjectManager.Storage.x004,
            };

            if (GameManagerAccountHelper.Current.DiabloIII.ObjectManager.Storage._x05C != -1) // GR
            {
                CurrentRift.RiftLevel  = (GameManagerAccountHelper.Current.DiabloIII.ObjectManager.Storage._x05C + 1);
                CurrentRift.Difficulty = Difficulty.GreaterRift;

                TownHelper.UpdateStash();

                //RiftType = RiftType.GreaterRift;
            }

            Account = GameManagerAccountHelper.Current;
            SetTimer();
        }
Пример #2
0
        public void Update(object state)
        {
            Enigma.D3.Quest Quest = GetQuest();

            if (Quest != null)
            {
                if (CurrentRift.Difficulty == Difficulty.GreaterRift)
                {
                    CurrentRift.State = (GreaterRiftState)Quest.x01C_QuestStep;
                    CurrentRift.Diff  = (GameManager.Instance.GameTicks - CurrentRift.StartTick) / 60d;

                    /*if(true)
                     * {
                     *  if (!UIObjects.GemUpgrade.Cache & UIObjects.GemUpgrade.TryGetValue<Enigma.D3.UI.Controls.UXItemsControl>())
                     *      GameManager.Instance.GManager.GRef.Attacher.Add<Templates.Rifts.GemUpgrade>("GemUpgrade");
                     * }*/

                    if (Quest.x01C_QuestStep == (int)GreaterRiftState.NotStarted) // Finished
                    {
                        CloseRift();
                    }

                    else if (Quest.x01C_QuestStep == (int)GreaterRiftState.KillBoss && PreviousStep != Quest.x01C_QuestStep)
                    {
                        CurrentRift.BossSpawned = (GameManager.Instance.GameTicks - CurrentRift.StartTick) / 60d;
                    }

                    //   else if (Quest.x01C_QuestStep == (int)GreaterRiftState.KillBoss && CurrentRift.Boss == -1)
                    //     ActorCommonDataHelper.Enumerate().Where(x => x.x0B8_MonsterQuality == Enigma.D3.Enums.MonsterQuality.Boss).

                    else if (Quest.x01C_QuestStep == (int)GreaterRiftState.KilledBoss && PreviousStep != Quest.x01C_QuestStep)
                    {
                        CurrentRift.BossKilled = (GameManager.Instance.GameTicks - CurrentRift.StartTick) / 60d;
                    }
                }

                else
                {
                    //CurrentRift.State = (RiftState)Quest.x01C_QuestStep;
                    CurrentRift.Diff = (GameManager.Instance.GameTicks - CurrentRift.StartTick) / 60d;

                    if (Quest.x01C_QuestStep == (int)RiftState.NotStarted) // Finnished
                    {
                        CloseRift();
                    }

                    else if (Quest.x01C_QuestStep == (int)RiftState.KillBoss && PreviousStep != Quest.x01C_QuestStep)
                    {
                        CurrentRift.BossSpawned = (GameManager.Instance.GameTicks - CurrentRift.StartTick) / 60d;
                    }

                    else if (Quest.x01C_QuestStep == (int)RiftState.KilledBoss && PreviousStep != Quest.x01C_QuestStep)
                    {
                        CurrentRift.BossKilled = (GameManager.Instance.GameTicks - CurrentRift.StartTick) / 60d;
                    }
                }

                PreviousStep = Quest.x01C_QuestStep;
            }

            else
            {
                PreviousStep = 0;
                CloseRift();
            }
        }