Пример #1
0
 public Skill(long amount, Database.Type type, Entity target, Player targetPlayer, Entity source, Player sourcePlayer, int skillId, bool hotdot,
     bool critic, long time, NpcInfo pet, HitDirection direction)
 {
     Amount = amount;
     Type = type;
     EntityTarget = target;
     EntitySource = source;
     PlayerTarget = targetPlayer;
     PlayerSource = sourcePlayer;
     SkillId = skillId;
     Critic = critic;
     HotDot = hotdot;
     Time = time;
     Pet = pet;
     Direction = direction;
     Source = source;
     Target = target;
     if(PlayerSource != null)
     {
         Source = PlayerSource.User;
     }
     if(PlayerTarget != null)
     {
         Target = PlayerTarget.User;
     }
 }
Пример #2
0
 internal Skill(int id, string name, bool?isChained = null, string detail = "", string iconName = "",
                NpcInfo npcInfo = null, bool isHotDot = false)
 {
     Id        = id;
     Name      = name;
     ShortName = RemoveLvl(name);
     IsChained = isChained;
     Detail    = detail;
     IconName  = iconName;
     NpcInfo   = npcInfo;
     IsHotDot  = isHotDot;
     Boom      = detail.Contains("Boom");
 }
Пример #3
0
        public bool Type(Entity source, Entity target, int skillid, NpcInfo pet, bool timed, Database.Type type)
        {
            var targetString = target?.Id.ToString() ?? "";
            var name = "";
            if (pet != null)
            {
                name = pet.Name;
            }
            var key = "type/" + source + "/" + targetString + "/" + name + "/" + skillid + "/" + type + "/" + timed;
            if (_caching.ContainsKey(key)) return (bool) _caching[key];

            var dataSource = DataSource(source, target, skillid, timed);
            IEnumerable<Database.Type> result;
            if (pet == null)
            {
                result = from skills in dataSource
                         where
                             skills.Pet == null && skills.Type == type
                         select skills.Type;
            }
            else
            {
                result = from skills in dataSource
                    where
                        skills.Pet != null &&
                        skills.Pet.Name == pet.Name && skills.Type == type
                    select skills.Type;
            }

            var typeExist = result.Count();

            _caching[key] = typeExist != 0;
            return typeExist != 0;
        }