Exemplo n.º 1
0
        //Called when pressing the combo key
        private static void OnCombo()
        {
            //Find a target for Q
            var qTarget = TargetSelector.GetTarget(Variables.spells[SpellSlot.Q].Range,
                                                   TargetSelector.DamageType.Magical);

            //If the Q Target found is a valid one
            if (qTarget.IsValidTarget())
            {
                //Check if Q is ready and enabled in the menu
                if (Variables.AssemblyMenu.Item("dz191.orianna.combo.q").IsActive() &&
                    Variables.spells[SpellSlot.Q].IsReady())
                {
                    var qPrediction = Variables.spells[SpellSlot.Q].GetPrediction(qTarget);

                    //TODO AOE Q->R Setup

                    //Check if the qPrediction Cast Position is in range of Q from the player
                    if (qPrediction.CastPosition.Distance(ObjectManager.Player.ServerPosition) <
                        Variables.spells[SpellSlot.Q].Range)
                    {
                        //Create a new command instance
                        var ballCommand = new BallCommand()
                        {
                            BallCommandPosition = qPrediction.CastPosition,
                            CommandType         = BallCommands.Q
                        };

                        //Execute the command
                        ballCommand.Execute();
                    }
                }
            }

            //Get another target for W based on the Ball position this time
            var wTarget =
                HeroManager.Enemies.FirstOrDefault(
                    m => m.IsValidTarget(Variables.spells[SpellSlot.W].Range, true, BallManager.BallPosition));

            if (Variables.spells[SpellSlot.W].IsKillable(wTarget))
            {
                //Create a new command instance
                var ballCommand = new BallCommand()
                {
                    CommandType = BallCommands.W
                };

                //Execute the command
                ballCommand.Execute();
            }
        }