Example #1
0
        public Dictionary <int, List <int> > GetPartnerCanLearnSkill()
        {
            Dictionary <int, List <int> > fellowlearnskill = new Dictionary <int, List <int> >();

            for (int i = 0; i < ContainerSize; i++)
            {
                Fellow fellow = GetFellowByIndex(i);
                if (fellow != null && fellow.IsValid() && fellow.Called && !fellowlearnskill.ContainsKey(fellow.DataId))
                {
                    for (int j = 0; j < Fellow.FELLOW_ELEMENTSKILL_COUNT && j < Fellow.FELLOW_ELEMENTSKILL_OPENCOUNT; j++)
                    {
                        if (fellow.GetElementSkillId(j) == GlobeVar.INVALID_ID && j > -1 &&
                            j < Fellow.FELLOW_ELEMENTSKILL_LEVELNEED.Length && fellow.Level >= Fellow.FELLOW_ELEMENTSKILL_LEVELNEED[j])
                        {
                            List <Tab_CabalFellowElementSkillBook> books = GameManager.gameManager.PlayerDataPool.BackPack.GetSkillLearnBooksByElementType(fellow.ElementAttr);
                            if (books != null && books.Count > j && GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(books[j].Id) > 0)
                            {
                                List <int> skills;
                                if (!fellowlearnskill.TryGetValue(fellow.DataId, out skills))
                                {
                                    skills = new List <int>();
                                }
                                skills.Add(j);
                            }
                        }
                    }
                }
            }
            return(fellowlearnskill);
        }
Example #2
0
        public Dictionary <int, List <int> > GetPartnerCanUpdateSkill()
        {
            Dictionary <int, List <int> > fellowupdateskill = new Dictionary <int, List <int> >();

            for (int i = 0; i < ContainerSize; i++)
            {
                Fellow fellow = GetFellowByIndex(i);
                if (fellow != null && fellow.IsValid() && !fellowupdateskill.ContainsKey(fellow.DataId))
                {
                    for (int j = 0; j < Fellow.FELLOW_ELEMENTSKILL_COUNT; j++)
                    {
                        int fellowElementSkillId = fellow.GetElementSkillId(j);
                        if (fellowElementSkillId != GlobeVar.INVALID_ID)
                        {
                            Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(fellowElementSkillId, 0);
                            if (tabSkill != null)
                            {
                                Tab_CabalFellowElementSkill tabNextSkill = TableManager.GetCabalFellowElementSkillByID(tabSkill.NextSkillId, 0);
                                {
                                    if (tabNextSkill != null)
                                    {
                                        int packHaveBookNum      = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(tabNextSkill.NeedBookId);
                                        int nextSkillNeedBookNum = tabNextSkill.NeedBookCount;
                                        if (packHaveBookNum >= nextSkillNeedBookNum)
                                        {
                                            List <int> skilllist;
                                            if (!fellowupdateskill.TryGetValue(fellow.DataId, out skilllist))
                                            {
                                                skilllist = new List <int>();
                                            }
                                            skilllist.Add(fellowElementSkillId);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(fellowupdateskill);
        }