Example #1
0
        internal static void Init()
        {
            Variables.AssemblyMenu = new LeagueSharp.Common.Menu("Orianna", "dz191.oriannahunter", true);
            MenuGenerator.GenerateMenu(Variables.AssemblyMenu);
            Variables.AssemblyMenu.AddToMainMenu();
            SpellQueue.OnLoad();
            BallManager.OnLoad();

            Orianna.OnLoad();
        }
 void Start()
 {
     camForward   = Camera.main.transform.forward;
     camForward.y = 0;
     camForward   = camForward.normalized;
     right        = Camera.main.transform.right;
     animator     = GetComponent <Animator>();
     root         = transform.Find("Root");
     SetRagdoll(false, true);
     spellQueue = gameObject.AddComponent <SpellQueue>();
 }
Example #3
0
File: HUD.cs Project: nemec/4Realms
            internal PlayerHUD(IHUDTheme theme, Player p, int xOffset, int yOffset)
            {
                #region Name
                Text name = new Text("player_name_" + p.Name, "Text", p.Name);
                name.DisplayColor = theme.TextColor;
                name.Pos          = new Vector2(xOffset, yOffset);
                name.Static       = true;
                #endregion

                #region HealthBar
                healthBar = new ProgressBar("Health_" + p.Name, p.MaxHealth,
                                            Color.DarkRed, Color.Firebrick, Color.Black, barSize);
                healthBar.Pos    = new Vector2(xOffset, name.Pos.Y + name.GetAnimation().Height);
                healthBar.Static = true;
                healthBar.Value  = p.MaxHealth;

                p.HealthChanged += delegate(object obj, int value)
                {
                    healthBar.Value = value;
                    if (value == 0)
                    {
                        name.DisplayColor = Color.Tomato;
                    }
                    else
                    {
                        name.DisplayColor = theme.TextColor;
                    }
                };
                #endregion

                #region ManaBar
                manaBar = new ProgressBar("Mana_" + p.Name, p.MaxMana,
                                          Color.MidnightBlue, Color.Blue, Color.Black, barSize);
                manaBar.Pos = new Vector2(xOffset,
                                          healthBar.Pos.Y + barSize.Y + barSpacing.Y);
                manaBar.Static = true;
                manaBar.Value  = p.MaxMana;

                p.ManaChanged += delegate(object obj, int value)
                {
                    manaBar.Value = value;
                };
                #endregion

                #region Spell Queue
                spellQueue     = new SpellQueue("Queue", theme, p);
                spellQueue.Pos = new Vector2(xOffset,
                                             healthBar.Pos.Y + barSize.Y + 2 * barSpacing.Y + barSize.Y);
                spellQueue.Static = true;

                #endregion
            }
Example #4
0
        private static async Task <bool> SpellQueueMethod()
        {
            InSpellQueue = true;
            var spell = SpellQueue.Peek();

            if (spell.Wait != null)
            {
                if (await Coroutine.Wait(spell.Wait.WaitTime, spell.Wait.Check))
                {
                    Logger.Write($"Spell Queue Wait: {spell.Wait.Name}");
                }
                else
                {
                    SpellQueue.Dequeue();
                    return(true);
                }
            }

            if (spell.Checks.Any(x => !x.Check.Invoke()))
            {
                SpellQueue.Dequeue();
                Logger.Write($"Removing {spell.Spell.LocalizedName} from the Spell Queue because it failed it's checks.");
                foreach (var check in spell.Checks.Where(x => !x.Check.Invoke()))
                {
                    Logger.Write($"Failed Check: {check.Name}");
                }
                return(true);
            }

            var target = spell.Target();

            if (target != null)
            {
                if (await spell.Spell.Cast(target))
                {
                    SpellQueue.Dequeue();
                    return(true);
                }
            }

            return(SpellQueue.Any());
        }
Example #5
0
File: HUD.cs Project: nemec/4Realms
            internal PlayerHUD(IHUDTheme theme, Player p, int xOffset, int yOffset)
            {
                #region Name
                Text name = new Text("player_name_" + p.Name, "Text", p.Name);
                name.DisplayColor = theme.TextColor;
                name.Pos = new Vector2(xOffset, yOffset);
                name.Static = true;
                #endregion

                #region HealthBar
                healthBar = new ProgressBar("Health_" + p.Name, p.MaxHealth,
                    Color.DarkRed, Color.Firebrick, Color.Black, barSize);
                healthBar.Pos = new Vector2(xOffset, name.Pos.Y + name.GetAnimation().Height);
                healthBar.Static = true;
                healthBar.Value = p.MaxHealth;

                p.HealthChanged += delegate(object obj, int value)
                {
                    healthBar.Value = value;
                    if (value == 0)
                    {
                        name.DisplayColor = Color.Tomato;
                    }
                    else
                    {
                        name.DisplayColor = theme.TextColor;
                    }
                };
                #endregion

                #region ManaBar
                manaBar = new ProgressBar("Mana_" + p.Name, p.MaxMana,
                    Color.MidnightBlue, Color.Blue, Color.Black, barSize);
                manaBar.Pos = new Vector2(xOffset,
                    healthBar.Pos.Y + barSize.Y + barSpacing.Y);
                manaBar.Static = true;
                manaBar.Value = p.MaxMana;

                p.ManaChanged += delegate(object obj, int value)
                {
                    manaBar.Value = value;
                };
                #endregion

                #region Spell Queue
                spellQueue = new SpellQueue("Queue", theme, p);
                spellQueue.Pos = new Vector2(xOffset,
                    healthBar.Pos.Y + barSize.Y + 2 * barSpacing.Y + barSize.Y);
                spellQueue.Static = true;

                #endregion
            }
Example #6
0
        public static async Task <bool> Execute()
        {
            if (!Core.Me.HasTarget || !Core.Me.CurrentTarget.ThoroughCanAttack())
            {
                return(false);
            }

            if (await CustomOpenerLogic.Opener())
            {
                return(true);
            }

            if (!SpellQueue.Any())
            {
                InSpellQueue = false;
            }

            if (SpellQueue.Any())
            {
                if (await SpellQueueMethod())
                {
                    return(true);
                }
            }

            if (await Defensive.ExecuteTankBusters())
            {
                return(true);
            }

            if (BotManager.Current.IsAutonomous)
            {
                Movement.NavigateToUnitLos(Core.Me.CurrentTarget, 3);
            }

            if (await Buff.Grit())
            {
                return(true);
            }
            if (await Defensive.TheBlackestNight())
            {
                return(true);
            }
            if (await Buff.Delirium())
            {
                return(true);
            }
            if (await Buff.BloodWeapon())
            {
                return(true);
            }

            if (Utilities.Routines.DarkKnight.OnGcd)
            {
                if (await Tank.Provoke(DarkKnightSettings.Instance))
                {
                    return(true);
                }
                if (await Defensive.Execute())
                {
                    return(true);
                }
                if (await Buff.LivingShadow())
                {
                    return(true);
                }
                if (await SingleTarget.CarveAndSpit())
                {
                    return(true);
                }

                if (AoeCheck)
                {
                    if (await Aoe.SaltedEarth())
                    {
                        return(true);
                    }
                    if (await Aoe.AbyssalDrain())
                    {
                        return(true);
                    }
                    if (await Aoe.FloodofDarknessShadow())
                    {
                        return(true);
                    }
                }

                if (await SingleTarget.EdgeofDarknessShadow())
                {
                    return(true);
                }
                if (await SingleTarget.Plunge())
                {
                    return(true);
                }
                if (await SingleTarget.Reprisal())
                {
                    return(true);
                }
            }

            if (await SingleTarget.Unmend())
            {
                return(true);
            }

            if (AoeCheck)
            {
                if (await Aoe.Quietus())
                {
                    return(true);
                }
                if (await Aoe.StalwartSoul())
                {
                    return(true);
                }
                if (await Aoe.Unleash())
                {
                    return(true);
                }
            }

            if (await SingleTarget.Bloodspiller())
            {
                return(true);
            }
            if (await SingleTarget.SoulEater())
            {
                return(true);
            }
            if (await SingleTarget.SyphonStrike())
            {
                return(true);
            }
            return(await SingleTarget.HardSlash());
        }
Example #7
0
 public Mob()
 {
     spellQueue   = new SpellQueue(this);
     timerHandler = new MobTimerHandler(this);
 }
Example #8
0
        public static async Task <bool> SpellQueueMethod()
        {
            if (!InSpellQueue)
            {
                Logger.WriteInfo("Starting Spell Queue");
                Casting.LastSpell = null;
            }

            Debug.Instance.Queue = new AsyncObservableCollection <QueueSpell>(SpellQueue);
            InSpellQueue         = true;

            if (CancelSpellQueue.Invoke())
            {
                SpellQueueStop();
                Logger.WriteInfo("Had To Cancel Spell Queue");
                return(true);
            }

            var spell = SpellQueue.Peek();

            if (NeedToDequeueSuccessfulCast)
            {
                if (Casting.LastSpell != null && Casting.LastSpell.Id == spell.Spell.Id)
                {
                    SpellQueue.Dequeue();
                    NeedToDequeueSuccessfulCast = false;
                    if (!SpellQueue.Any())
                    {
                        Logger.WriteInfo("Spell Queue Complete");
                        SpellQueueStop();
                    }
                    return(true);
                }
            }

            if (spell.SleepBefore)
            {
                await Coroutine.Sleep(spell.SleepMilliseconds);
            }

            if (spell.Wait != null)
            {
                if (await Coroutine.Wait(spell.Wait.WaitTime, spell.Wait.Check))
                {
                    Logger.Write($"Spell Queue Wait: {spell.Wait.Name}");
                }
                else
                {
                    SpellQueue.Dequeue();
                    Logger.Error($"Spell Wait Expired or Otherwise Unable to Cast: {spell.Wait.Name}");
                    return(true);
                }
            }

            if (spell.Checks.Any(x => !x.Check.Invoke()))
            {
                SpellQueue.Dequeue();

                Logger.Write($"Removing {spell.Spell.LocalizedName} From The Spell Queue Because It Failed It's Checks.");

                foreach (var check in spell.Checks.Where(x => !x.Check.Invoke()))
                {
                    if (!check.SilentMode)
                    {
                        Logger.Write($"Failed Check: {check.Name}");
                    }
                }

                return(true);
            }

            var target = spell.Target();

            if (target == null)
            {
                return(SpellQueue.Any());
            }

            if (!await spell.Spell.Cast(target))
            {
                return(SpellQueue.Any());
            }



            Logger.WriteInfo($@"Queue Cast: {spell.Spell.LocalizedName}");

            NeedToDequeueSuccessfulCast = true;
            return(SpellQueue.Any());
        }
Example #9
0
 private static void SpellQueueStop()
 {
     SpellQueue.Clear();
     Timeout.Reset();
     InSpellQueue = false;
 }
Example #10
0
        public static async Task <bool> Execute()
        {
            if (!Core.Me.HasTarget || !Core.Me.CurrentTarget.ThoroughCanAttack())
            {
                return(false);
            }

            if (await CustomOpenerLogic.Opener())
            {
                return(true);
            }

            if (!SpellQueue.Any())
            {
                InSpellQueue = false;
            }

            if (SpellQueue.Any())
            {
                if (await SpellQueueMethod())
                {
                    return(true);
                }
            }

            if (await Defensive.ExecuteTankBusters())
            {
                return(true);
            }

            if (BotManager.Current.IsAutonomous)
            {
                Movement.NavigateToUnitLos(Core.Me.CurrentTarget, 3);
            }

            Logger.Write($"Blood: {ActionResourceManager.DarkKnight.BlackBlood}, Darkside: {ActionResourceManager.DarkKnight.Darkside.TotalMilliseconds}, DarkArts: {ActionResourceManager.DarkKnight.DarkArts}");

            if (await Buff.Grit())
            {
                return(true);
            }
            if (await Defensive.TheBlackestNight())
            {
                return(true);
            }
            if (await Buff.Delirium())
            {
                return(true);
            }
            if (await Buff.BloodWeapon())
            {
                return(true);
            }

            if (Utilities.Routines.DarkKnight.OnGcd)
            {
                if (await Tank.Provoke(DarkKnightSettings.Instance))
                {
                    return(true);
                }
                if (await Defensive.Execute())
                {
                    return(true);
                }
                if (await SingleTarget.LowBlow())
                {
                    return(true);
                }
                if (await SingleTarget.Reprisal())
                {
                    return(true);
                }
                if (await Aoe.SaltedEarth())
                {
                    return(true);
                }
                if (await SingleTarget.CarveAndSpit())
                {
                    return(true);
                }
                if (await SingleTarget.Plunge())
                {
                    return(true);
                }
            }

            if (await Aoe.AbyssalDrain())
            {
                return(true);
            }
            if (await Aoe.Unleash())
            {
                return(true);
            }
            if (await SingleTarget.Unmend())
            {
                return(true);
            }
            if (await Aoe.Quietus())
            {
                return(true);
            }
            if (await SingleTarget.Bloodspiller())
            {
                return(true);
            }
            if (await SingleTarget.SoulEater())
            {
                return(true);
            }
            if (await SingleTarget.SyphonStrike())
            {
                return(true);
            }
            return(await SingleTarget.HardSlash());
        }