Beispiel #1
0
        public void SetReward(MissionRewardDisplay.RewardType rewardType, int rewardID, int rewardQuantity, Sprite rewardSprite, int itemContext)
        {
            this.m_rewardType = rewardType;
            this.m_rewardID   = rewardID;
            switch (rewardType)
            {
            case MissionRewardDisplay.RewardType.item:
            {
                ItemStatCache instance = ItemStatCache.instance;
                instance.ItemStatCacheUpdateAction = (Action <int, int, WrapperItemStats>)Delegate.Combine(instance.ItemStatCacheUpdateAction, new Action <int, int, WrapperItemStats>(this.ItemStatsUpdated));
                this.SetItem(rewardID, itemContext, rewardSprite);
                break;
            }

            case MissionRewardDisplay.RewardType.gold:
                this.SetGold(rewardQuantity, rewardSprite);
                break;

            case MissionRewardDisplay.RewardType.followerXP:
                this.SetFollowerXP(rewardQuantity, rewardSprite);
                break;

            case MissionRewardDisplay.RewardType.currency:
                this.SetCurrency(rewardID, rewardQuantity, rewardSprite);
                break;

            case MissionRewardDisplay.RewardType.faction:
                this.SetFaction(rewardID, rewardQuantity, rewardSprite);
                break;
            }
        }
Beispiel #2
0
        private void ShowILVL()
        {
            ItemRec record = StaticDB.itemDB.GetRecord(this.m_itemID);

            if (record == null)
            {
                Debug.LogWarning(string.Concat(new object[]
                {
                    "Invalid Item ID ",
                    this.m_itemID,
                    " from Quest ID ",
                    this.m_questID,
                    ". Ignoring for showing iLevel on map."
                }));
                return;
            }
            if (AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.Gear) && (record.ClassID == 2 || record.ClassID == 3 || record.ClassID == 4 || record.ClassID == 6))
            {
                WrapperItemStats?itemStats = ItemStatCache.instance.GetItemStats(this.m_itemID, this.m_itemContext, this.m_itemInstance);
                if (itemStats != null)
                {
                    this.m_quantityArea.gameObject.SetActive(true);
                    this.m_quantity.text = StaticDB.GetString("ILVL", null) + " " + itemStats.Value.ItemLevel;
                }
                else
                {
                    ItemStatCache instance = ItemStatCache.instance;
                    instance.ItemStatCacheUpdateAction = (Action <int, int, WrapperItemStats, WrapperItemInstance?>)Delegate.Combine(instance.ItemStatCacheUpdateAction, new Action <int, int, WrapperItemStats, WrapperItemInstance?>(this.ItemStatsUpdated));
                }
            }
        }
 private void Awake()
 {
     if (ItemStatCache.s_instance == null)
     {
         ItemStatCache.s_instance = this;
     }
 }
 private void ItemStatsUpdated(int itemID, int itemContext, WrapperItemStats itemStats, WrapperItemInstance?itemInstance)
 {
     if (this.m_rewardType == MissionRewardDisplay.RewardType.item)
     {
         this.SetItem(this.m_rewardID, itemContext, this.m_rewardIcon.sprite, itemInstance);
         ItemStatCache instance = ItemStatCache.instance;
         instance.ItemStatCacheUpdateAction = (Action <int, int, WrapperItemStats, WrapperItemInstance?>)Delegate.Remove(instance.ItemStatCacheUpdateAction, new Action <int, int, WrapperItemStats, WrapperItemInstance?>(this.ItemStatsUpdated));
     }
 }
Beispiel #5
0
 private void ItemStatsUpdated(int itemID, int itemContext, WrapperItemStats itemStats, WrapperItemInstance?itemInstance)
 {
     if (this.m_itemID == itemID && this.m_itemContext == itemContext)
     {
         ItemStatCache instance = ItemStatCache.instance;
         instance.ItemStatCacheUpdateAction = (Action <int, int, WrapperItemStats, WrapperItemInstance?>)Delegate.Remove(instance.ItemStatCacheUpdateAction, new Action <int, int, WrapperItemStats, WrapperItemInstance?>(this.ItemStatsUpdated));
         this.ShowILVL();
     }
 }
Beispiel #6
0
        public void UpdateLootQuality(int itemID, int itemContext, WrapperItemStats stats, WrapperItemInstance?itemInstance)
        {
            if (itemID != this.m_itemID)
            {
                return;
            }
            this.UpdateLootQualityImpl(stats);
            ItemStatCache instance = ItemStatCache.instance;

            instance.ItemStatCacheUpdateAction = (Action <int, int, WrapperItemStats, WrapperItemInstance?>)Delegate.Remove(instance.ItemStatCacheUpdateAction, new Action <int, int, WrapperItemStats, WrapperItemInstance?>(this.UpdateLootQuality));
        }
Beispiel #7
0
 private void OnDisable()
 {
     if (!this.m_disableScreenBlurEffect)
     {
         Main.instance.m_canvasBlurManager.RemoveBlurRef_MainCanvas();
         Main.instance.m_canvasBlurManager.RemoveBlurRef_Level2Canvas();
     }
     if (this.m_rewardType == MissionRewardDisplay.RewardType.item)
     {
         ItemStatCache instance = ItemStatCache.instance;
         instance.ItemStatCacheUpdateAction = (Action <int, int, WrapperItemStats>)Delegate.Remove(instance.ItemStatCacheUpdateAction, new Action <int, int, WrapperItemStats>(this.ItemStatsUpdated));
     }
     Main.instance.m_backButtonManager.PopBackAction();
 }
Beispiel #8
0
        public void SetQuestID(int questID)
        {
            this.m_questID       = questID;
            base.gameObject.name = "WorldQuest " + this.m_questID;
            if (!WorldQuestData.WorldQuestDictionary.ContainsKey(this.m_questID))
            {
                return;
            }
            WrapperWorldQuest wrapperWorldQuest = WorldQuestData.WorldQuestDictionary[this.m_questID];

            if (wrapperWorldQuest.Items == null)
            {
                return;
            }
            this.m_quantityArea.gameObject.SetActive(false);
            bool flag = false;

            foreach (WrapperWorldQuestReward wrapperWorldQuestReward in wrapperWorldQuest.Items)
            {
                ItemRec record = StaticDB.itemDB.GetRecord(wrapperWorldQuestReward.RecordID);
                if (record == null)
                {
                    Debug.LogWarning(string.Concat(new object[]
                    {
                        "Invalid Item ID ",
                        wrapperWorldQuestReward.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;
                    }
                    SpellEffectRec spellEffectRec2 = StaticDB.itemEffectDB.GetRecordsByParentID(wrapperWorldQuestReward.RecordID).SelectMany((ItemEffectRec itemEffectRec) => StaticDB.spellEffectDB.GetRecordsByParentID(itemEffectRec.SpellID)).FirstOrDefault((SpellEffectRec spellEffectRec) => spellEffectRec.Effect == 240);
                    this.m_main.sprite  = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, wrapperWorldQuestReward.FileDataID);
                    this.m_itemID       = wrapperWorldQuestReward.RecordID;
                    this.m_itemContext  = wrapperWorldQuestReward.ItemContext;
                    this.m_itemInstance = wrapperWorldQuestReward.ItemInstance;
                    if (!ItemStatCache.instance.HasItemStats(wrapperWorldQuestReward.RecordID))
                    {
                        ItemStatCache instance = ItemStatCache.instance;
                        instance.ItemStatCacheUpdateAction = (Action <int, int, WrapperItemStats, WrapperItemInstance?>)Delegate.Combine(instance.ItemStatCacheUpdateAction, new Action <int, int, WrapperItemStats, WrapperItemInstance?>(this.UpdateLootQuality));
                    }
                    WrapperItemStats?itemStats = ItemStatCache.instance.GetItemStats(wrapperWorldQuestReward.RecordID, wrapperWorldQuestReward.ItemContext, wrapperWorldQuestReward.ItemInstance);
                    if (itemStats != null)
                    {
                        this.UpdateLootQualityImpl(itemStats.Value);
                    }
                    this.ShowILVL();
                }
            }
            if (!flag)
            {
                if (wrapperWorldQuest.Currencies.Count > 0)
                {
                    foreach (WrapperWorldQuestReward wrapperWorldQuestReward2 in wrapperWorldQuest.Currencies)
                    {
                        CurrencyTypesRec record2 = StaticDB.currencyTypesDB.GetRecord(wrapperWorldQuestReward2.RecordID);
                        if (record2 != null)
                        {
                            int num = ((record2.Flags & 8u) == 0u) ? 1 : 100;
                            this.m_main.sprite = CurrencyContainerDB.LoadCurrencyContainerIcon(wrapperWorldQuestReward2.RecordID, wrapperWorldQuestReward2.Quantity / num);
                            CurrencyContainerRec currencyContainerRec = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(wrapperWorldQuestReward2.RecordID, wrapperWorldQuestReward2.Quantity / num);
                            if (currencyContainerRec != null)
                            {
                                this.m_lootQuality = (ITEM_QUALITY)currencyContainerRec.ContainerQuality;
                            }
                        }
                        if (AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.OrderResources))
                        {
                            this.m_quantityArea.gameObject.SetActive(true);
                            this.m_quantity.text = wrapperWorldQuestReward2.Quantity.ToString();
                        }
                    }
                }
                else if (wrapperWorldQuest.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 + wrapperWorldQuest.Money / 100 / 100;
                    }
                }
                else if (wrapperWorldQuest.Experience > 0)
                {
                    this.m_main.sprite = GeneralHelpers.GetLocalizedFollowerXpIcon();
                }
            }
            this.m_endTime = wrapperWorldQuest.EndTime;
            int             areaID  = 0;
            WorldMapAreaRec record3 = StaticDB.worldMapAreaDB.GetRecord(wrapperWorldQuest.WorldMapAreaID);

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

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

            this.m_dragonFrame.gameObject.SetActive(active);
            bool active2 = record4.Type == 12;

            if (this.m_lootQuality < ITEM_QUALITY.STANDARD)
            {
                this.m_normalGlow.color = this.WORLD_QUEST_GLOW_COLOR_DEFAULT;
            }
            if (this.m_lootQuality > ITEM_QUALITY.STANDARD)
            {
                string text = "#" + GeneralHelpers.GetItemQualityColor((int)this.m_lootQuality);
                Color  color;
                if (ColorUtility.TryParseHtmlString(text, ref color))
                {
                    this.m_normalGlow.color = color;
                }
            }
            if (this.m_assaultEffect != null)
            {
                this.m_assaultEffect.SetActive(active2);
            }
            bool flag2 = (record4.Modifiers & 1) != 0;

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

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