public void HandleBountyInfoUpdated() { BountySite[] componentsInChildren = this.m_missionAndWordQuestArea.get_transform().GetComponentsInChildren <BountySite>(true); BountySite[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { BountySite bountySite = array[i]; Object.DestroyImmediate(bountySite.get_gameObject()); } IEnumerator enumerator = PersistentBountyData.bountyDictionary.get_Values().GetEnumerator(); try { while (enumerator.MoveNext()) { MobileWorldQuestBounty mobileWorldQuestBounty = (MobileWorldQuestBounty)enumerator.get_Current(); GameObject gameObject = Object.Instantiate <GameObject>(this.m_bountySitePrefab); BountySite component = gameObject.GetComponent <BountySite>(); component.SetBounty(mobileWorldQuestBounty); gameObject.set_name("BountySite " + mobileWorldQuestBounty.QuestID); RectTransform component2 = gameObject.GetComponent <RectTransform>(); gameObject.get_transform().SetParent(this.m_missionAndWordQuestArea.get_transform(), false); component2.set_anchorMin(new Vector2(0.5f, 0.5f)); component2.set_anchorMax(new Vector2(0.5f, 0.5f)); QuestV2Rec record = StaticDB.questDB.GetRecord(mobileWorldQuestBounty.QuestID); bool flag = true; ZoneMissionOverview zoneMissionOverview = null; int questSortID = record.QuestSortID; if (questSortID == 7502) { goto IL_1AA; } if (questSortID != 7503) { if (questSortID != 7334) { if (questSortID != 7541) { if (questSortID != 7558) { if (questSortID != 7637) { if (questSortID == 8147) { goto IL_1AA; } flag = false; } else { zoneMissionOverview = this.m_allZoneMissionOverviews[4]; } } else { zoneMissionOverview = this.m_allZoneMissionOverviews[5]; } } else { zoneMissionOverview = this.m_allZoneMissionOverviews[3]; } } else { zoneMissionOverview = this.m_allZoneMissionOverviews[0]; } } else { zoneMissionOverview = this.m_allZoneMissionOverviews[2]; } IL_1C1: if (flag) { if (zoneMissionOverview.zoneNameTag.get_Length() > 0) { gameObject.get_transform().SetParent(zoneMissionOverview.m_bountyButtonRoot.get_transform(), false); } else { gameObject.get_transform().SetParent(zoneMissionOverview.m_anonymousBountyButtonRoot.get_transform(), false); } gameObject.get_transform().set_localPosition(Vector3.get_zero()); component.m_errorImage.get_gameObject().SetActive(false); } else { gameObject.get_transform().set_localPosition(new Vector3(0f, 0f, 0f)); component.m_errorImage.get_gameObject().SetActive(true); } StackableMapIcon component3 = gameObject.GetComponent <StackableMapIcon>(); if (component3 != null) { component3.RegisterWithManager(); continue; } continue; IL_1AA: zoneMissionOverview = this.m_allZoneMissionOverviews[6]; goto IL_1C1; } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } }
public void SetQuest(int questID) { this.m_expiringSoon.get_gameObject().SetActive(false); this.m_questID = questID; Transform[] componentsInChildren = this.m_worldQuestObjectiveRoot.GetComponentsInChildren <Transform>(true); Transform[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { Transform transform = array[i]; if (transform != null && transform != this.m_worldQuestObjectiveRoot.get_transform()) { Object.DestroyImmediate(transform.get_gameObject()); } } MobileWorldQuest mobileWorldQuest = (MobileWorldQuest)WorldQuestData.worldQuestDictionary.get_Item(this.m_questID); GameObject gameObject = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab); gameObject.get_transform().SetParent(this.m_worldQuestObjectiveRoot.get_transform(), false); Text component = gameObject.GetComponent <Text>(); component.set_text(mobileWorldQuest.QuestTitle); component.set_resizeTextMaxSize(26); BountySite[] componentsInChildren2 = this.m_bountyLogoRoot.get_transform().GetComponentsInChildren <BountySite>(true); BountySite[] array2 = componentsInChildren2; for (int j = 0; j < array2.Length; j++) { BountySite bountySite = array2[j]; Object.DestroyImmediate(bountySite.get_gameObject()); } if (PersistentBountyData.bountiesByWorldQuestDictionary.ContainsKey(mobileWorldQuest.QuestID)) { MobileBountiesByWorldQuest mobileBountiesByWorldQuest = (MobileBountiesByWorldQuest)PersistentBountyData.bountiesByWorldQuestDictionary.get_Item(mobileWorldQuest.QuestID); for (int k = 0; k < mobileBountiesByWorldQuest.BountyQuestID.Length; k++) { IEnumerator enumerator = PersistentBountyData.bountyDictionary.get_Values().GetEnumerator(); try { while (enumerator.MoveNext()) { MobileWorldQuestBounty mobileWorldQuestBounty = (MobileWorldQuestBounty)enumerator.get_Current(); if (mobileBountiesByWorldQuest.BountyQuestID[k] == mobileWorldQuestBounty.QuestID) { QuestV2Rec record = StaticDB.questDB.GetRecord(mobileWorldQuestBounty.QuestID); if (record != null) { GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab); gameObject2.get_transform().SetParent(this.m_worldQuestObjectiveRoot.get_transform(), false); this.m_worldQuestTimeText = gameObject2.GetComponent <Text>(); this.m_worldQuestTimeText.set_text(record.QuestTitle); this.m_worldQuestTimeText.set_horizontalOverflow(1); this.m_worldQuestTimeText.set_color(new Color(1f, 0.773f, 0f, 1f)); BountySite bountySite2 = Object.Instantiate <BountySite>(this.m_bountyLogoPrefab); bountySite2.SetBounty(mobileWorldQuestBounty); bountySite2.get_transform().SetParent(this.m_bountyLogoRoot.get_transform(), false); } } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } } } GameObject gameObject3 = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab); gameObject3.get_transform().SetParent(this.m_worldQuestObjectiveRoot.get_transform(), false); this.m_worldQuestTimeText = gameObject3.GetComponent <Text>(); this.m_worldQuestTimeText.set_text(mobileWorldQuest.QuestTitle); this.m_worldQuestTimeText.set_horizontalOverflow(1); this.m_worldQuestTimeText.set_color(new Color(1f, 0.773f, 0f, 1f)); using (IEnumerator <MobileWorldQuestObjective> enumerator2 = Enumerable.AsEnumerable <MobileWorldQuestObjective>(mobileWorldQuest.Objective).GetEnumerator()) { while (enumerator2.MoveNext()) { MobileWorldQuestObjective current = enumerator2.get_Current(); GameObject gameObject4 = Object.Instantiate <GameObject>(this.m_worldQuestObjectiveDisplayPrefab); gameObject4.get_transform().SetParent(this.m_worldQuestObjectiveRoot.get_transform(), false); Text component2 = gameObject4.GetComponent <Text>(); component2.set_text("-" + current.Text); } } this.InitRewardInfoDisplay(mobileWorldQuest); this.m_endTime = (long)(mobileWorldQuest.EndTime - 900); QuestInfoRec record2 = StaticDB.questInfoDB.GetRecord(mobileWorldQuest.QuestInfoID); if (record2 == null) { return; } bool active = (record2.Modifiers & 2) != 0; this.m_dragonFrame.get_gameObject().SetActive(active); this.m_background.set_sprite(Resources.Load <Sprite>("NewWorldQuest/Mobile-NormalQuest")); bool flag = (record2.Modifiers & 1) != 0; if (flag && record2.Type != 3) { this.m_background.set_sprite(Resources.Load <Sprite>("NewWorldQuest/Mobile-RareQuest")); } bool flag2 = (record2.Modifiers & 4) != 0; if (flag2 && record2.Type != 3) { this.m_background.set_sprite(Resources.Load <Sprite>("NewWorldQuest/Mobile-EpicQuest")); } int uITextureAtlasMemberID; string text; switch (record2.Type) { case 1: { int profession = record2.Profession; switch (profession) { case 182: uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-herbalism"); text = "Mobile-Herbalism"; goto IL_6CB; case 183: case 184: IL_4B6: if (profession == 164) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-blacksmithing"); text = "Mobile-Blacksmithing"; goto IL_6CB; } if (profession == 165) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-leatherworking"); text = "Mobile-Leatherworking"; goto IL_6CB; } if (profession == 129) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-firstaid"); text = "Mobile-FirstAid"; goto IL_6CB; } if (profession == 171) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-alchemy"); text = "Mobile-Alchemy"; goto IL_6CB; } if (profession == 197) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-tailoring"); text = "Mobile-Tailoring"; goto IL_6CB; } if (profession == 202) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-engineering"); text = "Mobile-Engineering"; goto IL_6CB; } if (profession == 333) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-enchanting"); text = "Mobile-Enchanting"; goto IL_6CB; } if (profession == 356) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-fishing"); text = "Mobile-Fishing"; goto IL_6CB; } if (profession == 393) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-skinning"); text = "Mobile-Skinning"; goto IL_6CB; } if (profession == 755) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-jewelcrafting"); text = "Mobile-Jewelcrafting"; goto IL_6CB; } if (profession == 773) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-inscription"); text = "Mobile-Inscription"; goto IL_6CB; } if (profession != 794) { uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang"); text = "Mobile-QuestExclamationIcon"; goto IL_6CB; } uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-archaeology"); text = "Mobile-Archaeology"; goto IL_6CB; case 185: uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-cooking"); text = "Mobile-Cooking"; goto IL_6CB; case 186: uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-mining"); text = "Mobile-Mining"; goto IL_6CB; } goto IL_4B6; IL_6CB: goto IL_718; } case 3: uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-pvp-ffa"); text = "Mobile-PVP"; goto IL_718; case 4: uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-icon-petbattle"); text = "Mobile-Pets"; goto IL_718; } uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("worldquest-questmarker-questbang"); text = "Mobile-QuestExclamationIcon"; IL_718: if (text != null) { this.m_main.set_sprite(Resources.Load <Sprite>("NewWorldQuest/" + text)); } else if (uITextureAtlasMemberID > 0) { this.m_main.set_sprite(TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID)); this.m_main.SetNativeSize(); } this.UpdateTimeRemaining(); }