コード例 #1
0
        public void SetCurrency(int currencyID, int quantity, Sprite iconSprite)
        {
            CurrencyTypesRec     record = StaticDB.currencyTypesDB.GetRecord(currencyID);
            CurrencyContainerRec currencyContainerRec = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(currencyID, quantity);

            if (currencyContainerRec != null)
            {
                this.m_rewardName.text        = GeneralHelpers.GetItemQualityColorTag((int)currencyContainerRec.ContainerQuality) + currencyContainerRec.ContainerName + "</color>";
                this.m_rewardDescription.text = GeneralHelpers.QuantityRule(currencyContainerRec.ContainerDescription, quantity);
                this.m_rewardQuantity.text    = string.Empty;
                this.m_rewardIcon.sprite      = iconSprite;
                if (this.m_rewardIconBorder != null)
                {
                    Color color;
                    ColorUtility.TryParseHtmlString("#" + GeneralHelpers.GetItemQualityColor((int)currencyContainerRec.ContainerQuality), ref color);
                    this.m_rewardIconBorder.gameObject.SetActive(true);
                    this.m_rewardIconBorder.color = color;
                }
            }
            else
            {
                if (record != null)
                {
                    this.m_rewardName.text        = record.Name;
                    this.m_rewardDescription.text = record.Description;
                }
                this.m_rewardQuantity.text = ((quantity <= 1) ? string.Empty : (string.Empty + quantity));
                this.m_rewardIcon.sprite   = iconSprite;
            }
        }
コード例 #2
0
        public void SetCurrency(int currencyID, int quantity, Sprite iconSprite)
        {
            CurrencyTypesRec     record = StaticDB.currencyTypesDB.GetRecord(currencyID);
            CurrencyContainerRec currencyContainerRec = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(currencyID, quantity);

            if (currencyContainerRec == null)
            {
                if (record != null)
                {
                    this.m_rewardName.text        = record.Name;
                    this.m_rewardDescription.text = record.Description;
                }
                this.m_rewardQuantity.text = (quantity <= 1 ? string.Empty : string.Concat(string.Empty, quantity));
                this.m_rewardIcon.sprite   = iconSprite;
            }
            else
            {
                this.m_rewardName.text        = string.Concat(GeneralHelpers.GetItemQualityColorTag(currencyContainerRec.ContainerQuality), currencyContainerRec.ContainerName, "</color>");
                this.m_rewardDescription.text = GeneralHelpers.QuantityRule(currencyContainerRec.ContainerDescription, quantity);
                this.m_rewardQuantity.text    = string.Empty;
                this.m_rewardIcon.sprite      = iconSprite;
            }
        }
コード例 #3
0
        public void SetQuestID(int questID)
        {
            Color color;

            this.m_questID       = questID;
            base.gameObject.name = string.Concat("WorldQuest ", this.m_questID);
            if (!WorldQuestData.WorldQuestDictionary.ContainsKey(this.m_questID))
            {
                return;
            }
            WrapperWorldQuest item = WorldQuestData.WorldQuestDictionary[this.m_questID];

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

            foreach (WrapperWorldQuestReward wrapperWorldQuestReward in item.Items)
            {
                ItemRec record = StaticDB.itemDB.GetRecord(wrapperWorldQuestReward.RecordID);
                if (record != null)
                {
                    flag = true;
                    if (record.OverallQualityID > (int)this.m_lootQuality)
                    {
                        this.m_lootQuality = (ITEM_QUALITY)record.OverallQualityID;
                    }
                    if (!this.m_showLootIconInsteadOfMain)
                    {
                        continue;
                    }
                    StaticDB.itemEffectDB.GetRecordsByParentID(wrapperWorldQuestReward.RecordID).SelectMany <ItemEffectRec, SpellEffectRec>((ItemEffectRec itemEffectRec) => StaticDB.spellEffectDB.GetRecordsByParentID(itemEffectRec.SpellID)).FirstOrDefault <SpellEffectRec>((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.ShowILVL();
                }
                else
                {
                    Debug.LogWarning(string.Concat(new object[] { "Invalid Item ID ", wrapperWorldQuestReward.RecordID, " from Quest ID ", this.m_questID, ". Ignoring for loot quality check." }));
                }
            }
            if (!flag && this.m_showLootIconInsteadOfMain)
            {
                if (item.Currencies.Count > 0)
                {
                    foreach (WrapperWorldQuestReward currency in item.Currencies)
                    {
                        if (StaticDB.currencyTypesDB.GetRecord(currency.RecordID) != null)
                        {
                            this.m_main.sprite = CurrencyContainerDB.LoadCurrencyContainerIcon(currency.RecordID, currency.Quantity);
                            CurrencyContainerRec currencyContainerRec = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(currency.RecordID, currency.Quantity);
                            if (currencyContainerRec != null)
                            {
                                this.m_lootQuality = (ITEM_QUALITY)currencyContainerRec.ContainerQuality;
                            }
                        }
                        if (!AdventureMapPanel.instance.IsFilterEnabled(MapFilterType.OrderResources))
                        {
                            continue;
                        }
                        this.m_quantityArea.gameObject.SetActive(true);
                        this.m_quantity.text = currency.Quantity.ToString();
                    }
                }
                else if (item.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.Concat(string.Empty, item.Money / 100 / 100);
                    }
                }
                else if (item.Experience > 0)
                {
                    this.m_main.sprite = GeneralHelpers.GetLocalizedFollowerXpIcon();
                }
            }
            this.m_endTime = item.EndTime;
            int             areaID          = 0;
            WorldMapAreaRec worldMapAreaRec = StaticDB.worldMapAreaDB.GetRecord(item.WorldMapAreaID);

            if (worldMapAreaRec != null)
            {
                areaID = worldMapAreaRec.AreaID;
            }
            this.m_areaID = areaID;
            QuestInfoRec questInfoRec = StaticDB.questInfoDB.GetRecord(item.QuestInfoID);

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

            this.m_dragonFrame.gameObject.SetActive(modifiers);
            bool type = questInfoRec.Type == 7;

            this.m_normalGlow.gameObject.SetActive(!type);
            if (this.m_lootQuality < ITEM_QUALITY.STANDARD)
            {
                this.m_normalGlow.color = this.WORLD_QUEST_GLOW_COLOR_DEFAULT;
            }
            if (this.m_lootQuality > ITEM_QUALITY.STANDARD && ColorUtility.TryParseHtmlString(string.Concat("#", GeneralHelpers.GetItemQualityColor((int)this.m_lootQuality)), out color))
            {
                this.m_normalGlow.color = color;
            }
            this.m_legionAssaultGlow.gameObject.SetActive(type);
            if ((questInfoRec.Modifiers & 1) != 0 && questInfoRec.Type != 3)
            {
                this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-RareQuest");
            }
            if ((questInfoRec.Modifiers & 4) != 0 && questInfoRec.Type != 3)
            {
                this.m_background.sprite = Resources.Load <Sprite>("NewWorldQuest/Mobile-EpicQuest");
            }
            int    uITextureAtlasMemberID = 0;
            string str = null;

            switch (questInfoRec.Type)
            {
            case 1:
            {
                int profession = questInfoRec.Profession;
                switch (profession)
                {
                case 182:
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-herbalism");
                    str = "Mobile-Herbalism";
                    break;
                }

                case 185:
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-cooking");
                    str = "Mobile-Cooking";
                    break;
                }

                case 186:
                {
                    uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-mining");
                    str = "Mobile-Mining";
                    break;
                }

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

            case 2:
            {
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang");
                str = "Mobile-QuestExclamationIcon";
                break;
            }

            case 3:
            {
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-pvp-ffa");
                str = "Mobile-PVP";
                break;
            }

            case 4:
            {
                uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-petbattle");
                str = "Mobile-Pets";
                break;
            }

            default:
            {
                goto case 2;
            }
            }
            if (!this.m_showLootIconInsteadOfMain)
            {
                if (str != null)
                {
                    this.m_main.sprite = Resources.Load <Sprite>(string.Concat("NewWorldQuest/", str));
                }
                else if (uITextureAtlasMemberID > 0)
                {
                    this.m_main.sprite = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID);
                    this.m_main.SetNativeSize();
                }
            }
        }
コード例 #4
0
        public void InitReward(MissionRewardDisplay.RewardType rewardType, int rewardID, int rewardQuantity, int itemContext, int iconFileDataID = 0)
        {
            if (rewardType == MissionRewardDisplay.RewardType.faction)
            {
                return;
            }
            this.ClearResults();
            this.m_rewardType     = rewardType;
            this.m_rewardID       = rewardID;
            this.m_rewardQuantity = rewardQuantity;
            this.m_itemContext    = itemContext;
            if (this.m_iconErrorText != null)
            {
                this.m_iconErrorText.gameObject.SetActive(false);
            }
            switch (this.m_rewardType)
            {
            case MissionRewardDisplay.RewardType.item:
            {
                Sprite  sprite = null;
                ItemRec record = StaticDB.itemDB.GetRecord(this.m_rewardID);
                if (iconFileDataID > 0)
                {
                    sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, iconFileDataID);
                }
                else if (record != null)
                {
                    sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record.IconFileDataID);
                }
                if (sprite != null)
                {
                    this.m_rewardIcon.sprite = sprite;
                }
                else if (this.m_iconErrorText != null)
                {
                    this.m_iconErrorText.gameObject.SetActive(true);
                    this.m_iconErrorText.text = string.Empty + iconFileDataID;
                }
                if (this.m_rewardName != null)
                {
                    if (record != null)
                    {
                        this.m_rewardName.text  = record.Display;
                        this.m_rewardName.color = GeneralHelpers.GetQualityColor(record.OverallQualityID);
                    }
                    else
                    {
                        this.m_rewardName.text = "Unknown Item " + this.m_rewardID;
                    }
                }
                if (this.m_isExpandedDisplay)
                {
                    this.m_rewardQuantityText.text = ((this.m_rewardQuantity <= 1) ? string.Empty : this.m_rewardQuantity.ToString("N0", MobileDeviceLocale.GetCultureInfoLocale()));
                }
                break;
            }

            case MissionRewardDisplay.RewardType.gold:
                this.m_rewardIcon.sprite = Resources.Load <Sprite>("MiscIcons/INV_Misc_Coin_01");
                if (this.m_isExpandedDisplay)
                {
                    this.m_rewardQuantityText.text = string.Empty;
                    this.m_rewardName.text         = ((this.m_rewardQuantity <= 1) ? string.Empty : this.m_rewardQuantity.ToString("N0", MobileDeviceLocale.GetCultureInfoLocale()));
                }
                break;

            case MissionRewardDisplay.RewardType.followerXP:
                this.m_rewardIcon.sprite       = GeneralHelpers.GetLocalizedFollowerXpIcon();
                this.m_rewardQuantityText.text = string.Empty;
                if (this.m_rewardName != null && this.m_isExpandedDisplay)
                {
                    this.m_rewardName.text = ((this.m_rewardQuantity <= 1) ? string.Empty : (this.m_rewardQuantity.ToString("N0", MobileDeviceLocale.GetCultureInfoLocale()) + " " + StaticDB.GetString("XP2", "XP")));
                }
                break;

            case MissionRewardDisplay.RewardType.currency:
            {
                Sprite sprite2 = CurrencyContainerDB.LoadCurrencyContainerIcon(this.m_rewardID, this.m_rewardQuantity);
                if (sprite2 != null)
                {
                    this.m_rewardIcon.sprite = sprite2;
                }
                else
                {
                    this.m_iconErrorText.gameObject.SetActive(true);
                    this.m_iconErrorText.text = "c " + this.m_rewardID;
                }
                if (this.m_isExpandedDisplay)
                {
                    CurrencyTypesRec record2 = StaticDB.currencyTypesDB.GetRecord(rewardID);
                    if (record2 != null)
                    {
                        CurrencyContainerRec currencyContainerRec = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(this.m_rewardID, this.m_rewardQuantity);
                        if (currencyContainerRec != null)
                        {
                            this.m_rewardName.text         = currencyContainerRec.ContainerName;
                            this.m_rewardName.color        = GeneralHelpers.GetQualityColor((int)currencyContainerRec.ContainerQuality);
                            this.m_rewardQuantityText.text = string.Empty;
                        }
                        else
                        {
                            this.m_rewardName.text         = record2.Name;
                            this.m_rewardQuantityText.text = ((this.m_rewardQuantity <= 1) ? string.Empty : this.m_rewardQuantity.ToString("N0", MobileDeviceLocale.GetCultureInfoLocale()));
                        }
                    }
                    else
                    {
                        this.m_rewardName.text         = string.Empty;
                        this.m_rewardQuantityText.text = ((this.m_rewardQuantity <= 1) ? string.Empty : this.m_rewardQuantity.ToString("N0", MobileDeviceLocale.GetCultureInfoLocale()));
                    }
                }
                else
                {
                    CurrencyTypesRec record3 = StaticDB.currencyTypesDB.GetRecord(rewardID);
                    if (record3 != null)
                    {
                        CurrencyContainerRec currencyContainerRec2 = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(this.m_rewardID, this.m_rewardQuantity);
                        if (currencyContainerRec2 != null && currencyContainerRec2.ContainerQuality > 0 && this.m_qualityBorder != null)
                        {
                            this.m_qualityBorder.color = GeneralHelpers.GetQualityColor((int)currencyContainerRec2.ContainerQuality);
                        }
                    }
                }
                break;
            }
            }
            if (!this.m_isExpandedDisplay)
            {
                CurrencyContainerRec currencyContainerRec3 = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(this.m_rewardID, rewardQuantity);
                if (currencyContainerRec3 != null)
                {
                    this.m_rewardQuantityText.text = string.Empty;
                }
                else
                {
                    this.m_rewardQuantityText.text = ((this.m_rewardQuantity <= 1) ? string.Empty : this.m_rewardQuantity.ToString("N0", MobileDeviceLocale.GetCultureInfoLocale()));
                }
            }
        }
コード例 #5
0
        public void SetBounty(WrapperWorldQuestBounty bounty)
        {
            this.m_bounty = bounty;
            Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, bounty.IconFileDataID);

            if (sprite != null)
            {
                this.m_bountyIconInvalidFileDataID.gameObject.SetActive(false);
                this.m_bountyIcon.sprite = sprite;
            }
            else
            {
                this.m_bountyIconInvalidFileDataID.gameObject.SetActive(true);
                this.m_bountyIconInvalidFileDataID.text = string.Empty + bounty.IconFileDataID;
            }
            QuestV2Rec record = StaticDB.questV2DB.GetRecord(bounty.QuestID);

            if (record != null)
            {
                this.m_bountyName.text        = record.QuestTitle;
                this.m_bountyDescription.text = string.Concat(new object[]
                {
                    string.Empty,
                    bounty.NumCompleted,
                    "/",
                    bounty.NumNeeded,
                    " ",
                    record.LogDescription
                });
            }
            else
            {
                this.m_bountyName.text        = "Unknown Quest ID " + bounty.QuestID;
                this.m_bountyDescription.text = "Unknown Quest ID " + bounty.QuestID;
            }
            this.m_timeLeft.text = StaticDB.GetString("TIME_LEFT", "Time Left: PH");
            RectTransform[] componentsInChildren = this.m_bountyQuestIconArea.GetComponentsInChildren <RectTransform>(true);
            foreach (RectTransform rectTransform in componentsInChildren)
            {
                if (rectTransform != null && rectTransform.gameObject != this.m_bountyQuestIconArea.gameObject)
                {
                    rectTransform.SetParent(null);
                    Object.Destroy(rectTransform.gameObject);
                }
            }
            for (int j = 0; j < bounty.NumCompleted; j++)
            {
                GameObject gameObject = Object.Instantiate <GameObject>(this.m_bountyQuestCompleteIconPrefab);
                gameObject.transform.SetParent(this.m_bountyQuestIconArea.transform, false);
            }
            for (int k = 0; k < bounty.NumNeeded - bounty.NumCompleted; k++)
            {
                GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_bountyQuestAvailableIconPrefab);
                gameObject2.transform.SetParent(this.m_bountyQuestIconArea.transform, false);
            }
            this.UpdateTimeRemaining();
            if (bounty.Items.Count > 0 && StaticDB.itemDB.GetRecord(bounty.Items[0].RecordID) != null)
            {
                WrapperWorldQuestReward wrapperWorldQuestReward = bounty.Items[0];
                Sprite rewardSprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, wrapperWorldQuestReward.FileDataID);
                this.m_rewardInfo.SetReward(MissionRewardDisplay.RewardType.item, wrapperWorldQuestReward.RecordID, wrapperWorldQuestReward.Quantity, rewardSprite, wrapperWorldQuestReward.ItemContext, wrapperWorldQuestReward.ItemInstance);
            }
            else if (bounty.Money > 1000000)
            {
                Sprite iconSprite = Resources.Load <Sprite>("MiscIcons/INV_Misc_Coin_01");
                this.m_rewardInfo.SetGold(bounty.Money / 10000, iconSprite);
            }
            else if (bounty.Currencies.Count > 1)
            {
                int num = 0;
                foreach (WrapperWorldQuestReward wrapperWorldQuestReward2 in bounty.Currencies)
                {
                    bool                 flag    = wrapperWorldQuestReward2.RecordID == 1560;
                    CurrencyTypesRec     record2 = StaticDB.currencyTypesDB.GetRecord(wrapperWorldQuestReward2.RecordID);
                    CurrencyContainerRec currencyContainerRec = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(wrapperWorldQuestReward2.RecordID, wrapperWorldQuestReward2.Quantity);
                    if (currencyContainerRec != null)
                    {
                        Sprite iconSprite2 = CurrencyContainerDB.LoadCurrencyContainerIcon(wrapperWorldQuestReward2.RecordID, wrapperWorldQuestReward2.Quantity);
                        int    num2        = wrapperWorldQuestReward2.Quantity / (((record2.Flags & 8u) == 0u) ? 1 : 100);
                        if (num2 > num)
                        {
                            num = num2;
                            this.m_rewardInfo.SetCurrency(wrapperWorldQuestReward2.RecordID, num, iconSprite2);
                        }
                    }
                    else
                    {
                        Sprite iconSprite2 = GeneralHelpers.LoadCurrencyIcon(wrapperWorldQuestReward2.RecordID);
                        int    num3        = wrapperWorldQuestReward2.Quantity / (((record2.Flags & 8u) == 0u) ? 1 : 100);
                        if (num3 > num || flag)
                        {
                            num = num3;
                            this.m_rewardInfo.SetCurrency(wrapperWorldQuestReward2.RecordID, num, iconSprite2);
                            if (flag)
                            {
                                break;
                            }
                        }
                    }
                }
            }
        }
コード例 #6
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");
            }
        }
コード例 #7
0
        private void InitRewardInfoDisplay(WrapperWorldQuest worldQuest)
        {
            int num = 0;

            this.m_rewardInfo[0].gameObject.SetActive(true);
            this.m_rewardInfo[1].gameObject.SetActive(false);
            this.m_rewardInfo[2].gameObject.SetActive(false);
            if (worldQuest.Items != null && worldQuest.Items.Count <WrapperWorldQuestReward>() > 0)
            {
                foreach (WrapperWorldQuestReward wrapperWorldQuestReward in worldQuest.Items)
                {
                    Sprite rewardSprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, wrapperWorldQuestReward.FileDataID);
                    this.m_rewardInfo[num].SetReward(MissionRewardDisplay.RewardType.item, wrapperWorldQuestReward.RecordID, wrapperWorldQuestReward.Quantity, rewardSprite, wrapperWorldQuestReward.ItemContext, wrapperWorldQuestReward.ItemInstance);
                    this.EnableAdditionalRewardDisplays(num++);
                    if (num >= 3)
                    {
                        break;
                    }
                }
            }
            else if (worldQuest.Currencies.Count <WrapperWorldQuestReward>() > 0)
            {
                foreach (WrapperWorldQuestReward wrapperWorldQuestReward2 in worldQuest.Currencies)
                {
                    CurrencyTypesRec     record = StaticDB.currencyTypesDB.GetRecord(wrapperWorldQuestReward2.RecordID);
                    CurrencyContainerRec currencyContainerRec = CurrencyContainerDB.CheckAndGetValidCurrencyContainer(wrapperWorldQuestReward2.RecordID, wrapperWorldQuestReward2.Quantity);
                    if (currencyContainerRec != null)
                    {
                        Sprite iconSprite = CurrencyContainerDB.LoadCurrencyContainerIcon(wrapperWorldQuestReward2.RecordID, wrapperWorldQuestReward2.Quantity);
                        int    quantity   = wrapperWorldQuestReward2.Quantity / (((record.Flags & 8u) == 0u) ? 1 : 100);
                        this.m_rewardInfo[num].SetCurrency(wrapperWorldQuestReward2.RecordID, quantity, iconSprite);
                        this.EnableAdditionalRewardDisplays(num++);
                        if (num >= 3)
                        {
                            break;
                        }
                    }
                    else
                    {
                        Sprite iconSprite = GeneralHelpers.LoadCurrencyIcon(wrapperWorldQuestReward2.RecordID);
                        int    quantity   = wrapperWorldQuestReward2.Quantity / (((record.Flags & 8u) == 0u) ? 1 : 100);
                        this.m_rewardInfo[num].SetCurrency(wrapperWorldQuestReward2.RecordID, quantity, iconSprite);
                        this.EnableAdditionalRewardDisplays(num++);
                        if (num >= 3)
                        {
                            break;
                        }
                    }
                }
            }
            else if (worldQuest.Money > 0)
            {
                Sprite iconSprite2 = Resources.Load <Sprite>("MiscIcons/INV_Misc_Coin_01");
                this.m_rewardInfo[num].SetGold(worldQuest.Money / 10000, iconSprite2);
                this.EnableAdditionalRewardDisplays(num++);
                if (num >= 3)
                {
                    return;
                }
            }
            else if (worldQuest.Experience > 0)
            {
                Sprite localizedFollowerXpIcon = GeneralHelpers.GetLocalizedFollowerXpIcon();
                this.m_rewardInfo[num].SetFollowerXP(worldQuest.Experience, localizedFollowerXpIcon);
                this.EnableAdditionalRewardDisplays(num++);
                if (num >= 3)
                {
                    return;
                }
            }
        }