示例#1
0
    public void ShowMissionResults(int garrMissionID, int missionResultType, bool awardOvermax)
    {
        this.m_missionResultsDisplayCanvasGroupAutoFadeOut.Reset();
        this.m_currentResultType = (MissionResultType)missionResultType;
        this.m_followerExperienceDisplayArea.SetActive(false);
        this.m_attemptedAutoComplete = false;
        this.m_garrMissionID         = garrMissionID;
        this.m_darknessBG.SetActive(true);
        this.m_popupView.SetActive(true);
        this.m_bonusLootDisplay.SetActive(false);
        if (this.missionFollowerSlotGroup != null)
        {
            MissionFollowerSlot[] componentsInChildren = this.missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true);
            for (int i = 0; i < componentsInChildren.Length; i++)
            {
                if (componentsInChildren[i] != null && componentsInChildren[i] != this.missionFollowerSlotGroup.get_transform())
                {
                    Object.DestroyImmediate(componentsInChildren[i].get_gameObject());
                }
            }
        }
        MissionEncounter[] componentsInChildren2 = this.enemyPortraitsGroup.GetComponentsInChildren <MissionEncounter>(true);
        for (int j = 0; j < componentsInChildren2.Length; j++)
        {
            if (componentsInChildren2[j] != null && componentsInChildren2[j] != this.enemyPortraitsGroup.get_transform())
            {
                Object.DestroyImmediate(componentsInChildren2[j].get_gameObject());
            }
        }
        if (this.treasureChestHorde != null && this.treasureChestAlliance != null)
        {
            if (GarrisonStatus.Faction() == PVP_FACTION.HORDE)
            {
                this.treasureChestHorde.SetActive(true);
                this.treasureChestAlliance.SetActive(false);
            }
            else
            {
                this.treasureChestHorde.SetActive(false);
                this.treasureChestAlliance.SetActive(true);
            }
        }
        JamGarrisonMobileMission jamGarrisonMobileMission = (JamGarrisonMobileMission)PersistentMissionData.missionDictionary.get_Item(garrMissionID);

        this.m_missionStartedTime       = jamGarrisonMobileMission.StartTime;
        this.m_missionDurationInSeconds = jamGarrisonMobileMission.MissionDuration;
        for (int k = 0; k < jamGarrisonMobileMission.Encounter.Length; k++)
        {
            GameObject gameObject = Object.Instantiate <GameObject>(this.missionEncounterPrefab);
            gameObject.get_transform().SetParent(this.enemyPortraitsGroup.get_transform(), false);
            MissionEncounter component = gameObject.GetComponent <MissionEncounter>();
            int garrMechanicID         = (jamGarrisonMobileMission.Encounter[k].MechanicID.Length <= 0) ? 0 : jamGarrisonMobileMission.Encounter[k].MechanicID[0];
            component.SetEncounter(jamGarrisonMobileMission.Encounter[k].EncounterID, garrMechanicID);
        }
        GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(garrMissionID);

        this.missionNameText.set_text(record.Name);
        this.missionLocationText.set_text(record.Location);
        this.missioniLevelText.set_text(StaticDB.GetString("ITEM_LEVEL_ABBREVIATION", null) + " " + record.TargetItemLevel);
        GarrMissionTypeRec record2 = StaticDB.garrMissionTypeDB.GetRecord((int)record.GarrMissionTypeID);

        this.missionTypeImage.set_overrideSprite(TextureAtlas.instance.GetAtlasSprite((int)record2.UiTextureAtlasMemberID));
        if (this.missionFollowerSlotGroup != null)
        {
            int num = 0;
            while ((long)num < (long)((ulong)record.MaxFollowers))
            {
                GameObject gameObject2 = Object.Instantiate <GameObject>(this.missionFollowerSlotPrefab);
                gameObject2.get_transform().SetParent(this.missionFollowerSlotGroup.get_transform(), false);
                MissionFollowerSlot component2 = gameObject2.GetComponent <MissionFollowerSlot>();
                component2.m_enemyPortraitsGroup = this.enemyPortraitsGroup;
                num++;
            }
        }
        if (record.UiTextureKitID > 0u)
        {
            UiTextureKitRec record3 = StaticDB.uiTextureKitDB.GetRecord((int)record.UiTextureKitID);
            this.m_scrollingEnvironment_Back.set_enabled(false);
            this.m_scrollingEnvironment_Mid.set_enabled(false);
            this.m_scrollingEnvironment_Fore.set_enabled(false);
            int uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Back");
            if (uITextureAtlasMemberID > 0)
            {
                Sprite atlasSprite = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID);
                if (atlasSprite != null)
                {
                    this.m_scrollingEnvironment_Back.set_enabled(true);
                    this.m_scrollingEnvironment_Back.set_sprite(atlasSprite);
                }
            }
            int uITextureAtlasMemberID2 = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Mid");
            if (uITextureAtlasMemberID2 > 0)
            {
                Sprite atlasSprite2 = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID2);
                if (atlasSprite2 != null)
                {
                    this.m_scrollingEnvironment_Mid.set_enabled(true);
                    this.m_scrollingEnvironment_Mid.set_sprite(atlasSprite2);
                }
            }
            int uITextureAtlasMemberID3 = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Fore");
            if (uITextureAtlasMemberID3 > 0)
            {
                Sprite atlasSprite3 = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID3);
                if (atlasSprite3 != null)
                {
                    this.m_scrollingEnvironment_Fore.set_enabled(true);
                    this.m_scrollingEnvironment_Fore.set_sprite(atlasSprite3);
                }
            }
        }
        else
        {
            Debug.LogWarning(string.Concat(new object[]
            {
                "DATA ERROR: Mission UITextureKit Not Set for mission ID:",
                record.ID,
                " - ",
                record.Name
            }));
            Debug.LogWarning("This means the scrolling background images will show the wrong location");
        }
        if (this.m_lootGroupObj == null || this.m_missionRewardDisplayPrefab == null)
        {
            return;
        }
        MissionRewardDisplay[] componentsInChildren3 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true);
        for (int l = 0; l < componentsInChildren3.Length; l++)
        {
            if (componentsInChildren3[l] != null)
            {
                Object.DestroyImmediate(componentsInChildren3[l].get_gameObject());
            }
        }
        MissionFollowerSlot[] componentsInChildren4 = this.missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true);
        int num2 = 0;

        using (Dictionary <int, JamGarrisonFollower> .ValueCollection.Enumerator enumerator = PersistentFollowerData.followerDictionary.get_Values().GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                JamGarrisonFollower current = enumerator.get_Current();
                if (current.CurrentMissionID == garrMissionID)
                {
                    componentsInChildren4[num2++].SetFollower(current.GarrFollowerID);
                    if (missionResultType == 1)
                    {
                        PersistentFollowerData.CachePreMissionFollower(current);
                    }
                }
            }
        }
        this.UpdateMissionStatus(garrMissionID);
        MissionFollowerSlot[] array = componentsInChildren4;
        for (int m = 0; m < array.Length; m++)
        {
            MissionFollowerSlot missionFollowerSlot = array[m];
            missionFollowerSlot.InitHeartPanel();
        }
        MissionRewardDisplay.InitMissionRewards(this.m_missionRewardDisplayPrefab.get_gameObject(), this.m_lootGroupObj.get_transform(), jamGarrisonMobileMission.Reward);
        if (record.OvermaxRewardPackID > 0 && jamGarrisonMobileMission.OvermaxReward.Length > 0)
        {
            this.m_bonusLootDisplay.SetActive(true);
            JamGarrisonMissionReward jamGarrisonMissionReward = jamGarrisonMobileMission.OvermaxReward[0];
            if (jamGarrisonMissionReward.ItemID > 0)
            {
                this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.item, jamGarrisonMissionReward.ItemID, (int)jamGarrisonMissionReward.ItemQuantity, 0, jamGarrisonMissionReward.ItemFileDataID);
            }
            else if (jamGarrisonMissionReward.FollowerXP > 0u)
            {
                this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.followerXP, 0, (int)jamGarrisonMissionReward.FollowerXP, 0, 0);
            }
            else if (jamGarrisonMissionReward.CurrencyQuantity > 0u)
            {
                if (jamGarrisonMissionReward.CurrencyType == 0)
                {
                    this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.gold, 0, (int)(jamGarrisonMissionReward.CurrencyQuantity / 10000u), 0, 0);
                }
                else
                {
                    CurrencyTypesRec record4 = StaticDB.currencyTypesDB.GetRecord(jamGarrisonMissionReward.CurrencyType);
                    int rewardQuantity       = (int)((ulong)jamGarrisonMissionReward.CurrencyQuantity / (ulong)(((record4.Flags & 8u) == 0u) ? 1L : 100L));
                    this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.currency, jamGarrisonMissionReward.CurrencyType, rewardQuantity, 0, 0);
                }
            }
        }
        this.m_timeUntilFadeOutMissionDetailsDisplay   = this.m_missionDetailsFadeOutDelay;
        this.m_timeUntilShowFollowerExperienceDisplays = this.m_experienceDisplayInitialEntranceDelay;
        if (missionResultType == 2)
        {
            this.InitFollowerExperienceDisplays();
            Main.instance.m_UISound.Play_MissionSuccess();
            this.m_missionInProgressMessage.SetActive(false);
            this.m_missionSuccessMessage.SetActive(true);
            this.m_missionFailMessage.SetActive(false);
            if (this.m_fancyEntrance != null)
            {
                Object.DestroyImmediate(this.m_fancyEntrance);
                iTween.Stop(this.m_missionSuccessMessage);
                this.m_missionSuccessMessage.get_transform().set_localScale(Vector3.get_one());
                iTween.Stop(this.m_missionFailMessage);
                this.m_missionFailMessage.get_transform().set_localScale(Vector3.get_one());
            }
            this.m_missionSuccessMessage.SetActive(false);
            this.m_fancyEntrance = this.m_missionSuccessMessage.AddComponent <FancyEntrance>();
            this.m_fancyEntrance.m_fadeInCanvasGroup   = this.m_missionSuccessMessage.GetComponent <CanvasGroup>();
            this.m_fancyEntrance.m_fadeInTime          = this.m_messageFadeInTime;
            this.m_fancyEntrance.m_punchScale          = this.m_messagePunchScale;
            this.m_fancyEntrance.m_punchScaleAmount    = this.m_messagePunchScaleAmount;
            this.m_fancyEntrance.m_punchScaleDuration  = this.m_messagePunchScaleDuration;
            this.m_fancyEntrance.m_timeToDelayEntrance = this.m_messageTimeToDelayEntrance;
            this.m_missionSuccessMessage.SetActive(true);
            MissionRewardDisplay[] componentsInChildren5 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true);
            for (int n = 0; n < componentsInChildren5.Length; n++)
            {
                componentsInChildren5[n].ShowResultSuccess(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)n);
            }
            if (awardOvermax)
            {
                this.m_bonusMissionRewardDisplay.ShowResultSuccess(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)componentsInChildren5.Length);
            }
            else
            {
                this.m_bonusMissionRewardDisplay.ShowResultFail(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)componentsInChildren5.Length);
            }
        }
        if (missionResultType == 3)
        {
            this.InitFollowerExperienceDisplays();
            Main.instance.m_UISound.Play_MissionFailure();
            this.m_missionInProgressMessage.SetActive(false);
            this.m_missionSuccessMessage.SetActive(false);
            this.m_missionFailMessage.SetActive(true);
            if (this.m_fancyEntrance != null)
            {
                Object.DestroyImmediate(this.m_fancyEntrance);
                iTween.Stop(this.m_missionSuccessMessage);
                this.m_missionSuccessMessage.get_transform().set_localScale(Vector3.get_one());
                iTween.Stop(this.m_missionFailMessage);
                this.m_missionFailMessage.get_transform().set_localScale(Vector3.get_one());
            }
            this.m_missionFailMessage.SetActive(false);
            this.m_fancyEntrance = this.m_missionFailMessage.AddComponent <FancyEntrance>();
            this.m_fancyEntrance.m_fadeInCanvasGroup   = this.m_missionFailMessage.GetComponent <CanvasGroup>();
            this.m_fancyEntrance.m_fadeInTime          = this.m_messageFadeInTime;
            this.m_fancyEntrance.m_punchScale          = this.m_messagePunchScale;
            this.m_fancyEntrance.m_punchScaleAmount    = this.m_messagePunchScaleAmount;
            this.m_fancyEntrance.m_punchScaleDuration  = this.m_messagePunchScaleDuration;
            this.m_fancyEntrance.m_timeToDelayEntrance = this.m_messageTimeToDelayEntrance;
            this.m_missionFailMessage.SetActive(true);
            MissionRewardDisplay[] componentsInChildren6 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true);
            for (int num3 = 0; num3 < componentsInChildren6.Length; num3++)
            {
                componentsInChildren6[num3].ShowResultFail(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)num3);
            }
            this.m_bonusMissionRewardDisplay.ShowResultFail(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)componentsInChildren6.Length);
        }
        if (missionResultType == 0)
        {
            this.m_missionInProgressMessage.SetActive(true);
            this.m_missionSuccessMessage.SetActive(false);
            this.m_missionFailMessage.SetActive(false);
            this.m_bonusMissionRewardDisplay.ClearResults();
        }
        if (missionResultType == 1)
        {
            this.m_missionInProgressMessage.SetActive(false);
            this.m_missionSuccessMessage.SetActive(false);
            this.m_missionFailMessage.SetActive(false);
            FollowerExperienceDisplay[] componentsInChildren7 = this.m_followerExperienceDisplayArea.GetComponentsInChildren <FollowerExperienceDisplay>(true);
            FollowerExperienceDisplay[] array2 = componentsInChildren7;
            for (int num4 = 0; num4 < array2.Length; num4++)
            {
                FollowerExperienceDisplay followerExperienceDisplay = array2[num4];
                Object.DestroyImmediate(followerExperienceDisplay.get_gameObject());
            }
        }
        if (this.m_partyBuffGroup != null)
        {
            AbilityDisplay[] componentsInChildren8 = this.m_partyBuffGroup.GetComponentsInChildren <AbilityDisplay>(true);
            AbilityDisplay[] array3 = componentsInChildren8;
            for (int num5 = 0; num5 < array3.Length; num5++)
            {
                AbilityDisplay abilityDisplay = array3[num5];
                Object.DestroyImmediate(abilityDisplay.get_gameObject());
            }
        }
        int num6 = 0;

        using (Dictionary <int, JamGarrisonFollower> .ValueCollection.Enumerator enumerator2 = PersistentFollowerData.followerDictionary.get_Values().GetEnumerator())
        {
            while (enumerator2.MoveNext())
            {
                JamGarrisonFollower current2 = enumerator2.get_Current();
                if (current2.CurrentMissionID == garrMissionID)
                {
                    int[] buffsForCurrentMission = GeneralHelpers.GetBuffsForCurrentMission(current2.GarrFollowerID, garrMissionID, this.missionFollowerSlotGroup);
                    num6 += buffsForCurrentMission.Length;
                    int[] array4 = buffsForCurrentMission;
                    for (int num7 = 0; num7 < array4.Length; num7++)
                    {
                        int        garrAbilityID = array4[num7];
                        GameObject gameObject3   = Object.Instantiate <GameObject>(this.m_mechanicEffectDisplayPrefab);
                        gameObject3.get_transform().SetParent(this.m_partyBuffGroup.get_transform(), false);
                        AbilityDisplay component3 = gameObject3.GetComponent <AbilityDisplay>();
                        component3.SetAbility(garrAbilityID, false, false, null);
                    }
                }
            }
        }
        this.m_partyBuffGroup.SetActive(num6 > 0);
    }
    public void SetQuest(int questID)
    {
        this.m_expiringSoon.get_gameObject().SetActive(false);
        this.m_questID = questID;
        Transform[] componentsInChildren = this.m_worldQuestObjectiveRoot.GetComponentsInChildren <Transform>(true);
        Transform[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            Transform transform = array[i];
            if (transform != null && transform != this.m_worldQuestObjectiveRoot.get_transform())
            {
                Object.DestroyImmediate(transform.get_gameObject());
            }
        }
        MobileWorldQuest mobileWorldQuest = (MobileWorldQuest)WorldQuestData.worldQuestDictionary.get_Item(this.m_questID);

        this.m_worldQuestNameText.set_text(mobileWorldQuest.QuestTitle);
        using (IEnumerator <MobileWorldQuestObjective> enumerator = Enumerable.AsEnumerable <MobileWorldQuestObjective>(mobileWorldQuest.Objective).GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                MobileWorldQuestObjective current = enumerator.get_Current();
                GameObject gameObject             = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab);
                gameObject.get_transform().SetParent(this.m_worldQuestObjectiveRoot.get_transform(), false);
                Text component = gameObject.GetComponent <Text>();
                component.set_text("-" + current.Text);
            }
        }
        this.InitRewardInfoDisplay(mobileWorldQuest);
        this.m_endTime = (long)(mobileWorldQuest.EndTime - 900);
        QuestInfoRec record = StaticDB.questInfoDB.GetRecord(mobileWorldQuest.QuestInfoID);

        if (record == null)
        {
            return;
        }
        bool active = (record.Modifiers & 2) != 0;

        this.m_dragonFrame.get_gameObject().SetActive(active);
        this.m_background.set_sprite(Resources.Load <Sprite>("NewWorldQuest/Mobile-NormalQuest"));
        bool flag = (record.Modifiers & 1) != 0;

        if (flag && record.Type != 3)
        {
            this.m_background.set_sprite(Resources.Load <Sprite>("NewWorldQuest/Mobile-RareQuest"));
        }
        bool flag2 = (record.Modifiers & 4) != 0;

        if (flag2 && record.Type != 3)
        {
            this.m_background.set_sprite(Resources.Load <Sprite>("NewWorldQuest/Mobile-EpicQuest"));
        }
        int    uITextureAtlasMemberID;
        string text;

        switch (record.Type)
        {
        case 1:
        {
            int profession = record.Profession;
            switch (profession)
            {
            case 182:
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-herbalism");
                text = "Mobile-Herbalism";
                goto IL_46E;

            case 183:
            case 184:
IL_259:
                if (profession == 164)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-blacksmithing");
                    text = "Mobile-Blacksmithing";
                    goto IL_46E;
                }
                if (profession == 165)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-leatherworking");
                    text = "Mobile-Leatherworking";
                    goto IL_46E;
                }
                if (profession == 129)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-firstaid");
                    text = "Mobile-FirstAid";
                    goto IL_46E;
                }
                if (profession == 171)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-alchemy");
                    text = "Mobile-Alchemy";
                    goto IL_46E;
                }
                if (profession == 197)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-tailoring");
                    text = "Mobile-Tailoring";
                    goto IL_46E;
                }
                if (profession == 202)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-engineering");
                    text = "Mobile-Engineering";
                    goto IL_46E;
                }
                if (profession == 333)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-enchanting");
                    text = "Mobile-Enchanting";
                    goto IL_46E;
                }
                if (profession == 356)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-fishing");
                    text = "Mobile-Fishing";
                    goto IL_46E;
                }
                if (profession == 393)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-skinning");
                    text = "Mobile-Skinning";
                    goto IL_46E;
                }
                if (profession == 755)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-jewelcrafting");
                    text = "Mobile-Jewelcrafting";
                    goto IL_46E;
                }
                if (profession == 773)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-inscription");
                    text = "Mobile-Inscription";
                    goto IL_46E;
                }
                if (profession != 794)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
                    text = "Mobile-QuestExclamationIcon";
                    goto IL_46E;
                }
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-archaeology");
                text = "Mobile-Archaeology";
                goto IL_46E;

            case 185:
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-cooking");
                text = "Mobile-Cooking";
                goto IL_46E;

            case 186:
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-mining");
                text = "Mobile-Mining";
                goto IL_46E;
            }
            goto IL_259;
IL_46E:
            goto IL_4BB;
        }

        case 3:
            uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-pvp-ffa");
            text = "Mobile-PVP";
            goto IL_4BB;

        case 4:
            uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-petbattle");
            text = "Mobile-Pets";
            goto IL_4BB;
        }
        uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
        text = "Mobile-QuestExclamationIcon";
IL_4BB:
        if (text != null)
        {
            this.m_main.set_sprite(Resources.Load <Sprite>("NewWorldQuest/" + text));
        }
        else if (uITextureAtlasMemberID > 0)
        {
            this.m_main.set_sprite(TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID));
            this.m_main.SetNativeSize();
        }
        this.UpdateTimeRemaining();
    }
    public void SetMission(JamGarrisonMobileMission mission)
    {
        this.m_statusDarkener.get_gameObject().SetActive(false);
        this.m_statusText.get_gameObject().SetActive(false);
        this.m_mission = mission;
        GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(mission.MissionRecID);

        if (record == null)
        {
            return;
        }
        if (this.m_missionTypeIcon != null)
        {
            GarrMissionTypeRec record2 = StaticDB.garrMissionTypeDB.GetRecord((int)record.GarrMissionTypeID);
            this.m_missionTypeIcon.set_sprite(TextureAtlas.instance.GetAtlasSprite((int)record2.UiTextureAtlasMemberID));
        }
        bool flag = false;

        if (mission.MissionState == 1)
        {
            flag = true;
            this.m_statusDarkener.get_gameObject().SetActive(true);
            this.m_statusDarkener.set_color(new Color(0f, 0f, 0f, 0.3529412f));
            this.m_statusText.get_gameObject().SetActive(true);
            this.m_missionTime.get_gameObject().SetActive(false);
        }
        this.m_previewMechanicsGroup.SetActive(!flag);
        Duration duration = new Duration(record.MissionDuration, false);
        string   text;

        if (duration.DurationValue >= 28800)
        {
            text = "<color=#ff8600ff>" + duration.DurationString + "</color>";
        }
        else
        {
            text = "<color=#BEBEBEFF>" + duration.DurationString + "</color>";
        }
        this.m_missionTime.set_text("(" + text + ")");
        this.m_missionName.set_text(record.Name);
        if (this.m_missionLevel != null)
        {
            if (record.TargetLevel < 110)
            {
                this.m_missionLevel.set_text(string.Empty + record.TargetLevel);
            }
            else
            {
                this.m_missionLevel.set_text(string.Concat(new object[]
                {
                    string.Empty,
                    record.TargetLevel,
                    "\n(",
                    record.TargetItemLevel,
                    ")"
                }));
            }
        }
        bool flag2 = (record.Flags & 1u) != 0u;

        this.m_expirationText.get_gameObject().SetActive(flag2);
        this.m_rareMissionLabel.get_gameObject().SetActive(flag2);
        this.m_rareMissionHighlight.get_gameObject().SetActive(flag2);
        if (flag2)
        {
            this.m_missionTypeBG.set_color(new Color(0f, 0f, 1f, 0.24f));
        }
        else
        {
            this.m_missionTypeBG.set_color(new Color(0f, 0f, 0f, 0.478f));
        }
        this.m_missionLocation.set_enabled(false);
        UiTextureKitRec record3 = StaticDB.uiTextureKitDB.GetRecord((int)record.UiTextureKitID);

        if (record3 != null)
        {
            int uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID(record3.KitPrefix + "-List");
            if (uITextureAtlasMemberID > 0)
            {
                Sprite atlasSprite = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID);
                if (atlasSprite != null)
                {
                    this.m_missionLocation.set_enabled(true);
                    this.m_missionLocation.set_sprite(atlasSprite);
                }
            }
        }
        this.UpdateMechanicPreview(flag, mission);
        MissionRewardDisplay[] componentsInChildren = this.m_previewLootGroup.GetComponentsInChildren <MissionRewardDisplay>(true);
        for (int i = 0; i < componentsInChildren.Length; i++)
        {
            if (componentsInChildren[i] != null)
            {
                Object.DestroyImmediate(componentsInChildren[i].get_gameObject());
            }
        }
        MissionRewardDisplay.InitMissionRewards(this.m_missionRewardDisplayPrefab.get_gameObject(), this.m_previewLootGroup.get_transform(), mission.Reward);
    }
    public void SetQuestID(int questID)
    {
        this.m_questID       = questID;
        base.gameObject.name = "WorldQuest " + this.m_questID;
        MobileWorldQuest mobileWorldQuest = (MobileWorldQuest)WorldQuestData.worldQuestDictionary[this.m_questID];

        if (mobileWorldQuest == null || mobileWorldQuest.Item == null)
        {
            return;
        }
        this.m_quantityArea.gameObject.SetActive(false);
        bool flag = false;

        foreach (MobileWorldQuestReward mobileWorldQuestReward in mobileWorldQuest.Item)
        {
            ItemRec record = StaticDB.itemDB.GetRecord(mobileWorldQuestReward.RecordID);
            if (record == null)
            {
                Debug.LogWarning(string.Concat(new object[]
                {
                    "Invalid Item ID ",
                    mobileWorldQuestReward.RecordID,
                    " from Quest ID ",
                    this.m_questID,
                    ". Ignoring for loot quality check."
                }));
            }
            else
            {
                flag = true;
                if (record.OverallQualityID > (int)this.m_lootQuality)
                {
                    this.m_lootQuality = (ITEM_QUALITY)record.OverallQualityID;
                }
                if (this.m_showLootIconInsteadOfMain)
                {
                    bool isArtifactXP = false;
                    long quantity     = 0L;
                    StaticDB.itemEffectDB.EnumRecordsByParentID(mobileWorldQuestReward.RecordID, delegate(ItemEffectRec itemEffectRec)
                    {
                        StaticDB.spellEffectDB.EnumRecordsByParentID(itemEffectRec.SpellID, delegate(SpellEffectRec spellEffectRec)
                        {
                            if (spellEffectRec.Effect == 240)
                            {
                                isArtifactXP = true;
                                quantity     = GeneralHelpers.ApplyArtifactXPMultiplier((long)spellEffectRec.EffectBasePoints, (double)GarrisonStatus.ArtifactXpMultiplier);
                                return(false);
                            }
                            return(true);
                        });
                        return(!isArtifactXP);
                    });
                    if (isArtifactXP)
                    {
                        this.m_main.sprite = Resources.Load <Sprite>("WorldMap/INV_Artifact_XP02");
                        if (AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.ArtifactPower))
                        {
                            this.m_quantityArea.gameObject.SetActive(true);
                            this.m_quantity.text = quantity.ToString();
                        }
                    }
                    else
                    {
                        this.m_main.sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, mobileWorldQuestReward.FileDataID);
                        this.m_itemID      = mobileWorldQuestReward.RecordID;
                        this.m_itemContext = mobileWorldQuestReward.ItemContext;
                        this.ShowILVL();
                    }
                }
            }
        }
        if (!flag && this.m_showLootIconInsteadOfMain)
        {
            if (mobileWorldQuest.Currency.GetLength(0) > 0)
            {
                foreach (MobileWorldQuestReward mobileWorldQuestReward2 in mobileWorldQuest.Currency)
                {
                    CurrencyTypesRec record2 = StaticDB.currencyTypesDB.GetRecord(mobileWorldQuestReward2.RecordID);
                    if (record2 != null)
                    {
                        this.m_main.sprite = GeneralHelpers.LoadCurrencyIcon(mobileWorldQuestReward2.RecordID);
                    }
                    if (AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.OrderResources))
                    {
                        this.m_quantityArea.gameObject.SetActive(true);
                        this.m_quantity.text = mobileWorldQuestReward2.Quantity.ToString();
                    }
                }
            }
            else if (mobileWorldQuest.Money > 0)
            {
                this.m_main.sprite = Resources.Load <Sprite>("MiscIcons/INV_Misc_Coin_01");
                if (AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.Gold))
                {
                    this.m_quantityArea.gameObject.SetActive(true);
                    this.m_quantity.text = string.Empty + mobileWorldQuest.Money / 100 / 100;
                }
            }
            else if (mobileWorldQuest.Experience > 0)
            {
                this.m_main.sprite = GeneralHelpers.GetLocalizedFollowerXpIcon();
            }
        }
        this.m_endTime = (long)mobileWorldQuest.EndTime;
        int             areaID  = 0;
        WorldMapAreaRec record3 = StaticDB.worldMapAreaDB.GetRecord(mobileWorldQuest.WorldMapAreaID);

        if (record3 != null)
        {
            areaID = record3.AreaID;
        }
        this.m_areaID = areaID;
        QuestInfoRec record4 = StaticDB.questInfoDB.GetRecord(mobileWorldQuest.QuestInfoID);

        if (record4 == null)
        {
            return;
        }
        bool active = (record4.Modifiers & 2) != 0;

        this.m_dragonFrame.gameObject.SetActive(active);
        bool flag2 = record4.Type == 7;

        this.m_normalGlow.gameObject.SetActive(!flag2);
        this.m_legionAssaultGlow.gameObject.SetActive(flag2);
        bool flag3 = (record4.Modifiers & 1) != 0;

        if (flag3 && record4.Type != 3)
        {
            this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-RareQuest");
        }
        bool flag4 = (record4.Modifiers & 4) != 0;

        if (flag4 && record4.Type != 3)
        {
            this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-EpicQuest");
        }
        int    uitextureAtlasMemberID;
        string text;

        switch (record4.Type)
        {
        case 1:
        {
            int profession = record4.Profession;
            switch (profession)
            {
            case 182:
                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-herbalism");
                text = "Mobile-Herbalism";
                break;

            default:
                if (profession != 164)
                {
                    if (profession != 165)
                    {
                        if (profession != 129)
                        {
                            if (profession != 171)
                            {
                                if (profession != 197)
                                {
                                    if (profession != 202)
                                    {
                                        if (profession != 333)
                                        {
                                            if (profession != 356)
                                            {
                                                if (profession != 393)
                                                {
                                                    if (profession != 755)
                                                    {
                                                        if (profession != 773)
                                                        {
                                                            if (profession != 794)
                                                            {
                                                                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
                                                                text = "Mobile-QuestExclamationIcon";
                                                            }
                                                            else
                                                            {
                                                                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-archaeology");
                                                                text = "Mobile-Archaeology";
                                                            }
                                                        }
                                                        else
                                                        {
                                                            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-inscription");
                                                            text = "Mobile-Inscription";
                                                        }
                                                    }
                                                    else
                                                    {
                                                        uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-jewelcrafting");
                                                        text = "Mobile-Jewelcrafting";
                                                    }
                                                }
                                                else
                                                {
                                                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-skinning");
                                                    text = "Mobile-Skinning";
                                                }
                                            }
                                            else
                                            {
                                                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-fishing");
                                                text = "Mobile-Fishing";
                                            }
                                        }
                                        else
                                        {
                                            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-enchanting");
                                            text = "Mobile-Enchanting";
                                        }
                                    }
                                    else
                                    {
                                        uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-engineering");
                                        text = "Mobile-Engineering";
                                    }
                                }
                                else
                                {
                                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-tailoring");
                                    text = "Mobile-Tailoring";
                                }
                            }
                            else
                            {
                                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-alchemy");
                                text = "Mobile-Alchemy";
                            }
                        }
                        else
                        {
                            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-firstaid");
                            text = "Mobile-FirstAid";
                        }
                    }
                    else
                    {
                        uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-leatherworking");
                        text = "Mobile-Leatherworking";
                    }
                }
                else
                {
                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-blacksmithing");
                    text = "Mobile-Blacksmithing";
                }
                break;

            case 185:
                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-cooking");
                text = "Mobile-Cooking";
                break;

            case 186:
                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-mining");
                text = "Mobile-Mining";
                break;
            }
            goto IL_70A;
        }

        case 3:
            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-pvp-ffa");
            text = "Mobile-PVP";
            goto IL_70A;

        case 4:
            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-petbattle");
            text = "Mobile-Pets";
            goto IL_70A;
        }
        uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
        text = "Mobile-QuestExclamationIcon";
IL_70A:
        if (!this.m_showLootIconInsteadOfMain)
        {
            if (text != null)
            {
                this.m_main.sprite = Resources.Load <Sprite>("NewWorldQuest/" + text);
            }
            else if (uitextureAtlasMemberID > 0)
            {
                this.m_main.sprite = TextureAtlas.instance.GetAtlasSprite(uitextureAtlasMemberID);
                this.m_main.SetNativeSize();
            }
        }
    }
示例#5
0
    public void SetQuestID(int questID)
    {
        this.m_questID = questID;
        base.get_gameObject().set_name("WorldQuest " + this.m_questID);
        MobileWorldQuest mobileWorldQuest = (MobileWorldQuest)WorldQuestData.worldQuestDictionary.get_Item(this.m_questID);

        if (mobileWorldQuest == null || mobileWorldQuest.Item == null)
        {
            return;
        }
        MobileWorldQuestReward[] item = mobileWorldQuest.Item;
        for (int i = 0; i < item.Length; i++)
        {
            MobileWorldQuestReward mobileWorldQuestReward = item[i];
            ItemRec record = StaticDB.itemDB.GetRecord(mobileWorldQuestReward.RecordID);
            if (record == null)
            {
                Debug.LogWarning(string.Concat(new object[]
                {
                    "Invalid Item ID ",
                    mobileWorldQuestReward.RecordID,
                    " from Quest ID ",
                    this.m_questID,
                    ". Ignoring for loot quality check."
                }));
            }
            else
            {
                if (record.OverallQualityID > (int)this.m_lootQuality)
                {
                    this.m_lootQuality = (ITEM_QUALITY)record.OverallQualityID;
                }
                if (this.m_showLootIconInsteadOfMain)
                {
                    this.m_main.set_sprite(GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, mobileWorldQuestReward.FileDataID));
                }
            }
        }
        if (this.m_showLootIconInsteadOfMain)
        {
            if (mobileWorldQuest.Money > 0)
            {
                this.m_main.set_sprite(Resources.Load <Sprite>("MiscIcons/INV_Misc_Coin_01"));
            }
            if (mobileWorldQuest.Experience > 0)
            {
                this.m_main.set_sprite(GeneralHelpers.GetLocalizedFollowerXpIcon());
            }
            MobileWorldQuestReward[] currency = mobileWorldQuest.Currency;
            for (int j = 0; j < currency.Length; j++)
            {
                MobileWorldQuestReward mobileWorldQuestReward2 = currency[j];
                CurrencyTypesRec       record2 = StaticDB.currencyTypesDB.GetRecord(mobileWorldQuestReward2.RecordID);
                if (record2 != null)
                {
                    this.m_main.set_sprite(GeneralHelpers.LoadCurrencyIcon(mobileWorldQuestReward2.RecordID));
                }
            }
        }
        this.m_endTime = (long)mobileWorldQuest.EndTime;
        int             areaID  = 0;
        WorldMapAreaRec record3 = StaticDB.worldMapAreaDB.GetRecord(mobileWorldQuest.WorldMapAreaID);

        if (record3 != null)
        {
            areaID = record3.AreaID;
        }
        this.m_areaID = areaID;
        QuestInfoRec record4 = StaticDB.questInfoDB.GetRecord(mobileWorldQuest.QuestInfoID);

        if (record4 == null)
        {
            return;
        }
        bool active = (record4.Modifiers & 2) != 0;

        this.m_dragonFrame.get_gameObject().SetActive(active);
        bool flag = (record4.Modifiers & 1) != 0;

        if (flag && record4.Type != 3)
        {
            this.m_background.set_sprite(Resources.Load <Sprite>("NewWorldQuest/Mobile-RareQuest"));
        }
        bool flag2 = (record4.Modifiers & 4) != 0;

        if (flag2 && record4.Type != 3)
        {
            this.m_background.set_sprite(Resources.Load <Sprite>("NewWorldQuest/Mobile-EpicQuest"));
        }
        int    uITextureAtlasMemberID;
        string text;

        switch (record4.Type)
        {
        case 1:
        {
            int profession = record4.Profession;
            switch (profession)
            {
            case 182:
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-herbalism");
                text = "Mobile-Herbalism";
                goto IL_50E;

            case 183:
            case 184:
IL_2F9:
                if (profession == 164)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-blacksmithing");
                    text = "Mobile-Blacksmithing";
                    goto IL_50E;
                }
                if (profession == 165)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-leatherworking");
                    text = "Mobile-Leatherworking";
                    goto IL_50E;
                }
                if (profession == 129)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-firstaid");
                    text = "Mobile-FirstAid";
                    goto IL_50E;
                }
                if (profession == 171)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-alchemy");
                    text = "Mobile-Alchemy";
                    goto IL_50E;
                }
                if (profession == 197)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-tailoring");
                    text = "Mobile-Tailoring";
                    goto IL_50E;
                }
                if (profession == 202)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-engineering");
                    text = "Mobile-Engineering";
                    goto IL_50E;
                }
                if (profession == 333)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-enchanting");
                    text = "Mobile-Enchanting";
                    goto IL_50E;
                }
                if (profession == 356)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-fishing");
                    text = "Mobile-Fishing";
                    goto IL_50E;
                }
                if (profession == 393)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-skinning");
                    text = "Mobile-Skinning";
                    goto IL_50E;
                }
                if (profession == 755)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-jewelcrafting");
                    text = "Mobile-Jewelcrafting";
                    goto IL_50E;
                }
                if (profession == 773)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-inscription");
                    text = "Mobile-Inscription";
                    goto IL_50E;
                }
                if (profession != 794)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
                    text = "Mobile-QuestExclamationIcon";
                    goto IL_50E;
                }
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-archaeology");
                text = "Mobile-Archaeology";
                goto IL_50E;

            case 185:
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-cooking");
                text = "Mobile-Cooking";
                goto IL_50E;

            case 186:
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-mining");
                text = "Mobile-Mining";
                goto IL_50E;
            }
            goto IL_2F9;
IL_50E:
            goto IL_55B;
        }

        case 3:
            uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-pvp-ffa");
            text = "Mobile-PVP";
            goto IL_55B;

        case 4:
            uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-petbattle");
            text = "Mobile-Pets";
            goto IL_55B;
        }
        uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
        text = "Mobile-QuestExclamationIcon";
IL_55B:
        if (!this.m_showLootIconInsteadOfMain)
        {
            if (text != null)
            {
                this.m_main.set_sprite(Resources.Load <Sprite>("NewWorldQuest/" + text));
            }
            else if (uITextureAtlasMemberID > 0)
            {
                this.m_main.set_sprite(TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID));
                this.m_main.SetNativeSize();
            }
        }
    }
    public void ShowMissionResults(int garrMissionID, int missionResultType, bool awardOvermax)
    {
        GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(garrMissionID);

        if (record == null)
        {
            return;
        }
        this.m_missionResultsDisplayCanvasGroupAutoFadeOut.Reset();
        this.m_currentResultType = (MissionResultType)missionResultType;
        this.m_followerExperienceDisplayArea.SetActive(false);
        this.m_attemptedAutoComplete = false;
        this.m_garrMissionID         = garrMissionID;
        this.m_darknessBG.SetActive(true);
        this.m_popupView.SetActive(true);
        this.m_bonusLootDisplay.SetActive(false);
        if (this.missionFollowerSlotGroup != null)
        {
            MissionFollowerSlot[] componentsInChildren = this.missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true);
            for (int i = 0; i < componentsInChildren.Length; i++)
            {
                if (componentsInChildren[i] != null && componentsInChildren[i] != this.missionFollowerSlotGroup.transform)
                {
                    Object.DestroyImmediate(componentsInChildren[i].gameObject);
                }
            }
        }
        MissionEncounter[] componentsInChildren2 = this.enemyPortraitsGroup.GetComponentsInChildren <MissionEncounter>(true);
        for (int j = 0; j < componentsInChildren2.Length; j++)
        {
            if (componentsInChildren2[j] != null && componentsInChildren2[j] != this.enemyPortraitsGroup.transform)
            {
                Object.DestroyImmediate(componentsInChildren2[j].gameObject);
            }
        }
        if (this.treasureChestHorde != null && this.treasureChestAlliance != null)
        {
            if (GarrisonStatus.Faction() == PVP_FACTION.HORDE)
            {
                this.treasureChestHorde.SetActive(true);
                this.treasureChestAlliance.SetActive(false);
            }
            else
            {
                this.treasureChestHorde.SetActive(false);
                this.treasureChestAlliance.SetActive(true);
            }
        }
        JamGarrisonMobileMission jamGarrisonMobileMission = (JamGarrisonMobileMission)PersistentMissionData.missionDictionary[garrMissionID];

        this.m_missionStartedTime       = jamGarrisonMobileMission.StartTime;
        this.m_missionDurationInSeconds = jamGarrisonMobileMission.MissionDuration;
        for (int k = 0; k < jamGarrisonMobileMission.Encounter.Length; k++)
        {
            GameObject gameObject = Object.Instantiate <GameObject>(this.missionEncounterPrefab);
            gameObject.transform.SetParent(this.enemyPortraitsGroup.transform, false);
            MissionEncounter component = gameObject.GetComponent <MissionEncounter>();
            int garrMechanicID         = (jamGarrisonMobileMission.Encounter[k].MechanicID.Length <= 0) ? 0 : jamGarrisonMobileMission.Encounter[k].MechanicID[0];
            component.SetEncounter(jamGarrisonMobileMission.Encounter[k].EncounterID, garrMechanicID);
        }
        this.missionNameText.text     = record.Name;
        this.missionLocationText.text = record.Location;
        this.missioniLevelText.text   = StaticDB.GetString("ITEM_LEVEL_ABBREVIATION", null) + " " + record.TargetItemLevel;
        GarrMissionTypeRec record2 = StaticDB.garrMissionTypeDB.GetRecord((int)record.GarrMissionTypeID);

        this.missionTypeImage.overrideSprite = TextureAtlas.instance.GetAtlasSprite((int)record2.UiTextureAtlasMemberID);
        if (this.missionFollowerSlotGroup != null)
        {
            int num = 0;
            while ((long)num < (long)((ulong)record.MaxFollowers))
            {
                GameObject gameObject2 = Object.Instantiate <GameObject>(this.missionFollowerSlotPrefab);
                gameObject2.transform.SetParent(this.missionFollowerSlotGroup.transform, false);
                MissionFollowerSlot component2 = gameObject2.GetComponent <MissionFollowerSlot>();
                component2.m_enemyPortraitsGroup = this.enemyPortraitsGroup;
                num++;
            }
        }
        if (record.UiTextureKitID > 0u)
        {
            UiTextureKitRec record3 = StaticDB.uiTextureKitDB.GetRecord((int)record.UiTextureKitID);
            this.m_scrollingEnvironment_Back.enabled = false;
            this.m_scrollingEnvironment_Mid.enabled  = false;
            this.m_scrollingEnvironment_Fore.enabled = false;
            int uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Back");
            if (uitextureAtlasMemberID > 0)
            {
                Sprite atlasSprite = TextureAtlas.instance.GetAtlasSprite(uitextureAtlasMemberID);
                if (atlasSprite != null)
                {
                    this.m_scrollingEnvironment_Back.enabled = true;
                    this.m_scrollingEnvironment_Back.sprite  = atlasSprite;
                }
            }
            int uitextureAtlasMemberID2 = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Mid");
            if (uitextureAtlasMemberID2 > 0)
            {
                Sprite atlasSprite2 = TextureAtlas.instance.GetAtlasSprite(uitextureAtlasMemberID2);
                if (atlasSprite2 != null)
                {
                    this.m_scrollingEnvironment_Mid.enabled = true;
                    this.m_scrollingEnvironment_Mid.sprite  = atlasSprite2;
                }
            }
            int uitextureAtlasMemberID3 = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Fore");
            if (uitextureAtlasMemberID3 > 0)
            {
                Sprite atlasSprite3 = TextureAtlas.instance.GetAtlasSprite(uitextureAtlasMemberID3);
                if (atlasSprite3 != null)
                {
                    this.m_scrollingEnvironment_Fore.enabled = true;
                    this.m_scrollingEnvironment_Fore.sprite  = atlasSprite3;
                }
            }
        }
        else
        {
            Debug.LogWarning(string.Concat(new object[]
            {
                "DATA ERROR: Mission UITextureKit Not Set for mission ID:",
                record.ID,
                " - ",
                record.Name
            }));
            Debug.LogWarning("This means the scrolling background images will show the wrong location");
        }
        if (this.m_lootGroupObj == null || this.m_missionRewardDisplayPrefab == null)
        {
            return;
        }
        MissionRewardDisplay[] componentsInChildren3 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true);
        for (int l = 0; l < componentsInChildren3.Length; l++)
        {
            if (componentsInChildren3[l] != null)
            {
                Object.DestroyImmediate(componentsInChildren3[l].gameObject);
            }
        }
        if (missionResultType == 1)
        {
            PersistentFollowerData.ClearPreMissionFollowerData();
        }
        List <JamGarrisonFollower> list = new List <JamGarrisonFollower>();

        MissionFollowerSlot[] componentsInChildren4 = this.missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true);
        int num2 = 0;

        foreach (JamGarrisonFollower jamGarrisonFollower in PersistentFollowerData.followerDictionary.Values)
        {
            if (jamGarrisonFollower.CurrentMissionID == garrMissionID)
            {
                componentsInChildren4[num2++].SetFollower(jamGarrisonFollower.GarrFollowerID);
                if (missionResultType == 1)
                {
                    PersistentFollowerData.CachePreMissionFollower(jamGarrisonFollower);
                }
                list.Add(jamGarrisonFollower);
            }
        }
        this.UpdateMissionStatus(garrMissionID);
        foreach (MissionFollowerSlot missionFollowerSlot in componentsInChildren4)
        {
            missionFollowerSlot.InitHeartPanel();
        }
        MissionRewardDisplay.InitMissionRewards(this.m_missionRewardDisplayPrefab.gameObject, this.m_lootGroupObj.transform, jamGarrisonMobileMission.Reward);
        if (record.OvermaxRewardPackID > 0 && jamGarrisonMobileMission.OvermaxReward.Length > 0)
        {
            this.m_bonusLootDisplay.SetActive(true);
            JamGarrisonMissionReward jamGarrisonMissionReward = jamGarrisonMobileMission.OvermaxReward[0];
            if (jamGarrisonMissionReward.ItemID > 0)
            {
                this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.item, jamGarrisonMissionReward.ItemID, (int)jamGarrisonMissionReward.ItemQuantity, 0, jamGarrisonMissionReward.ItemFileDataID);
            }
            else if (jamGarrisonMissionReward.FollowerXP > 0u)
            {
                this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.followerXP, 0, (int)jamGarrisonMissionReward.FollowerXP, 0, 0);
            }
            else if (jamGarrisonMissionReward.CurrencyQuantity > 0u)
            {
                if (jamGarrisonMissionReward.CurrencyType == 0)
                {
                    this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.gold, 0, (int)(jamGarrisonMissionReward.CurrencyQuantity / 10000u), 0, 0);
                }
                else
                {
                    CurrencyTypesRec record4 = StaticDB.currencyTypesDB.GetRecord(jamGarrisonMissionReward.CurrencyType);
                    int rewardQuantity       = (int)((ulong)jamGarrisonMissionReward.CurrencyQuantity / (ulong)(((record4.Flags & 8u) == 0u) ? 1L : 100L));
                    this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.currency, jamGarrisonMissionReward.CurrencyType, rewardQuantity, 0, 0);
                }
            }
        }
        this.m_timeUntilFadeOutMissionDetailsDisplay   = this.m_missionDetailsFadeOutDelay;
        this.m_timeUntilShowFollowerExperienceDisplays = this.m_experienceDisplayInitialEntranceDelay;
        if (missionResultType == 2)
        {
            this.InitFollowerExperienceDisplays();
            this.m_missionInProgressMessage.SetActive(false);
            this.m_missionSuccessMessage.SetActive(true);
            this.m_missionFailMessage.SetActive(false);
            if (this.m_fancyEntrance != null)
            {
                Object.DestroyImmediate(this.m_fancyEntrance);
                iTween.Stop(this.m_missionSuccessMessage);
                this.m_missionSuccessMessage.transform.localScale = Vector3.one;
                iTween.Stop(this.m_missionFailMessage);
                this.m_missionFailMessage.transform.localScale = Vector3.one;
            }
            this.m_missionSuccessMessage.SetActive(false);
            this.m_fancyEntrance = this.m_missionSuccessMessage.AddComponent <FancyEntrance>();
            this.m_fancyEntrance.m_fadeInCanvasGroup         = this.m_missionSuccessMessage.GetComponent <CanvasGroup>();
            this.m_fancyEntrance.m_fadeInTime                = this.m_messageFadeInTime;
            this.m_fancyEntrance.m_punchScale                = this.m_messagePunchScale;
            this.m_fancyEntrance.m_punchScaleAmount          = this.m_messagePunchScaleAmount;
            this.m_fancyEntrance.m_punchScaleDuration        = this.m_messagePunchScaleDuration;
            this.m_fancyEntrance.m_timeToDelayEntrance       = this.m_messageTimeToDelayEntrance;
            this.m_fancyEntrance.m_activateOnEnable          = true;
            this.m_fancyEntrance.m_objectToNotifyOnBegin     = base.gameObject;
            this.m_fancyEntrance.m_notifyOnBeginCallbackName = "OnShowSuccessMessage";
            this.m_missionSuccessMessage.SetActive(true);
            MissionRewardDisplay[] componentsInChildren5 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true);
            for (int n = 0; n < componentsInChildren5.Length; n++)
            {
                componentsInChildren5[n].ShowResultSuccess(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)n);
            }
            if (this.m_bonusLootChance > 0)
            {
                iTween.ValueTo(base.gameObject, iTween.Hash(new object[]
                {
                    "name",
                    "ShakeIt",
                    "from",
                    0.3f,
                    "to",
                    1f,
                    "delay",
                    this.m_bonusLootShakeInitialDelay,
                    "time",
                    this.m_bonusLootShakeDuration,
                    "onupdate",
                    "OnBonusLootShakeUpdate",
                    "oncomplete",
                    "OnBonusLootShakeComplete"
                }));
            }
            if (awardOvermax)
            {
                this.m_bonusMissionRewardDisplay.ShowResultSuccess(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)componentsInChildren5.Length);
            }
            else
            {
                this.m_bonusMissionRewardDisplay.ShowResultFail(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)componentsInChildren5.Length);
            }
        }
        if (missionResultType == 3)
        {
            this.InitFollowerExperienceDisplays();
            this.m_missionInProgressMessage.SetActive(false);
            this.m_missionSuccessMessage.SetActive(false);
            this.m_missionFailMessage.SetActive(true);
            if (this.m_fancyEntrance != null)
            {
                Object.DestroyImmediate(this.m_fancyEntrance);
                iTween.Stop(this.m_missionSuccessMessage);
                this.m_missionSuccessMessage.transform.localScale = Vector3.one;
                iTween.Stop(this.m_missionFailMessage);
                this.m_missionFailMessage.transform.localScale = Vector3.one;
            }
            this.m_missionFailMessage.SetActive(false);
            this.m_fancyEntrance = this.m_missionFailMessage.AddComponent <FancyEntrance>();
            this.m_fancyEntrance.m_fadeInCanvasGroup         = this.m_missionFailMessage.GetComponent <CanvasGroup>();
            this.m_fancyEntrance.m_fadeInTime                = this.m_messageFadeInTime;
            this.m_fancyEntrance.m_punchScale                = this.m_messagePunchScale;
            this.m_fancyEntrance.m_punchScaleAmount          = this.m_messagePunchScaleAmount;
            this.m_fancyEntrance.m_punchScaleDuration        = this.m_messagePunchScaleDuration;
            this.m_fancyEntrance.m_timeToDelayEntrance       = this.m_messageTimeToDelayEntrance;
            this.m_fancyEntrance.m_activateOnEnable          = true;
            this.m_fancyEntrance.m_objectToNotifyOnBegin     = base.gameObject;
            this.m_fancyEntrance.m_notifyOnBeginCallbackName = "OnShowFailMessage";
            this.m_missionFailMessage.SetActive(true);
            MissionRewardDisplay[] componentsInChildren6 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true);
            for (int num3 = 0; num3 < componentsInChildren6.Length; num3++)
            {
                componentsInChildren6[num3].ShowResultFail(this.m_lootEffectInitialDelay);
            }
            this.m_bonusMissionRewardDisplay.ShowResultFail(this.m_lootEffectInitialDelay);
        }
        if (missionResultType == 0)
        {
            this.m_missionInProgressMessage.SetActive(true);
            this.m_missionSuccessMessage.SetActive(false);
            this.m_missionFailMessage.SetActive(false);
            this.m_bonusMissionRewardDisplay.ClearResults();
        }
        if (missionResultType == 1)
        {
            this.m_missionInProgressMessage.SetActive(false);
            this.m_missionSuccessMessage.SetActive(false);
            this.m_missionFailMessage.SetActive(false);
            FollowerExperienceDisplay[] componentsInChildren7 = this.m_followerExperienceDisplayArea.GetComponentsInChildren <FollowerExperienceDisplay>(true);
            foreach (FollowerExperienceDisplay followerExperienceDisplay in componentsInChildren7)
            {
                Object.DestroyImmediate(followerExperienceDisplay.gameObject);
            }
        }
        if (this.m_partyBuffGroup == null)
        {
            return;
        }
        AbilityDisplay[] componentsInChildren8 = this.m_partyBuffGroup.GetComponentsInChildren <AbilityDisplay>(true);
        foreach (AbilityDisplay abilityDisplay in componentsInChildren8)
        {
            Object.DestroyImmediate(abilityDisplay.gameObject);
        }
        int adjustedMissionDuration = GeneralHelpers.GetAdjustedMissionDuration(record, list, this.enemyPortraitsGroup);
        int num6 = 0;

        foreach (JamGarrisonFollower jamGarrisonFollower2 in PersistentFollowerData.followerDictionary.Values)
        {
            if (jamGarrisonFollower2.CurrentMissionID == garrMissionID)
            {
                int[] buffsForCurrentMission = GeneralHelpers.GetBuffsForCurrentMission(jamGarrisonFollower2.GarrFollowerID, garrMissionID, this.missionFollowerSlotGroup, adjustedMissionDuration);
                num6 += buffsForCurrentMission.Length;
                foreach (int garrAbilityID in buffsForCurrentMission)
                {
                    GameObject gameObject3 = Object.Instantiate <GameObject>(this.m_mechanicEffectDisplayPrefab);
                    gameObject3.transform.SetParent(this.m_partyBuffGroup.transform, false);
                    AbilityDisplay component3 = gameObject3.GetComponent <AbilityDisplay>();
                    component3.SetAbility(garrAbilityID, false, false, null);
                }
            }
        }
        if (num6 > 8)
        {
            this.m_partyBuffsText.text = string.Empty;
        }
        else
        {
            this.m_partyBuffsText.text = StaticDB.GetString("PARTY_BUFFS", null);
        }
        HorizontalLayoutGroup component4 = this.m_partyBuffGroup.GetComponent <HorizontalLayoutGroup>();

        if (component4 != null)
        {
            if (num6 > 10 && Main.instance.IsNarrowScreen())
            {
                component4.spacing = 3f;
            }
            else
            {
                component4.spacing = 6f;
            }
        }
        this.m_partyBuffGroup.SetActive(num6 > 0);
    }
示例#7
0
    public void SetQuest(int questID)
    {
        this.m_expiringSoon.gameObject.SetActive(false);
        this.m_questID = questID;
        Transform[] componentsInChildren = this.m_worldQuestObjectiveRoot.GetComponentsInChildren <Transform>(true);
        foreach (Transform transform in componentsInChildren)
        {
            if (transform != null && transform != this.m_worldQuestObjectiveRoot.transform)
            {
                Object.DestroyImmediate(transform.gameObject);
            }
        }
        MobileWorldQuest mobileWorldQuest = (MobileWorldQuest)WorldQuestData.worldQuestDictionary[this.m_questID];
        GameObject       gameObject       = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab);

        gameObject.transform.SetParent(this.m_worldQuestObjectiveRoot.transform, false);
        Text component = gameObject.GetComponent <Text>();

        component.text = mobileWorldQuest.QuestTitle;
        component.resizeTextMaxSize = 26;
        BountySite[] componentsInChildren2 = this.m_bountyLogoRoot.transform.GetComponentsInChildren <BountySite>(true);
        foreach (BountySite bountySite in componentsInChildren2)
        {
            Object.DestroyImmediate(bountySite.gameObject);
        }
        if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(mobileWorldQuest.QuestID))
        {
            MobileBountiesByWorldQuest mobileBountiesByWorldQuest = (MobileBountiesByWorldQuest)PersistentBountyData.bountiesByWorldQuestDictionary[mobileWorldQuest.QuestID];
            for (int k = 0; k < mobileBountiesByWorldQuest.BountyQuestID.Length; k++)
            {
                IEnumerator enumerator = PersistentBountyData.bountyDictionary.Values.GetEnumerator();
                try
                {
                    while (enumerator.MoveNext())
                    {
                        object obj = enumerator.Current;
                        MobileWorldQuestBounty mobileWorldQuestBounty = (MobileWorldQuestBounty)obj;
                        if (mobileBountiesByWorldQuest.BountyQuestID[k] == mobileWorldQuestBounty.QuestID)
                        {
                            QuestV2Rec record = StaticDB.questDB.GetRecord(mobileWorldQuestBounty.QuestID);
                            if (record != null)
                            {
                                GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab);
                                gameObject2.transform.SetParent(this.m_worldQuestObjectiveRoot.transform, false);
                                Text component2 = gameObject2.GetComponent <Text>();
                                component2.text  = record.QuestTitle;
                                component2.color = new Color(1f, 0.773f, 0f, 1f);
                                BountySite bountySite2 = Object.Instantiate <BountySite>(this.m_bountyLogoPrefab);
                                bountySite2.SetBounty(mobileWorldQuestBounty);
                                bountySite2.transform.SetParent(this.m_bountyLogoRoot.transform, false);
                            }
                        }
                    }
                }
                finally
                {
                    IDisposable disposable;
                    if ((disposable = (enumerator as IDisposable)) != null)
                    {
                        disposable.Dispose();
                    }
                }
            }
        }
        GameObject gameObject3 = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab);

        gameObject3.transform.SetParent(this.m_worldQuestObjectiveRoot.transform, false);
        this.m_worldQuestTimeText       = gameObject3.GetComponent <Text>();
        this.m_worldQuestTimeText.text  = mobileWorldQuest.QuestTitle;
        this.m_worldQuestTimeText.color = new Color(1f, 0.773f, 0f, 1f);
        foreach (MobileWorldQuestObjective mobileWorldQuestObjective in mobileWorldQuest.Objective.AsEnumerable <MobileWorldQuestObjective>())
        {
            GameObject gameObject4 = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab);
            gameObject4.transform.SetParent(this.m_worldQuestObjectiveRoot.transform, false);
            Text component3 = gameObject4.GetComponent <Text>();
            component3.text = "- " + mobileWorldQuestObjective.Text;
        }
        this.InitRewardInfoDisplay(mobileWorldQuest);
        this.m_endTime = (long)mobileWorldQuest.EndTime;
        QuestInfoRec record2 = StaticDB.questInfoDB.GetRecord(mobileWorldQuest.QuestInfoID);

        if (record2 == null)
        {
            return;
        }
        bool active = (record2.Modifiers & 2) != 0;

        this.m_dragonFrame.gameObject.SetActive(active);
        if (record2.Type == 7)
        {
            this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-NormalQuest");
            this.m_main.sprite       = Resources.Load <Sprite>("NewWorldQuest/Map-LegionInvasion-SargerasCrest");
            return;
        }
        this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-NormalQuest");
        bool flag = (record2.Modifiers & 1) != 0;

        if (flag && record2.Type != 3)
        {
            this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-RareQuest");
        }
        bool flag2 = (record2.Modifiers & 4) != 0;

        if (flag2 && record2.Type != 3)
        {
            this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-EpicQuest");
        }
        int    uitextureAtlasMemberID;
        string text;

        switch (record2.Type)
        {
        case 1:
        {
            int profession = record2.Profession;
            switch (profession)
            {
            case 182:
                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-herbalism");
                text = "Mobile-Herbalism";
                break;

            default:
                if (profession != 164)
                {
                    if (profession != 165)
                    {
                        if (profession != 129)
                        {
                            if (profession != 171)
                            {
                                if (profession != 197)
                                {
                                    if (profession != 202)
                                    {
                                        if (profession != 333)
                                        {
                                            if (profession != 356)
                                            {
                                                if (profession != 393)
                                                {
                                                    if (profession != 755)
                                                    {
                                                        if (profession != 773)
                                                        {
                                                            if (profession != 794)
                                                            {
                                                                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
                                                                text = "Mobile-QuestExclamationIcon";
                                                            }
                                                            else
                                                            {
                                                                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-archaeology");
                                                                text = "Mobile-Archaeology";
                                                            }
                                                        }
                                                        else
                                                        {
                                                            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-inscription");
                                                            text = "Mobile-Inscription";
                                                        }
                                                    }
                                                    else
                                                    {
                                                        uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-jewelcrafting");
                                                        text = "Mobile-Jewelcrafting";
                                                    }
                                                }
                                                else
                                                {
                                                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-skinning");
                                                    text = "Mobile-Skinning";
                                                }
                                            }
                                            else
                                            {
                                                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-fishing");
                                                text = "Mobile-Fishing";
                                            }
                                        }
                                        else
                                        {
                                            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-enchanting");
                                            text = "Mobile-Enchanting";
                                        }
                                    }
                                    else
                                    {
                                        uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-engineering");
                                        text = "Mobile-Engineering";
                                    }
                                }
                                else
                                {
                                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-tailoring");
                                    text = "Mobile-Tailoring";
                                }
                            }
                            else
                            {
                                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-alchemy");
                                text = "Mobile-Alchemy";
                            }
                        }
                        else
                        {
                            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-firstaid");
                            text = "Mobile-FirstAid";
                        }
                    }
                    else
                    {
                        uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-leatherworking");
                        text = "Mobile-Leatherworking";
                    }
                }
                else
                {
                    uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-blacksmithing");
                    text = "Mobile-Blacksmithing";
                }
                break;

            case 185:
                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-cooking");
                text = "Mobile-Cooking";
                break;

            case 186:
                uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-mining");
                text = "Mobile-Mining";
                break;
            }
            goto IL_729;
        }

        case 3:
            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-pvp-ffa");
            text = "Mobile-PVP";
            goto IL_729;

        case 4:
            uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-petbattle");
            text = "Mobile-Pets";
            goto IL_729;
        }
        uitextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
        text = "Mobile-QuestExclamationIcon";
IL_729:
        if (text != null)
        {
            this.m_main.sprite = Resources.Load <Sprite>("NewWorldQuest/" + text);
        }
        else if (uitextureAtlasMemberID > 0)
        {
            this.m_main.sprite = TextureAtlas.instance.GetAtlasSprite(uitextureAtlasMemberID);
            this.m_main.SetNativeSize();
        }
        this.UpdateTimeRemaining();
    }
    public void SetQuest(int questID)
    {
        this.m_expiringSoon.get_gameObject().SetActive(false);
        this.m_questID = questID;
        Transform[] componentsInChildren = this.m_worldQuestObjectiveRoot.GetComponentsInChildren <Transform>(true);
        Transform[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            Transform transform = array[i];
            if (transform != null && transform != this.m_worldQuestObjectiveRoot.get_transform())
            {
                Object.DestroyImmediate(transform.get_gameObject());
            }
        }
        MobileWorldQuest mobileWorldQuest = (MobileWorldQuest)WorldQuestData.worldQuestDictionary.get_Item(this.m_questID);
        GameObject       gameObject       = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab);

        gameObject.get_transform().SetParent(this.m_worldQuestObjectiveRoot.get_transform(), false);
        Text component = gameObject.GetComponent <Text>();

        component.set_text(mobileWorldQuest.QuestTitle);
        component.set_resizeTextMaxSize(26);
        BountySite[] componentsInChildren2 = this.m_bountyLogoRoot.get_transform().GetComponentsInChildren <BountySite>(true);
        BountySite[] array2 = componentsInChildren2;
        for (int j = 0; j < array2.Length; j++)
        {
            BountySite bountySite = array2[j];
            Object.DestroyImmediate(bountySite.get_gameObject());
        }
        if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(mobileWorldQuest.QuestID))
        {
            MobileBountiesByWorldQuest mobileBountiesByWorldQuest = (MobileBountiesByWorldQuest)PersistentBountyData.bountiesByWorldQuestDictionary.get_Item(mobileWorldQuest.QuestID);
            for (int k = 0; k < mobileBountiesByWorldQuest.BountyQuestID.Length; k++)
            {
                IEnumerator enumerator = PersistentBountyData.bountyDictionary.get_Values().GetEnumerator();
                try
                {
                    while (enumerator.MoveNext())
                    {
                        MobileWorldQuestBounty mobileWorldQuestBounty = (MobileWorldQuestBounty)enumerator.get_Current();
                        if (mobileBountiesByWorldQuest.BountyQuestID[k] == mobileWorldQuestBounty.QuestID)
                        {
                            QuestV2Rec record = StaticDB.questDB.GetRecord(mobileWorldQuestBounty.QuestID);
                            if (record != null)
                            {
                                GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab);
                                gameObject2.get_transform().SetParent(this.m_worldQuestObjectiveRoot.get_transform(), false);
                                this.m_worldQuestTimeText = gameObject2.GetComponent <Text>();
                                this.m_worldQuestTimeText.set_text(record.QuestTitle);
                                this.m_worldQuestTimeText.set_horizontalOverflow(1);
                                this.m_worldQuestTimeText.set_color(new Color(1f, 0.773f, 0f, 1f));
                                BountySite bountySite2 = Object.Instantiate <BountySite>(this.m_bountyLogoPrefab);
                                bountySite2.SetBounty(mobileWorldQuestBounty);
                                bountySite2.get_transform().SetParent(this.m_bountyLogoRoot.get_transform(), false);
                            }
                        }
                    }
                }
                finally
                {
                    IDisposable disposable = enumerator as IDisposable;
                    if (disposable != null)
                    {
                        disposable.Dispose();
                    }
                }
            }
        }
        GameObject gameObject3 = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab);

        gameObject3.get_transform().SetParent(this.m_worldQuestObjectiveRoot.get_transform(), false);
        this.m_worldQuestTimeText = gameObject3.GetComponent <Text>();
        this.m_worldQuestTimeText.set_text(mobileWorldQuest.QuestTitle);
        this.m_worldQuestTimeText.set_horizontalOverflow(1);
        this.m_worldQuestTimeText.set_color(new Color(1f, 0.773f, 0f, 1f));
        using (IEnumerator <MobileWorldQuestObjective> enumerator2 = Enumerable.AsEnumerable <MobileWorldQuestObjective>(mobileWorldQuest.Objective).GetEnumerator())
        {
            while (enumerator2.MoveNext())
            {
                MobileWorldQuestObjective current = enumerator2.get_Current();
                GameObject gameObject4            = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab);
                gameObject4.get_transform().SetParent(this.m_worldQuestObjectiveRoot.get_transform(), false);
                Text component2 = gameObject4.GetComponent <Text>();
                component2.set_text("-" + current.Text);
            }
        }
        this.InitRewardInfoDisplay(mobileWorldQuest);
        this.m_endTime = (long)(mobileWorldQuest.EndTime - 900);
        QuestInfoRec record2 = StaticDB.questInfoDB.GetRecord(mobileWorldQuest.QuestInfoID);

        if (record2 == null)
        {
            return;
        }
        bool active = (record2.Modifiers & 2) != 0;

        this.m_dragonFrame.get_gameObject().SetActive(active);
        this.m_background.set_sprite(Resources.Load <Sprite>("NewWorldQuest/Mobile-NormalQuest"));
        bool flag = (record2.Modifiers & 1) != 0;

        if (flag && record2.Type != 3)
        {
            this.m_background.set_sprite(Resources.Load <Sprite>("NewWorldQuest/Mobile-RareQuest"));
        }
        bool flag2 = (record2.Modifiers & 4) != 0;

        if (flag2 && record2.Type != 3)
        {
            this.m_background.set_sprite(Resources.Load <Sprite>("NewWorldQuest/Mobile-EpicQuest"));
        }
        int    uITextureAtlasMemberID;
        string text;

        switch (record2.Type)
        {
        case 1:
        {
            int profession = record2.Profession;
            switch (profession)
            {
            case 182:
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-herbalism");
                text = "Mobile-Herbalism";
                goto IL_6CB;

            case 183:
            case 184:
IL_4B6:
                if (profession == 164)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-blacksmithing");
                    text = "Mobile-Blacksmithing";
                    goto IL_6CB;
                }
                if (profession == 165)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-leatherworking");
                    text = "Mobile-Leatherworking";
                    goto IL_6CB;
                }
                if (profession == 129)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-firstaid");
                    text = "Mobile-FirstAid";
                    goto IL_6CB;
                }
                if (profession == 171)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-alchemy");
                    text = "Mobile-Alchemy";
                    goto IL_6CB;
                }
                if (profession == 197)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-tailoring");
                    text = "Mobile-Tailoring";
                    goto IL_6CB;
                }
                if (profession == 202)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-engineering");
                    text = "Mobile-Engineering";
                    goto IL_6CB;
                }
                if (profession == 333)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-enchanting");
                    text = "Mobile-Enchanting";
                    goto IL_6CB;
                }
                if (profession == 356)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-fishing");
                    text = "Mobile-Fishing";
                    goto IL_6CB;
                }
                if (profession == 393)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-skinning");
                    text = "Mobile-Skinning";
                    goto IL_6CB;
                }
                if (profession == 755)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-jewelcrafting");
                    text = "Mobile-Jewelcrafting";
                    goto IL_6CB;
                }
                if (profession == 773)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-inscription");
                    text = "Mobile-Inscription";
                    goto IL_6CB;
                }
                if (profession != 794)
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
                    text = "Mobile-QuestExclamationIcon";
                    goto IL_6CB;
                }
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-archaeology");
                text = "Mobile-Archaeology";
                goto IL_6CB;

            case 185:
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-cooking");
                text = "Mobile-Cooking";
                goto IL_6CB;

            case 186:
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-mining");
                text = "Mobile-Mining";
                goto IL_6CB;
            }
            goto IL_4B6;
IL_6CB:
            goto IL_718;
        }

        case 3:
            uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-pvp-ffa");
            text = "Mobile-PVP";
            goto IL_718;

        case 4:
            uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-petbattle");
            text = "Mobile-Pets";
            goto IL_718;
        }
        uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
        text = "Mobile-QuestExclamationIcon";
IL_718:
        if (text != null)
        {
            this.m_main.set_sprite(Resources.Load <Sprite>("NewWorldQuest/" + text));
        }
        else if (uITextureAtlasMemberID > 0)
        {
            this.m_main.set_sprite(TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID));
            this.m_main.SetNativeSize();
        }
        this.UpdateTimeRemaining();
    }