private void ParseSpellPoints()
        {
            this.ConsumeCharacter();
            this.ReadAndConsumeNumber();
            int num = Convert.ToInt32(this.m_currentValue);

            num--;
            if (num < 0)
            {
                num = 0;
            }
            SpellEffectRec spellEffectRec1 = StaticDB.spellEffectDB.GetRecordsByParentID(this.m_spellID).FirstOrDefault <SpellEffectRec>((SpellEffectRec spellEffectRec) => spellEffectRec.EffectIndex == num);

            this.m_currentValue = ((spellEffectRec1 == null ? 0 : spellEffectRec1.EffectBasePoints)).ToString();
            this.AddNumericToken();
        }
Ejemplo n.º 2
0
        private void ParseSpellPoints()
        {
            this.ConsumeCharacter();
            this.ReadAndConsumeNumber();
            int effectIndex = Convert.ToInt32(this.m_currentValue);

            effectIndex--;
            if (effectIndex < 0)
            {
                effectIndex = 0;
            }
            SpellEffectRec spellEffectRec2 = StaticDB.spellEffectDB.GetRecordsByParentID(this.m_spellID).FirstOrDefault((SpellEffectRec spellEffectRec) => spellEffectRec.EffectIndex == effectIndex);

            this.m_currentValue = ((spellEffectRec2 == null) ? 0 : spellEffectRec2.EffectBasePoints).ToString();
            this.AddNumericToken();
        }
Ejemplo n.º 3
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");
            }
        }
Ejemplo n.º 4
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;
                    }
                    if (this.m_showLootIconInsteadOfMain)
                    {
                        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.ShowILVL();
                    }
                }
            }
            if (!flag && this.m_showLootIconInsteadOfMain)
            {
                if (wrapperWorldQuest.Currencies.Count > 0)
                {
                    foreach (WrapperWorldQuestReward wrapperWorldQuestReward2 in wrapperWorldQuest.Currencies)
                    {
                        CurrencyTypesRec record2 = StaticDB.currencyTypesDB.GetRecord(wrapperWorldQuestReward2.RecordID);
                        if (record2 != null)
                        {
                            this.m_main.sprite = GeneralHelpers.LoadCurrencyIcon(wrapperWorldQuestReward2.RecordID);
                        }
                        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 flag2 = record4.Type == 7;

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

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

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

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

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

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

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

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

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