| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using TableConfig; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | using System.Text.RegularExpressions; |
| | | using System.Text; |
| | | using Snxxz.UI; |
| | | //任务信息的存储 |
| | | |
| | | /** 任务结构 */ |
| | | public class MissionDetailDates |
| | | { |
| | | public DateTime Time;//记录时间 |
| | | public int ID;//任务ID |
| | | public string Name;//任务名称 |
| | | public int Type;//任务类型 |
| | | public int NPC_ID;//起始NPCID |
| | | public int LV;//可接等级 |
| | | public int ColorLV;//任务难度 |
| | | public string Desclist;//任务详情 |
| | | public string RewardList;//奖励信息 |
| | | public List<TsakLight> LightList;//任务灯信息 |
| | | public string InforList;//任务完成条件 |
| | | public int MissionState;//任务状态0未接,1进行中,2可提交,3已完成,6特殊卡级 |
| | | public int descIndex;//任务描述索引 |
| | | } |
| | | |
| | | |
| | | public class MissionDict//任务字典信息 |
| | | { |
| | | public int MissionId;//任务ID |
| | | |
| | | public int DictKeyLen;//任务字典中的某个Key |
| | | |
| | | public string DictKey;//key的长度 |
| | | |
| | | public int DictValue;//该key对应的值 |
| | | |
| | | |
| | | } |
| | | public class RunTaskAwardRecord |
| | | { |
| | | public int Num; |
| | | public int AwardState; |
| | | } |
| | | |
| | | public struct TsakLight |
| | | { |
| | | public int NpcId; |
| | | public int StateLight; |
| | | } |
| | | |
| | | |
| | | public class PlayerTaskDatas : Model, IBeforePlayerDataInitialize, IPlayerLoginOk |
| | | { |
| | | |
| | | /** 任务总清单 */ |
| | | public static bool _globalbool = false; |
| | | public Dictionary<int, MissionDetailDates> allMissionDict = new Dictionary<int, MissionDetailDates>();//任务初始化接收字典 |
| | | public Dictionary<int, MissionDetailDates> MainTaskDic = new Dictionary<int, MissionDetailDates>();//主线任务字典 |
| | | public Dictionary<int, MissionDetailDates> SideQuestsDic = new Dictionary<int, MissionDetailDates>();//支线任务字典 |
| | | public Dictionary<int, MissionDetailDates> BountyDic = new Dictionary<int, MissionDetailDates>();//赏金任务 |
| | | public Dictionary<int, MissionDetailDates> FairyAuDic = new Dictionary<int, MissionDetailDates>();//仙盟任务 |
| | | public Dictionary<int, MissionDetailDates> SpecialTask = new Dictionary<int, MissionDetailDates>();//特殊任务类型 |
| | | public Dictionary<int, Dictionary<string, string>> _DicTaskInformation = new Dictionary<int, Dictionary<string, string>>();//任务字典的信息 |
| | | public Dictionary<int, Dictionary<string, int>> ReplaceDic = new Dictionary<int, Dictionary<string, int>>();//key值替换字典 |
| | | public Dictionary<int, RunTaskAwardRecord> AwardRecordDic = new Dictionary<int, RunTaskAwardRecord>();//跑环奖励记录 |
| | | public Dictionary<int, int> NPCShowDic = new Dictionary<int, int>();//关于NPC的显隐问题 |
| | | public delegate void OnTaskToAdd(int MissionID, int MissionState, int DiscriptionIndex); |
| | | public static event OnTaskToAdd Event_TaskToAdd;//任务添加 |
| | | public delegate void OnTaskRefreshes(int _taskId); |
| | | public static event OnTaskRefreshes Event_TaskRefreshes;//任务的刷新 |
| | | public delegate void OnBounty();//赏金任务的添加 |
| | | public static event OnBounty Event_nBounty; |
| | | public delegate void OnFairyAuTask();//仙盟任务的添加和刷新 |
| | | public static event OnFairyAuTask Event_FairyAuTask; |
| | | |
| | | public delegate void OnTaskInformation(int _id, Dictionary<int, Dictionary<string, string>> _Dic); |
| | | public static event OnTaskInformation Event_TaskInformation;//任务字典信息 |
| | | |
| | | public delegate void OnTaskToDelete(int _taskID); |
| | | public static event OnTaskToDelete Event_TaskToDelete;//任务的删除 |
| | | |
| | | public delegate void OnBountyRewards(int Number, int AwardState);//获取赏金奖励 |
| | | public static event OnBountyRewards Event_BountyRewards; |
| | | public int BountyRewardsNumber = 0;//获取赏金内容的奖励值 |
| | | |
| | | public delegate void OnFairyAuReward(int Number, int AwardState);//仙盟奖励 |
| | | public static event OnFairyAuReward Event_FairyAuReward; |
| | | public int OnFairyAuNumber = 0;//获取仙盟的奖励值 |
| | | |
| | | public string _conversation = null;//对话内容、 |
| | | public int _TaskNow = 0;//获取当前任务ID |
| | | public string _DefaultDialogContent = null;//默认对话内容 |
| | | |
| | | public delegate void OnMainlineTask(int MissionID, int MissionState);//主线任务任务状态变更和刷新 |
| | | public static event OnMainlineTask Event_MainlineTask; |
| | | |
| | | public delegate void OnTaskResponse(int _nowNPCid, int _nPCLamp, Dictionary<int, int> _dic = null);//NPCNPC灯状态,可接取任务(NPCID,任务灯状态) |
| | | public static event OnTaskResponse Event_TaskResponse; |
| | | |
| | | public static event Action tryGetTaskAwardEvent;//这个是客户端只要尝试去领奖就会触发,不管最后的领奖结果。 |
| | | |
| | | public static event Action<int> CardLevelChange;//关于任务卡机状态的转变 |
| | | |
| | | public static event Action<int> SideQuestChangeEvent;//支线任务状态改变 |
| | | |
| | | public static event Action<int> MainCardLevelChange;//主线任务卡级状态改变 |
| | | |
| | | public static event Action<int> CompletionOfTaskEvent;//任务完成回调 |
| | | |
| | | public static event Action TaskCoinTaskEvent;//赏金任务信息字典变更 |
| | | public static event Action FairyTaskEvent;//仙盟任务信息字典变更 |
| | | |
| | | public int NPCid = 0;//获取NPCID(打开任务面板时)、 |
| | | |
| | | public bool BountyMotionBool = false;//控制赏金任务是否自动移动 |
| | | public bool FairyAuBool = false;//控制仙盟任务是否自动移动 |
| | | public int currentMission { get; private set; } |
| | | public int currentMissionState { get; private set; } |
| | | |
| | | public int GetNowTaskID { get; set; } |
| | | |
| | | private bool AutomaticityBool = false;//控制是否自动进行自动任务 |
| | | private int retainTaskID = 0; |
| | | private float BossDelayTimeint = 0; |
| | | private List<int> FaBaoNPCIdList = new List<int>();//用于获取需要消失的法宝NPCID; |
| | | public Vector3 UIeffectFabaoVec = new Vector3();//法宝NPC消失时获取的坐标 |
| | | PlayerPackModel _playerPack; |
| | | PlayerPackModel playerPack |
| | | { |
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } |
| | | } |
| | | |
| | | public override void Init() |
| | | { |
| | | StageManager.Instance.onStageLoadFinish += onStageLoadFinish; |
| | | NPCInteractProcessor.s_NpcInteractEvent += NpcInterac; |
| | | FaBaoNPCIdList.Clear(); |
| | | string strFabao = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("FaBaoNPCID").Numerical1; |
| | | string[] strFabaoNpcID = ConfigParse.GetMultipleStr(strFabao);//解析出数组| |
| | | |
| | | for (int i = 0; i < strFabaoNpcID.Length; i++) |
| | | { |
| | | FaBaoNPCIdList.Add(int.Parse(strFabaoNpcID[i])); |
| | | } |
| | | string BossDelayTime = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("BossDelayTime").Numerical1; |
| | | BossDelayTimeint = float.Parse(BossDelayTime); |
| | | } |
| | | |
| | | public override void UnInit() |
| | | { |
| | | StageManager.Instance.onStageLoadFinish -= onStageLoadFinish; |
| | | NPCInteractProcessor.s_NpcInteractEvent -= NpcInterac; |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | allMissionDict.Clear(); |
| | | MainTaskDic.Clear(); |
| | | SideQuestsDic.Clear(); |
| | | BountyDic.Clear(); |
| | | FairyAuDic.Clear(); |
| | | SpecialTask.Clear(); |
| | | _DicTaskInformation.Clear(); |
| | | ReplaceDic.Clear(); |
| | | AwardRecordDic.Clear(); |
| | | NPCShowDic.Clear(); |
| | | _conversation = null; |
| | | _DefaultDialogContent = null; |
| | | _TaskNow = 0; |
| | | BountyRewardsNumber = 0; |
| | | NPCid = 0; |
| | | retainTaskID = 0; |
| | | currentMission = 0; |
| | | _globalbool = false; |
| | | BountyMotionBool = false; |
| | | FairyAuBool = false; |
| | | AutomaticityBool = false; |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | AutomaticityBool = true; |
| | | } |
| | | |
| | | private void onStageLoadFinish()//地图切换时调用 |
| | | { |
| | | var inDungeon = IsDungeon(); |
| | | if (!inDungeon && retainTaskID != 0) |
| | | { |
| | | if (ReplaceDic.ContainsKey(retainTaskID)) |
| | | { |
| | | AutomaticTripToTask(retainTaskID); |
| | | retainTaskID = 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void RefreshMissionState(int MissionID, int MissionState, int DiscriptionIndex)//1.任务ID,2任务状态,3,任务描述Index(接收任务) |
| | | { |
| | | try |
| | | { |
| | | var pytaskM = ConfigManager.Instance.GetTemplate<PyTaskConfig>(MissionID); |
| | | if (pytaskM == null) |
| | | { |
| | | return; |
| | | } |
| | | if ((pytaskM.type == (int)TaskTypenum.MainlineTaskType || pytaskM.type == (int)TaskTypenum.MainlineTaskTyp2) && MissionState != 0 && MissionState != 3) |
| | | { |
| | | currentMission = MissionID; |
| | | currentMissionState = MissionState; |
| | | if (Event_MainlineTask != null) |
| | | Event_MainlineTask(MissionID, MissionState); |
| | | } |
| | | |
| | | |
| | | if (allMissionDict.ContainsKey(MissionID)) |
| | | { |
| | | if (allMissionDict[MissionID].MissionState != MissionState && MissionState == 3 && AutomaticityBool) |
| | | { |
| | | if (CompletionOfTaskEvent != null) |
| | | { |
| | | CompletionOfTaskEvent(MissionID); |
| | | } |
| | | } |
| | | TaskChanges(MissionID, MissionState, DiscriptionIndex);//任务的状态修改 |
| | | |
| | | if (Event_TaskRefreshes != null)//刷新任务 |
| | | { |
| | | Event_TaskRefreshes(MissionID); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | AddMission(MissionID, MissionState, DiscriptionIndex);//任务的添加 |
| | | if (Event_TaskToAdd != null) |
| | | { |
| | | Event_TaskToAdd(MissionID, MissionState, DiscriptionIndex); |
| | | } |
| | | } |
| | | TaskClassification(MissionID, MissionState);//任务分类 |
| | | IsShowNpC(1);//是否显示NPC |
| | | IsShowNpC(MissionID);//是否显示NPC |
| | | if (AutomaticityBool) |
| | | { |
| | | AutotaskingPrecedence(AutomaticityBool, MissionID);//是否执行自动任务 |
| | | } |
| | | TaskTerminationToHangUp(MissionID, MissionState);//结束赏金和仙盟任务前往挂机 |
| | | if (Event_TaskResponse != null)//发送任务灯信息 |
| | | { |
| | | if (allMissionDict[MissionID].LightList.Equals(default(TsakLight))) |
| | | { |
| | | return; |
| | | } |
| | | for (int i = 0; i < allMissionDict[MissionID].LightList.Count; i++) |
| | | { |
| | | Event_TaskResponse(allMissionDict[MissionID].LightList[i].NpcId, allMissionDict[MissionID].LightList[i].StateLight); |
| | | } |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DesignDebug.Log(ex); |
| | | } |
| | | |
| | | } |
| | | |
| | | void NpcInterac(E_NpcType equip, int NPcID, uint instanceId)//服务器发包(NPCID,人物位置) |
| | | { |
| | | float Posx = PlayerDatas.Instance.hero.Pos.x * 2; |
| | | float PosY = PlayerDatas.Instance.hero.Pos.z * 2; |
| | | if (BossInfoConfig.GetBossInfoByStoneId(NPcID) != null) |
| | | { |
| | | return; |
| | | } |
| | | C0801_tagCNPCTalk _C0801 = new C0801_tagCNPCTalk(); |
| | | _C0801.NPCID = instanceId; |
| | | _C0801.PosX = (ushort)Posx; |
| | | _C0801.PosY = (ushort)PosY; |
| | | GameNetSystem.Instance.SendInfo(_C0801); |
| | | } |
| | | |
| | | void DefaultDialogue()//关于打开默认对话界面 |
| | | { |
| | | bool IsOpenMain = WindowCenter.Instance.CheckOpen<MainInterfaceWin>(); |
| | | if (!WindowCenter.Instance.CheckOpen<DefaultDialogueBoxWin>() && IsOpenMain) |
| | | { |
| | | WindowCenter.Instance.Open<DefaultDialogueBoxWin>(); |
| | | WindowCenter.Instance.Close<MainInterfaceWin>(); |
| | | } |
| | | } |
| | | |
| | | private void OnEventTalkEvent(int taskID)//NPC对话后的弹框 |
| | | { |
| | | //if (WindowCenter.Instance.ExitAnyFullScreenOrMaskWin()) |
| | | //{ |
| | | // return; |
| | | //} |
| | | if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing) |
| | | { |
| | | return; |
| | | } |
| | | var config = ConfigManager.Instance.GetTemplate<StoryMissionsConfig>(taskID); |
| | | bool IsOpenMain = WindowCenter.Instance.CheckOpen<MainInterfaceWin>(); |
| | | var treasureStageUpShow = ModelCenter.Instance.GetModel<TreasureModel>().treasureStageUpShow; |
| | | if (config != null) |
| | | { |
| | | for (int i = 0; i < config.NpcID.Length; i++) |
| | | { |
| | | if (NPCid == config.NpcID[i]) |
| | | { |
| | | if (!WindowCenter.Instance.CheckOpen<DialogueDuidanceWin>() && IsOpenMain |
| | | && !treasureStageUpShow && !WindowCenter.Instance.ExitAnyFullScreenOrMaskWin()) |
| | | { |
| | | WindowCenter.Instance.Close<MainInterfaceWin>(); |
| | | WindowCenter.Instance.Open<DialogueDuidanceWin>(); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | if (!WindowCenter.Instance.CheckOpen<TaskBoxBGMWin>() && IsOpenMain && !treasureStageUpShow) |
| | | { |
| | | WindowCenter.Instance.Close<MainInterfaceWin>(); |
| | | WindowCenter.Instance.Open<TaskBoxBGMWin>(); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (BountyDic.ContainsKey(_TaskNow) || FairyAuDic.ContainsKey(_TaskNow)) |
| | | { |
| | | RequestGetTaskAward("OK"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (!WindowCenter.Instance.CheckOpen<TaskBoxBGMWin>() && IsOpenMain && !treasureStageUpShow) |
| | | { |
| | | WindowCenter.Instance.Close<MainInterfaceWin>(); |
| | | WindowCenter.Instance.Open<TaskBoxBGMWin>(); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (BountyDic.ContainsKey(_TaskNow) || FairyAuDic.ContainsKey(_TaskNow)) |
| | | { |
| | | RequestGetTaskAward("OK"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | private void BountySelfMotion() |
| | | { |
| | | int blank = playerPack.GetReaminGridCount(PackType.rptItem); |
| | | if (blank < 1)//"请先清理背包再领取奖励 |
| | | { |
| | | return; |
| | | } |
| | | |
| | | } |
| | | |
| | | void AddMission(int MissionID, int MissionState, int DiscriptionIndex)//添加任务 |
| | | { |
| | | var config = ConfigManager.Instance.GetTemplate<PyTaskConfig>(MissionID); |
| | | if (config == null) |
| | | { |
| | | DesignDebug.LogError(MissionID + "表格中不存在此任务ID"); |
| | | return; |
| | | } |
| | | |
| | | if (allMissionDict == null) |
| | | allMissionDict = new Dictionary<int, MissionDetailDates>(); |
| | | MissionDetailDates vDetailData = new MissionDetailDates(); |
| | | vDetailData.Time = DateTime.Now; |
| | | vDetailData.ID = int.Parse(config.id); |
| | | vDetailData.Name = config.name; |
| | | vDetailData.Type = config.type; |
| | | vDetailData.NPC_ID = config.npcId; |
| | | vDetailData.LV = config.lv; |
| | | vDetailData.ColorLV = config.colorLV; |
| | | |
| | | vDetailData.RewardList = RewardInformation(config.rewardList, DiscriptionIndex);//奖励信息 |
| | | if (ReplaceDic.ContainsKey(MissionID)) |
| | | { |
| | | Dictionary<string, int> _dic = ReplaceDic[MissionID]; |
| | | if (_dic.ContainsKey("visit_npc_id") || _dic.ContainsKey("kill_npc_id")) |
| | | { |
| | | vDetailData.LightList = CharactersReplace(config.lightList, DiscriptionIndex, int.Parse(config.id)); |
| | | } |
| | | else |
| | | { |
| | | vDetailData.LightList = StrSegmentation(config.lightList, DiscriptionIndex);//任务信息灯 |
| | | } |
| | | if (MissionState == 3) |
| | | { |
| | | for (int i = 0; i < vDetailData.LightList.Count; i++) |
| | | { |
| | | TsakLight TsakLight = new TsakLight(); |
| | | TsakLight.NpcId = vDetailData.LightList[i].NpcId; |
| | | TsakLight.StateLight = -1; |
| | | vDetailData.LightList[i] = TsakLight; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | vDetailData.LightList = StrSegmentation(config.lightList, DiscriptionIndex);//任务信息灯 |
| | | if (MissionState == 3) |
| | | { |
| | | for (int i = 0; i < vDetailData.LightList.Count; i++) |
| | | { |
| | | TsakLight TsakLight = new TsakLight(); |
| | | TsakLight.NpcId = vDetailData.LightList[i].NpcId; |
| | | TsakLight.StateLight = -1; |
| | | vDetailData.LightList[i] = TsakLight; |
| | | } |
| | | } |
| | | } |
| | | vDetailData.Desclist = TaskDetails(config.descList, DiscriptionIndex);//任务详情 |
| | | vDetailData.InforList = StrInforList(config.infoList, DiscriptionIndex);//任务完成条件 |
| | | |
| | | |
| | | vDetailData.MissionState = MissionState; |
| | | vDetailData.descIndex = DiscriptionIndex; |
| | | |
| | | GetNowTaskID = MissionID; |
| | | allMissionDict.Add(MissionID, vDetailData);//添加任务 |
| | | } |
| | | |
| | | public enum TaskTypenum//任务类型分类 |
| | | { |
| | | MainlineTaskType = 0,//主线 |
| | | MainlineTaskTyp2 = 1, |
| | | SideQuestsType2 = 2,//支线 |
| | | SideQuestsType3 = 3,//支线任务(本源法宝支线) |
| | | SideQuestsType4 = 4, |
| | | SideQuestsType5 = 5, |
| | | BountyMissionsType6 = 6,//赏金任务 |
| | | BountyMissionsType7 = 7, |
| | | BountyMissionsType8 = 8, |
| | | FairyAuMissionType11 = 11,//仙盟任务 |
| | | FairyAuMissionType12 = 12, |
| | | SpecialTaskType13 = 13,//特殊任务类型(用于赏金) |
| | | SpecialTaskType14 = 14,//特殊任务类型(用于仙盟) |
| | | AchievementTask = 15,//成就任务(暂未开出专属字典) |
| | | SpecialTaskType16 = 16,//特殊任务类型(用于法宝) |
| | | SideQuestsType17 = 17,//支线17-21新增 |
| | | SideQuestsType18 = 18, |
| | | SideQuestsType19 = 19, |
| | | SideQuestsType20 = 20, |
| | | SideQuestsType21 = 21, |
| | | } |
| | | |
| | | void TaskClassification(int _taskID, int MissionState)//任务分类(主线任务,支线任务) |
| | | { |
| | | |
| | | TaskTypenum type = (TaskTypenum)allMissionDict[_taskID].Type; |
| | | switch (type) |
| | | { |
| | | case TaskTypenum.MainlineTaskType: |
| | | case TaskTypenum.MainlineTaskTyp2: |
| | | { |
| | | if (_taskID != 1)//主线任务(添加与更新) |
| | | { |
| | | if (MainTaskDic.ContainsKey(_taskID)) |
| | | { |
| | | MainTaskDic[_taskID] = allMissionDict[_taskID]; |
| | | } |
| | | else |
| | | { |
| | | MainTaskDic.Add(_taskID, allMissionDict[_taskID]); |
| | | } |
| | | } |
| | | |
| | | } |
| | | break; |
| | | case TaskTypenum.SideQuestsType2: |
| | | case TaskTypenum.SideQuestsType3: |
| | | case TaskTypenum.SideQuestsType4: |
| | | case TaskTypenum.SideQuestsType5: |
| | | case TaskTypenum.SideQuestsType17: |
| | | case TaskTypenum.SideQuestsType18: |
| | | case TaskTypenum.SideQuestsType19: |
| | | case TaskTypenum.SideQuestsType20: |
| | | case TaskTypenum.SideQuestsType21: |
| | | { |
| | | if (SideQuestsDic.ContainsKey(_taskID)) |
| | | { |
| | | SideQuestsDic[_taskID] = allMissionDict[_taskID]; |
| | | } |
| | | else |
| | | { |
| | | SideQuestsDic.Add(_taskID, allMissionDict[_taskID]); |
| | | } |
| | | if (SideQuestChangeEvent != null) |
| | | { |
| | | SideQuestChangeEvent(_taskID); |
| | | } |
| | | } |
| | | break; |
| | | case TaskTypenum.BountyMissionsType6: |
| | | case TaskTypenum.BountyMissionsType7: |
| | | case TaskTypenum.BountyMissionsType8: |
| | | { |
| | | |
| | | if (BountyDic.ContainsKey(_taskID)) |
| | | BountyDic[_taskID] = allMissionDict[_taskID]; |
| | | else |
| | | BountyDic.Add(_taskID, allMissionDict[_taskID]); |
| | | if (Event_nBounty != null) |
| | | Event_nBounty(); |
| | | } |
| | | |
| | | break; |
| | | case TaskTypenum.FairyAuMissionType11: |
| | | case TaskTypenum.FairyAuMissionType12: |
| | | { |
| | | if (FairyAuDic.ContainsKey(_taskID)) |
| | | FairyAuDic[_taskID] = allMissionDict[_taskID]; |
| | | else |
| | | FairyAuDic.Add(_taskID, allMissionDict[_taskID]); |
| | | if (Event_FairyAuTask != null && MissionState != 3) |
| | | Event_FairyAuTask(); |
| | | } |
| | | break; |
| | | case TaskTypenum.SpecialTaskType13: |
| | | case TaskTypenum.SpecialTaskType14: |
| | | case TaskTypenum.SpecialTaskType16: |
| | | |
| | | { |
| | | if (SpecialTask.ContainsKey(_taskID)) |
| | | SpecialTask[_taskID] = allMissionDict[_taskID]; |
| | | else |
| | | SpecialTask.Add(_taskID, allMissionDict[_taskID]); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | void TaskTypeDeletion(int _taskID)//任务类型的删除 |
| | | { |
| | | |
| | | if (MainTaskDic.ContainsKey(_taskID))//主线 |
| | | { |
| | | MainTaskDic.Remove(_taskID); |
| | | } |
| | | else if (SideQuestsDic.ContainsKey(_taskID))//支线 |
| | | { |
| | | SideQuestsDic.Remove(_taskID); |
| | | } |
| | | else if (BountyDic.ContainsKey(_taskID))//赏金 |
| | | { |
| | | BountyDic.Remove(_taskID); |
| | | if (Event_nBounty != null) |
| | | Event_nBounty(); |
| | | |
| | | } |
| | | else if (SpecialTask.ContainsKey(_taskID))//特殊任务 |
| | | { |
| | | SpecialTask.Remove(_taskID); |
| | | } |
| | | else if (FairyAuDic.ContainsKey(_taskID)) |
| | | { |
| | | FairyAuDic.Remove(_taskID); |
| | | if (Event_FairyAuTask != null) |
| | | Event_FairyAuTask(); |
| | | } |
| | | |
| | | |
| | | } |
| | | string TaskDetails(string _string, int _index)////Json解析 |
| | | { |
| | | JsonData _Json = JsonMapper.ToObject(_string); |
| | | if (_Json.Count == 1) |
| | | { |
| | | string _TaskDetails = _Json["0"].ToString().Replace("\"", ""); |
| | | return _TaskDetails; |
| | | } |
| | | else |
| | | { |
| | | string _TaskDetails = _Json[_index.ToString()].ToString().Replace("\"", ""); |
| | | return _TaskDetails; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | List<TsakLight> CharactersReplace(string _string, int _index, int Id) |
| | | { |
| | | |
| | | JsonData _Json = JsonMapper.ToObject(_string); |
| | | List<TsakLight> TsakLightList = new List<TsakLight>(); |
| | | TsakLightList.Clear(); |
| | | TsakLight taskLight = new TsakLight(); |
| | | foreach (var key in _Json.Keys) |
| | | { |
| | | if (int.Parse(key) == _index) |
| | | { |
| | | JsonData _Json1 = _Json[key]; |
| | | if (_Json1.Count != 0) |
| | | { |
| | | foreach (var _key in _Json1.Keys) |
| | | { |
| | | string Str = _key.ToString(); |
| | | Match match = Regex.Match(Str, pattern); |
| | | if (ReplaceDic.ContainsKey(Id)) |
| | | { |
| | | Dictionary<string, int> _dic = ReplaceDic[Id]; |
| | | if (_dic.ContainsKey(match.Groups[1].Value)) |
| | | { |
| | | taskLight.NpcId = _dic[match.Groups[1].Value]; |
| | | taskLight.StateLight = int.Parse(_Json1[_key].ToString()); |
| | | TsakLightList.Add(taskLight); |
| | | return TsakLightList; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | return TsakLightList; |
| | | } |
| | | |
| | | string StrInforList(string _string, int _index) |
| | | { |
| | | JsonData _Json = JsonMapper.ToObject(_string); |
| | | foreach (var key in _Json.Keys) |
| | | { |
| | | if (int.Parse(key) == _index) |
| | | { |
| | | JsonData _Json1 = _Json[key]; |
| | | if (_Json1.Count != 0) |
| | | { |
| | | foreach (var _key in _Json1.Keys) |
| | | { |
| | | return _Json1[_key].ToString(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return string.Empty; |
| | | } |
| | | |
| | | List<TsakLight> StrSegmentation(string _string, int _index) |
| | | { |
| | | int val; |
| | | JsonData _Json = JsonMapper.ToObject(_string); |
| | | List<TsakLight> TsakLightList = new List<TsakLight>(); |
| | | TsakLightList.Clear(); |
| | | |
| | | foreach (var key in _Json.Keys) |
| | | { |
| | | if (int.Parse(key) == _index) |
| | | { |
| | | JsonData _Json1 = _Json[key]; |
| | | if (_Json1.Count != 0) |
| | | { |
| | | foreach (var _key in _Json1.Keys) |
| | | { |
| | | if (int.TryParse(_key, out val)) |
| | | { |
| | | TsakLight taskLight = new TsakLight(); |
| | | taskLight.NpcId = int.Parse(_key); |
| | | taskLight.StateLight = int.Parse(_Json1[_key].ToString()); |
| | | TsakLightList.Add(taskLight); |
| | | } |
| | | return TsakLightList; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return TsakLightList; |
| | | } |
| | | |
| | | string RewardInformation(string _string, int _index)//奖励信息 |
| | | { |
| | | |
| | | string _occupation = ("J" + PlayerDatas.Instance.baseData.Job).ToString(); |
| | | JsonData _Json = JsonMapper.ToObject(_string); |
| | | foreach (var key in _Json.Keys) |
| | | { |
| | | if (int.Parse(key) == _index) |
| | | { |
| | | JsonData _Json1 = _Json[key]; |
| | | if (_Json1.Count != 0) |
| | | { |
| | | foreach (var _key in _Json1.Keys) |
| | | { |
| | | if (_key == _occupation) |
| | | return _Json1[_key].ToString(); |
| | | else if (_key == "-") |
| | | return _Json1[_key].ToString(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | void TaskChanges(int MissionID, int MissionState, int DiscriptionIndex)//存在的任务的修改 |
| | | { |
| | | var pytaskM = ConfigManager.Instance.GetTemplate<PyTaskConfig>(MissionID); |
| | | if (pytaskM == null) |
| | | return; |
| | | allMissionDict[MissionID].Time = DateTime.Now; |
| | | allMissionDict[MissionID].MissionState = MissionState; |
| | | allMissionDict[MissionID].descIndex = DiscriptionIndex; |
| | | allMissionDict[MissionID].RewardList = RewardInformation(pytaskM.rewardList, DiscriptionIndex);//奖励信息 |
| | | allMissionDict[MissionID].Desclist = TaskDetails(pytaskM.descList, DiscriptionIndex);//任务详情 |
| | | allMissionDict[MissionID].InforList = StrInforList(pytaskM.infoList, DiscriptionIndex);//任务完成条件 |
| | | |
| | | |
| | | if (MissionState == 3) |
| | | { |
| | | if (allMissionDict[MissionID].LightList.Equals(default(TsakLight))) |
| | | { |
| | | return; |
| | | } |
| | | for (int i = 0; i < allMissionDict[MissionID].LightList.Count; i++) |
| | | { |
| | | TsakLight TsakLight = new TsakLight(); |
| | | TsakLight.NpcId = allMissionDict[MissionID].LightList[i].NpcId; |
| | | TsakLight.StateLight = -1; |
| | | allMissionDict[MissionID].LightList[i] = TsakLight; |
| | | } |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (ReplaceDic.ContainsKey(MissionID)) |
| | | { |
| | | Dictionary<string, int> _dic = ReplaceDic[MissionID]; |
| | | if (_dic.ContainsKey("visit_npc_id") || _dic.ContainsKey("kill_npc_id")) |
| | | { |
| | | allMissionDict[MissionID].LightList = CharactersReplace(pytaskM.lightList, DiscriptionIndex, allMissionDict[MissionID].ID); |
| | | } |
| | | else |
| | | { |
| | | allMissionDict[MissionID].LightList = StrSegmentation(pytaskM.lightList, DiscriptionIndex);//任务信息灯 |
| | | } |
| | | } |
| | | else |
| | | { |
| | | allMissionDict[MissionID].LightList = StrSegmentation(pytaskM.lightList, DiscriptionIndex);//任务信息灯 |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void Task0820(H0820_tagMissionDict info)//0820信息字典 |
| | | { |
| | | Dictionary<string, int> dic = null; |
| | | ReplaceDic.TryGetValue((int)info.MissionID, out dic); |
| | | if (dic == null) |
| | | { |
| | | dic = new Dictionary<string, int>(); |
| | | StorageNPCDic(info.DictKey, (int)info.DictValue); |
| | | dic.Add(info.DictKey, (int)info.DictValue); |
| | | ReplaceDic.Add((int)info.MissionID, dic); |
| | | } |
| | | else |
| | | { |
| | | if (dic.ContainsKey(info.DictKey)) |
| | | { |
| | | StorageNPCDic(info.DictKey, (int)info.DictValue); |
| | | dic[info.DictKey] = (int)info.DictValue; |
| | | if (info.DictKey == "around_allcount") |
| | | { |
| | | if (TaskCoinTaskEvent != null) |
| | | { |
| | | TaskCoinTaskEvent(); |
| | | } |
| | | } |
| | | if (info.DictKey == "around_count_family") |
| | | { |
| | | if (FairyTaskEvent != null) |
| | | { |
| | | FairyTaskEvent(); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | StorageNPCDic(info.DictKey, (int)info.DictValue); |
| | | dic.Add(info.DictKey, (int)info.DictValue); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | public void RequestGetTaskAward(string _answer) |
| | | { |
| | | var sendInfo = new C0802_tagCNPCAnswer(); |
| | | sendInfo.Answer = _answer; |
| | | sendInfo.AnswerLen = (byte)_answer.Length; |
| | | GameNetSystem.Instance.SendInfo(sendInfo); |
| | | |
| | | if (tryGetTaskAwardEvent != null) |
| | | { |
| | | tryGetTaskAwardEvent(); |
| | | } |
| | | } |
| | | |
| | | public void TaskRefreshes(int _MissionId, int _DictKeyLen, string _DictKey, int _DictValue)//任务数据的刷新(任务字典信息) |
| | | { |
| | | |
| | | if (!_DicTaskInformation.ContainsKey(_MissionId)) |
| | | { |
| | | Dictionary<string, string> _dic = new Dictionary<string, string>(); |
| | | if (_dic.ContainsKey(_DictKey)) |
| | | { |
| | | _dic[_DictKey] = _DictValue.ToString(); |
| | | } |
| | | else |
| | | { |
| | | _dic.Add(_DictKey, _DictValue.ToString()); |
| | | } |
| | | _DicTaskInformation.Add(_MissionId, _dic); |
| | | string kaji = "kaji"; |
| | | if (_DicTaskInformation.ContainsKey(_MissionId) && _DicTaskInformation[_MissionId].ContainsKey(kaji)) |
| | | { |
| | | if (MainTaskDic.ContainsKey(_MissionId) && MainCardLevelChange != null && _DictValue == 0) |
| | | { |
| | | MainCardLevelChange(_MissionId); |
| | | } |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (_DicTaskInformation[_MissionId].ContainsKey(_DictKey)) |
| | | { |
| | | _DicTaskInformation[_MissionId][_DictKey] = _DictValue.ToString(); |
| | | if (_DictKey == "kaji" && _DictValue == 0) |
| | | { |
| | | if (CardLevelChange != null) |
| | | { |
| | | CardLevelChange(_MissionId); |
| | | } |
| | | if (MainTaskDic.ContainsKey(_MissionId) && MainCardLevelChange != null) |
| | | { |
| | | MainCardLevelChange(_MissionId); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | _DicTaskInformation[_MissionId].Add(_DictKey, _DictValue.ToString()); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (Event_TaskInformation != null) |
| | | Event_TaskInformation(_MissionId, _DicTaskInformation); |
| | | } |
| | | public void DelMission(int _taskID)//真实任务删除 |
| | | { |
| | | if (allMissionDict.ContainsKey(_taskID)) |
| | | { |
| | | allMissionDict.Remove(_taskID); |
| | | _DicTaskInformation.Remove(_taskID); |
| | | } |
| | | TaskTypeDeletion(_taskID); |
| | | if (Event_TaskToDelete != null) |
| | | Event_TaskToDelete(_taskID); |
| | | |
| | | |
| | | } |
| | | bool _bool = false; |
| | | string _conversationA = null; |
| | | public void EventTalk(H0801_tagEventTalk info)//访问任务是否可提交 |
| | | { |
| | | NPCid = (int)info.NPCID; |
| | | if (info.Msg == null || info.Msg[0].MsgLen == 0) |
| | | { |
| | | _conversation = _conversationA; |
| | | } |
| | | else |
| | | { |
| | | if (_conversationA != info.Msg[0].Msg) |
| | | { |
| | | _conversation = info.Msg[0].Msg; |
| | | _conversationA = _conversation; |
| | | } |
| | | } |
| | | |
| | | if (_bool) |
| | | { |
| | | if ((int)info.MissionID != 0) |
| | | { |
| | | _TaskNow = (int)info.MissionID; |
| | | OnEventTalkEvent((int)info.MissionID); |
| | | _bool = false; |
| | | return; |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < info.Answer.Length; i++) |
| | | { |
| | | string[] str = info.Answer[i].Msg.Split('_'); |
| | | int var; |
| | | if (str.Length > 1) |
| | | { |
| | | for (int j = 0; j < info.Answer.Length; j++) |
| | | { |
| | | string[] stX = info.Answer[j].Msg.Split('_'); |
| | | if (stX.Length > 1) |
| | | { |
| | | string strXX = stX[stX.Length - 1]; |
| | | if (int.TryParse(strXX, out var)) |
| | | { |
| | | if (int.Parse(strXX) == GetNowTaskID) |
| | | { |
| | | RequestGetTaskAward(strXX); |
| | | _bool = true; |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | string str1 = str[str.Length - 1]; |
| | | RequestGetTaskAward(str1); |
| | | _bool = true; |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | _bool = false; |
| | | if ((int)info.NPCID != 32504001) |
| | | { |
| | | DefaultDialogue(); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public string pattern = @"\{(.+)\}"; |
| | | |
| | | public int StatusLightQuery(int _NpcID)//状态灯查询 |
| | | { |
| | | int Light = -1; |
| | | foreach (int key in allMissionDict.Keys) |
| | | { |
| | | if (allMissionDict[key].LightList.Equals(default(TsakLight))) |
| | | { |
| | | continue; |
| | | } |
| | | for (int i = 0; i < allMissionDict[key].LightList.Count; i++) |
| | | { |
| | | if (_NpcID == allMissionDict[key].LightList[i].NpcId) |
| | | { |
| | | if (allMissionDict[key].LightList[i].StateLight > Light) |
| | | { |
| | | Light = allMissionDict[key].LightList[i].StateLight; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //if (_NpcID == allMissionDict[key].LightList.NpcId) |
| | | //{ |
| | | // if (allMissionDict[key].LightList.StateLight > Light) |
| | | // { |
| | | // Light = allMissionDict[key].LightList.StateLight; |
| | | // } |
| | | |
| | | //} |
| | | } |
| | | |
| | | return Light; |
| | | } |
| | | |
| | | public void DailyFairyTaskMove()//日常仙盟任务 |
| | | { |
| | | if (SpecialTask.Count != 0) |
| | | { |
| | | foreach (int key in SpecialTask.Keys) |
| | | { |
| | | if (SpecialTask[key].Type == 14 && SpecialTask[key].MissionState != 3)//未接任务 |
| | | { |
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI(); |
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key)); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (FairyAuDic.Count != 0) |
| | | { |
| | | foreach (int key in FairyAuDic.Keys) |
| | | { |
| | | if (FairyAuDic[key].MissionState != 0 && FairyAuDic[key].MissionState != 3) |
| | | { |
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI(); |
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key)); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | public void DailyBountyMove()//日常赏金任务 |
| | | { |
| | | if (SpecialTask.Count != 0) |
| | | { |
| | | foreach (int key in SpecialTask.Keys) |
| | | { |
| | | if (SpecialTask[key].Type == 13 && SpecialTask[key].MissionState != 3)//未接任务 |
| | | { |
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI(); |
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key)); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (BountyDic.Count != 0) |
| | | { |
| | | foreach (int key in BountyDic.Keys) |
| | | { |
| | | if (BountyDic[key].MissionState != 0 && BountyDic[key].MissionState != 3) |
| | | { |
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI(); |
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key)); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | private void AutotaskingPrecedence(bool automaticityBool, int missionID)//关于是否执行自动任务和自动任务的优先级 |
| | | { |
| | | if (automaticityBool) |
| | | { |
| | | var inDungeon = IsDungeon(); |
| | | |
| | | if (inDungeon)//判断是否再副本中对任务ID进行储存 |
| | | { |
| | | retainTaskID = Autotasking(missionID); |
| | | } |
| | | else |
| | | { |
| | | retainTaskID = 0; |
| | | if (Autotasking(missionID) != 0) |
| | | { |
| | | AutomaticTripToTask(Autotasking(missionID)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private int Autotasking(int taskID) |
| | | { |
| | | foreach (var value in MainTaskDic.Values) |
| | | { |
| | | if (value.MissionState != 0 && value.MissionState != 3) |
| | | { |
| | | if (allMissionDict.ContainsKey(taskID) && (allMissionDict[taskID].Time - value.Time).TotalSeconds <= 1) |
| | | { |
| | | if (ReplaceDic.ContainsKey(value.ID)) |
| | | { |
| | | Dictionary<string, int> _dic = ReplaceDic[value.ID]; |
| | | if (_dic.ContainsKey("continue") && _dic["continue"] == 1) |
| | | { |
| | | return value.ID; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (ReplaceDic.ContainsKey(taskID)) |
| | | { |
| | | Dictionary<string, int> _dic = ReplaceDic[taskID]; |
| | | if (_dic.ContainsKey("continue") && _dic["continue"] == 1) |
| | | { |
| | | return taskID; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | public void AutomaticTripToTask(int _taskID)//任务自动前往(任务添加) |
| | | { |
| | | try |
| | | { |
| | | if (MainTaskDic.ContainsKey(_taskID))//主线任务 |
| | | { |
| | | if (MainTaskDic[_taskID].MissionState == 0 || MainTaskDic[_taskID].MissionState == 3) |
| | | return; |
| | | if (MainTaskDic.ContainsKey(_taskID)) |
| | | { |
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI(); |
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID)); |
| | | return; |
| | | } |
| | | } |
| | | if (BountyDic.ContainsKey(_taskID))//赏金任务 |
| | | { |
| | | if (BountyDic[_taskID].MissionState == 3 || BountyDic[_taskID].MissionState == 2 || BountyMotionBool) |
| | | { |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (BountyDic.ContainsKey(_taskID)) |
| | | { |
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI(); |
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID)); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (FairyAuDic.ContainsKey(_taskID))//仙盟任务 |
| | | { |
| | | if (FairyAuDic[_taskID].MissionState == 3 || FairyAuDic[_taskID].MissionState == 2 || FairyAuBool) |
| | | { |
| | | return; |
| | | } |
| | | if (FairyAuDic.ContainsKey(_taskID)) |
| | | { |
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI(); |
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID)); |
| | | return; |
| | | } |
| | | } |
| | | else if (SideQuestsDic.ContainsKey(_taskID)) |
| | | { |
| | | if (SideQuestsDic[_taskID].MissionState == 0 || SideQuestsDic[_taskID].MissionState == 3) |
| | | { |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI(); |
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID)); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DesignDebug.Log(ex); |
| | | } |
| | | } |
| | | |
| | | public void RunTaskAwarInfo(HA708_tagMCRunTaskAwardInfo info)//通知跑环奖励记录 |
| | | { |
| | | for (int i = 0; i < info.Cnt; i++) |
| | | { |
| | | if (!AwardRecordDic.ContainsKey(info.InfoList[i].Type)) |
| | | { |
| | | RunTaskAwardRecord _RunTaskAwardRecord = new RunTaskAwardRecord(); |
| | | _RunTaskAwardRecord.Num = (int)info.InfoList[i].Num; |
| | | _RunTaskAwardRecord.AwardState = info.InfoList[i].AwardState; |
| | | AwardRecordDic.Add(info.InfoList[i].Type, _RunTaskAwardRecord); |
| | | } |
| | | else |
| | | { |
| | | AwardRecordDic[info.InfoList[i].Type].Num = (int)info.InfoList[i].Num; |
| | | AwardRecordDic[info.InfoList[i].Type].AwardState = info.InfoList[i].AwardState; |
| | | } |
| | | if (info.InfoList[i].Type == (int)TaskTypenum.BountyMissionsType7) |
| | | { |
| | | BountyRewardsNumber = (int)info.InfoList[i].Num; |
| | | if (Event_BountyRewards != null) |
| | | Event_BountyRewards((int)info.InfoList[i].Num, info.InfoList[i].AwardState); |
| | | } |
| | | else if (info.InfoList[i].Type == (int)TaskTypenum.FairyAuMissionType12) |
| | | { |
| | | OnFairyAuNumber = (int)info.InfoList[i].Num; |
| | | if (Event_FairyAuReward != null) |
| | | Event_FairyAuReward((int)info.InfoList[i].Num, info.InfoList[i].AwardState); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private PlayerPackModel m_PlayerBackModel; |
| | | private PlayerPackModel PlayerBackModel |
| | | { |
| | | get |
| | | { |
| | | return m_PlayerBackModel ?? (m_PlayerBackModel = ModelCenter.Instance.GetModel<PlayerPackModel>()); |
| | | } |
| | | } |
| | | |
| | | private IEnumerator WaitForSkillFinished(int _taskID) |
| | | { |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | | |
| | | if (_hero == null) |
| | | { |
| | | yield break; |
| | | } |
| | | while (_hero.SkillMgr.CurCastSkill != null && |
| | | _hero.SkillMgr.CurCastSkill.SkillCompelete == false) |
| | | { |
| | | yield return null; |
| | | } |
| | | |
| | | yield return WaitingForSecondConst.WaitMS500; |
| | | |
| | | var _singleModel = PlayerBackModel.GetSinglePackModel(PackType.rptEquip); |
| | | // 如果有守护, 则不拾取 |
| | | var _itemModel = _singleModel.GetItemModelByIndex((int)RoleEquipType.retSpiritAnimal); |
| | | if (_itemModel == null || !GeneralConfig.Instance.GuardianPickUpID.Contains(_itemModel.itemId)) |
| | | { |
| | | float _chkDistanceSqrt; |
| | | DropItemManager.DropObject _obj = null; |
| | | while (DropItemManager.HandupTryGetHeroItem(out _obj)) |
| | | { |
| | | if (DropItemManager.StopMissionPickup) |
| | | { |
| | | break; |
| | | } |
| | | |
| | | if (MapTransferUtility.Instance.MapTransferDoType != MapTransferUtility.E_MapTransferDoType.None) |
| | | { |
| | | break; |
| | | } |
| | | Vector3 _targetPosition = _obj.dropItem.transform.position; |
| | | _chkDistanceSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _targetPosition); |
| | | if (_chkDistanceSqrt > 0.5f) |
| | | { |
| | | if (_hero.State != E_ActorState.AutoRun) |
| | | { |
| | | _hero.MoveToPosition(_targetPosition); |
| | | } |
| | | } |
| | | |
| | | yield return null; |
| | | } |
| | | } |
| | | |
| | | if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing) |
| | | { |
| | | yield break; |
| | | } |
| | | |
| | | if (WindowCenter.Instance.CheckOpen<TreasureLevelUpWin>()) |
| | | { |
| | | yield break; |
| | | } |
| | | |
| | | if (WindowCenter.Instance.CheckOpen<MysteriousMissionWin>()) |
| | | { |
| | | yield break; |
| | | } |
| | | if (BountyDic.ContainsKey(_taskID) || FairyAuDic.ContainsKey(_taskID)) |
| | | { |
| | | yield return WaitingForSecondConst.WaitMS800;//缓冲一秒再进行 |
| | | } |
| | | |
| | | if (GA_Hero.s_MapSwitching) |
| | | { |
| | | yield break; |
| | | } |
| | | |
| | | try |
| | | { |
| | | if (allMissionDict.ContainsKey(_taskID) && !NewBieCenter.Instance.inGuiding) |
| | | { |
| | | // GetNowTaskID = _taskID; |
| | | string _strTest = allMissionDict[_taskID].InforList; |
| | | string strTask = TaskAllocation.Instance.GetTaskInfo(ConfigManager.Instance.GetTemplate<TASKINFOConfig>(_strTest).show_writing, _taskID); |
| | | HrefAnalysis.Inst.ExcuteHrefEvent(strTask); |
| | | DropItemManager.StopMissionPickup = false; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DesignDebug.Log(ex); |
| | | } |
| | | |
| | | } |
| | | |
| | | private int GetNPCID(Dictionary<string, int> _Dic) |
| | | { |
| | | foreach (string key in _Dic.Keys) |
| | | { |
| | | string[] str = key.Split('_'); |
| | | if (str[0] == "Show") |
| | | { |
| | | return int.Parse(str[1]); |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | private void StorageNPCDic(string key, int Value)//关于NPC的显隐 |
| | | { |
| | | string[] str = key.Split('_'); |
| | | if (str[0] == "Show") |
| | | { |
| | | int NPCid = int.Parse(str[1]); |
| | | if (NPCShowDic.ContainsKey(NPCid)) |
| | | { |
| | | NPCShowDic[NPCid] = Value; |
| | | |
| | | } |
| | | else |
| | | { |
| | | NPCShowDic.Add(NPCid, Value); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private void IsShowNpC(int _taskID)//关于NPC的显隐 |
| | | { |
| | | if (ReplaceDic.ContainsKey(_taskID)) |
| | | { |
| | | Dictionary<string, int> showNpcDic = ReplaceDic[_taskID]; |
| | | int Npcid = GetNPCID(showNpcDic); |
| | | if (Npcid != 0 && NPCShowDic.ContainsKey(Npcid)) |
| | | { |
| | | if (NPCShowDic[Npcid] == 0) |
| | | { |
| | | if (FaBaoNPCIdList.Contains(Npcid)) |
| | | { |
| | | GA_NpcFunc.SetNpcFuncVisible(Npcid, false, 0.5f, (Vector3 _pos) => |
| | | { |
| | | WindowCenter.Instance.Open<EffectToFaBaoWin>(); |
| | | UIeffectFabaoVec = _pos; |
| | | }, 0.3f); |
| | | } |
| | | else |
| | | { |
| | | GA_NpcFunc.SetNpcFuncVisible(Npcid, false); |
| | | } |
| | | |
| | | } |
| | | else if (NPCShowDic[Npcid] == 1) |
| | | { |
| | | GA_NpcFunc.SetNpcFuncVisible(Npcid, true); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | public enum TaskStatus//任务状态 |
| | | { |
| | | None=-5,//没有 |
| | | Normal = 0,//正常任务(绿) |
| | | TreasureCardLevel = 1,//法宝卡级(红) |
| | | CardLevel = 2,//等级卡级(红) |
| | | Completed = 3,//立即完成任务 |
| | | } |
| | | public TaskStatus GetTaskStatus(int taskID) |
| | | { |
| | | if (_DicTaskInformation.ContainsKey(taskID) && _DicTaskInformation[taskID].ContainsKey("kaji")) |
| | | { |
| | | var kaji = _DicTaskInformation[taskID]["kaji"]; |
| | | |
| | | switch (int.Parse(kaji)) |
| | | { |
| | | case 0: |
| | | return TaskStatus.Normal; |
| | | case 1: |
| | | return TaskStatus.TreasureCardLevel; |
| | | case 2: |
| | | return TaskStatus.CardLevel; |
| | | case 3: |
| | | return TaskStatus.Completed; |
| | | default: |
| | | return TaskStatus.None; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return TaskStatus.None; |
| | | } |
| | | |
| | | } |
| | | private bool IsDungeon()//判断是否在副本中 |
| | | { |
| | | var mapId = PlayerDatas.Instance.baseData.MapID; |
| | | var mapConfig = ConfigManager.Instance.GetTemplate<MapConfig>(mapId); |
| | | return mapConfig != null && mapConfig.MapFBType != 0; |
| | | } |
| | | public bool IsGather(int npdId)//是否能采集NPC |
| | | { |
| | | var taskListConfig = ConfigManager.Instance.GetTemplate<TaskListConfig>(currentMission); |
| | | if (taskListConfig != null) |
| | | { |
| | | int[] collectNPCList = taskListConfig.CollectNPC; |
| | | if ((collectNPCList.Length == 1 && collectNPCList[0] == 0) || GetTaskStatus(currentMission) != 0) |
| | | { |
| | | return false; |
| | | |
| | | } |
| | | for (int i = 0; i < collectNPCList.Length; i++) |
| | | { |
| | | if (collectNPCList[i] == npdId) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static bool IsOPenAutoResolve()//任务面板不开启自动挂机状态 |
| | | { |
| | | WindowCenter.Instance.CheckOpen<DefaultDialogueBoxWin>(); |
| | | WindowCenter.Instance.CheckOpen<DialogueDuidanceWin>(); |
| | | bool _bool = true; |
| | | if (WindowCenter.Instance.CheckOpen<TaskBoxBGMWin>()) |
| | | { |
| | | _bool = false; |
| | | } |
| | | else if (WindowCenter.Instance.CheckOpen<DefaultDialogueBoxWin>()) |
| | | { |
| | | _bool = false; |
| | | } |
| | | else if (WindowCenter.Instance.CheckOpen<DialogueDuidanceWin>()) |
| | | { |
| | | _bool = false; |
| | | } |
| | | return _bool; |
| | | } |
| | | |
| | | private int BOUNTYTASK = 2009;//赏金任务 |
| | | private int FAIRYAUTASK = 3009;//仙盟任务 |
| | | private void TaskTerminationToHangUp(int taskID, int MissionState)//(完成任务后前往挂机地点)任务ID,任务状态 |
| | | { |
| | | if (!AutomaticityBool) |
| | | { |
| | | return; |
| | | } |
| | | if ((taskID == BOUNTYTASK && MissionState == 1 && !BountyMotionBool && TaskAllocation.Instance.ForRingAllNumber()!=10) |
| | | || (taskID == FAIRYAUTASK && MissionState == 1 && !FairyAuBool && TaskAllocation.Instance.FairyAuAllNumber()==70)) |
| | | { |
| | | var mapModel = ModelCenter.Instance.GetModel<MapModel>(); |
| | | var point = mapModel.GetRecommendHangPoint(); |
| | | var config = ConfigManager.Instance.GetTemplate<MapEventPointConfig>(point); |
| | | MapTransferUtility.Instance.MoveToNPC(config.NPCID); |
| | | |
| | | } |
| | | } |
| | | public void CompletionOfTask(int TaskID)//任务完成 |
| | | { |
| | | CA206_tagCMQuickFinishMission _CA206 = new CA206_tagCMQuickFinishMission(); |
| | | _CA206.MissionID = (uint)TaskID; |
| | | _CA206.DoType = 0; |
| | | GameNetSystem.Instance.SendInfo(_CA206); |
| | | } |
| | | |
| | | public int SideQuestState(int TaskID)//关于查询任务的状态(-1没有此任务,0未接,1正在进行中,2可提交) |
| | | { |
| | | if (allMissionDict.ContainsKey(TaskID)) |
| | | { |
| | | return allMissionDict[TaskID].MissionState; |
| | | } |
| | | else |
| | | { |
| | | return -1; |
| | | } |
| | | |
| | | } |
| | | |
| | | public int GetQuestState(int _taskId) |
| | | { |
| | | if (allMissionDict.ContainsKey(_taskId)) |
| | | { |
| | | return allMissionDict[_taskId].MissionState; |
| | | } |
| | | else |
| | | { |
| | | return -1; |
| | | } |
| | | } |
| | | |
| | | } |
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | | using System.Text.RegularExpressions;
|
| | | using System.Text;
|
| | | using Snxxz.UI;
|
| | | //任务信息的存储
|
| | |
|
| | | /** 任务结构 */
|
| | | public class MissionDetailDates
|
| | | {
|
| | | public DateTime Time;//记录时间
|
| | | public int ID;//任务ID
|
| | | public string Name;//任务名称
|
| | | public int Type;//任务类型
|
| | | public int NPC_ID;//起始NPCID
|
| | | public int LV;//可接等级
|
| | | public int ColorLV;//任务难度
|
| | | public string Desclist;//任务详情
|
| | | public string RewardList;//奖励信息
|
| | | public List<TsakLight> LightList;//任务灯信息
|
| | | public string InforList;//任务完成条件
|
| | | public int MissionState;//任务状态0未接,1进行中,2可提交,3已完成,6特殊卡级
|
| | | public int descIndex;//任务描述索引
|
| | | }
|
| | |
|
| | |
|
| | | public class MissionDict//任务字典信息
|
| | | {
|
| | | public int MissionId;//任务ID |
| | |
|
| | | public int DictKeyLen;//任务字典中的某个Key
|
| | |
|
| | | public string DictKey;//key的长度
|
| | |
|
| | | public int DictValue;//该key对应的值
|
| | |
|
| | |
|
| | | }
|
| | | public class RunTaskAwardRecord
|
| | | {
|
| | | public int Num;
|
| | | public int AwardState;
|
| | | }
|
| | |
|
| | | public struct TsakLight
|
| | | {
|
| | | public int NpcId;
|
| | | public int StateLight;
|
| | | }
|
| | |
|
| | |
|
| | | public class PlayerTaskDatas : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | |
|
| | | /** 任务总清单 */
|
| | | public static bool _globalbool = false;
|
| | | public Dictionary<int, MissionDetailDates> allMissionDict = new Dictionary<int, MissionDetailDates>();//任务初始化接收字典
|
| | | public Dictionary<int, MissionDetailDates> MainTaskDic = new Dictionary<int, MissionDetailDates>();//主线任务字典
|
| | | public Dictionary<int, MissionDetailDates> SideQuestsDic = new Dictionary<int, MissionDetailDates>();//支线任务字典
|
| | | public Dictionary<int, MissionDetailDates> BountyDic = new Dictionary<int, MissionDetailDates>();//赏金任务
|
| | | public Dictionary<int, MissionDetailDates> FairyAuDic = new Dictionary<int, MissionDetailDates>();//仙盟任务
|
| | | public Dictionary<int, MissionDetailDates> SpecialTask = new Dictionary<int, MissionDetailDates>();//特殊任务类型
|
| | | public Dictionary<int, Dictionary<string, string>> _DicTaskInformation = new Dictionary<int, Dictionary<string, string>>();//任务字典的信息
|
| | | public Dictionary<int, Dictionary<string, int>> ReplaceDic = new Dictionary<int, Dictionary<string, int>>();//key值替换字典
|
| | | public Dictionary<int, RunTaskAwardRecord> AwardRecordDic = new Dictionary<int, RunTaskAwardRecord>();//跑环奖励记录
|
| | | public Dictionary<int, int> NPCShowDic = new Dictionary<int, int>();//关于NPC的显隐问题
|
| | | public delegate void OnTaskToAdd(int MissionID, int MissionState, int DiscriptionIndex);
|
| | | public static event OnTaskToAdd Event_TaskToAdd;//任务添加
|
| | | public delegate void OnTaskRefreshes(int _taskId);
|
| | | public static event OnTaskRefreshes Event_TaskRefreshes;//任务的刷新
|
| | | public delegate void OnBounty();//赏金任务的添加
|
| | | public static event OnBounty Event_nBounty;
|
| | | public delegate void OnFairyAuTask();//仙盟任务的添加和刷新
|
| | | public static event OnFairyAuTask Event_FairyAuTask;
|
| | |
|
| | | public delegate void OnTaskInformation(int _id, Dictionary<int, Dictionary<string, string>> _Dic);
|
| | | public static event OnTaskInformation Event_TaskInformation;//任务字典信息
|
| | |
|
| | | public delegate void OnTaskToDelete(int _taskID);
|
| | | public static event OnTaskToDelete Event_TaskToDelete;//任务的删除
|
| | |
|
| | | public delegate void OnBountyRewards(int Number, int AwardState);//获取赏金奖励
|
| | | public static event OnBountyRewards Event_BountyRewards;
|
| | | public int BountyRewardsNumber = 0;//获取赏金内容的奖励值
|
| | |
|
| | | public delegate void OnFairyAuReward(int Number, int AwardState);//仙盟奖励
|
| | | public static event OnFairyAuReward Event_FairyAuReward;
|
| | | public int OnFairyAuNumber = 0;//获取仙盟的奖励值
|
| | |
|
| | | public string _conversation = null;//对话内容、
|
| | | public int _TaskNow = 0;//获取当前任务ID
|
| | | public string _DefaultDialogContent = null;//默认对话内容
|
| | |
|
| | | public delegate void OnMainlineTask(int MissionID, int MissionState);//主线任务任务状态变更和刷新
|
| | | public static event OnMainlineTask Event_MainlineTask;
|
| | |
|
| | | public delegate void OnTaskResponse(int _nowNPCid, int _nPCLamp, Dictionary<int, int> _dic = null);//NPCNPC灯状态,可接取任务(NPCID,任务灯状态)
|
| | | public static event OnTaskResponse Event_TaskResponse;
|
| | |
|
| | | public static event Action tryGetTaskAwardEvent;//这个是客户端只要尝试去领奖就会触发,不管最后的领奖结果。
|
| | |
|
| | | public static event Action<int> CardLevelChange;//关于任务卡机状态的转变
|
| | |
|
| | | public static event Action<int> SideQuestChangeEvent;//支线任务状态改变
|
| | |
|
| | | public static event Action<int> MainCardLevelChange;//主线任务卡级状态改变
|
| | |
|
| | | public static event Action<int> CompletionOfTaskEvent;//任务完成回调
|
| | |
|
| | | public static event Action TaskCoinTaskEvent;//赏金任务信息字典变更
|
| | | public static event Action FairyTaskEvent;//仙盟任务信息字典变更
|
| | |
|
| | | public int NPCid = 0;//获取NPCID(打开任务面板时)、
|
| | |
|
| | | public bool BountyMotionBool = false;//控制赏金任务是否自动移动
|
| | | public bool FairyAuBool = false;//控制仙盟任务是否自动移动
|
| | | public int currentMission { get; private set; }
|
| | | public int currentMissionState { get; private set; }
|
| | |
|
| | | public int GetNowTaskID { get; set; }
|
| | |
|
| | | private bool AutomaticityBool = false;//控制是否自动进行自动任务
|
| | | private int retainTaskID = 0;
|
| | | private float BossDelayTimeint = 0;
|
| | | private List<int> FaBaoNPCIdList = new List<int>();//用于获取需要消失的法宝NPCID;
|
| | | public Vector3 UIeffectFabaoVec = new Vector3();//法宝NPC消失时获取的坐标
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack
|
| | | {
|
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); }
|
| | | }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | StageManager.Instance.onStageLoadFinish += onStageLoadFinish;
|
| | | NPCInteractProcessor.s_NpcInteractEvent += NpcInterac;
|
| | | FaBaoNPCIdList.Clear();
|
| | | string strFabao = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("FaBaoNPCID").Numerical1;
|
| | | string[] strFabaoNpcID = ConfigParse.GetMultipleStr(strFabao);//解析出数组|
|
| | |
|
| | | for (int i = 0; i < strFabaoNpcID.Length; i++)
|
| | | {
|
| | | FaBaoNPCIdList.Add(int.Parse(strFabaoNpcID[i]));
|
| | | }
|
| | | string BossDelayTime = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("BossDelayTime").Numerical1;
|
| | | BossDelayTimeint = float.Parse(BossDelayTime);
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | StageManager.Instance.onStageLoadFinish -= onStageLoadFinish;
|
| | | NPCInteractProcessor.s_NpcInteractEvent -= NpcInterac;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | allMissionDict.Clear();
|
| | | MainTaskDic.Clear();
|
| | | SideQuestsDic.Clear();
|
| | | BountyDic.Clear();
|
| | | FairyAuDic.Clear();
|
| | | SpecialTask.Clear();
|
| | | _DicTaskInformation.Clear();
|
| | | ReplaceDic.Clear();
|
| | | AwardRecordDic.Clear();
|
| | | NPCShowDic.Clear();
|
| | | _conversation = null;
|
| | | _DefaultDialogContent = null;
|
| | | _TaskNow = 0;
|
| | | BountyRewardsNumber = 0;
|
| | | NPCid = 0;
|
| | | retainTaskID = 0;
|
| | | currentMission = 0;
|
| | | _globalbool = false;
|
| | | BountyMotionBool = false;
|
| | | FairyAuBool = false;
|
| | | AutomaticityBool = false;
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | AutomaticityBool = true;
|
| | | }
|
| | |
|
| | | private void onStageLoadFinish()//地图切换时调用
|
| | | {
|
| | | var inDungeon = IsDungeon();
|
| | | if (!inDungeon && retainTaskID != 0)
|
| | | {
|
| | | if (ReplaceDic.ContainsKey(retainTaskID))
|
| | | {
|
| | | AutomaticTripToTask(retainTaskID);
|
| | | retainTaskID = 0;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void RefreshMissionState(int MissionID, int MissionState, int DiscriptionIndex)//1.任务ID,2任务状态,3,任务描述Index(接收任务)
|
| | | {
|
| | | try
|
| | | {
|
| | | var pytaskM = ConfigManager.Instance.GetTemplate<PyTaskConfig>(MissionID);
|
| | | if (pytaskM == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if ((pytaskM.type == (int)TaskTypenum.MainlineTaskType || pytaskM.type == (int)TaskTypenum.MainlineTaskTyp2) && MissionState != 0 && MissionState != 3)
|
| | | {
|
| | | currentMission = MissionID;
|
| | | currentMissionState = MissionState;
|
| | | if (Event_MainlineTask != null)
|
| | | Event_MainlineTask(MissionID, MissionState);
|
| | | }
|
| | |
|
| | |
|
| | | if (allMissionDict.ContainsKey(MissionID))
|
| | | {
|
| | | if (allMissionDict[MissionID].MissionState != MissionState && MissionState == 3 && AutomaticityBool)
|
| | | {
|
| | | if (CompletionOfTaskEvent != null)
|
| | | {
|
| | | CompletionOfTaskEvent(MissionID);
|
| | | }
|
| | | }
|
| | | TaskChanges(MissionID, MissionState, DiscriptionIndex);//任务的状态修改
|
| | |
|
| | | if (Event_TaskRefreshes != null)//刷新任务
|
| | | {
|
| | | Event_TaskRefreshes(MissionID);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | AddMission(MissionID, MissionState, DiscriptionIndex);//任务的添加
|
| | | if (Event_TaskToAdd != null)
|
| | | {
|
| | | Event_TaskToAdd(MissionID, MissionState, DiscriptionIndex);
|
| | | }
|
| | | }
|
| | | TaskClassification(MissionID, MissionState);//任务分类
|
| | | IsShowNpC(1);//是否显示NPC
|
| | | IsShowNpC(MissionID);//是否显示NPC
|
| | | if (AutomaticityBool)
|
| | | {
|
| | | AutotaskingPrecedence(AutomaticityBool, MissionID);//是否执行自动任务
|
| | | }
|
| | | TaskTerminationToHangUp(MissionID, MissionState);//结束赏金和仙盟任务前往挂机
|
| | | if (Event_TaskResponse != null)//发送任务灯信息
|
| | | {
|
| | | if (allMissionDict[MissionID].LightList.Equals(default(TsakLight)))
|
| | | {
|
| | | return;
|
| | | }
|
| | | for (int i = 0; i < allMissionDict[MissionID].LightList.Count; i++)
|
| | | {
|
| | | Event_TaskResponse(allMissionDict[MissionID].LightList[i].NpcId, allMissionDict[MissionID].LightList[i].StateLight);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | void NpcInterac(E_NpcType equip, int NPcID, uint instanceId)//服务器发包(NPCID,人物位置)
|
| | | {
|
| | | float Posx = PlayerDatas.Instance.hero.Pos.x * 2;
|
| | | float PosY = PlayerDatas.Instance.hero.Pos.z * 2;
|
| | | if (BossInfoConfig.GetBossInfoByStoneId(NPcID) != null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | C0801_tagCNPCTalk _C0801 = new C0801_tagCNPCTalk();
|
| | | _C0801.NPCID = instanceId;
|
| | | _C0801.PosX = (ushort)Posx;
|
| | | _C0801.PosY = (ushort)PosY;
|
| | | GameNetSystem.Instance.SendInfo(_C0801);
|
| | | }
|
| | |
|
| | | void DefaultDialogue()//关于打开默认对话界面
|
| | | {
|
| | | bool IsOpenMain = WindowCenter.Instance.CheckOpen<MainInterfaceWin>();
|
| | | if (!WindowCenter.Instance.CheckOpen<DefaultDialogueBoxWin>() && IsOpenMain)
|
| | | {
|
| | | WindowCenter.Instance.Open<DefaultDialogueBoxWin>();
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnEventTalkEvent(int taskID)//NPC对话后的弹框
|
| | | {
|
| | | //if (WindowCenter.Instance.ExitAnyFullScreenOrMaskWin())
|
| | | //{
|
| | | // return;
|
| | | //}
|
| | | if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var config = ConfigManager.Instance.GetTemplate<StoryMissionsConfig>(taskID);
|
| | | bool IsOpenMain = WindowCenter.Instance.CheckOpen<MainInterfaceWin>();
|
| | | var treasureStageUpShow = ModelCenter.Instance.GetModel<TreasureModel>().treasureStageUpShow;
|
| | | if (config != null)
|
| | | {
|
| | | for (int i = 0; i < config.NpcID.Length; i++)
|
| | | {
|
| | | if (NPCid == config.NpcID[i])
|
| | | {
|
| | | if (!WindowCenter.Instance.CheckOpen<DialogueDuidanceWin>() && IsOpenMain
|
| | | && !treasureStageUpShow && !WindowCenter.Instance.ExitAnyFullScreenOrMaskWin())
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<DialogueDuidanceWin>();
|
| | | }
|
| | | return;
|
| | | }
|
| | | }
|
| | | if (!WindowCenter.Instance.CheckOpen<TaskBoxBGMWin>() && IsOpenMain && !treasureStageUpShow)
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<TaskBoxBGMWin>();
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (BountyDic.ContainsKey(_TaskNow) || FairyAuDic.ContainsKey(_TaskNow))
|
| | | {
|
| | | RequestGetTaskAward("OK");
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!WindowCenter.Instance.CheckOpen<TaskBoxBGMWin>() && IsOpenMain && !treasureStageUpShow)
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<TaskBoxBGMWin>();
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (BountyDic.ContainsKey(_TaskNow) || FairyAuDic.ContainsKey(_TaskNow))
|
| | | {
|
| | | RequestGetTaskAward("OK");
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | private void BountySelfMotion()
|
| | | {
|
| | | int blank = playerPack.GetReaminGridCount(PackType.rptItem);
|
| | | if (blank < 1)//"请先清理背包再领取奖励
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | void AddMission(int MissionID, int MissionState, int DiscriptionIndex)//添加任务
|
| | | {
|
| | | var config = ConfigManager.Instance.GetTemplate<PyTaskConfig>(MissionID);
|
| | | if (config == null)
|
| | | {
|
| | | DebugEx.LogError(MissionID + "表格中不存在此任务ID");
|
| | | return;
|
| | | }
|
| | |
|
| | | if (allMissionDict == null)
|
| | | allMissionDict = new Dictionary<int, MissionDetailDates>();
|
| | | MissionDetailDates vDetailData = new MissionDetailDates();
|
| | | vDetailData.Time = DateTime.Now;
|
| | | vDetailData.ID = int.Parse(config.id);
|
| | | vDetailData.Name = config.name;
|
| | | vDetailData.Type = config.type;
|
| | | vDetailData.NPC_ID = config.npcId;
|
| | | vDetailData.LV = config.lv;
|
| | | vDetailData.ColorLV = config.colorLV;
|
| | |
|
| | | vDetailData.RewardList = RewardInformation(config.rewardList, DiscriptionIndex);//奖励信息
|
| | | if (ReplaceDic.ContainsKey(MissionID))
|
| | | {
|
| | | Dictionary<string, int> _dic = ReplaceDic[MissionID];
|
| | | if (_dic.ContainsKey("visit_npc_id") || _dic.ContainsKey("kill_npc_id"))
|
| | | {
|
| | | vDetailData.LightList = CharactersReplace(config.lightList, DiscriptionIndex, int.Parse(config.id));
|
| | | }
|
| | | else
|
| | | {
|
| | | vDetailData.LightList = StrSegmentation(config.lightList, DiscriptionIndex);//任务信息灯
|
| | | }
|
| | | if (MissionState == 3)
|
| | | {
|
| | | for (int i = 0; i < vDetailData.LightList.Count; i++)
|
| | | {
|
| | | TsakLight TsakLight = new TsakLight();
|
| | | TsakLight.NpcId = vDetailData.LightList[i].NpcId;
|
| | | TsakLight.StateLight = -1;
|
| | | vDetailData.LightList[i] = TsakLight;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | vDetailData.LightList = StrSegmentation(config.lightList, DiscriptionIndex);//任务信息灯
|
| | | if (MissionState == 3)
|
| | | {
|
| | | for (int i = 0; i < vDetailData.LightList.Count; i++)
|
| | | {
|
| | | TsakLight TsakLight = new TsakLight();
|
| | | TsakLight.NpcId = vDetailData.LightList[i].NpcId;
|
| | | TsakLight.StateLight = -1;
|
| | | vDetailData.LightList[i] = TsakLight;
|
| | | }
|
| | | }
|
| | | }
|
| | | vDetailData.Desclist = TaskDetails(config.descList, DiscriptionIndex);//任务详情
|
| | | vDetailData.InforList = StrInforList(config.infoList, DiscriptionIndex);//任务完成条件
|
| | |
|
| | |
|
| | | vDetailData.MissionState = MissionState;
|
| | | vDetailData.descIndex = DiscriptionIndex;
|
| | |
|
| | | GetNowTaskID = MissionID;
|
| | | allMissionDict.Add(MissionID, vDetailData);//添加任务
|
| | | }
|
| | |
|
| | | public enum TaskTypenum//任务类型分类
|
| | | {
|
| | | MainlineTaskType = 0,//主线
|
| | | MainlineTaskTyp2 = 1,
|
| | | SideQuestsType2 = 2,//支线
|
| | | SideQuestsType3 = 3,//支线任务(本源法宝支线)
|
| | | SideQuestsType4 = 4,
|
| | | SideQuestsType5 = 5,
|
| | | BountyMissionsType6 = 6,//赏金任务
|
| | | BountyMissionsType7 = 7,
|
| | | BountyMissionsType8 = 8,
|
| | | FairyAuMissionType11 = 11,//仙盟任务
|
| | | FairyAuMissionType12 = 12,
|
| | | SpecialTaskType13 = 13,//特殊任务类型(用于赏金)
|
| | | SpecialTaskType14 = 14,//特殊任务类型(用于仙盟)
|
| | | AchievementTask = 15,//成就任务(暂未开出专属字典)
|
| | | SpecialTaskType16 = 16,//特殊任务类型(用于法宝)
|
| | | SideQuestsType17 = 17,//支线17-21新增
|
| | | SideQuestsType18 = 18,
|
| | | SideQuestsType19 = 19,
|
| | | SideQuestsType20 = 20,
|
| | | SideQuestsType21 = 21,
|
| | | }
|
| | |
|
| | | void TaskClassification(int _taskID, int MissionState)//任务分类(主线任务,支线任务)
|
| | | {
|
| | | if (!allMissionDict.ContainsKey(_taskID))
|
| | | {
|
| | | return;
|
| | | }
|
| | | TaskTypenum type = (TaskTypenum)allMissionDict[_taskID].Type;
|
| | | switch (type)
|
| | | {
|
| | | case TaskTypenum.MainlineTaskType:
|
| | | case TaskTypenum.MainlineTaskTyp2:
|
| | | {
|
| | | if (_taskID != 1)//主线任务(添加与更新)
|
| | | {
|
| | | if (MainTaskDic.ContainsKey(_taskID))
|
| | | {
|
| | | MainTaskDic[_taskID] = allMissionDict[_taskID];
|
| | | }
|
| | | else
|
| | | {
|
| | | MainTaskDic.Add(_taskID, allMissionDict[_taskID]);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | break;
|
| | | case TaskTypenum.SideQuestsType2:
|
| | | case TaskTypenum.SideQuestsType3:
|
| | | case TaskTypenum.SideQuestsType4:
|
| | | case TaskTypenum.SideQuestsType5:
|
| | | case TaskTypenum.SideQuestsType17:
|
| | | case TaskTypenum.SideQuestsType18:
|
| | | case TaskTypenum.SideQuestsType19:
|
| | | case TaskTypenum.SideQuestsType20:
|
| | | case TaskTypenum.SideQuestsType21:
|
| | | {
|
| | | if (SideQuestsDic.ContainsKey(_taskID))
|
| | | {
|
| | | SideQuestsDic[_taskID] = allMissionDict[_taskID];
|
| | | }
|
| | | else
|
| | | {
|
| | | SideQuestsDic.Add(_taskID, allMissionDict[_taskID]);
|
| | | }
|
| | | if (SideQuestChangeEvent != null)
|
| | | {
|
| | | SideQuestChangeEvent(_taskID);
|
| | | }
|
| | | }
|
| | | break;
|
| | | case TaskTypenum.BountyMissionsType6:
|
| | | case TaskTypenum.BountyMissionsType7:
|
| | | case TaskTypenum.BountyMissionsType8:
|
| | | {
|
| | |
|
| | | if (BountyDic.ContainsKey(_taskID))
|
| | | BountyDic[_taskID] = allMissionDict[_taskID];
|
| | | else
|
| | | BountyDic.Add(_taskID, allMissionDict[_taskID]);
|
| | | if (Event_nBounty != null)
|
| | | Event_nBounty();
|
| | | }
|
| | |
|
| | | break;
|
| | | case TaskTypenum.FairyAuMissionType11:
|
| | | case TaskTypenum.FairyAuMissionType12:
|
| | | {
|
| | | if (FairyAuDic.ContainsKey(_taskID))
|
| | | FairyAuDic[_taskID] = allMissionDict[_taskID];
|
| | | else
|
| | | FairyAuDic.Add(_taskID, allMissionDict[_taskID]);
|
| | | if (Event_FairyAuTask != null && MissionState != 3)
|
| | | Event_FairyAuTask();
|
| | | }
|
| | | break;
|
| | | case TaskTypenum.SpecialTaskType13:
|
| | | case TaskTypenum.SpecialTaskType14:
|
| | | case TaskTypenum.SpecialTaskType16:
|
| | |
|
| | | {
|
| | | if (SpecialTask.ContainsKey(_taskID))
|
| | | SpecialTask[_taskID] = allMissionDict[_taskID];
|
| | | else
|
| | | SpecialTask.Add(_taskID, allMissionDict[_taskID]);
|
| | | }
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | void TaskTypeDeletion(int _taskID)//任务类型的删除
|
| | | {
|
| | |
|
| | | if (MainTaskDic.ContainsKey(_taskID))//主线
|
| | | {
|
| | | MainTaskDic.Remove(_taskID);
|
| | | }
|
| | | else if (SideQuestsDic.ContainsKey(_taskID))//支线
|
| | | {
|
| | | SideQuestsDic.Remove(_taskID);
|
| | | }
|
| | | else if (BountyDic.ContainsKey(_taskID))//赏金
|
| | | {
|
| | | BountyDic.Remove(_taskID);
|
| | | if (Event_nBounty != null)
|
| | | Event_nBounty();
|
| | |
|
| | | }
|
| | | else if (SpecialTask.ContainsKey(_taskID))//特殊任务
|
| | | {
|
| | | SpecialTask.Remove(_taskID);
|
| | | }
|
| | | else if (FairyAuDic.ContainsKey(_taskID))
|
| | | {
|
| | | FairyAuDic.Remove(_taskID);
|
| | | if (Event_FairyAuTask != null)
|
| | | Event_FairyAuTask();
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | string TaskDetails(string _string, int _index)////Json解析
|
| | | {
|
| | | JsonData _Json = JsonMapper.ToObject(_string);
|
| | | if (_Json.Count == 1)
|
| | | {
|
| | | string _TaskDetails = _Json["0"].ToString().Replace("\"", "");
|
| | | return _TaskDetails;
|
| | | }
|
| | | else
|
| | | {
|
| | | string _TaskDetails = _Json[_index.ToString()].ToString().Replace("\"", "");
|
| | | return _TaskDetails;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | List<TsakLight> CharactersReplace(string _string, int _index, int Id)
|
| | | {
|
| | |
|
| | | JsonData _Json = JsonMapper.ToObject(_string);
|
| | | List<TsakLight> TsakLightList = new List<TsakLight>();
|
| | | TsakLightList.Clear();
|
| | | TsakLight taskLight = new TsakLight();
|
| | | foreach (var key in _Json.Keys)
|
| | | {
|
| | | if (int.Parse(key) == _index)
|
| | | {
|
| | | JsonData _Json1 = _Json[key];
|
| | | if (_Json1.Count != 0)
|
| | | {
|
| | | foreach (var _key in _Json1.Keys)
|
| | | {
|
| | | string Str = _key.ToString();
|
| | | Match match = Regex.Match(Str, pattern);
|
| | | if (ReplaceDic.ContainsKey(Id))
|
| | | {
|
| | | Dictionary<string, int> _dic = ReplaceDic[Id];
|
| | | if (_dic.ContainsKey(match.Groups[1].Value))
|
| | | {
|
| | | taskLight.NpcId = _dic[match.Groups[1].Value];
|
| | | taskLight.StateLight = int.Parse(_Json1[_key].ToString());
|
| | | TsakLightList.Add(taskLight);
|
| | | return TsakLightList;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | return TsakLightList;
|
| | | }
|
| | |
|
| | | string StrInforList(string _string, int _index)
|
| | | {
|
| | | JsonData _Json = JsonMapper.ToObject(_string);
|
| | | foreach (var key in _Json.Keys)
|
| | | {
|
| | | if (int.Parse(key) == _index)
|
| | | {
|
| | | JsonData _Json1 = _Json[key];
|
| | | if (_Json1.Count != 0)
|
| | | {
|
| | | foreach (var _key in _Json1.Keys)
|
| | | {
|
| | | return _Json1[_key].ToString();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return string.Empty;
|
| | | }
|
| | |
|
| | | List<TsakLight> StrSegmentation(string _string, int _index)
|
| | | {
|
| | | int val;
|
| | | JsonData _Json = JsonMapper.ToObject(_string);
|
| | | List<TsakLight> TsakLightList = new List<TsakLight>();
|
| | | TsakLightList.Clear();
|
| | |
|
| | | foreach (var key in _Json.Keys)
|
| | | {
|
| | | if (int.Parse(key) == _index)
|
| | | {
|
| | | JsonData _Json1 = _Json[key];
|
| | | if (_Json1.Count != 0)
|
| | | {
|
| | | foreach (var _key in _Json1.Keys)
|
| | | {
|
| | | if (int.TryParse(_key, out val))
|
| | | {
|
| | | TsakLight taskLight = new TsakLight();
|
| | | taskLight.NpcId = int.Parse(_key);
|
| | | taskLight.StateLight = int.Parse(_Json1[_key].ToString());
|
| | | TsakLightList.Add(taskLight);
|
| | | }
|
| | | return TsakLightList;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | return TsakLightList;
|
| | | }
|
| | |
|
| | | string RewardInformation(string _string, int _index)//奖励信息
|
| | | {
|
| | |
|
| | | string _occupation = ("J" + PlayerDatas.Instance.baseData.Job).ToString();
|
| | | JsonData _Json = JsonMapper.ToObject(_string);
|
| | | foreach (var key in _Json.Keys)
|
| | | {
|
| | | if (int.Parse(key) == _index)
|
| | | {
|
| | | JsonData _Json1 = _Json[key];
|
| | | if (_Json1.Count != 0)
|
| | | {
|
| | | foreach (var _key in _Json1.Keys)
|
| | | {
|
| | | if (_key == _occupation)
|
| | | return _Json1[_key].ToString();
|
| | | else if (_key == "-")
|
| | | return _Json1[_key].ToString();
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | return null;
|
| | | }
|
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | |
|
| | | void TaskChanges(int MissionID, int MissionState, int DiscriptionIndex)//存在的任务的修改
|
| | | {
|
| | | var pytaskM = ConfigManager.Instance.GetTemplate<PyTaskConfig>(MissionID);
|
| | | if (pytaskM == null)
|
| | | return;
|
| | | allMissionDict[MissionID].Time = DateTime.Now;
|
| | | allMissionDict[MissionID].MissionState = MissionState;
|
| | | allMissionDict[MissionID].descIndex = DiscriptionIndex;
|
| | | allMissionDict[MissionID].RewardList = RewardInformation(pytaskM.rewardList, DiscriptionIndex);//奖励信息
|
| | | allMissionDict[MissionID].Desclist = TaskDetails(pytaskM.descList, DiscriptionIndex);//任务详情
|
| | | allMissionDict[MissionID].InforList = StrInforList(pytaskM.infoList, DiscriptionIndex);//任务完成条件
|
| | |
|
| | |
|
| | | if (MissionState == 3)
|
| | | {
|
| | | if (allMissionDict[MissionID].LightList.Equals(default(TsakLight)))
|
| | | {
|
| | | return;
|
| | | }
|
| | | for (int i = 0; i < allMissionDict[MissionID].LightList.Count; i++)
|
| | | {
|
| | | TsakLight TsakLight = new TsakLight();
|
| | | TsakLight.NpcId = allMissionDict[MissionID].LightList[i].NpcId;
|
| | | TsakLight.StateLight = -1;
|
| | | allMissionDict[MissionID].LightList[i] = TsakLight;
|
| | | }
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (ReplaceDic.ContainsKey(MissionID))
|
| | | {
|
| | | Dictionary<string, int> _dic = ReplaceDic[MissionID];
|
| | | if (_dic.ContainsKey("visit_npc_id") || _dic.ContainsKey("kill_npc_id"))
|
| | | {
|
| | | allMissionDict[MissionID].LightList = CharactersReplace(pytaskM.lightList, DiscriptionIndex, allMissionDict[MissionID].ID);
|
| | | }
|
| | | else
|
| | | {
|
| | | allMissionDict[MissionID].LightList = StrSegmentation(pytaskM.lightList, DiscriptionIndex);//任务信息灯
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | allMissionDict[MissionID].LightList = StrSegmentation(pytaskM.lightList, DiscriptionIndex);//任务信息灯
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void Task0820(H0820_tagMissionDict info)//0820信息字典
|
| | | {
|
| | | Dictionary<string, int> dic = null;
|
| | | ReplaceDic.TryGetValue((int)info.MissionID, out dic);
|
| | | if (dic == null)
|
| | | {
|
| | | dic = new Dictionary<string, int>();
|
| | | StorageNPCDic(info.DictKey, (int)info.DictValue);
|
| | | dic.Add(info.DictKey, (int)info.DictValue);
|
| | | ReplaceDic.Add((int)info.MissionID, dic);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (dic.ContainsKey(info.DictKey))
|
| | | {
|
| | | StorageNPCDic(info.DictKey, (int)info.DictValue);
|
| | | dic[info.DictKey] = (int)info.DictValue;
|
| | | if (info.DictKey == "around_allcount")
|
| | | {
|
| | | if (TaskCoinTaskEvent != null)
|
| | | {
|
| | | TaskCoinTaskEvent();
|
| | | }
|
| | | }
|
| | | if (info.DictKey == "around_count_family")
|
| | | {
|
| | | if (FairyTaskEvent != null)
|
| | | {
|
| | | FairyTaskEvent();
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | StorageNPCDic(info.DictKey, (int)info.DictValue);
|
| | | dic.Add(info.DictKey, (int)info.DictValue);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public void RequestGetTaskAward(string _answer)
|
| | | {
|
| | | var sendInfo = new C0802_tagCNPCAnswer();
|
| | | sendInfo.Answer = _answer;
|
| | | sendInfo.AnswerLen = (byte)_answer.Length;
|
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|
| | |
|
| | | if (tryGetTaskAwardEvent != null)
|
| | | {
|
| | | tryGetTaskAwardEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | public void TaskRefreshes(int _MissionId, int _DictKeyLen, string _DictKey, int _DictValue)//任务数据的刷新(任务字典信息)
|
| | | {
|
| | |
|
| | | if (!_DicTaskInformation.ContainsKey(_MissionId))
|
| | | {
|
| | | Dictionary<string, string> _dic = new Dictionary<string, string>();
|
| | | if (_dic.ContainsKey(_DictKey))
|
| | | {
|
| | | _dic[_DictKey] = _DictValue.ToString();
|
| | | }
|
| | | else
|
| | | {
|
| | | _dic.Add(_DictKey, _DictValue.ToString());
|
| | | }
|
| | | _DicTaskInformation.Add(_MissionId, _dic);
|
| | | string kaji = "kaji";
|
| | | if (_DicTaskInformation.ContainsKey(_MissionId) && _DicTaskInformation[_MissionId].ContainsKey(kaji))
|
| | | {
|
| | | if (MainTaskDic.ContainsKey(_MissionId) && MainCardLevelChange != null && _DictValue == 0)
|
| | | {
|
| | | MainCardLevelChange(_MissionId);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_DicTaskInformation[_MissionId].ContainsKey(_DictKey))
|
| | | {
|
| | | _DicTaskInformation[_MissionId][_DictKey] = _DictValue.ToString();
|
| | | if (_DictKey == "kaji" && _DictValue == 0)
|
| | | {
|
| | | if (CardLevelChange != null)
|
| | | {
|
| | | CardLevelChange(_MissionId);
|
| | | }
|
| | | if (MainTaskDic.ContainsKey(_MissionId) && MainCardLevelChange != null)
|
| | | {
|
| | | MainCardLevelChange(_MissionId);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | _DicTaskInformation[_MissionId].Add(_DictKey, _DictValue.ToString());
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | if (Event_TaskInformation != null)
|
| | | Event_TaskInformation(_MissionId, _DicTaskInformation);
|
| | | }
|
| | | public void DelMission(int _taskID)//真实任务删除
|
| | | {
|
| | | if (allMissionDict.ContainsKey(_taskID))
|
| | | {
|
| | | allMissionDict.Remove(_taskID);
|
| | | if (_DicTaskInformation.ContainsKey(_taskID))
|
| | | {
|
| | | _DicTaskInformation.Remove(_taskID);
|
| | | }
|
| | | }
|
| | | TaskTypeDeletion(_taskID);
|
| | | if (Event_TaskToDelete != null)
|
| | | {
|
| | | Event_TaskToDelete(_taskID);
|
| | | }
|
| | | }
|
| | | bool _bool = false;
|
| | | string _conversationA = null;
|
| | | public void EventTalk(H0801_tagEventTalk info)//访问任务是否可提交
|
| | | {
|
| | | NPCid = (int)info.NPCID;
|
| | | if (info.Msg == null || info.Msg[0].MsgLen == 0)
|
| | | {
|
| | | _conversation = _conversationA;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_conversationA != info.Msg[0].Msg)
|
| | | {
|
| | | _conversation = info.Msg[0].Msg;
|
| | | _conversationA = _conversation;
|
| | | }
|
| | | }
|
| | |
|
| | | if (_bool)
|
| | | {
|
| | | if ((int)info.MissionID != 0)
|
| | | {
|
| | | _TaskNow = (int)info.MissionID;
|
| | | OnEventTalkEvent((int)info.MissionID);
|
| | | _bool = false;
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | for (int i = 0; i < info.Answer.Length; i++)
|
| | | {
|
| | | string[] str = info.Answer[i].Msg.Split('_');
|
| | | int var;
|
| | | if (str.Length > 1)
|
| | | {
|
| | | for (int j = 0; j < info.Answer.Length; j++)
|
| | | {
|
| | | string[] stX = info.Answer[j].Msg.Split('_');
|
| | | if (stX.Length > 1)
|
| | | {
|
| | | string strXX = stX[stX.Length - 1];
|
| | | if (int.TryParse(strXX, out var))
|
| | | {
|
| | | if (int.Parse(strXX) == GetNowTaskID)
|
| | | {
|
| | | RequestGetTaskAward(strXX);
|
| | | _bool = true;
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | string str1 = str[str.Length - 1];
|
| | | RequestGetTaskAward(str1);
|
| | | _bool = true;
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | _bool = false;
|
| | | if ((int)info.NPCID != 32504001)
|
| | | {
|
| | | DefaultDialogue();
|
| | | }
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public string pattern = @"\{(.+)\}";
|
| | |
|
| | | public int StatusLightQuery(int _NpcID)//状态灯查询
|
| | | {
|
| | | int Light = -1;
|
| | | foreach (int key in allMissionDict.Keys)
|
| | | {
|
| | | if (allMissionDict[key].LightList.Equals(default(TsakLight)))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | for (int i = 0; i < allMissionDict[key].LightList.Count; i++)
|
| | | {
|
| | | if (_NpcID == allMissionDict[key].LightList[i].NpcId)
|
| | | {
|
| | | if (allMissionDict[key].LightList[i].StateLight > Light)
|
| | | {
|
| | | Light = allMissionDict[key].LightList[i].StateLight;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | //if (_NpcID == allMissionDict[key].LightList.NpcId)
|
| | | //{
|
| | | // if (allMissionDict[key].LightList.StateLight > Light)
|
| | | // {
|
| | | // Light = allMissionDict[key].LightList.StateLight;
|
| | | // }
|
| | |
|
| | | //}
|
| | | }
|
| | |
|
| | | return Light;
|
| | | }
|
| | |
|
| | | public void DailyFairyTaskMove()//日常仙盟任务
|
| | | {
|
| | | if (SpecialTask.Count != 0)
|
| | | {
|
| | | foreach (int key in SpecialTask.Keys)
|
| | | {
|
| | | if (SpecialTask[key].Type == 14 && SpecialTask[key].MissionState != 3)//未接任务
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
|
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | if (FairyAuDic.Count != 0)
|
| | | {
|
| | | foreach (int key in FairyAuDic.Keys)
|
| | | {
|
| | | if (FairyAuDic[key].MissionState != 0 && FairyAuDic[key].MissionState != 3)
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
|
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key));
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | public void DailyBountyMove()//日常赏金任务
|
| | | {
|
| | | if (SpecialTask.Count != 0)
|
| | | {
|
| | | foreach (int key in SpecialTask.Keys)
|
| | | {
|
| | | if (SpecialTask[key].Type == 13 && SpecialTask[key].MissionState != 3)//未接任务
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
|
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | if (BountyDic.Count != 0)
|
| | | {
|
| | | foreach (int key in BountyDic.Keys)
|
| | | {
|
| | | if (BountyDic[key].MissionState != 0 && BountyDic[key].MissionState != 3)
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
|
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key));
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | private void AutotaskingPrecedence(bool automaticityBool, int missionID)//关于是否执行自动任务和自动任务的优先级
|
| | | {
|
| | | if (automaticityBool)
|
| | | {
|
| | | var inDungeon = IsDungeon();
|
| | |
|
| | | if (inDungeon)//判断是否再副本中对任务ID进行储存
|
| | | {
|
| | | retainTaskID = Autotasking(missionID);
|
| | | }
|
| | | else
|
| | | {
|
| | | retainTaskID = 0;
|
| | | if (Autotasking(missionID) != 0)
|
| | | {
|
| | | AutomaticTripToTask(Autotasking(missionID));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private int Autotasking(int taskID)
|
| | | {
|
| | | foreach (var value in MainTaskDic.Values)
|
| | | {
|
| | | if (value.MissionState != 0 && value.MissionState != 3)
|
| | | {
|
| | | if (allMissionDict.ContainsKey(taskID) && (allMissionDict[taskID].Time - value.Time).TotalSeconds <= 1)
|
| | | {
|
| | | if (ReplaceDic.ContainsKey(value.ID))
|
| | | {
|
| | | Dictionary<string, int> _dic = ReplaceDic[value.ID];
|
| | | if (_dic.ContainsKey("continue") && _dic["continue"] == 1)
|
| | | {
|
| | | return value.ID;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | if (ReplaceDic.ContainsKey(taskID))
|
| | | {
|
| | | Dictionary<string, int> _dic = ReplaceDic[taskID];
|
| | | if (_dic.ContainsKey("continue") && _dic["continue"] == 1)
|
| | | {
|
| | | return taskID;
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | |
|
| | | public void AutomaticTripToTask(int _taskID)//任务自动前往(任务添加)
|
| | | {
|
| | | try
|
| | | {
|
| | | if (MainTaskDic.ContainsKey(_taskID))//主线任务
|
| | | {
|
| | | if (MainTaskDic[_taskID].MissionState == 0 || MainTaskDic[_taskID].MissionState == 3)
|
| | | return;
|
| | | if (MainTaskDic.ContainsKey(_taskID))
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
|
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID));
|
| | | return;
|
| | | }
|
| | | }
|
| | | if (BountyDic.ContainsKey(_taskID))//赏金任务
|
| | | {
|
| | | if (BountyDic[_taskID].MissionState == 3 || BountyDic[_taskID].MissionState == 2 || BountyMotionBool)
|
| | | {
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | if (BountyDic.ContainsKey(_taskID))
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
|
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | else if (FairyAuDic.ContainsKey(_taskID))//仙盟任务
|
| | | {
|
| | | if (FairyAuDic[_taskID].MissionState == 3 || FairyAuDic[_taskID].MissionState == 2 || FairyAuBool)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (FairyAuDic.ContainsKey(_taskID))
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
|
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID));
|
| | | return;
|
| | | }
|
| | | }
|
| | | else if (SideQuestsDic.ContainsKey(_taskID))
|
| | | {
|
| | | if (SideQuestsDic[_taskID].MissionState == 0 || SideQuestsDic[_taskID].MissionState == 3)
|
| | | {
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
|
| | | SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID));
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | | }
|
| | |
|
| | | public void RunTaskAwarInfo(HA708_tagMCRunTaskAwardInfo info)//通知跑环奖励记录
|
| | | {
|
| | | for (int i = 0; i < info.Cnt; i++)
|
| | | {
|
| | | if (!AwardRecordDic.ContainsKey(info.InfoList[i].Type))
|
| | | {
|
| | | RunTaskAwardRecord _RunTaskAwardRecord = new RunTaskAwardRecord();
|
| | | _RunTaskAwardRecord.Num = (int)info.InfoList[i].Num;
|
| | | _RunTaskAwardRecord.AwardState = info.InfoList[i].AwardState;
|
| | | AwardRecordDic.Add(info.InfoList[i].Type, _RunTaskAwardRecord);
|
| | | }
|
| | | else
|
| | | {
|
| | | AwardRecordDic[info.InfoList[i].Type].Num = (int)info.InfoList[i].Num;
|
| | | AwardRecordDic[info.InfoList[i].Type].AwardState = info.InfoList[i].AwardState;
|
| | | }
|
| | | if (info.InfoList[i].Type == (int)TaskTypenum.BountyMissionsType7)
|
| | | {
|
| | | BountyRewardsNumber = (int)info.InfoList[i].Num;
|
| | | if (Event_BountyRewards != null)
|
| | | Event_BountyRewards((int)info.InfoList[i].Num, info.InfoList[i].AwardState);
|
| | | }
|
| | | else if (info.InfoList[i].Type == (int)TaskTypenum.FairyAuMissionType12)
|
| | | {
|
| | | OnFairyAuNumber = (int)info.InfoList[i].Num;
|
| | | if (Event_FairyAuReward != null)
|
| | | Event_FairyAuReward((int)info.InfoList[i].Num, info.InfoList[i].AwardState);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private PlayerPackModel m_PlayerBackModel;
|
| | | private PlayerPackModel PlayerBackModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_PlayerBackModel ?? (m_PlayerBackModel = ModelCenter.Instance.GetModel<PlayerPackModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | private IEnumerator WaitForSkillFinished(int _taskID)
|
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | |
|
| | | if (_hero == null)
|
| | | {
|
| | | yield break;
|
| | | }
|
| | | while (_hero.SkillMgr.CurCastSkill != null &&
|
| | | _hero.SkillMgr.CurCastSkill.SkillCompelete == false)
|
| | | {
|
| | | yield return null;
|
| | | }
|
| | |
|
| | | yield return WaitingForSecondConst.WaitMS500;
|
| | |
|
| | | var _singleModel = PlayerBackModel.GetSinglePackModel(PackType.rptEquip);
|
| | | // 如果有守护, 则不拾取
|
| | | var _itemModel = _singleModel.GetItemModelByIndex((int)RoleEquipType.retSpiritAnimal);
|
| | | if (_itemModel == null || !GeneralConfig.Instance.GuardianPickUpID.Contains(_itemModel.itemId))
|
| | | {
|
| | | float _chkDistanceSqrt;
|
| | | DropItemManager.DropObject _obj = null;
|
| | | while (DropItemManager.HandupTryGetHeroItem(out _obj))
|
| | | {
|
| | | if (DropItemManager.StopMissionPickup)
|
| | | {
|
| | | break;
|
| | | }
|
| | |
|
| | | if (MapTransferUtility.Instance.MapTransferDoType != MapTransferUtility.E_MapTransferDoType.None)
|
| | | {
|
| | | break;
|
| | | }
|
| | | Vector3 _targetPosition = _obj.dropItem.transform.position;
|
| | | _chkDistanceSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _targetPosition);
|
| | | if (_chkDistanceSqrt > 0.5f)
|
| | | {
|
| | | if (_hero.State != E_ActorState.AutoRun)
|
| | | {
|
| | | _hero.MoveToPosition(_targetPosition);
|
| | | }
|
| | | }
|
| | |
|
| | | yield return null;
|
| | | }
|
| | | }
|
| | |
|
| | | if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing)
|
| | | {
|
| | | yield break;
|
| | | }
|
| | |
|
| | | if (WindowCenter.Instance.CheckOpen<TreasureLevelUpWin>())
|
| | | {
|
| | | yield break;
|
| | | }
|
| | |
|
| | | if (WindowCenter.Instance.CheckOpen<MysteriousMissionWin>())
|
| | | {
|
| | | yield break;
|
| | | }
|
| | | if (BountyDic.ContainsKey(_taskID) || FairyAuDic.ContainsKey(_taskID))
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS800;//缓冲一秒再进行
|
| | | }
|
| | |
|
| | | if (GA_Hero.s_MapSwitching)
|
| | | {
|
| | | yield break;
|
| | | }
|
| | |
|
| | | try
|
| | | {
|
| | | if (allMissionDict.ContainsKey(_taskID) && !NewBieCenter.Instance.inGuiding)
|
| | | {
|
| | | // GetNowTaskID = _taskID;
|
| | | string _strTest = allMissionDict[_taskID].InforList;
|
| | | string strTask = TaskAllocation.Instance.GetTaskInfo(ConfigManager.Instance.GetTemplate<TASKINFOConfig>(_strTest).show_writing, _taskID);
|
| | | HrefAnalysis.Inst.ExcuteHrefEvent(strTask);
|
| | | DropItemManager.StopMissionPickup = false;
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private int GetNPCID(Dictionary<string, int> _Dic)
|
| | | {
|
| | | foreach (string key in _Dic.Keys)
|
| | | {
|
| | | string[] str = key.Split('_');
|
| | | if (str[0] == "Show")
|
| | | {
|
| | | return int.Parse(str[1]);
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private void StorageNPCDic(string key, int Value)//关于NPC的显隐
|
| | | {
|
| | | string[] str = key.Split('_');
|
| | | if (str[0] == "Show")
|
| | | {
|
| | | int NPCid = int.Parse(str[1]);
|
| | | if (NPCShowDic.ContainsKey(NPCid))
|
| | | {
|
| | | NPCShowDic[NPCid] = Value;
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | NPCShowDic.Add(NPCid, Value);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | private void IsShowNpC(int _taskID)//关于NPC的显隐
|
| | | {
|
| | | if (ReplaceDic.ContainsKey(_taskID))
|
| | | {
|
| | | Dictionary<string, int> showNpcDic = ReplaceDic[_taskID];
|
| | | int Npcid = GetNPCID(showNpcDic);
|
| | | if (Npcid != 0 && NPCShowDic.ContainsKey(Npcid))
|
| | | {
|
| | | if (NPCShowDic[Npcid] == 0)
|
| | | {
|
| | | if (FaBaoNPCIdList.Contains(Npcid))
|
| | | {
|
| | | GA_NpcFunc.SetNpcFuncVisible(Npcid, false, 0.5f, (Vector3 _pos) =>
|
| | | {
|
| | | WindowCenter.Instance.Open<EffectToFaBaoWin>();
|
| | | UIeffectFabaoVec = _pos;
|
| | | }, 0.3f);
|
| | | }
|
| | | else
|
| | | {
|
| | | GA_NpcFunc.SetNpcFuncVisible(Npcid, false);
|
| | | }
|
| | |
|
| | | }
|
| | | else if (NPCShowDic[Npcid] == 1)
|
| | | {
|
| | | GA_NpcFunc.SetNpcFuncVisible(Npcid, true);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | public enum TaskStatus//任务状态
|
| | | {
|
| | | None = -5,//没有
|
| | | Normal = 0,//正常任务(绿)
|
| | | TreasureCardLevel = 1,//法宝卡级(红)
|
| | | CardLevel = 2,//等级卡级(红)
|
| | | Completed = 3,//立即完成任务
|
| | | }
|
| | | public TaskStatus GetTaskStatus(int taskID)
|
| | | {
|
| | | if (_DicTaskInformation.ContainsKey(taskID) && _DicTaskInformation[taskID].ContainsKey("kaji"))
|
| | | {
|
| | | var kaji = _DicTaskInformation[taskID]["kaji"];
|
| | |
|
| | | switch (int.Parse(kaji))
|
| | | {
|
| | | case 0:
|
| | | return TaskStatus.Normal;
|
| | | case 1:
|
| | | return TaskStatus.TreasureCardLevel;
|
| | | case 2:
|
| | | return TaskStatus.CardLevel;
|
| | | case 3:
|
| | | return TaskStatus.Completed;
|
| | | default:
|
| | | return TaskStatus.None;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | return TaskStatus.None;
|
| | | }
|
| | |
|
| | | }
|
| | | private bool IsDungeon()//判断是否在副本中
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var mapConfig = ConfigManager.Instance.GetTemplate<MapConfig>(mapId);
|
| | | return mapConfig != null && mapConfig.MapFBType != 0;
|
| | | }
|
| | | public bool IsGather(int npdId)//是否能采集NPC
|
| | | {
|
| | | var taskListConfig = ConfigManager.Instance.GetTemplate<TaskListConfig>(currentMission);
|
| | | if (taskListConfig != null)
|
| | | {
|
| | | int[] collectNPCList = taskListConfig.CollectNPC;
|
| | | if ((collectNPCList.Length == 1 && collectNPCList[0] == 0) || GetTaskStatus(currentMission) != 0)
|
| | | {
|
| | | return false;
|
| | |
|
| | | }
|
| | | for (int i = 0; i < collectNPCList.Length; i++)
|
| | | {
|
| | | if (collectNPCList[i] == npdId)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public static bool IsOPenAutoResolve()//任务面板不开启自动挂机状态
|
| | | {
|
| | | WindowCenter.Instance.CheckOpen<DefaultDialogueBoxWin>();
|
| | | WindowCenter.Instance.CheckOpen<DialogueDuidanceWin>();
|
| | | bool _bool = true;
|
| | | if (WindowCenter.Instance.CheckOpen<TaskBoxBGMWin>())
|
| | | {
|
| | | _bool = false;
|
| | | }
|
| | | else if (WindowCenter.Instance.CheckOpen<DefaultDialogueBoxWin>())
|
| | | {
|
| | | _bool = false;
|
| | | }
|
| | | else if (WindowCenter.Instance.CheckOpen<DialogueDuidanceWin>())
|
| | | {
|
| | | _bool = false;
|
| | | }
|
| | | return _bool;
|
| | | }
|
| | |
|
| | | private int BOUNTYTASK = 2009;//赏金任务
|
| | | private int FAIRYAUTASK = 3009;//仙盟任务
|
| | | private void TaskTerminationToHangUp(int taskID, int MissionState)//(完成任务后前往挂机地点)任务ID,任务状态
|
| | | {
|
| | | if (!AutomaticityBool)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if ((taskID == BOUNTYTASK && MissionState == 1 && !BountyMotionBool && TaskAllocation.Instance.ForRingAllNumber() != 10)
|
| | | || (taskID == FAIRYAUTASK && MissionState == 1 && !FairyAuBool && TaskAllocation.Instance.FairyAuAllNumber() == 70))
|
| | | {
|
| | | var mapModel = ModelCenter.Instance.GetModel<MapModel>();
|
| | | var point = mapModel.GetRecommendHangPoint();
|
| | | var config = ConfigManager.Instance.GetTemplate<MapEventPointConfig>(point);
|
| | | MapTransferUtility.Instance.MoveToNPC(config.NPCID);
|
| | |
|
| | | }
|
| | | }
|
| | | public void CompletionOfTask(int TaskID)//任务完成
|
| | | {
|
| | | CA206_tagCMQuickFinishMission _CA206 = new CA206_tagCMQuickFinishMission();
|
| | | _CA206.MissionID = (uint)TaskID;
|
| | | _CA206.DoType = 0;
|
| | | GameNetSystem.Instance.SendInfo(_CA206);
|
| | | }
|
| | |
|
| | | public int SideQuestState(int TaskID)//关于查询任务的状态(-1没有此任务,0未接,1正在进行中,2可提交)
|
| | | {
|
| | | if (allMissionDict.ContainsKey(TaskID))
|
| | | {
|
| | | return allMissionDict[TaskID].MissionState;
|
| | | }
|
| | | else
|
| | | {
|
| | | return -1;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public int GetQuestState(int _taskId)
|
| | | {
|
| | | if (allMissionDict.ContainsKey(_taskId))
|
| | | {
|
| | | return allMissionDict[_taskId].MissionState;
|
| | | }
|
| | | else
|
| | | {
|
| | | return -1;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|