private void OnSkillPlayOver(ref Client.stSkillStateEnter sse, int nEventId) { if (!Client.ClientGlobal.Instance().IsMainPlayer(sse.uid)) { return; } m_bAddSkillNoneListener = false; Engine.Utility.EventEngine.Instance().RemoveEventListener(nEventId, OnEvent); QuestTraceInfo questInfo = QuestTranceManager.Instance.GetQuestTraceInfo(m_nDoingTaskID); if (questInfo == null) { return; } Engine.Utility.Log.Info("{0}技能播放完毕 执行任务{1} {2}", TAG, m_nDoingTaskID, Client.ClientGlobal.Instance().MainPlayer.GetCurState()); Client.IControllerSystem cs = Client.ClientGlobal.Instance().GetControllerSystem(); if (cs == null) { return; } m_nDoingTaskID = 0; ProcessTask(questInfo); }
void OnEvent(int nEventId, object param) { Client.GameEventID eid = (Client.GameEventID)nEventId; if (eid == Client.GameEventID.TASK_ACCEPT) { uint nTaskID = (uint)param; OnTaskAccept(nTaskID); return; } else if (eid == Client.GameEventID.TASK_CANSUBMIT) { Client.stTaskCanSubmit cs = (Client.stTaskCanSubmit)param; OnTaskCanCommit(cs.taskid); } else if (eid == Client.GameEventID.TASK_DONE) { Client.stTaskDone td = (Client.stTaskDone)param; OnTaskDone(td.taskid); } else if (eid == Client.GameEventID.TASK_DONING) { Client.stDoingTask dt = (Client.stDoingTask)param; DataManager.Manager <TaskDataManager>().DoingTaskID = dt.taskid; OnExecuteTask(dt.taskid); } else if (eid == Client.GameEventID.ENTITYSYSTEM_ENTITYSTOPMOVE) { Client.stEntityStopMove stopEntity = (Client.stEntityStopMove)param; OnPlayerStopMove(ref stopEntity, nEventId); return; } else if (eid == Client.GameEventID.SKILLNONESTATE_ENTER) { Client.stSkillStateEnter sse = (Client.stSkillStateEnter)param; OnSkillPlayOver(ref sse, nEventId); return; } else if (eid == Client.GameEventID.ENTITYSYSTEM_CHANGE) { Client.stPlayerChange pc = (Client.stPlayerChange)param; if (!Client.ClientGlobal.Instance().IsMainPlayer(pc.uid)) { return; } Engine.Utility.EventEngine.Instance().RemoveEventListener(nEventId, OnEvent); QuestTraceInfo questInfo = QuestTranceManager.Instance.GetQuestTraceInfo(m_nDoingTaskID); if (questInfo == null) { return; } m_bAddChangeListener = false; Engine.Utility.Log.Info("{0} 变身完毕 执行任务{1}", TAG, m_nDoingTaskID); ProcessTask(questInfo); m_nDoingTaskID = 0; } else if (eid == Client.GameEventID.ENTITYSYSTEM_RESTORE) { Client.stPlayerChange pc = (Client.stPlayerChange)param; if (!Client.ClientGlobal.Instance().IsMainPlayer(pc.uid)) { return; } Engine.Utility.EventEngine.Instance().RemoveEventListener(nEventId, OnEvent); Engine.Utility.Log.Info("{0}变身回来 执行任务{1}", TAG, m_nDoingTaskID); OnTaskDone(m_nDoingTaskID); m_nDoingTaskID = 0; m_bAddRestoreListener = false; } }