public void HandleShipmentItemPushed(WrapperShipmentItem item)
        {
            if (!this.m_itemResourceCostText.gameObject.activeSelf)
            {
                return;
            }
            if (!this.m_lootDisplayArea.activeSelf)
            {
                this.m_lootDisplayArea.SetActive(true);
            }
            int charShipmentTypeID = this.GetCharShipmentTypeID();
            MissionRewardDisplay missionRewardDisplay = null;

            if (charShipmentTypeID < 372 || charShipmentTypeID > 383)
            {
                missionRewardDisplay = UnityEngine.Object.Instantiate <MissionRewardDisplay>(this.m_rewardDisplayPrefab);
                missionRewardDisplay.transform.SetParent(this.m_lootItemArea.transform, false);
                missionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.item, item.ItemID, item.Count, item.Context, item.IconFileDataID);
            }
            else
            {
                missionRewardDisplay = UnityEngine.Object.Instantiate <MissionRewardDisplay>(this.m_rewardDisplayPrefab);
                missionRewardDisplay.transform.SetParent(this.m_lootItemArea.transform, false);
                missionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.currency, item.ItemID, item.Count, 0, 0);
            }
            if (missionRewardDisplay != null)
            {
                UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", missionRewardDisplay.transform, Vector3.zero, 1.5f, 0f);
            }
        }
예제 #2
0
        public void OnAddMissionLootToRewardPanel(int garrMissionID)
        {
            WrapperGarrisonMission item = PersistentMissionData.missionDictionary[garrMissionID];

            MissionRewardDisplay.InitMissionRewards(AdventureMapPanel.instance.m_missionRewardResultsDisplayPrefab, this.m_rewardIconArea.transform, item.Rewards);
            if (item.MissionState != 3)
            {
                return;
            }
            GarrMissionRec record = StaticDB.garrMissionDB.GetRecord(garrMissionID);

            if (record == null)
            {
                return;
            }
            if (StaticDB.rewardPackDB.GetRecord(record.OvermaxRewardPackID) == null)
            {
                return;
            }
            if (item.OvermaxRewards.Count > 0)
            {
                GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(AdventureMapPanel.instance.m_missionRewardResultsDisplayPrefab);
                gameObject.transform.SetParent(this.m_rewardIconArea.transform, false);
                MissionRewardDisplay component = gameObject.GetComponent <MissionRewardDisplay>();
                int  itemID       = item.OvermaxRewards[0].ItemID;
                uint itemQuantity = item.OvermaxRewards[0].ItemQuantity;
                WrapperGarrisonMissionReward wrapperGarrisonMissionReward = item.OvermaxRewards[0];
                component.InitReward(MissionRewardDisplay.RewardType.item, itemID, (int)itemQuantity, 0, wrapperGarrisonMissionReward.ItemFileDataID);
            }
        }
 public static void InitMissionRewards(GameObject prefab, Transform parent, IEnumerable <WrapperGarrisonMissionReward> rewards)
 {
     foreach (WrapperGarrisonMissionReward reward in rewards)
     {
         GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(prefab);
         gameObject.SetActive(true);
         gameObject.transform.SetParent(parent, false);
         MissionRewardDisplay component = gameObject.GetComponent <MissionRewardDisplay>();
         if (reward.ItemID > 0)
         {
             component.InitReward(MissionRewardDisplay.RewardType.item, reward.ItemID, (int)reward.ItemQuantity, 0, reward.ItemFileDataID);
         }
         else if (reward.FollowerXP <= 0)
         {
             if (reward.CurrencyQuantity <= 0)
             {
                 continue;
             }
             if (reward.CurrencyType != 0)
             {
                 CurrencyTypesRec record = StaticDB.currencyTypesDB.GetRecord(reward.CurrencyType);
                 if (record == null)
                 {
                     Debug.LogError(string.Concat("Unknown CurrencyType ID ", reward.CurrencyType));
                 }
                 else
                 {
                     int currencyQuantity = (int)((ulong)reward.CurrencyQuantity / (long)(((record.Flags & 8) == 0 ? 1 : 100)));
                     component.InitReward(MissionRewardDisplay.RewardType.currency, reward.CurrencyType, currencyQuantity, 0, 0);
                 }
             }
             else
             {
                 component.InitReward(MissionRewardDisplay.RewardType.gold, 0, (int)(reward.CurrencyQuantity / 10000), 0, 0);
             }
         }
         else
         {
             component.InitReward(MissionRewardDisplay.RewardType.followerXP, 0, (int)reward.FollowerXP, 0, 0);
         }
     }
 }
 public static void InitMissionRewards(GameObject prefab, Transform parent, IEnumerable <WrapperGarrisonMissionReward> rewards)
 {
     foreach (WrapperGarrisonMissionReward wrapperGarrisonMissionReward in rewards)
     {
         GameObject gameObject = Object.Instantiate <GameObject>(prefab);
         gameObject.SetActive(true);
         gameObject.transform.SetParent(parent, false);
         MissionRewardDisplay component = gameObject.GetComponent <MissionRewardDisplay>();
         if (wrapperGarrisonMissionReward.ItemID > 0)
         {
             component.InitReward(MissionRewardDisplay.RewardType.item, wrapperGarrisonMissionReward.ItemID, (int)wrapperGarrisonMissionReward.ItemQuantity, 0, wrapperGarrisonMissionReward.ItemFileDataID);
         }
         else if (wrapperGarrisonMissionReward.FollowerXP > 0u)
         {
             component.InitReward(MissionRewardDisplay.RewardType.followerXP, 0, (int)wrapperGarrisonMissionReward.FollowerXP, 0, 0);
         }
         else if (wrapperGarrisonMissionReward.CurrencyQuantity > 0u)
         {
             if (wrapperGarrisonMissionReward.CurrencyType == 0)
             {
                 component.InitReward(MissionRewardDisplay.RewardType.gold, 0, (int)(wrapperGarrisonMissionReward.CurrencyQuantity / 10000u), 0, 0);
             }
             else
             {
                 CurrencyTypesRec record = StaticDB.currencyTypesDB.GetRecord(wrapperGarrisonMissionReward.CurrencyType);
                 if (record != null)
                 {
                     int rewardQuantity = (int)((ulong)wrapperGarrisonMissionReward.CurrencyQuantity / (ulong)(((record.Flags & 8u) == 0u) ? 1L : 100L));
                     component.InitReward(MissionRewardDisplay.RewardType.currency, wrapperGarrisonMissionReward.CurrencyType, rewardQuantity, 0, 0);
                 }
                 else
                 {
                     Debug.LogError("Unknown CurrencyType ID " + wrapperGarrisonMissionReward.CurrencyType);
                 }
             }
         }
     }
 }
 public static void InitWorldQuestRewards(WrapperWorldQuest worldQuest, GameObject prefab, Transform parent)
 {
     if (worldQuest.Items != null)
     {
         foreach (WrapperWorldQuestReward wrapperWorldQuestReward in worldQuest.Items)
         {
             GameObject gameObject = Object.Instantiate <GameObject>(prefab);
             gameObject.transform.SetParent(parent, false);
             MissionRewardDisplay component = gameObject.GetComponent <MissionRewardDisplay>();
             component.InitReward(MissionRewardDisplay.RewardType.item, wrapperWorldQuestReward.RecordID, wrapperWorldQuestReward.Quantity, wrapperWorldQuestReward.ItemContext, wrapperWorldQuestReward.FileDataID);
         }
     }
     if (worldQuest.Money > 0)
     {
         GameObject gameObject2 = Object.Instantiate <GameObject>(prefab);
         gameObject2.transform.SetParent(parent, false);
         MissionRewardDisplay component2 = gameObject2.GetComponent <MissionRewardDisplay>();
         component2.InitReward(MissionRewardDisplay.RewardType.gold, 0, worldQuest.Money / 10000, 0, 0);
     }
     if (worldQuest.Experience > 0)
     {
         GameObject gameObject3 = Object.Instantiate <GameObject>(prefab);
         gameObject3.transform.SetParent(parent, false);
         MissionRewardDisplay component3 = gameObject3.GetComponent <MissionRewardDisplay>();
         component3.InitReward(MissionRewardDisplay.RewardType.followerXP, 0, worldQuest.Experience, 0, 0);
     }
     foreach (WrapperWorldQuestReward wrapperWorldQuestReward2 in worldQuest.Currencies)
     {
         GameObject gameObject4 = Object.Instantiate <GameObject>(prefab);
         gameObject4.transform.SetParent(parent, false);
         MissionRewardDisplay component4 = gameObject4.GetComponent <MissionRewardDisplay>();
         CurrencyTypesRec     record     = StaticDB.currencyTypesDB.GetRecord(wrapperWorldQuestReward2.RecordID);
         if (record != null)
         {
             int rewardQuantity = wrapperWorldQuestReward2.Quantity / (((record.Flags & 8u) == 0u) ? 1 : 100);
             component4.InitReward(MissionRewardDisplay.RewardType.currency, wrapperWorldQuestReward2.RecordID, rewardQuantity, 0, 0);
         }
         else
         {
             Debug.LogWarning(string.Concat(new object[]
             {
                 "WORLD QUEST ",
                 worldQuest.QuestID,
                 " has bogus currency reward (id ",
                 wrapperWorldQuestReward2.RecordID,
                 ")"
             }));
         }
     }
 }
 public static void InitWorldQuestRewards(WrapperWorldQuest worldQuest, GameObject prefab, Transform parent)
 {
     if (worldQuest.Items != null)
     {
         foreach (WrapperWorldQuestReward item in worldQuest.Items)
         {
             GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(prefab);
             gameObject.transform.SetParent(parent, false);
             MissionRewardDisplay component = gameObject.GetComponent <MissionRewardDisplay>();
             component.InitReward(MissionRewardDisplay.RewardType.item, item.RecordID, item.Quantity, item.ItemContext, item.FileDataID);
         }
     }
     if (worldQuest.Money > 0)
     {
         GameObject gameObject1 = UnityEngine.Object.Instantiate <GameObject>(prefab);
         gameObject1.transform.SetParent(parent, false);
         MissionRewardDisplay missionRewardDisplay = gameObject1.GetComponent <MissionRewardDisplay>();
         missionRewardDisplay.InitReward(MissionRewardDisplay.RewardType.gold, 0, worldQuest.Money / 10000, 0, 0);
     }
     if (worldQuest.Experience > 0)
     {
         GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(prefab);
         gameObject2.transform.SetParent(parent, false);
         MissionRewardDisplay component1 = gameObject2.GetComponent <MissionRewardDisplay>();
         component1.InitReward(MissionRewardDisplay.RewardType.followerXP, 0, worldQuest.Experience, 0, 0);
     }
     foreach (WrapperWorldQuestReward currency in worldQuest.Currencies)
     {
         GameObject gameObject3 = UnityEngine.Object.Instantiate <GameObject>(prefab);
         gameObject3.transform.SetParent(parent, false);
         MissionRewardDisplay missionRewardDisplay1 = gameObject3.GetComponent <MissionRewardDisplay>();
         CurrencyTypesRec     record = StaticDB.currencyTypesDB.GetRecord(currency.RecordID);
         if (record == null)
         {
             Debug.LogWarning(string.Concat(new object[] { "WORLD QUEST ", worldQuest.QuestID, " has bogus currency reward (id ", currency.RecordID, ")" }));
         }
         else
         {
             int quantity = currency.Quantity / ((record.Flags & 8) == 0 ? 1 : 100);
             missionRewardDisplay1.InitReward(MissionRewardDisplay.RewardType.currency, currency.RecordID, quantity, 0, 0);
         }
     }
 }