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;
            }
        }
        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;
            }
        }
Example #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();
                }
            }
        }
        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()));
                }
            }
        }
        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;
                            }
                        }
                    }
                }
            }
        }
Example #6
0
        public void InitDBs(AssetBundle nonLocalizedBundle, AssetBundle localizedBundle)
        {
            if (StaticDB.s_initialized)
            {
                Debug.Log("WARNING! ATTEMPTED TO INIT STATIC DBS THAT WERE ALREADY INITIALIZED!! IGNORING");
                return;
            }
            string str    = "Assets/BundleAssets/StaticDB/";
            string locale = Main.instance.GetLocale();

            this.m_azeriteEmpoweredItemDB = new AzeriteEmpoweredItemDB();
            if (!this.m_azeriteEmpoweredItemDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load AzeriteEmpoweredItem static DB");
            }
            this.m_charShipmentDB = new CharShipmentDB();
            if (!this.m_charShipmentDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load charShipmentDB static DB");
            }
            this.m_charShipmentContainerDB = new CharShipmentContainerDB();
            if (!this.m_charShipmentContainerDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load charShipmentContainerDB static DB");
            }
            this.m_chrClassesDB = new ChrClassesDB();
            if (!this.m_chrClassesDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load chrClasses static DB");
            }
            this.m_communityIconDB = new CommunityIconDB();
            if (!this.m_communityIconDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load CommunityIcon static DB");
            }
            this.m_creatureDB = new CreatureDB();
            if (!this.m_creatureDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load creature static DB");
            }
            this.m_currencyTypesDB = new CurrencyTypesDB();
            if (!this.m_currencyTypesDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load currencyTypes static DB");
            }
            this.m_currencyContainerDB = new CurrencyContainerDB();
            if (!this.m_currencyContainerDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load currencyContainer static DB");
            }
            this.m_factionDB = new FactionDB();
            if (!this.m_factionDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load faction static DB");
            }
            this.m_garrAbilityDB = new GarrAbilityDB();
            if (!this.m_garrAbilityDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrAbility static DB");
            }
            this.m_garrAbilityCategoryDB = new GarrAbilityCategoryDB();
            if (!this.m_garrAbilityCategoryDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrAbilityCategory static DB");
            }
            this.m_garrAbilityEffectDB = new GarrAbilityEffectDB();
            if (!this.m_garrAbilityEffectDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrAbilityEffect static DB");
            }
            this.m_garrClassSpecDB = new GarrClassSpecDB();
            if (!this.m_garrClassSpecDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrClassSpec static DB");
            }
            this.m_garrEncounterDB = new GarrEncounterDB();
            if (!this.m_garrEncounterDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrEncounter static DB");
            }
            this.m_garrEncounterSetXEncounterDB = new GarrEncounterSetXEncounterDB();
            if (!this.m_garrEncounterSetXEncounterDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrEncounterSetXEncounterDB static DB");
            }
            this.m_garrFollItemSetMemberDB = new GarrFollItemSetMemberDB();
            if (!this.m_garrFollItemSetMemberDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrFollItemSetMember static DB");
            }
            this.m_garrFollowerDB = new GarrFollowerDB();
            if (!this.m_garrFollowerDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrFollower static DB");
            }
            this.m_garrFollowerLevelXPDB = new GarrFollowerLevelXPDB();
            if (!this.m_garrFollowerLevelXPDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrFollowerLevelXP static DB");
            }
            this.m_garrFollowerTypeDB = new GarrFollowerTypeDB();
            if (!this.m_garrFollowerTypeDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load m_garrFollowerType static DB");
            }
            this.m_garrFollowerQualityDB = new GarrFollowerQualityDB();
            if (!this.m_garrFollowerQualityDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load m_garrFollowerQuality static DB");
            }
            this.m_garrFollowerXAbilityDB = new GarrFollowerXAbilityDB();
            if (!this.m_garrFollowerXAbilityDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load m_garrFollowerXAbilty static DB");
            }
            this.m_garrMechanicDB = new GarrMechanicDB();
            if (!this.m_garrMechanicDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMechanic static DB");
            }
            this.m_garrMechanicTypeDB = new GarrMechanicTypeDB();
            if (!this.m_garrMechanicTypeDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMechanicType static DB");
            }
            this.m_garrMissionDB = new GarrMissionDB();
            if (!this.m_garrMissionDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMission static DB");
            }
            this.m_garrMissionRewardDB = new GarrMissionRewardDB();
            if (!this.m_garrMissionRewardDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMissionReward static DB");
            }
            this.m_garrMissionTypeDB = new GarrMissionTypeDB();
            if (!this.m_garrMissionTypeDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMissionType static DB");
            }
            this.m_garrMissionXEncounterDB = new GarrMissionXEncounterDB();
            if (!this.m_garrMissionXEncounterDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrMissionXEncounter static DB");
            }
            this.m_garrStringDB = new GarrStringDB();
            if (!this.m_garrStringDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrStringDB static DB");
            }
            this.m_garrTalentDB = new GarrTalentDB();
            if (!this.m_garrTalentDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrTalent static DB");
            }
            this.m_garrTalentTreeDB = new GarrTalentTreeDB();
            if (!this.m_garrTalentTreeDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load garrTalentTree static DB");
            }
            this.m_itemDB = new ItemDB();
            if (!this.m_itemDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load item static DB");
            }
            this.m_itemSubClassDB = new ItemSubClassDB();
            if (!this.m_itemSubClassDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load item sub class static DB");
            }
            this.m_itemEffectDB = new ItemEffectDB();
            if (!this.m_itemEffectDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load item effect static DB");
            }
            this.m_itemNameDescriptionDB = new ItemNameDescriptionDB();
            if (!this.m_itemNameDescriptionDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load item name description DB");
            }
            this.m_mobileStringsDB = new MobileStringsDB();
            if (!this.m_mobileStringsDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load MobileStrings static DB");
            }
            this.m_questDB = new QuestV2DB();
            if (!this.m_questDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load Quest static DB");
            }
            this.m_questInfoDB = new QuestInfoDB();
            if (!this.m_questInfoDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load QuestInfo static DB");
            }
            this.m_spellEffectDB = new SpellEffectDB();
            if (!this.m_spellEffectDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load SpellEffect static DB");
            }
            this.m_spellTooltipDB = new SpellTooltipDB();
            if (!this.m_spellTooltipDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load SpellTooltip static DB");
            }
            this.m_vw_mobileSpellDB = new VW_MobileSpellDB();
            if (!this.m_vw_mobileSpellDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load VW_MobileSpellDB static DB");
            }
            this.m_uiTextureAtlasMemberDB = new UiTextureAtlasMemberDB();
            if (!this.m_uiTextureAtlasMemberDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load uiTextureAtlasMember static DB");
            }
            this.m_uiTextureAtlasDB = new UiTextureAtlasDB();
            if (!this.m_uiTextureAtlasDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load uiTextureAtlas static DB");
            }
            this.m_uiTextureKitDB = new UiTextureKitDB();
            if (!this.m_uiTextureKitDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load uiTextureKit static DB");
            }
            this.m_worldMapAreaDB = new WorldMapAreaDB();
            if (!this.m_worldMapAreaDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load worldMapArea static DB");
            }
            this.m_rewardPackDB = new RewardPackDB();
            if (!this.m_rewardPackDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load rewardPack static DB");
            }
            this.m_rewardPackXItemDB = new RewardPackXItemDB();
            if (!this.m_rewardPackXItemDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load rewardPackXItem static DB");
            }
            this.m_rewardPackXCurrencyTypeDB = new RewardPackXCurrencyTypeDB();
            if (!this.m_rewardPackXCurrencyTypeDB.Load(str, nonLocalizedBundle, localizedBundle, locale))
            {
                Debug.Log("Failed to load rewardPackXCurrencyType static DB");
            }
            if (localizedBundle != null)
            {
                localizedBundle.Unload(true);
            }
            if (nonLocalizedBundle != null)
            {
                nonLocalizedBundle.Unload(true);
            }
            StaticDB.s_initialized = true;
        }
Example #7
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");
            }
        }
        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;
                }
            }
        }
Example #9
0
        private void InitRewardInfoDisplay(WrapperWorldQuest worldQuest)
        {
            Sprite sprite;
            int    quantity;
            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 item in worldQuest.Items)
                {
                    Sprite sprite1 = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, item.FileDataID);
                    this.m_rewardInfo[num].SetReward(MissionRewardDisplay.RewardType.item, item.RecordID, item.Quantity, sprite1, item.ItemContext);
                    int num1 = num;
                    num = num1 + 1;
                    this.EnableAdditionalRewardDisplays(num1);
                    if (num < 3)
                    {
                        continue;
                    }
                    return;
                }
            }
            else if (worldQuest.Currencies.Count <WrapperWorldQuestReward>() > 0)
            {
                foreach (WrapperWorldQuestReward currency in worldQuest.Currencies)
                {
                    CurrencyTypesRec record = StaticDB.currencyTypesDB.GetRecord(currency.RecordID);
                    if (CurrencyContainerDB.CheckAndGetValidCurrencyContainer(currency.RecordID, currency.Quantity) == null)
                    {
                        sprite   = GeneralHelpers.LoadCurrencyIcon(currency.RecordID);
                        quantity = currency.Quantity / ((record.Flags & 8) == 0 ? 1 : 100);
                        this.m_rewardInfo[num].SetCurrency(currency.RecordID, quantity, sprite);
                        int num2 = num;
                        num = num2 + 1;
                        this.EnableAdditionalRewardDisplays(num2);
                        if (num < 3)
                        {
                            continue;
                        }
                        return;
                    }
                    else
                    {
                        sprite   = CurrencyContainerDB.LoadCurrencyContainerIcon(currency.RecordID, currency.Quantity);
                        quantity = currency.Quantity / ((record.Flags & 8) == 0 ? 1 : 100);
                        this.m_rewardInfo[num].SetCurrency(currency.RecordID, quantity, sprite);
                        int num3 = num;
                        num = num3 + 1;
                        this.EnableAdditionalRewardDisplays(num3);
                        if (num >= 3)
                        {
                            return;
                        }
                    }
                }
            }
            else if (worldQuest.Money > 0)
            {
                Sprite sprite2 = Resources.Load <Sprite>("MiscIcons/INV_Misc_Coin_01");
                this.m_rewardInfo[num].SetGold(worldQuest.Money / 10000, sprite2);
                int num4 = num;
                num = num4 + 1;
                this.EnableAdditionalRewardDisplays(num4);
                if (num >= 3)
                {
                    return;
                }
            }
            else if (worldQuest.Experience > 0)
            {
                Sprite localizedFollowerXpIcon = GeneralHelpers.GetLocalizedFollowerXpIcon();
                this.m_rewardInfo[num].SetFollowerXP(worldQuest.Experience, localizedFollowerXpIcon);
                int num5 = num;
                num = num5 + 1;
                this.EnableAdditionalRewardDisplays(num5);
                if (num >= 3)
                {
                    return;
                }
            }
        }
Example #10
0
        public void SetBounty(WrapperWorldQuestBounty bounty)
        {
            Sprite sprite;

            this.m_bounty = bounty;
            Sprite sprite1 = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, bounty.IconFileDataID);

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

            if (record == null)
            {
                this.m_bountyName.text        = string.Concat("Unknown Quest ID ", bounty.QuestID);
                this.m_bountyDescription.text = string.Concat("Unknown Quest ID ", bounty.QuestID);
            }
            else
            {
                this.m_bountyName.text        = record.QuestTitle;
                this.m_bountyDescription.text = string.Concat(new object[] { string.Empty, bounty.NumCompleted, "/", bounty.NumNeeded, " ", record.LogDescription });
            }
            this.m_timeLeft.text = StaticDB.GetString("TIME_LEFT", "Time Left: PH");
            RectTransform[] componentsInChildren = this.m_bountyQuestIconArea.GetComponentsInChildren <RectTransform>(true);
            for (int i = 0; i < (int)componentsInChildren.Length; i++)
            {
                RectTransform rectTransform = componentsInChildren[i];
                if (rectTransform != null && rectTransform.gameObject != this.m_bountyQuestIconArea.gameObject)
                {
                    rectTransform.SetParent(null);
                    UnityEngine.Object.Destroy(rectTransform.gameObject);
                }
            }
            for (int j = 0; j < bounty.NumCompleted; j++)
            {
                GameObject gameObject = UnityEngine.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 gameObject1 = UnityEngine.Object.Instantiate <GameObject>(this.m_bountyQuestAvailableIconPrefab);
                gameObject1.transform.SetParent(this.m_bountyQuestIconArea.transform, false);
            }
            this.UpdateTimeRemaining();
            bounty.Items.RemoveAll((WrapperWorldQuestReward item) => (item.RecordID == 157831 ? true : item.RecordID == 1500));
            if (bounty.Items.Count > 0 && StaticDB.itemDB.GetRecord(bounty.Items[0].RecordID) != null)
            {
                WrapperWorldQuestReward wrapperWorldQuestReward = bounty.Items[0];
                Sprite sprite2 = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, wrapperWorldQuestReward.FileDataID);
                this.m_rewardInfo.SetReward(MissionRewardDisplay.RewardType.item, wrapperWorldQuestReward.RecordID, wrapperWorldQuestReward.Quantity, sprite2, wrapperWorldQuestReward.ItemContext);
            }
            else if (bounty.Money > 1000000)
            {
                Sprite sprite3 = Resources.Load <Sprite>("MiscIcons/INV_Misc_Coin_01");
                this.m_rewardInfo.SetGold(bounty.Money / 10000, sprite3);
            }
            else if (bounty.Currencies.Count > 1)
            {
                int num = 0;
                foreach (WrapperWorldQuestReward currency in bounty.Currencies)
                {
                    CurrencyTypesRec currencyTypesRec = StaticDB.currencyTypesDB.GetRecord(currency.RecordID);
                    if (currency.RecordID == 1553 && currencyTypesRec != null)
                    {
                        if (CurrencyContainerDB.CheckAndGetValidCurrencyContainer(currency.RecordID, currency.Quantity) == null)
                        {
                            sprite = GeneralHelpers.LoadCurrencyIcon(currency.RecordID);
                            int quantity = currency.Quantity / ((currencyTypesRec.Flags & 8) == 0 ? 1 : 100);
                            if (quantity <= num)
                            {
                                continue;
                            }
                            num = quantity;
                            this.m_rewardInfo.SetCurrency(currency.RecordID, num, sprite);
                        }
                        else
                        {
                            sprite = CurrencyContainerDB.LoadCurrencyContainerIcon(currency.RecordID, currency.Quantity);
                            int quantity1 = currency.Quantity / ((currencyTypesRec.Flags & 8) == 0 ? 1 : 100);
                            if (quantity1 > num)
                            {
                                num = quantity1;
                                this.m_rewardInfo.SetCurrency(currency.RecordID, num, sprite);
                            }
                        }
                    }
                }
            }
        }