|
|
@@ -1,910 +0,0 @@
|
|
|
-using System.Collections.Generic;
|
|
|
-using UnityEngine;
|
|
|
-using GFGGame;
|
|
|
-using System;
|
|
|
-using System.Linq;
|
|
|
-using ET;
|
|
|
-
|
|
|
-namespace GFGEditor
|
|
|
-{
|
|
|
- /// <summary>
|
|
|
- /// 物品扫描器:
|
|
|
- /// 1.扫描获取途径,并填入物品表的获取途径字段
|
|
|
- /// 2.扫描套装部件个数
|
|
|
- /// </summary>
|
|
|
- public class ItemApproachScanner
|
|
|
- {
|
|
|
- private delegate string GetApproachCall(int itemId);
|
|
|
-
|
|
|
- public static void startScan()
|
|
|
- {
|
|
|
- ItemCfg[] dataArray = ItemCfgArray.Instance.dataArray;
|
|
|
- GetApproachCall[] actions = new GetApproachCall[] { GetClothingShopApproach, GetLeaguePrayApproach, GetLeagueAnswerApproach, CheckStoreApproach, GetClothingSyntheticApproach, GetSuitGuideApproach, GetSuitSyntheticApproach, GetClothingDecomposeApproach, CheckClothingFosterApproach, CheckDailyTaskApproach, CheckWeeklyTaskApproach, GetZhaiXingApproach, GetStoryLevelApproach, GetArenaApproach,GetHeavenApproach ,GetOpenServerFightApproach, GetYuanXiaoGameConsumeApproach, GetYuanXiaoRewardItemApproach, GetSkillBookSyntheticApproach };
|
|
|
- Dictionary<SuitCfg, List<int>> suitDic = new Dictionary<SuitCfg, List<int>>();
|
|
|
- Dictionary<ItemCfg, List<int>> syntheticSuitDic = new Dictionary<ItemCfg, List<int>>();
|
|
|
- Dictionary<SuitCfg, Dictionary<string, string>> suitTagsDic = new Dictionary<SuitCfg, Dictionary<string, string>>();
|
|
|
-
|
|
|
- int suitPartTotalCount = 0;
|
|
|
- int clothingPartsCount = 0;
|
|
|
- int cardCount = 0;
|
|
|
- foreach (ItemCfg cfg in dataArray)
|
|
|
- {
|
|
|
- HandleItemAndSuitTable(cfg, suitDic);
|
|
|
- HandleItemApproch(cfg, actions);
|
|
|
- HandleItemSyntheticSuit(cfg, syntheticSuitDic);
|
|
|
- HandleItemAndDressUpTable(cfg, ref clothingPartsCount);
|
|
|
- HandleItemAndCardTable(cfg, ref cardCount);
|
|
|
- HandleItemAndSuitTags(cfg, suitTagsDic);
|
|
|
- }
|
|
|
- var globalCfg = GlobalCfgArray.globalCfg;
|
|
|
- SQLiteHelper.Instance.OpenConnection();
|
|
|
- try
|
|
|
- {
|
|
|
- //物品
|
|
|
- foreach (ItemCfg cfg in dataArray)
|
|
|
- {
|
|
|
- var names = new string[] { nameof(cfg.subType), nameof(cfg.itemType), nameof(cfg.approach), nameof(cfg.isHide) };
|
|
|
- var values = new string[] { "" + cfg.subType, "" + cfg.itemType, "" + cfg.approach, "" + cfg.isHide };
|
|
|
- SQLiteHelper.Instance.UpdateValues(nameof(ItemCfgArray), names, values, nameof(cfg.id), cfg.id.ToString());
|
|
|
- }
|
|
|
- //套装
|
|
|
- foreach (var a in suitDic)
|
|
|
- {
|
|
|
- var names = new string[] { nameof(a.Key.partsArr).Replace("Arr", "") };
|
|
|
- var values = new string[] { string.Join(";", a.Value) };
|
|
|
- SQLiteHelper.Instance.UpdateValues(nameof(SuitCfgArray), names, values, nameof(a.Key.id), a.Key.id.ToString());
|
|
|
-
|
|
|
- if (a.Key.isHide <= 0)
|
|
|
- {
|
|
|
- if (a.Key.id != 210000)
|
|
|
- {
|
|
|
- suitPartTotalCount += a.Value.Count;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- globalCfg.suitPartTotalCount = suitPartTotalCount;
|
|
|
- globalCfg.ClothingPartsCount = clothingPartsCount;
|
|
|
- globalCfg.CardCount = cardCount;
|
|
|
- UpdateGlobalCfg(globalCfg);
|
|
|
-
|
|
|
- //材料对应的套装id
|
|
|
- foreach (var a in syntheticSuitDic)
|
|
|
- {
|
|
|
- var names = new string[] { nameof(a.Key.syntheticSuitArr).Replace("Arr", "") };
|
|
|
- var values = new string[] { string.Join(";", a.Value) };
|
|
|
- SQLiteHelper.Instance.UpdateValues(nameof(ItemCfgArray), names, values, nameof(a.Key.id), a.Key.id.ToString());
|
|
|
- }
|
|
|
-
|
|
|
- //套装属性累加
|
|
|
- foreach (var a in suitTagsDic)
|
|
|
- {
|
|
|
- var names = new string[] { nameof(a.Key.tagsArr).Replace("Arr", "") };
|
|
|
- var value = "";
|
|
|
- foreach (var e in a.Value)
|
|
|
- {
|
|
|
- value = value + e.Key + "*" + e.Value + ";";
|
|
|
- }
|
|
|
- var values = new string[] { string.Join(";", value) };
|
|
|
- SQLiteHelper.Instance.UpdateValues(nameof(SuitCfgArray), names, values, nameof(a.Key.id), a.Key.id.ToString());
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- ET.Log.Error(e.ToString());
|
|
|
- }
|
|
|
- finally
|
|
|
- {
|
|
|
- SQLiteHelper.Instance.CloseConnection();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private static void UpdateGlobalCfg(GlobalCfg globalCfg)
|
|
|
- {
|
|
|
- var names = new string[]
|
|
|
- { nameof(globalCfg.suitPartTotalCount), nameof(globalCfg.ClothingPartsCount), nameof(globalCfg.CardCount) };
|
|
|
- var values = new string[]
|
|
|
- { globalCfg.suitPartTotalCount.ToString(), globalCfg.ClothingPartsCount.ToString(), globalCfg.CardCount.ToString() };
|
|
|
- SQLiteHelper.Instance.UpdateValues(nameof(GlobalCfgArray), names, values, nameof(globalCfg.id), globalCfg.id.ToString());
|
|
|
- }
|
|
|
-
|
|
|
- private static void HandleItemSyntheticSuit(ItemCfg itemCfg, Dictionary<ItemCfg, List<int>> syntheticSuitDic)
|
|
|
- {
|
|
|
- if (itemCfg.syntheticMateriarsArr.Length <= 0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (itemCfg.itemType == ConstItemType.DRESS_UP)
|
|
|
- {
|
|
|
- ItemCfg materialItemCfg;
|
|
|
- foreach (int[] materiars in itemCfg.syntheticMateriarsArr)
|
|
|
- {
|
|
|
- int materialId = materiars[0];
|
|
|
- materialItemCfg = ItemCfgArray.Instance.GetCfg(materialId);
|
|
|
- if (materialItemCfg != null)
|
|
|
- {
|
|
|
- syntheticSuitDic.TryGetValue(materialItemCfg, out var syntheticSuitList);
|
|
|
- if (syntheticSuitList == null)
|
|
|
- {
|
|
|
- syntheticSuitList = new List<int>();
|
|
|
- syntheticSuitDic[materialItemCfg] = syntheticSuitList;
|
|
|
- }
|
|
|
- syntheticSuitList.Add(itemCfg.id);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private static void HandleItemAndSuitTable(ItemCfg itemCfg, Dictionary<SuitCfg, List<int>> suitDic)
|
|
|
- {
|
|
|
- if (itemCfg.suitId <= 0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- var suitCfg = SuitCfgArray.Instance.GetCfg(itemCfg.suitId);
|
|
|
- if (suitCfg == null)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (itemCfg.itemType == ConstItemType.DRESS_UP)
|
|
|
- {
|
|
|
- suitDic.TryGetValue(suitCfg, out var partsList);
|
|
|
- if (partsList == null)
|
|
|
- {
|
|
|
- partsList = new List<int>();
|
|
|
- suitDic[suitCfg] = partsList;
|
|
|
- }
|
|
|
- partsList.Add(itemCfg.id);
|
|
|
- }
|
|
|
- itemCfg.isHide = suitCfg.isHide;
|
|
|
- }
|
|
|
-
|
|
|
- private static void HandleItemAndDressUpTable(ItemCfg itemCfg, ref int count)
|
|
|
- {
|
|
|
- // 除去初始衣装
|
|
|
- if (DressUpMenuItemDataManager.defaultID.Contains(itemCfg.id) || itemCfg.isHide > 0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (itemCfg.itemType == ConstItemType.DRESS_UP)
|
|
|
- {
|
|
|
- // 服装
|
|
|
- bool isDressUp = Array.IndexOf(DressUpMenuItemDataManager.dressUpGuideSubType, itemCfg.subType) >= 0;
|
|
|
- if (isDressUp)
|
|
|
- {
|
|
|
- ++count;
|
|
|
- return;
|
|
|
- }
|
|
|
- // 饰品
|
|
|
- bool isAccessories = Array.IndexOf(DressUpMenuItemDataManager.dressUpGuideAccessoriesType, itemCfg.subType) >= 0;
|
|
|
- if (isAccessories)
|
|
|
- {
|
|
|
- ++count;
|
|
|
- return;
|
|
|
- }
|
|
|
- // 特殊
|
|
|
- bool isSpecial = itemCfg.subType > ConstDressUpItemType.TE_SHU;
|
|
|
- if (isSpecial)
|
|
|
- {
|
|
|
- ++count;
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private static void HandleItemAndCardTable(ItemCfg itemCfg, ref int count)
|
|
|
- {
|
|
|
- if (itemCfg.isHide > 0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (itemCfg.itemType == ConstItemType.CARD)
|
|
|
- {
|
|
|
- ++count;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private static void HandleItemAndSuitTags(ItemCfg itemCfg, Dictionary<SuitCfg, Dictionary<string, string>> suitTagsDic)
|
|
|
- {
|
|
|
- if (itemCfg.suitId <= 0)
|
|
|
- return;
|
|
|
-
|
|
|
- var suitCfg = SuitCfgArray.Instance.GetCfg(itemCfg.suitId);
|
|
|
- if (suitCfg == null)
|
|
|
- return;
|
|
|
-
|
|
|
- if(DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(itemCfg.id))
|
|
|
- return;
|
|
|
-
|
|
|
- if (itemCfg.itemType == ConstItemType.DRESS_UP)
|
|
|
- {
|
|
|
- for (int i = 0; i < itemCfg.tagsArr.Length; i++)
|
|
|
- {
|
|
|
- suitTagsDic.TryGetValue(suitCfg, out var tags);
|
|
|
- if (tags == null)
|
|
|
- {
|
|
|
- tags = new Dictionary<string, string>();
|
|
|
- suitTagsDic[suitCfg] = tags;
|
|
|
- }
|
|
|
-
|
|
|
- if (!tags.ContainsKey(itemCfg.tagsArr[i][0]))
|
|
|
- tags[itemCfg.tagsArr[i][0]] = itemCfg.tagsArr[i][1];
|
|
|
- else
|
|
|
- tags[itemCfg.tagsArr[i][0]] = (Convert.ToInt32(tags[itemCfg.tagsArr[i][0]]) + Convert.ToInt32(itemCfg.tagsArr[i][1])).ToString();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private static void HandleItemApproch(ItemCfg cfg, GetApproachCall[] actions)
|
|
|
- {
|
|
|
- if (cfg.id == 3000001 || cfg.id == 3000002 || cfg.id == 3000003)
|
|
|
- {
|
|
|
- ET.Log.Debug("");
|
|
|
- }
|
|
|
- List<string> approachs = new List<string>();
|
|
|
- foreach (GetApproachCall action in actions)
|
|
|
- {
|
|
|
- string tempApproach = action(cfg.id);
|
|
|
- if (tempApproach != null)
|
|
|
- {
|
|
|
- approachs.Add(tempApproach);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (approachs.Count > 0)
|
|
|
- {
|
|
|
- string approach = string.Join(";", approachs);
|
|
|
- cfg.approach = approach;
|
|
|
- if (approachs.Count > 5)
|
|
|
- {
|
|
|
- Debug.LogFormat("物品{0}的获取途径为 {1}", cfg.name, approach);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (cfg.id < 1000000 || cfg.id >= 2000000)
|
|
|
- {
|
|
|
- if ((!cfg.name.Contains("原始") && !cfg.name.Contains("默认")) || cfg.id >= 1000000)
|
|
|
- {
|
|
|
- //Debug.LogErrorFormat("物品 {0} {1} 没有获取途径", cfg.id, cfg.name);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 尝试获取服装店产出途径
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetClothingShopApproach(int itemId)
|
|
|
- {
|
|
|
- List<ShopCfg> dataArray = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.FU_ZHUANG_DIAN, ConstStoreSubId.FU_ZHUANG_DIAN);
|
|
|
- foreach (ShopCfg cfg in dataArray)
|
|
|
- {
|
|
|
- if (cfg.itemId == itemId)
|
|
|
- {
|
|
|
- return "FU_ZHUANG_DIAN=" + ConstStoreId.CLOTHING_STORE_ID;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<ShopCfg> shopCfgGallerys = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_EXCHANGE_GALLERY);
|
|
|
- foreach (ShopCfg cfg in shopCfgGallerys)
|
|
|
- {
|
|
|
- if (cfg.itemId == itemId)
|
|
|
- {
|
|
|
- return "FU_ZHUANG_DIAN=" + ConstStoreId.GALLERY_STORE_ID;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return null;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 尝试获取服装分解产出途径
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetClothingDecomposeApproach(int itemId)
|
|
|
- {
|
|
|
- DecomposeCfgArray manager = DecomposeCfgArray.Instance;
|
|
|
- DecomposeCfg[] dataArray = manager.dataArray;
|
|
|
- foreach (DecomposeCfg cfg in dataArray)
|
|
|
- {
|
|
|
- for (int i = 0; i < cfg.itemsArr.Length; i++)
|
|
|
- {
|
|
|
- if (cfg.itemsArr[i][0] == itemId)
|
|
|
- {
|
|
|
- return "FU_ZHUANG_DECOMPOSE";
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 尝试获取摘星(抽奖)产出途径
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetZhaiXingApproach(int itemId)
|
|
|
- {
|
|
|
- LuckyBoxCfgArray manager = LuckyBoxCfgArray.Instance;
|
|
|
- LuckyBoxCfg[] dataArray = manager.dataArray;
|
|
|
- if (itemId == 10090)
|
|
|
- {
|
|
|
- Debug.Log("");
|
|
|
- }
|
|
|
-
|
|
|
- foreach (LuckyBoxCfg cfg in dataArray)
|
|
|
- {
|
|
|
- for (int i = 0; i < cfg.bonusArr.Length; i++)
|
|
|
- {
|
|
|
- if (itemId == cfg.bonusArr[i][0])
|
|
|
- {
|
|
|
- return "ZHAI_XING";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- int dropId = cfg.dropId;
|
|
|
- if (itemId == 10014)
|
|
|
- {
|
|
|
- if (dropId == 11000008)
|
|
|
- {
|
|
|
- ET.Log.Debug("");
|
|
|
- }
|
|
|
- ET.Log.Debug("");
|
|
|
- }
|
|
|
- int[] _dropIds = { dropId };
|
|
|
-
|
|
|
- bool approach = CheckItemInDropOut(itemId, _dropIds);
|
|
|
- if (approach)
|
|
|
- {
|
|
|
- return "ZHAI_XING";
|
|
|
- }
|
|
|
- // }
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 尝试获取飞花令产出途径
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetArenaApproach(int itemId)
|
|
|
- {
|
|
|
- if (itemId == ConstItemID.ARENA_CUR_COST)
|
|
|
- {
|
|
|
- return "ARENA";
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 尝试获取天堂产出途径
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetHeavenApproach(int itemId)
|
|
|
- {
|
|
|
- if (itemId == ConstItemID.GET_TICKETS)
|
|
|
- {
|
|
|
- return "HEAVEN_SMALL_GAMW";
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 尝试获取明堂产出途径
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetOpenServerFightApproach(int itemId)
|
|
|
- {
|
|
|
- if (itemId == ConstItemID.PAIR_CARD)
|
|
|
- {
|
|
|
- return "OPEN_SERVER_FIGHT";
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 尝试获取元宵小游戏消耗门票的产出途径
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetYuanXiaoGameConsumeApproach(int itemId)
|
|
|
- {
|
|
|
- if (itemId == ConstItemID.YUANXIAO_GAME_CONSUME)
|
|
|
- {
|
|
|
- return "ACTIVITY_GET_YUAN_XIAO_TASK";
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 尝试获取元宵小游戏奖励的产出途径
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetYuanXiaoRewardItemApproach(int itemId)
|
|
|
- {
|
|
|
- if (itemId == ConstItemID.YUANXIAO_REWARD)
|
|
|
- {
|
|
|
- return "ACTIVITY_GET_YUAN_XIAO";
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 尝试获取剧情关卡产出途径
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetStoryLevelApproach(int itemId)
|
|
|
- {
|
|
|
- List<string> approachs = new List<string>();
|
|
|
- StoryChapterCfg chapterCfg = new StoryChapterCfg();
|
|
|
- StudioCfg studioCfg = new StudioCfg();
|
|
|
- FieldCfg fieldCfg = new FieldCfg();
|
|
|
- StoryLevelCfgArray manager = StoryLevelCfgArray.Instance;
|
|
|
- StoryLevelCfg[] dataArray = manager.dataArray;
|
|
|
- foreach (StoryLevelCfg cfg in dataArray)
|
|
|
- {
|
|
|
- if (itemId == 3000041)
|
|
|
- {
|
|
|
- ET.Log.Debug("");
|
|
|
- }
|
|
|
- if (itemId == 3002001)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- StudioCfg _studioCfg = StudioCfgArray.Instance.GetCfgsByfunId(typeof(StudioPorcelainView).Name)[StudioDataManager.Instance.PorcelainTheme - 1];
|
|
|
-
|
|
|
- chapterCfg = StoryChapterCfgArray.Instance.GetCfg(cfg.chapterId);
|
|
|
- studioCfg = StudioCfgArray.Instance.GetCfg(cfg.chapterId);
|
|
|
- fieldCfg = FieldCfgArray.Instance.GetCfg(cfg.chapterId);
|
|
|
- //判断是否有配在剧情、工作室、田野调查表
|
|
|
- if (chapterCfg != null || studioCfg != null || fieldCfg != null)
|
|
|
- {
|
|
|
- bool result = CheckItemInBonus(itemId, cfg);
|
|
|
- if (studioCfg != null)
|
|
|
- {
|
|
|
- if (cfg.type == 2 && cfg.subType == 4)
|
|
|
- {
|
|
|
- if (_studioCfg.id != cfg.chapterId)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (result)
|
|
|
- {
|
|
|
- string approach = "JU_QING_GUAN_QIA=" + cfg.id;
|
|
|
- approachs.Add(approach);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (approachs.Count > 0)
|
|
|
- {
|
|
|
- return string.Join(";", approachs);
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 尝试获取服装合成产出途径
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetClothingSyntheticApproach(int itemId)
|
|
|
- {
|
|
|
- var itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
- if (itemCfg == null)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (itemCfg.itemType != ConstItemType.DRESS_UP)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (itemCfg.suitId <= 0)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- var suitCfg = SuitCfgArray.Instance.GetCfg(itemCfg.suitId);
|
|
|
- if (suitCfg == null)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (suitCfg.syntheticType <= 0)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- return "FU_ZHUANG_HE_CHENG=" + suitCfg.id;
|
|
|
- }
|
|
|
-
|
|
|
- private static string GetSuitGuideApproach(int itemId)
|
|
|
- {
|
|
|
- SuitCfgArray manager = SuitCfgArray.Instance;
|
|
|
- SuitCfg[] dataArray = manager.dataArray;
|
|
|
- foreach (SuitCfg cfg in dataArray)
|
|
|
- {
|
|
|
- bool result = CheckItemInBonus(itemId, cfg.guideBoxBonusArr);
|
|
|
- if (result)
|
|
|
- {
|
|
|
- return "TAO_ZHUANG_TU_JIAN";
|
|
|
- }
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- private static string GetSuitSyntheticApproach(int itemId)
|
|
|
- {
|
|
|
-
|
|
|
- var itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
- if (itemCfg == null)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (itemCfg.itemType != ConstItemType.DRESS_UP)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (itemCfg.suitId <= 0)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- var suitCfg = SuitCfgArray.Instance.GetCfg(itemCfg.suitId);
|
|
|
- if (suitCfg == null)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (suitCfg.syntheticType <= 0)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
- bool result = CheckItemInBonus(itemId, suitCfg.syntheticBoxBonusArr);
|
|
|
- if (result)
|
|
|
- {
|
|
|
- return "TAO_ZHUANG_HE_CHENG";
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- private static bool CheckItemInBonus(int itemId, StoryLevelCfg cfg)
|
|
|
- {
|
|
|
- if (cfg.fightID.Length > 0)
|
|
|
- {
|
|
|
- StoryFightCfgArray manager = StoryFightCfgArray.Instance;
|
|
|
- StoryFightCfg storyFightCfg = manager.GetCfg(cfg.fightID);
|
|
|
- List<int[]> a = new List<int[]>();
|
|
|
- // a.AddRange(cfg.bonusOnceArr);
|
|
|
- a.AddRange(storyFightCfg.bonusBaseArr);
|
|
|
- int[][] bonus = a.ToArray();
|
|
|
- bool result = CheckItemInBonus(itemId, bonus);
|
|
|
-
|
|
|
- if (storyFightCfg.id == "501")
|
|
|
- {
|
|
|
- ET.Log.Debug("");
|
|
|
- }
|
|
|
- if (result)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- result = CheckItemInDropOut(itemId, storyFightCfg.bonusRandomArr);
|
|
|
- return result;
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- private static bool CheckItemInBonus(int itemId, int[][] bosnu)
|
|
|
- {
|
|
|
- List<ItemData> aList = ItemUtil.CreateItemDataList(bosnu);
|
|
|
- foreach (ItemData itemData in aList)
|
|
|
- {
|
|
|
- if (itemId == itemData.id)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 检测掉落表是否产出该物品
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <param name="dropIds"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static bool CheckItemInDropOut(int itemId, int[] dropIds)
|
|
|
- {
|
|
|
- List<ItemData> result = new List<ItemData>();
|
|
|
- foreach (int dropId in dropIds)
|
|
|
- {
|
|
|
- DropOutCfgArray manager = DropOutCfgArray.Instance;
|
|
|
- List<DropOutCfg> aList = manager.GetCfgsByid(dropId);
|
|
|
- foreach (DropOutCfg dropOutCfg in aList)
|
|
|
- {
|
|
|
- if (manager.GetCfgsByid(dropOutCfg.item).Count > 0)
|
|
|
- {
|
|
|
- int[] _dropIds = { dropOutCfg.item };
|
|
|
- if (CheckItemInDropOut(itemId, _dropIds))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (itemId == dropOutCfg.item)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 检测商城-红包卡是否产出该物品
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string CheckStoreApproach(int itemId)
|
|
|
- {
|
|
|
- List<string> approachs = new List<string>();
|
|
|
- List<ShopCfg> goldShopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_GOLD_CARD);
|
|
|
- for (int i = 0; i < goldShopCfgs.Count; i++)
|
|
|
- {
|
|
|
- if (CheckIsHasItem(itemId, goldShopCfgs[i].itemId))
|
|
|
- {
|
|
|
- approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_MONTH_CARD + "=" + ConstStoreSubId.STORE_MONTH_GOLD_CARD);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<ShopCfg> blackShopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_MONTH_CARD, ConstStoreSubId.STORE_MONTH_BLACK_CARD);
|
|
|
- for (int i = 0; i < blackShopCfgs.Count; i++)
|
|
|
- {
|
|
|
- if (CheckIsHasItem(itemId, blackShopCfgs[i].itemId))
|
|
|
- {
|
|
|
- approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_MONTH_CARD + "=" + ConstStoreSubId.STORE_MONTH_BLACK_CARD);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<ShopCfg> itemShopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_TIME_LIMIT);
|
|
|
- for (int i = 0; i < itemShopCfgs.Count; i++)
|
|
|
- {
|
|
|
- if (CheckIsHasItem(itemId, itemShopCfgs[i].itemId))
|
|
|
- {
|
|
|
- approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_GIFT_BAG + "=" + ConstStoreSubId.STORE_GIFT_BAG_TIME_LIMIT);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<ShopCfg> greatestShopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_GREATEST);
|
|
|
- for (int i = 0; i < greatestShopCfgs.Count; i++)
|
|
|
- {
|
|
|
- if (CheckIsHasItem(itemId, greatestShopCfgs[i].itemId))
|
|
|
- {
|
|
|
- approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_GIFT_BAG + "=" + ConstStoreSubId.STORE_GIFT_BAG_GREATEST);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<ShopCfg> storyActivityCfg = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_ACTIVITY_EXCHANGE);
|
|
|
- for (int i = 0; i < storyActivityCfg.Count; i++)
|
|
|
- {
|
|
|
- if (CheckIsHasItem(itemId, storyActivityCfg[i].itemId))
|
|
|
- {
|
|
|
- approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_EXCHANGE + "=" + ConstStoreSubId.STORE_ACTIVITY_EXCHANGE);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<ShopCfg> exchangetShopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_EXCHANGE, ConstStoreSubId.STORE_EXCHANGE_LEAGUE);
|
|
|
- for (int i = 0; i < exchangetShopCfgs.Count; i++)
|
|
|
- {
|
|
|
- if (CheckIsHasItem(itemId, exchangetShopCfgs[i].itemId))
|
|
|
- {
|
|
|
- approachs.Add(ConstFunctionId.STORE + "=" + ConstStoreTabId.STORE_EXCHANGE + "=" + ConstStoreSubId.STORE_EXCHANGE_LEAGUE);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (approachs.Count > 0)
|
|
|
- {
|
|
|
- return string.Join(";", approachs);
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
- private static bool CheckIsHasItem(int itemId, int checkId)
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(checkId);
|
|
|
- if (itemCfg == null)
|
|
|
- {
|
|
|
- Log.Error($"CheckIsHasItem itemCfg is null. itemId:{itemId} checkId:{checkId}");
|
|
|
- }
|
|
|
- if (itemCfg.itemType == ConstItemType.USEABLE)
|
|
|
- {
|
|
|
- for (int i = 0; i < itemCfg.itemsArr.Length; i++)
|
|
|
- {
|
|
|
- if (itemCfg.itemsArr[i][0] == itemId) return true;
|
|
|
- }
|
|
|
- }
|
|
|
- else if (checkId == itemId)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- Log.Error($"CheckIsHasItemxxx itemCfg is null. itemId:{itemId} checkId:{checkId}");
|
|
|
- throw;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 检测服装升级是否产出该物品
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string CheckClothingFosterApproach(int itemId)
|
|
|
- {
|
|
|
- //培养
|
|
|
- SuitFosterCfgArray manager = SuitFosterCfgArray.Instance;
|
|
|
- SuitFosterCfg[] dataArray = manager.dataArray;
|
|
|
- for (int i = 0; i < dataArray.Length; i++)
|
|
|
- {
|
|
|
- for (int j = 0; j < dataArray[i].rewardsArr.Length; j++)
|
|
|
- {
|
|
|
- if (dataArray[i].rewardsArr[j][0] == itemId)
|
|
|
- {
|
|
|
- return ConstFunctionId.SUIT_FOSTER;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //换新
|
|
|
- SuitFosterListCfgArray manager1 = SuitFosterListCfgArray.Instance;
|
|
|
- SuitFosterListCfg[] dataArray1 = manager1.dataArray;
|
|
|
- for (int i = 0; i < dataArray1.Length; i++)
|
|
|
- {
|
|
|
- for (int j = 0; j < dataArray1[i].renewRewardsArr.Length; j++)
|
|
|
- {
|
|
|
- if (dataArray1[i].renewRewardsArr[j][0] == itemId)
|
|
|
- {
|
|
|
- return ConstFunctionId.SUIT_FOSTER;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 检测每日任务是否产出该物品
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string CheckDailyTaskApproach(int itemId)
|
|
|
- {
|
|
|
- TaskActiveRewardCfgArray manager = TaskActiveRewardCfgArray.Instance;
|
|
|
- List<TaskActiveRewardCfg> dataArray = manager.GetCfgsByfuncType(TaskFuncType.Daily);
|
|
|
- for (int i = 0; i < dataArray.Count; i++)
|
|
|
- {
|
|
|
- for (int j = 0; j < dataArray[i].rewardsArr.Length; j++)
|
|
|
- {
|
|
|
- if (dataArray[i].rewardsArr[j][0] == itemId)
|
|
|
- {
|
|
|
- return ConstFunctionId.DAILY_TASK;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return null;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 检测每周任务是否产出该物品
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string CheckWeeklyTaskApproach(int itemId)
|
|
|
- {
|
|
|
- TaskActiveRewardCfgArray manager = TaskActiveRewardCfgArray.Instance;
|
|
|
- List<TaskActiveRewardCfg> dataArray = manager.GetCfgsByfuncType(TaskFuncType.Weekly);
|
|
|
- for (int i = 0; i < dataArray.Count; i++)
|
|
|
- {
|
|
|
- for (int j = 0; j < dataArray[i].rewardsArr.Length; j++)
|
|
|
- {
|
|
|
- if (dataArray[i].rewardsArr[j][0] == itemId)
|
|
|
- {
|
|
|
- return ConstFunctionId.WEEKLY_TASK;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return null;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 检测雅集福利是否产出该物品
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetLeaguePrayApproach(int itemId)
|
|
|
- {
|
|
|
- LeaguePrayCfg[] prayCfgs = LeaguePrayCfgArray.Instance.dataArray;
|
|
|
- for (int i = 0; i < prayCfgs.Length; i++)
|
|
|
- {
|
|
|
- for (int j = 0; j < prayCfgs[i].bonusArr.Length; j++)
|
|
|
- {
|
|
|
- if (prayCfgs[i].bonusArr[j][0] == itemId)
|
|
|
- {
|
|
|
- return ConstFunctionId.LEAGUE_PRAY;
|
|
|
- }
|
|
|
- }
|
|
|
- for (int j = 0; j < prayCfgs[i].bonusOnceArr.Length; j++)
|
|
|
- {
|
|
|
- if (prayCfgs[i].bonusOnceArr[j][0] == itemId)
|
|
|
- {
|
|
|
- return ConstFunctionId.LEAGUE_PRAY;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 检测雅集答题是否产出该物品
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetLeagueAnswerApproach(int itemId)
|
|
|
- {
|
|
|
- LeagueQuestionCfg[] questionCfgs = LeagueQuestionCfgArray.Instance.dataArray;
|
|
|
- for (int i = 0; i < questionCfgs.Length; i++)
|
|
|
- {
|
|
|
- for (int j = 0; j < questionCfgs[i].bonusArr.Length; j++)
|
|
|
- {
|
|
|
- if (questionCfgs[i].bonusArr[j][0] == itemId)
|
|
|
- {
|
|
|
- return ConstFunctionId.LEAGUE_ANSWER;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- LeagueQuestionBonusCfg[] questionBonusCfgs = LeagueQuestionBonusCfgArray.Instance.dataArray;
|
|
|
- for (int i = 0; i < questionBonusCfgs.Length; i++)
|
|
|
- {
|
|
|
- for (int j = 0; j < questionBonusCfgs[i].bonusArr.Length; j++)
|
|
|
- {
|
|
|
- if (questionBonusCfgs[i].bonusArr[j][0] == itemId)
|
|
|
- {
|
|
|
- return ConstFunctionId.LEAGUE_ANSWER;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 检测技能书合成途径
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemId"></param>
|
|
|
- /// <returns></returns>
|
|
|
- private static string GetSkillBookSyntheticApproach(int itemId)
|
|
|
- {
|
|
|
- var itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
- if (itemCfg.itemType == ConstItemType.ITEM && itemCfg.subType == 1 && itemCfg.rarity >= 3)
|
|
|
- {
|
|
|
- ItemExchangeCfg itemExchange = ItemExchangeCfgArray.Instance.GetCfg(itemId);
|
|
|
- if(itemExchange != null)
|
|
|
- {
|
|
|
- return ConstFunctionId.SKILLBOOK;
|
|
|
- }
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|