public void AddSkillCD(uint skillid, int cd) { if (m_dictskill == null) { Client.IPlayer player = Client.ClientGlobal.Instance().MainPlayer; Client.ISkillPart m_skillPart = player.GetPart(Client.EntityPart.Skill) as Client.ISkillPart; m_dictskill = m_skillPart.GetCurSkills(); } table.SkillDatabase skillTable = null; if (m_dictskill.ContainsKey(skillid)) { skillTable = m_dictskill[skillid]; } if (skillTable == null) { skillTable = GameTableManager.Instance.GetTableItem <table.SkillDatabase>(skillid); } if (skillTable != null) { if (!m_dictSkillCD.ContainsKey(skillid)) { m_dictSkillCD.Add(skillid, new SkillCDInfo()); cdkeys.Add(skillid); } if (cd == -1) { m_dictSkillCD[skillid].totalTime = skillTable.dwIntervalTime; } else { m_dictSkillCD[skillid].totalTime = cd; } m_dictSkillCD[skillid].skillid = (int)skillid; m_dictSkillCD[skillid].currTime = m_dictSkillCD[skillid].totalTime; } else { table.RideSkillDes rideskill = GameTableManager.Instance.GetTableItem <table.RideSkillDes>(skillid); if (rideskill == null) { return; } if (!m_dictSkillCD.ContainsKey(skillid)) { m_dictSkillCD.Add(skillid, new SkillCDInfo()); cdkeys.Add(skillid); } m_dictSkillCD[skillid].totalTime = rideskill.skillCD; m_dictSkillCD[skillid].skillid = (int)skillid; m_dictSkillCD[skillid].currTime = rideskill.skillCD; } }
//public void AddSkillCD(uint skillid) //{ // if (m_dictskill == null) // { // Client.IPlayer player = Client.ClientGlobal.Instance().MainPlayer; // Client.ISkillPart m_skillPart = player.GetPart(Client.EntityPart.Skill) as Client.ISkillPart; // m_dictskill = m_skillPart.GetCurSkills(); // } // table.SkillDatabase skillTable = null; // if (m_dictskill.ContainsKey(skillid)) // { // skillTable = m_dictskill[skillid]; // } // if (skillTable == null) // { // skillTable = GameTableManager.Instance.GetTableItem<table.SkillDatabase>(skillid); // } // if (skillTable != null) // { // if (!m_dictSkillCD.ContainsKey(skillid)) // { // m_dictSkillCD.Add(skillid, new SkillCDInfo()); // cdkeys.Add(skillid); // } // m_dictSkillCD[skillid].totalTime = skillTable.dwIntervalTime; // m_dictSkillCD[skillid].skillid = (int)skillid; // m_dictSkillCD[skillid].currTime = skillTable.dwIntervalTime; // } // else // { // table.RideSkillDes rideskill = GameTableManager.Instance.GetTableItem<table.RideSkillDes>(skillid); // if (rideskill == null) // { // return; // } // if (!m_dictSkillCD.ContainsKey(skillid)) // { // m_dictSkillCD.Add(skillid, new SkillCDInfo()); // cdkeys.Add(skillid); // } // m_dictSkillCD[skillid].totalTime = rideskill.skillCD; // m_dictSkillCD[skillid].skillid = (int)skillid; // m_dictSkillCD[skillid].currTime = rideskill.skillCD; // } //} public void AddCommonSkillCD(uint skillid) { if (m_dictskill == null) { Client.IPlayer player = Client.ClientGlobal.Instance().MainPlayer; Client.ISkillPart m_skillPart = player.GetPart(Client.EntityPart.Skill) as Client.ISkillPart; m_dictskill = m_skillPart.GetCurSkills(); } table.SkillDatabase skillTable = null; if (m_dictskill.ContainsKey(skillid)) { skillTable = m_dictskill[skillid]; if (!m_dictSkillCD.ContainsKey(skillid)) { m_dictSkillCD.Add(skillid, new SkillCDInfo()); cdkeys.Add(skillid); } m_dictSkillCD[skillid].totalTime = skillTable.dwCommonCDTime; m_dictSkillCD[skillid].skillid = (int)skillid; m_dictSkillCD[skillid].currTime = skillTable.dwCommonCDTime; } }
/// <summary> /// 请求读条上马 /// </summary> public bool TryUsingRide(Action <object> callback, object param) { Client.IMapSystem ms = Client.ClientGlobal.Instance().GetMapSystem(); if (ms == null) { return(false); } table.MapDataBase mapdata = GameTableManager.Instance.GetTableItem <table.MapDataBase>(ms.GetMapID()); if (mapdata == null) { return(false); } if (mapdata.canUsingRide != 1) { TipsManager.Instance.ShowTips("该地图不能上马"); if (callback != null) { callback(param); } return(false); } Client.IPlayer mainPlayer = Client.ClientGlobal.Instance().MainPlayer; if (mainPlayer != null) { Client.ISkillPart skillpart = mainPlayer.GetPart(Client.EntityPart.Skill) as Client.ISkillPart; if (skillpart != null) { if (skillpart.GetCurSkillState() != (int)Client.SkillState.None) { TipsManager.Instance.ShowTips(LocalTextType.Ride_Commond_shifangjinengzhongwufashangma); if (callback != null) { callback(param); } return(false); } } bool isChangeBody = (bool)mainPlayer.SendMessage(Client.EntityMessage.EntityCommand_IsChange, null); if (isChangeBody) { if (callback != null) { callback(param); } return(false); } bool bRide = DataManager.Manager <RideManager>().IsRide; if (bRide) { if (callback != null) { callback(param); } return(false); } else if (Auto_Ride == 0) { if (callback != null) { callback(param); } return(false); } } UsingRideCallback = callback; UsingRideCallbackParam = param; if (Auto_Ride != 0) { //先发送读条 读条 结束在上马 Client.stUninterruptMagic stparam = new Client.stUninterruptMagic(); if (GetRideDataById(Auto_Ride) != null) { stparam.time = GetRideDataById(Auto_Ride).spellTime; } stparam.type = GameCmd.UninterruptActionType.UninterruptActionType_DEMON; stparam.uid = MainPlayerHelper.GetPlayerUID(); Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.SKILLGUIDE_PROGRESSSTART, stparam); //NetService.Instance.Send(new stUsingRideUserCmd_C()); } return(true); }