Esempio n. 1
0
        public static void RecordSpell(TrinityPower power)
        {
            if (_history.Count >= SpellHistorySize)
            {
                _history.RemoveAt(0);
            }

            var skill = SkillUtils.ById(power.SNOPower);

            if (skill.IsAttackSpender)
            {
                _lastSpenderCast = DateTime.UtcNow;
            }

            if (skill.IsGeneratorOrPrimary)
            {
                _lastGeneratorCast = DateTime.UtcNow;
            }

            _history.Add(new SpellHistoryItem
            {
                Power          = power,
                UseTime        = DateTime.UtcNow,
                MyPosition     = Trinity.Player.Position,
                TargetPosition = power.TargetPosition
            });

            Logger.LogVerbose(LogCategory.Targetting, "Recorded {0}", power);

            CacheData.AbilityLastUsed[power.SNOPower] = DateTime.UtcNow;
            Trinity.LastPowerUsed = power.SNOPower;
        }
Esempio n. 2
0
            private void RefreshHotbar()
            {
                using (new PerformanceLogger("RefreshHotbar"))
                {
                    var cPlayer = ZetaDia.CPlayer;

                    LastUpdated = DateTime.UtcNow;

                    PassiveSkills = new HashSet <SNOPower>(cPlayer.PassiveSkills);

                    for (int i = 0; i <= 5; i++)
                    {
                        var diaActiveSkill = cPlayer.GetActiveSkillByIndex(i, ZetaDia.Me.SkillOverrideActive);
                        if (diaActiveSkill == null || diaActiveSkill.Power == SNOPower.None)
                        {
                            continue;
                        }

                        var power     = diaActiveSkill.Power;
                        var runeIndex = diaActiveSkill.RuneIndex;

                        var hotbarskill = new HotbarSkill
                        {
                            Power           = diaActiveSkill.Power,
                            Slot            = (HotbarSlot)i,
                            RuneIndex       = runeIndex,
                            HasRuneEquipped = diaActiveSkill.HasRuneEquipped,
                            Skill           = SkillUtils.ById(power),
                            //Charges = ZetaDia.Me.CommonData.GetAttribute<int>(((int)diaActiveSkill.Power << 12) + ((int)ActorAttributeType.SkillCharges & 0xFFF)),
                        };

                        ActivePowers.Add(power);
                        ActiveSkills.Add(hotbarskill);
                        _skillBySNOPower.Add(power, hotbarskill);
                        _skillBySlot.Add((HotbarSlot)i, hotbarskill);



                        if (!DataDictionary.LastUseAbilityTimeDefaults.ContainsKey(power))
                        {
                            DataDictionary.LastUseAbilityTimeDefaults.Add(power, DateTime.MinValue);
                        }

                        if (!AbilityLastUsed.ContainsKey(power))
                        {
                            AbilityLastUsed.Add(power, DateTime.MinValue);
                        }
                    }

                    Logger.Log(TrinityLogLevel.Debug, LogCategory.CacheManagement,
                               "Refreshed Hotbar: ActiveSkills={0} PassiveSkills={1}",
                               ActiveSkills.Count,
                               PassiveSkills.Count);
                }
            }
Esempio n. 3
0
 public Skill GetSkill()
 {
     return(SkillUtils.ById(SNOPower));
 }