Esempio n. 1
0
        public SkillResult(int amount, bool isCritical, bool isHp, bool isHeal, HotDot hotdot, EntityId source,
                           EntityId target, DateTime time,
                           EntityTracker entityRegistry, PlayerTracker playerTracker)
        {
            Time        = time;
            Amount      = isHp ? Math.Abs(amount) : amount;
            IsCritical  = isCritical;
            IsHp        = isHp;
            IsHeal      = isHeal;
            SkillId     = hotdot.Id;
            Abnormality = true;

            Source = entityRegistry.GetOrPlaceholder(source);
            Target = entityRegistry.GetOrPlaceholder(target);
            var userNpc    = UserEntity.ForEntity(Source);
            var sourceUser = userNpc["root_source"] as UserEntity; // Attribute damage dealt by owned entities to the owner
            var targetUser = Target as UserEntity;                 // But don't attribute damage received by owned entities to the owner

            var pclass = PlayerClass.Common;

            if (sourceUser != null)
            {
                SourcePlayer = playerTracker.Get(sourceUser.ServerId, sourceUser.PlayerId);
                pclass       = SourcePlayer.RaceGenderClass.Class;
            }
            Skill = new UserSkill(hotdot.Id, pclass,
                                  hotdot.Name, "DOT", null, hotdot.IconName);

            if (targetUser != null)
            {
                TargetPlayer = playerTracker.Get(targetUser.ServerId, targetUser.PlayerId);
            }
            HitDirection = HitDirection.Dot;
        }
Esempio n. 2
0
        public HotDotDatabase(string folder, string language)
        {
            var reader = new StreamReader(File.OpenRead(Path.Combine(folder, $"hotdot\\hotdot-{language}.tsv")));

            while (!reader.EndOfStream)
            {
                var line = reader.ReadLine();
                if (line == null)
                {
                    continue;
                }
                var values   = line.Split('\t');
                var id       = int.Parse(values[0]);
                var type     = values[1];
                var hp       = double.Parse(values[2], CultureInfo.InvariantCulture);
                var mp       = double.Parse(values[3], CultureInfo.InvariantCulture);
                var method   = (HotDot.DotType)Enum.Parse(typeof(HotDot.DotType), values[4]);
                var time     = int.Parse(values[5]);
                var tick     = int.Parse(values[6]);
                var amount   = double.Parse(values[7], CultureInfo.InvariantCulture);
                var name     = values[8];
                var itemName = values[10];
                var tooltip  = values[11];
                var iconName = values[12];
                if (_hotdots.ContainsKey(id))
                {
                    _hotdots[id].Update(id, type, hp, mp, amount, method, time, tick, name, itemName, tooltip, iconName);
                }
                else
                {
                    _hotdots[id] = new HotDot(id, type, hp, mp, amount, method, time, tick, name, itemName, tooltip, iconName);
                }
            }
            _hotdots[(int)StaticallyUsedBuff.Enraged] = new HotDot((int)StaticallyUsedBuff.Enraged, "Endurance", 0, 0, 0, 0, 0, 0, "Enrage", "", "", "enraged");
            _hotdots[(int)StaticallyUsedBuff.Slaying] = new HotDot((int)StaticallyUsedBuff.Slaying, "CritPower", 0, 0, 0, 0, 0, 0, "Slaying", "",
                                                                   "'Slaying' crystal is working (if equipped) when player in this state.", "slaying");

            var shortnames = Path.Combine(folder, $"hotdot\\hotdot-short-{language}.tsv");

            if (File.Exists(shortnames))
            {
                reader = new StreamReader(File.OpenRead(shortnames));
                while (!reader.EndOfStream)
                {
                    var line = reader.ReadLine();
                    if (line == null)
                    {
                        continue;
                    }
                    var values    = line.Split('\t');
                    var id        = int.Parse(values[0]);
                    var shortname = values[1];
                    if (_hotdots.ContainsKey(id))
                    {
                        _hotdots[id].ShortName = shortname;
                    }
                }
            }

            Enraged = _hotdots[(int)StaticallyUsedBuff.Enraged];
            Slaying = _hotdots[(int)StaticallyUsedBuff.Slaying];
            _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying0, out JoyOfPartying0);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying20, out JoyOfPartying20);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying50, out JoyOfPartying50);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying100, out JoyOfPartying100);

            _hotdots.TryGetValue((int)StaticallyUsedBuff.Enraged, out Enrage);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.Contagion1, out Contagion1);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.Contagion2, out Contagion2);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.Hurricane, out Hurricane);
        }
Esempio n. 3
0
 public void Add(HotDot dot)
 {
     _hotdots[dot.Id] = dot;
 }
Esempio n. 4
0
 public bool Equals(HotDot other)
 {
     return(Id == other.Id);
 }
Esempio n. 5
0
        public HotDotDatabase(string folder, string language)
        {
            var reader = new StreamReader(File.OpenRead(Path.Combine(folder, $"hotdot\\hotdot-{language}.tsv")));

            while (!reader.EndOfStream)
            {
                var line = reader.ReadLine();
                if (line == null)
                {
                    continue;
                }
                var values     = line.Split('\t');
                var id         = int.Parse(values[0]);
                var type       = values[1];
                var abType     = (HotDot.AbnormalityType)Enum.Parse(typeof(HotDot.AbnormalityType), values[2]);
                var isBuff     = bool.Parse(values[3]);
                var method     = (HotDot.DotType)Enum.Parse(typeof(HotDot.DotType), values[4]);
                var time       = uint.Parse(values[5]);
                var tick       = int.Parse(values[6]);
                var amount     = double.Parse(values[7], CultureInfo.InvariantCulture);
                var hp         = type == "HPChange" ? amount : 0;
                var mp         = type == "MPChange" ? amount : 0;
                var name       = values[8];
                var itemName   = values[10];
                var tooltip    = Regex.Replace(values[11].Replace("$H_W_GOOD", "").Replace("H_W_GOOD", "").Replace("$COLOR_END", "").Replace("$H_W_BAD", "").Replace("$H_W_Bad", "").Replace("H_W_BAD", "").Replace("$BR", " ").Replace("<br>", " "), "</?(font{1}).*?/?>", "");
                var iconName   = values[12];
                var effectIcon = values[13];
                var isShow     = bool.Parse(values[14]);
                if (_hotdots.ContainsKey(id))
                {
                    _hotdots[id].Update(id, type, hp, mp, amount, method, time, tick, name, itemName, tooltip, iconName);
                }
                else
                {
                    _hotdots[id] = new HotDot(id, type, hp, mp, amount, method, time, tick, name, itemName, tooltip, iconName, abType, isBuff, isShow, effectIcon);
                }
            }
            _hotdots[(int)StaticallyUsedBuff.Enraged] = new HotDot((int)StaticallyUsedBuff.Enraged, "Endurance", 0, 0, 0, 0, 36000, 0, "Enrage", "", "", "enraged", HotDot.AbnormalityType.Debuff, true, true, "enraged");
            _hotdots[(int)StaticallyUsedBuff.Slaying] = new HotDot((int)StaticallyUsedBuff.Slaying, "CritPower", 0, 0, 0, 0, 0, 0, "Slaying", "",
                                                                   "'Slaying' crystal is working (if equipped) when player in this state.", "slaying", HotDot.AbnormalityType.Buff, true, true, "slaying");

            var shortnames = Path.Combine(folder, $"hotdot\\hotdot-short-{language}.tsv");

            if (File.Exists(shortnames))
            {
                reader = new StreamReader(File.OpenRead(shortnames));
                while (!reader.EndOfStream)
                {
                    var line = reader.ReadLine();
                    if (line == null)
                    {
                        continue;
                    }
                    var values    = line.Split('\t');
                    var id        = int.Parse(values[0]);
                    var shortname = values[1];
                    if (_hotdots.ContainsKey(id))
                    {
                        _hotdots[id].ShortName = shortname;
                    }
                }
            }

            Enraged = _hotdots[(int)StaticallyUsedBuff.Enraged];
            Slaying = _hotdots[(int)StaticallyUsedBuff.Slaying];
            _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying0, out JoyOfPartying0);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying20, out JoyOfPartying20);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying50, out JoyOfPartying50);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying100, out JoyOfPartying100);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.Enraged, out Enrage);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.Contagion1, out Contagion1);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.Contagion2, out Contagion2);
            _hotdots.TryGetValue((int)StaticallyUsedBuff.Hurricane, out Hurricane);
        }