public static void AddOrUpdateBounty(WrapperWorldQuestBounty bounty) { if (PersistentBountyData.instance.m_bountyDictionary.ContainsKey(bounty.QuestID)) { PersistentBountyData.instance.m_bountyDictionary.Remove(bounty.QuestID); } PersistentBountyData.instance.m_bountyDictionary.Add(bounty.QuestID, bounty); }
public void SetBounty(WrapperWorldQuestBounty bounty) { this.m_bounty = bounty; Sprite sprite = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, bounty.IconFileDataID); if (sprite != null) { this.m_invalidFileDataID.gameObject.SetActive(false); this.m_emissaryIcon.sprite = sprite; } else { this.m_invalidFileDataID.gameObject.SetActive(true); this.m_invalidFileDataID.text = string.Empty + bounty.IconFileDataID; } }
public void ShowBountyInfoTooltip(WrapperWorldQuestBounty bounty) { this.HideAllPopups(); this.m_bountyInfoTooltip.gameObject.SetActive(true); this.m_bountyInfoTooltip.SetBounty(bounty); }
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; } } } } } }
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.questDB.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) { 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) { ItemRec record2 = StaticDB.itemDB.GetRecord(bounty.Items[0].RecordID); if (record2 != null) { this.m_lootName.text = record2.Display; this.m_lootDescription.text = GeneralHelpers.GetItemDescription(record2); Sprite sprite2 = GeneralHelpers.LoadIconAsset(AssetBundleType.Icons, record2.IconFileDataID); if (sprite2 != null) { this.m_lootIcon.sprite = sprite2; } else if (this.m_lootIconInvalidFileDataID != null) { this.m_lootIconInvalidFileDataID.gameObject.SetActive(true); this.m_lootIconInvalidFileDataID.text = string.Empty + record2.IconFileDataID; } } else { this.m_lootName.text = "Unknown item " + bounty.Items[0].RecordID; this.m_lootDescription.text = "Unknown item " + bounty.Items[0].RecordID; } } else { this.m_lootName.text = "ERROR: Loot Not Specified"; this.m_lootDescription.text = "ERROR: Loot Not Specified"; } }
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); } } } } } }