Esempio n. 1
0
        protected override void OnPulse()
        {
            if (ZetaDia.Me == null)
            {
                return;
            }

            using (new PerformanceLogger("Utility.Cooldowns.Pulse"))
            {
                CurrentTime = ZetaDia.Globals.GameTick;
                IsLogging   = Core.Settings.Advanced.LogCategories.HasFlag(LogCategory.Cooldowns);

                foreach (var buff in ZetaDia.Me.GetAllBuffs()) //Core.Buffs.AllBuffs)
                {
                    var cBuff = new CachedBuff(buff);
                    RecordBuffData(cBuff.Id, cBuff.BuffAttributeSlot, cBuff.VariantName);
                }

                // Convention full duration buff.
                RecordBuffData((int)SNOPower.P2_ItemPassive_Unique_Ring_038, 8, "AllElements");

                foreach (var power in SkillUtils.ActiveIds)
                {
                    RecordSkillData(power);
                }
            }
        }
Esempio n. 2
0
            public string GetBuffVariantName(CachedBuff buff)
            {
                switch (buff.Id)
                {
                case (int)SNOPower.ItemPassive_Unique_Ring_735_x1:     // Bastians of Will
                    return(((ResourceEffectType)buff.VariantId).ToString());

                case (int)SNOPower.P2_ItemPassive_Unique_Ring_038:     // Convention of Elements
                    return(((Element)buff.VariantId).ToString());
                }
                return(string.Empty);
            }
Esempio n. 3
0
        public void UpdateBuffs()
        {
            if (!Core.Player.IsValid)
            {
                return;
            }

            Clear();

            foreach (var buff in ZetaDia.Me.GetAllBuffs())
            {
                if (!buff.IsValid)
                {
                    return;
                }

                var cachedBuff = new CachedBuff(buff);

                //Convention of Elements
                if (cachedBuff.Id == (int)SNOPower.P2_ItemPassive_Unique_Ring_038)
                {
                    ConventionElement            = CachedBuff.GetElement(cachedBuff.BuffAttributeSlot);
                    ConventionElementElapsedMs   = (int)cachedBuff.Elapsed.TotalMilliseconds;
                    ConventionElementRemainingMs = (int)cachedBuff.Remaining.TotalMilliseconds;
                }

                if (!BuffsById.ContainsKey(cachedBuff.Id))
                {
                    BuffsById.Add(cachedBuff.Id, cachedBuff);
                }

                ActiveBuffs.Add(cachedBuff);
            }

            HasArchon = HasBuff(SNOPower.Wizard_Archon); // .Any(p => GameData.ArchonSkillIds.Contains((int)p))

            // Bastians of Will
            HasBastiansWillSpenderBuff   = HasBuff(SNOPower.ItemPassive_Unique_Ring_735_x1, 2);
            HasBastiansWillGeneratorBuff = HasBuff(SNOPower.ItemPassive_Unique_Ring_735_x1, 1);

            // Shrines
            HasBlessedShrine      = HasBuff(30476); //Blessed (+25% defence)
            HasFrenzyShrine       = HasBuff(30479); //Frenzy  (+25% atk speed)
            HasInvulnerableShrine = HasBuff(SNOPower.Pages_Buff_Invulnerable);
            HasCastingShrine      = HasBuff(SNOPower.Pages_Buff_Infinite_Casting);
            HasConduitShrine      = HasBuff(SNOPower.Pages_Buff_Electrified) || HasBuff(SNOPower.Pages_Buff_Electrified_TieredRift);

            //P4_ItemPassive_Unique_Ring_057:1:\:0 dlg.icon == walking endlessly
            //P4_ItemPassive_Unique_Ring_057:2:\:0 dlg.icon == stopping for directions
            //P3_ItemPassive_Unique_Ring_026:1:\:1 dlg.icon == shenlongs spirit
        }
Esempio n. 4
0
            public void UpdateBuffsCache()
            {
                if (!Player.IsValid)
                {
                    return;
                }

                using (new PerformanceLogger("UpdateCachedBuffsData"))
                {
                    if (DateTime.UtcNow.Subtract(LastUpdated).TotalMilliseconds < 250)
                    {
                        return;
                    }

                    Clear();

                    foreach (var buff in ZetaDia.Me.GetAllBuffs())
                    {
                        if (!buff.IsValid)
                        {
                            return;
                        }

                        var cachedBuff = new CachedBuff(buff);

                        cachedBuff.VariantId   = GetBuffVariantId((SNOPower)cachedBuff.Id);
                        cachedBuff.VariantName = GetBuffVariantName(cachedBuff);

                        // Convention of Elements
                        if (cachedBuff.Id == (int)SNOPower.P2_ItemPassive_Unique_Ring_038)
                        {
                            ConventionElement = GetElement(cachedBuff.VariantId);
                        }

                        if (!_buffsById.ContainsKey(buff.SNOId))
                        {
                            _buffsById.Add(buff.SNOId, cachedBuff);
                        }

                        _buffs.Add(cachedBuff);

                        Logger.Log(TrinityLogLevel.Debug, LogCategory.CacheManagement,
                                   "ActiveBuffs: Id={0} Name={1} Stacks={2} VariantId={3} VariantName={4}", cachedBuff.Id, cachedBuff.InternalName, cachedBuff.StackCount, cachedBuff.VariantId, cachedBuff.VariantName);
                    }

                    LastUpdated = DateTime.UtcNow;

                    Logger.Log(TrinityLogLevel.Debug, LogCategory.CacheManagement,
                               "Refreshed Inventory: ActiveBuffs={0}", ActiveBuffs.Count);
                }

                // Bastians of Will
                HasBastiansWillSpenderBuff   = HasBuff(SNOPower.ItemPassive_Unique_Ring_735_x1, 2);
                HasBastiansWillGeneratorBuff = HasBuff(SNOPower.ItemPassive_Unique_Ring_735_x1, 1);

                // Shrines
                HasBlessedShrine      = HasBuff(30476); //Blessed (+25% defence)
                HasFrenzyShrine       = HasBuff(30479); //Frenzy  (+25% atk speed)
                HasInvulnerableShrine = HasBuff(SNOPower.Pages_Buff_Invulnerable);
                HasCastingShrine      = HasBuff(SNOPower.Pages_Buff_Infinite_Casting);
                HasConduitShrine      = HasBuff(SNOPower.Pages_Buff_Electrified) || HasBuff(SNOPower.Pages_Buff_Electrified_TieredRift);
            }