public void SetCharShipment(MobileClientShipmentType shipmentType, bool isSealOfFateHack = false, CharShipmentRec sealOfFateHackCharShipmentRec = null) { if (isSealOfFateHack) { this.m_shipmentCost = 0; } else { this.m_shipmentCost = shipmentType.CurrencyCost; } Transform[] componentsInChildren = this.m_troopHeartContainer.GetComponentsInChildren <Transform>(true); Transform[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { Transform transform = array[i]; if (transform != this.m_troopHeartContainer.get_transform()) { Object.DestroyImmediate(transform.get_gameObject()); } } AbilityDisplay[] componentsInChildren2 = this.m_traitsAndAbilitiesRootObject.GetComponentsInChildren <AbilityDisplay>(true); AbilityDisplay[] array2 = componentsInChildren2; for (int j = 0; j < array2.Length; j++) { AbilityDisplay abilityDisplay = array2[j]; Object.DestroyImmediate(abilityDisplay.get_gameObject()); } TroopSlot[] componentsInChildren3 = this.m_troopSlotsRootObject.GetComponentsInChildren <TroopSlot>(true); TroopSlot[] array3 = componentsInChildren3; for (int k = 0; k < array3.Length; k++) { TroopSlot troopSlot = array3[k]; Object.DestroyImmediate(troopSlot.get_gameObject()); } CharShipmentRec charShipmentRec = (!isSealOfFateHack) ? StaticDB.charShipmentDB.GetRecord(shipmentType.CharShipmentID) : sealOfFateHackCharShipmentRec; if (charShipmentRec == null) { Debug.LogError("Invalid Shipment ID: " + shipmentType.CharShipmentID); this.m_troopName.set_text("Invalid Shipment ID: " + shipmentType.CharShipmentID); return; } if (charShipmentRec.GarrFollowerID > 0u) { this.SetCharShipmentTroop(shipmentType, charShipmentRec); } else if (charShipmentRec.DummyItemID > 0) { this.SetCharShipmentItem(shipmentType, (!isSealOfFateHack) ? charShipmentRec : sealOfFateHackCharShipmentRec, isSealOfFateHack); } }
public void ShowMissionResults(int garrMissionID, int missionResultType, bool awardOvermax) { this.m_missionResultsDisplayCanvasGroupAutoFadeOut.Reset(); this.m_currentResultType = (MissionResultType)missionResultType; this.m_followerExperienceDisplayArea.SetActive(false); this.m_attemptedAutoComplete = false; this.m_garrMissionID = garrMissionID; this.m_darknessBG.SetActive(true); this.m_popupView.SetActive(true); this.m_bonusLootDisplay.SetActive(false); if (this.missionFollowerSlotGroup != null) { MissionFollowerSlot[] componentsInChildren = this.missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true); for (int i = 0; i < componentsInChildren.Length; i++) { if (componentsInChildren[i] != null && componentsInChildren[i] != this.missionFollowerSlotGroup.get_transform()) { Object.DestroyImmediate(componentsInChildren[i].get_gameObject()); } } } MissionEncounter[] componentsInChildren2 = this.enemyPortraitsGroup.GetComponentsInChildren <MissionEncounter>(true); for (int j = 0; j < componentsInChildren2.Length; j++) { if (componentsInChildren2[j] != null && componentsInChildren2[j] != this.enemyPortraitsGroup.get_transform()) { Object.DestroyImmediate(componentsInChildren2[j].get_gameObject()); } } if (this.treasureChestHorde != null && this.treasureChestAlliance != null) { if (GarrisonStatus.Faction() == PVP_FACTION.HORDE) { this.treasureChestHorde.SetActive(true); this.treasureChestAlliance.SetActive(false); } else { this.treasureChestHorde.SetActive(false); this.treasureChestAlliance.SetActive(true); } } JamGarrisonMobileMission jamGarrisonMobileMission = (JamGarrisonMobileMission)PersistentMissionData.missionDictionary.get_Item(garrMissionID); this.m_missionStartedTime = jamGarrisonMobileMission.StartTime; this.m_missionDurationInSeconds = jamGarrisonMobileMission.MissionDuration; for (int k = 0; k < jamGarrisonMobileMission.Encounter.Length; k++) { GameObject gameObject = Object.Instantiate <GameObject>(this.missionEncounterPrefab); gameObject.get_transform().SetParent(this.enemyPortraitsGroup.get_transform(), false); MissionEncounter component = gameObject.GetComponent <MissionEncounter>(); int garrMechanicID = (jamGarrisonMobileMission.Encounter[k].MechanicID.Length <= 0) ? 0 : jamGarrisonMobileMission.Encounter[k].MechanicID[0]; component.SetEncounter(jamGarrisonMobileMission.Encounter[k].EncounterID, garrMechanicID); } GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(garrMissionID); this.missionNameText.set_text(record.Name); this.missionLocationText.set_text(record.Location); this.missioniLevelText.set_text(StaticDB.GetString("ITEM_LEVEL_ABBREVIATION", null) + " " + record.TargetItemLevel); GarrMissionTypeRec record2 = StaticDB.garrMissionTypeDB.GetRecord((int)record.GarrMissionTypeID); this.missionTypeImage.set_overrideSprite(TextureAtlas.instance.GetAtlasSprite((int)record2.UiTextureAtlasMemberID)); if (this.missionFollowerSlotGroup != null) { int num = 0; while ((long)num < (long)((ulong)record.MaxFollowers)) { GameObject gameObject2 = Object.Instantiate <GameObject>(this.missionFollowerSlotPrefab); gameObject2.get_transform().SetParent(this.missionFollowerSlotGroup.get_transform(), false); MissionFollowerSlot component2 = gameObject2.GetComponent <MissionFollowerSlot>(); component2.m_enemyPortraitsGroup = this.enemyPortraitsGroup; num++; } } if (record.UiTextureKitID > 0u) { UiTextureKitRec record3 = StaticDB.uiTextureKitDB.GetRecord((int)record.UiTextureKitID); this.m_scrollingEnvironment_Back.set_enabled(false); this.m_scrollingEnvironment_Mid.set_enabled(false); this.m_scrollingEnvironment_Fore.set_enabled(false); int uITextureAtlasMemberID = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Back"); if (uITextureAtlasMemberID > 0) { Sprite atlasSprite = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID); if (atlasSprite != null) { this.m_scrollingEnvironment_Back.set_enabled(true); this.m_scrollingEnvironment_Back.set_sprite(atlasSprite); } } int uITextureAtlasMemberID2 = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Mid"); if (uITextureAtlasMemberID2 > 0) { Sprite atlasSprite2 = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID2); if (atlasSprite2 != null) { this.m_scrollingEnvironment_Mid.set_enabled(true); this.m_scrollingEnvironment_Mid.set_sprite(atlasSprite2); } } int uITextureAtlasMemberID3 = TextureAtlas.GetUITextureAtlasMemberID("_" + record3.KitPrefix + "-Fore"); if (uITextureAtlasMemberID3 > 0) { Sprite atlasSprite3 = TextureAtlas.instance.GetAtlasSprite(uITextureAtlasMemberID3); if (atlasSprite3 != null) { this.m_scrollingEnvironment_Fore.set_enabled(true); this.m_scrollingEnvironment_Fore.set_sprite(atlasSprite3); } } } else { Debug.LogWarning(string.Concat(new object[] { "DATA ERROR: Mission UITextureKit Not Set for mission ID:", record.ID, " - ", record.Name })); Debug.LogWarning("This means the scrolling background images will show the wrong location"); } if (this.m_lootGroupObj == null || this.m_missionRewardDisplayPrefab == null) { return; } MissionRewardDisplay[] componentsInChildren3 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true); for (int l = 0; l < componentsInChildren3.Length; l++) { if (componentsInChildren3[l] != null) { Object.DestroyImmediate(componentsInChildren3[l].get_gameObject()); } } MissionFollowerSlot[] componentsInChildren4 = this.missionFollowerSlotGroup.GetComponentsInChildren <MissionFollowerSlot>(true); int num2 = 0; using (Dictionary <int, JamGarrisonFollower> .ValueCollection.Enumerator enumerator = PersistentFollowerData.followerDictionary.get_Values().GetEnumerator()) { while (enumerator.MoveNext()) { JamGarrisonFollower current = enumerator.get_Current(); if (current.CurrentMissionID == garrMissionID) { componentsInChildren4[num2++].SetFollower(current.GarrFollowerID); if (missionResultType == 1) { PersistentFollowerData.CachePreMissionFollower(current); } } } } this.UpdateMissionStatus(garrMissionID); MissionFollowerSlot[] array = componentsInChildren4; for (int m = 0; m < array.Length; m++) { MissionFollowerSlot missionFollowerSlot = array[m]; missionFollowerSlot.InitHeartPanel(); } MissionRewardDisplay.InitMissionRewards(this.m_missionRewardDisplayPrefab.get_gameObject(), this.m_lootGroupObj.get_transform(), jamGarrisonMobileMission.Reward); if (record.OvermaxRewardPackID > 0 && jamGarrisonMobileMission.OvermaxReward.Length > 0) { this.m_bonusLootDisplay.SetActive(true); JamGarrisonMissionReward jamGarrisonMissionReward = jamGarrisonMobileMission.OvermaxReward[0]; if (jamGarrisonMissionReward.ItemID > 0) { this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.item, jamGarrisonMissionReward.ItemID, (int)jamGarrisonMissionReward.ItemQuantity, 0, jamGarrisonMissionReward.ItemFileDataID); } else if (jamGarrisonMissionReward.FollowerXP > 0u) { this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.followerXP, 0, (int)jamGarrisonMissionReward.FollowerXP, 0, 0); } else if (jamGarrisonMissionReward.CurrencyQuantity > 0u) { if (jamGarrisonMissionReward.CurrencyType == 0) { this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.gold, 0, (int)(jamGarrisonMissionReward.CurrencyQuantity / 10000u), 0, 0); } else { CurrencyTypesRec record4 = StaticDB.currencyTypesDB.GetRecord(jamGarrisonMissionReward.CurrencyType); int rewardQuantity = (int)((ulong)jamGarrisonMissionReward.CurrencyQuantity / (ulong)(((record4.Flags & 8u) == 0u) ? 1L : 100L)); this.m_bonusMissionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.currency, jamGarrisonMissionReward.CurrencyType, rewardQuantity, 0, 0); } } } this.m_timeUntilFadeOutMissionDetailsDisplay = this.m_missionDetailsFadeOutDelay; this.m_timeUntilShowFollowerExperienceDisplays = this.m_experienceDisplayInitialEntranceDelay; if (missionResultType == 2) { this.InitFollowerExperienceDisplays(); Main.instance.m_UISound.Play_MissionSuccess(); this.m_missionInProgressMessage.SetActive(false); this.m_missionSuccessMessage.SetActive(true); this.m_missionFailMessage.SetActive(false); if (this.m_fancyEntrance != null) { Object.DestroyImmediate(this.m_fancyEntrance); iTween.Stop(this.m_missionSuccessMessage); this.m_missionSuccessMessage.get_transform().set_localScale(Vector3.get_one()); iTween.Stop(this.m_missionFailMessage); this.m_missionFailMessage.get_transform().set_localScale(Vector3.get_one()); } this.m_missionSuccessMessage.SetActive(false); this.m_fancyEntrance = this.m_missionSuccessMessage.AddComponent <FancyEntrance>(); this.m_fancyEntrance.m_fadeInCanvasGroup = this.m_missionSuccessMessage.GetComponent <CanvasGroup>(); this.m_fancyEntrance.m_fadeInTime = this.m_messageFadeInTime; this.m_fancyEntrance.m_punchScale = this.m_messagePunchScale; this.m_fancyEntrance.m_punchScaleAmount = this.m_messagePunchScaleAmount; this.m_fancyEntrance.m_punchScaleDuration = this.m_messagePunchScaleDuration; this.m_fancyEntrance.m_timeToDelayEntrance = this.m_messageTimeToDelayEntrance; this.m_missionSuccessMessage.SetActive(true); MissionRewardDisplay[] componentsInChildren5 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true); for (int n = 0; n < componentsInChildren5.Length; n++) { componentsInChildren5[n].ShowResultSuccess(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)n); } if (awardOvermax) { this.m_bonusMissionRewardDisplay.ShowResultSuccess(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)componentsInChildren5.Length); } else { this.m_bonusMissionRewardDisplay.ShowResultFail(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)componentsInChildren5.Length); } } if (missionResultType == 3) { this.InitFollowerExperienceDisplays(); Main.instance.m_UISound.Play_MissionFailure(); this.m_missionInProgressMessage.SetActive(false); this.m_missionSuccessMessage.SetActive(false); this.m_missionFailMessage.SetActive(true); if (this.m_fancyEntrance != null) { Object.DestroyImmediate(this.m_fancyEntrance); iTween.Stop(this.m_missionSuccessMessage); this.m_missionSuccessMessage.get_transform().set_localScale(Vector3.get_one()); iTween.Stop(this.m_missionFailMessage); this.m_missionFailMessage.get_transform().set_localScale(Vector3.get_one()); } this.m_missionFailMessage.SetActive(false); this.m_fancyEntrance = this.m_missionFailMessage.AddComponent <FancyEntrance>(); this.m_fancyEntrance.m_fadeInCanvasGroup = this.m_missionFailMessage.GetComponent <CanvasGroup>(); this.m_fancyEntrance.m_fadeInTime = this.m_messageFadeInTime; this.m_fancyEntrance.m_punchScale = this.m_messagePunchScale; this.m_fancyEntrance.m_punchScaleAmount = this.m_messagePunchScaleAmount; this.m_fancyEntrance.m_punchScaleDuration = this.m_messagePunchScaleDuration; this.m_fancyEntrance.m_timeToDelayEntrance = this.m_messageTimeToDelayEntrance; this.m_missionFailMessage.SetActive(true); MissionRewardDisplay[] componentsInChildren6 = this.m_lootGroupObj.GetComponentsInChildren <MissionRewardDisplay>(true); for (int num3 = 0; num3 < componentsInChildren6.Length; num3++) { componentsInChildren6[num3].ShowResultFail(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)num3); } this.m_bonusMissionRewardDisplay.ShowResultFail(this.m_lootEffectInitialDelay + this.m_lootEffectDelay * (float)componentsInChildren6.Length); } if (missionResultType == 0) { this.m_missionInProgressMessage.SetActive(true); this.m_missionSuccessMessage.SetActive(false); this.m_missionFailMessage.SetActive(false); this.m_bonusMissionRewardDisplay.ClearResults(); } if (missionResultType == 1) { this.m_missionInProgressMessage.SetActive(false); this.m_missionSuccessMessage.SetActive(false); this.m_missionFailMessage.SetActive(false); FollowerExperienceDisplay[] componentsInChildren7 = this.m_followerExperienceDisplayArea.GetComponentsInChildren <FollowerExperienceDisplay>(true); FollowerExperienceDisplay[] array2 = componentsInChildren7; for (int num4 = 0; num4 < array2.Length; num4++) { FollowerExperienceDisplay followerExperienceDisplay = array2[num4]; Object.DestroyImmediate(followerExperienceDisplay.get_gameObject()); } } if (this.m_partyBuffGroup != null) { AbilityDisplay[] componentsInChildren8 = this.m_partyBuffGroup.GetComponentsInChildren <AbilityDisplay>(true); AbilityDisplay[] array3 = componentsInChildren8; for (int num5 = 0; num5 < array3.Length; num5++) { AbilityDisplay abilityDisplay = array3[num5]; Object.DestroyImmediate(abilityDisplay.get_gameObject()); } } int num6 = 0; using (Dictionary <int, JamGarrisonFollower> .ValueCollection.Enumerator enumerator2 = PersistentFollowerData.followerDictionary.get_Values().GetEnumerator()) { while (enumerator2.MoveNext()) { JamGarrisonFollower current2 = enumerator2.get_Current(); if (current2.CurrentMissionID == garrMissionID) { int[] buffsForCurrentMission = GeneralHelpers.GetBuffsForCurrentMission(current2.GarrFollowerID, garrMissionID, this.missionFollowerSlotGroup); num6 += buffsForCurrentMission.Length; int[] array4 = buffsForCurrentMission; for (int num7 = 0; num7 < array4.Length; num7++) { int garrAbilityID = array4[num7]; GameObject gameObject3 = Object.Instantiate <GameObject>(this.m_mechanicEffectDisplayPrefab); gameObject3.get_transform().SetParent(this.m_partyBuffGroup.get_transform(), false); AbilityDisplay component3 = gameObject3.GetComponent <AbilityDisplay>(); component3.SetAbility(garrAbilityID, false, false, null); } } } } this.m_partyBuffGroup.SetActive(num6 > 0); }