Ejemplo n.º 1
0
        private static async Task ApplyAura(Skill aura)
        {
            string name = aura.Name;

            GlobalLog.Debug($"[CastAuraTask] Now casting \"{name}\".");
            var used = SkillBar.Use(aura.Slot, false);

            if (used != LokiPoe.InGameState.UseResult.None)
            {
                GlobalLog.Error($"[CastAuraTask] Fail to cast \"{name}\". Error: \"{used}\".");
                return;
            }
            await Wait.For(() => !LokiPoe.Me.HasCurrentAction && PlayerHasAura(name), "aura applying");

            await Wait.SleepSafe(100);
        }
Ejemplo n.º 2
0
        public async Task <bool> Run()
        {
            var area = World.CurrentArea;

            if (!area.IsHideoutArea && !area.IsMapRoom)
            {
                return(false);
            }

            await Coroutines.CloseBlockingWindows();

            var golemSkill = SkillBar.Skills.FirstOrDefault(s => s.IsOnSkillBar && s.SkillTags.Contains("golem"));

            if (golemSkill != null)
            {
                var golemObj = golemSkill.DeployedObjects.FirstOrDefault() as Monster;
                if (golemObj == null || golemObj.HealthPercent < MinGolemHpPercent)
                {
                    GlobalLog.Debug($"[CastAuraTask] Now summoning \"{golemSkill.Name}\".");
                    SkillBar.Use(golemSkill.Slot, false);
                    await Wait.SleepSafe(100);

                    await Coroutines.FinishCurrentAction();

                    await Wait.SleepSafe(100);
                }
            }
            var auras = GetAurasForCast();

            if (auras.Count > 0 && AllAuras.Any(a => a.IsOnSkillBar))
            {
                GlobalLog.Info($"[CastAuraTask] Found {auras.Count} aura(s) for casting.");
                await CastAuras(auras);
            }
            return(false);
        }