Exemple #1
0
    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;
        }
    }
Exemple #2
0
    //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;
        }
    }