예제 #1
0
파일: Perk.cs 프로젝트: baburukiri/AOSharp
        public static int GetPerkLineLevel(PerkLine perkLine)
        {
            List <Perk> trainedPerksInLine = GetFullPerkMap()
                                             .Where(p => p.PerkLine == perkLine)
                                             .Where(p => p.IsTrained())
                                             .OrderBy(p => p.Instance)
                                             .ToList();

            if (trainedPerksInLine.Count == 0)
            {
                return(0);
            }

            return(trainedPerksInLine.Max(p => p.Level));
        }
예제 #2
0
파일: Perk.cs 프로젝트: baburukiri/AOSharp
        private Perk(int instance, int templateInstance, int prerequisitePerkInstance, int perkType,
                     int allowedProfessions, int actionInstance, int requiredExperience)
        {
            Instance                 = instance;
            TemplateInstance         = templateInstance;
            PrerequisitePerkInstance = prerequisitePerkInstance;
            PerkType                 = (PerkType)perkType;
            AllowedProfessions       = (ProfessionFlag)allowedProfessions;
            ActionInstance           = actionInstance;
            RequiredExperience       = requiredExperience;

            //Remaining is not returned by GetFullPerkMap
            Name = N3EngineClientAnarchy.GetName(new Identity(IdentityType.None, TemplateInstance));
            string sanitizedName = Name.Replace(" ", "").Replace("-", "").Replace("'", "");

            PerkLine = (PerkLine)Enum.Parse(typeof(PerkLine), sanitizedName);
        }
예제 #3
0
파일: Perk.cs 프로젝트: baburukiri/AOSharp
 public static bool IsTrained(PerkLine perkLine, int level)
 {
     return(GetFullPerkMap()
            .Any(p => p.PerkLine == perkLine && p.Level == level && p.IsTrained()));
 }