Ejemplo n.º 1
0
        private static void OnPlayAnimation(Obj_AI_Base sender, Obj_AI_BasePlayAnimationEventArgs Args)
        {
            try
            {
                if (sender.IsMe)
                {
                    //var time = 0;
                    bool cancel = false;

                    switch (Args.Animation)
                    {
                    case "Spell1a":
                        cancel    = true; //MiscMenu["FlowersRiven.MiscMenu.Q1Delay"].Value;
                        qStack    = 1;
                        lastQTime = Game.TickCount;
                        break;

                    case "Spell1b":
                        cancel    = true; //MiscMenu["FlowersRiven.MiscMenu.Q2Delay"].Value;
                        qStack    = 2;
                        lastQTime = Game.TickCount;
                        break;

                    case "Spell1c":
                        cancel    = true; //MiscMenu["FlowersRiven.MiscMenu.Q3Delay"].Value;
                        qStack    = 0;
                        lastQTime = Game.TickCount;
                        break;

                    default:
                        cancel = false;
                        break;
                    }

                    if (FleeMenu["FlowersRiven.FleeMenu.FleeKey"].As <MenuKeyBind>().Enabled ||
                        FleeMenu["FlowersRiven.FleeMenu.WallJumpKey"].As <MenuKeyBind>().Enabled)
                    {
                        return;
                    }

                    if (cancel == true)
                    {
                        //var delay1 = 400 + delay3;
                        //var delay2 = Game.Ping + delay3;
                        var delay3 = 1000 / (ObjectManager.GetLocalPlayer().AttackSpeedMod * 3.75);
                        //var delay4 = ObjectManager.GetLocalPlayer().AttackSpeedMod * 12;
                        //var delay5 = Game.Ping - Me.GetSpell(SpellSlot.Q).Level * 2;
                        //var delay6 = ObjectManager.GetLocalPlayer().AttackSpeedMod;
                        //var delay7 = 1 / ObjectManager.GetLocalPlayer().AttackSpeedMod;
                        //var delay8 = ObjectManager.GetLocalPlayer().AttackDelay;
                        //var delay9 = 1 / ObjectManager.GetLocalPlayer().AttackDelay;
                        //var delay10 = ObjectManager.GetLocalPlayer().AttackCastDelay;
                        //var delay11 = 1 / ObjectManager.GetLocalPlayer().AttackCastDelay;

                        //Console.WriteLine("Delay1: " + delay1);
                        //Console.WriteLine("Delay2: " + delay2);
                        //Console.WriteLine("Delay3: " + delay3);
                        //Console.WriteLine("Delay4: " + delay4);
                        //Console.WriteLine("Delay5: " + delay5);
                        //Console.WriteLine("Delay6: " + delay6);
                        //Console.WriteLine("Delay7: " + delay7);
                        //Console.WriteLine("Delay8: " + delay8);
                        //Console.WriteLine("Delay9: " + delay9);
                        //Console.WriteLine("Delay10: " + delay10);
                        //Console.WriteLine("Delay11: " + delay11);

                        var time = qStack != 0
                            ? (int)(delay3 + (Game.Ping > 50 ? Game.Ping : 50) + Me.GetSpell(SpellSlot.Q).Level * 2)
                            : (int)
                                   (delay3 + (Game.Ping > 50 ? Game.Ping : 50) +
                                    ((Game.Ping > 50 ? Game.Ping : 50) + Me.GetSpell(SpellSlot.Q).Level * 2));

                        // Console.WriteLine(time);
                        if (MiscMenu["FlowersRiven.MiscMenu.SemiCancel"].Enabled || Orbwalker.Mode != OrbwalkingMode.None)
                        {
                            if (MiscMenu["FlowersRiven.MiscMenu.CalculatePing"].Enabled)
                            {
                                if (time - Game.Ping > 0)
                                {
                                    DelayAction.Queue(time - Game.Ping, Cancel);
                                }
                                else
                                {
                                    DelayAction.Queue(1, Cancel);
                                }
                            }
                            else
                            {
                                DelayAction.Queue(time, Cancel);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error in MyEventManager.OnPlayAnimation." + ex);
            }
        }
Ejemplo n.º 2
0
        private static void HarassEvent()
        {
            try
            {
                if (Me.IsUnderEnemyTurret())
                {
                    return;
                }

                var target = TargetSelector.GetTarget(E.Range + Me.BoundingRadius);

                if (target.IsValidTarget())
                {
                    if (HarassMenu["FlowersRiven.HarassMenu.Mode"].As <MenuList>().Value == 0)
                    {
                        if (E.Ready && qStack == 2)
                        {
                            var pos = Me.ServerPosition + (Me.ServerPosition - target.ServerPosition).Normalized() * E.Range;

                            if (pos != Vector3.Zero)
                            {
                                E.Cast(pos);
                            }
                        }

                        if (Q.Ready && qStack == 2)
                        {
                            var pos = Me.ServerPosition + (Me.ServerPosition - target.ServerPosition).Normalized() * E.Range;

                            if (pos != Vector3.Zero)
                            {
                                DelayAction.Queue(100, () => Q.Cast(pos));
                            }
                        }

                        if (W.Ready && target.IsValidTarget(W.Range) && qStack == 1)
                        {
                            W.Cast();
                        }

                        if (Q.Ready)
                        {
                            if (qStack == 0)
                            {
                                MyExtraManager.CastQ(target);
                                Orbwalker.ForceTarget(target);
                            }

                            if (qStack == 1 && Environment.TickCount - lastQTime > 600)
                            {
                                MyExtraManager.CastQ(target);
                                Orbwalker.ForceTarget(target);
                            }
                        }
                    }
                    else
                    {
                        if (E.Ready && HarassMenu["FlowersRiven.HarassMenu.E"].Enabled &&
                            target.DistanceToPlayer() <= E.Range + (Q.Ready ? Q.Range : Me.AttackRange))
                        {
                            E.Cast(target.ServerPosition);
                        }

                        if (Q.Ready && HarassMenu["FlowersRiven.HarassMenu.Q"].Enabled &&
                            target.IsValidTarget(Q.Range) && qStack == 0 && Game.TickCount - lastQTime > 500)
                        {
                            MyExtraManager.CastQ(target);
                            Orbwalker.ForceTarget(target);
                        }

                        if (W.Ready && HarassMenu["FlowersRiven.HarassMenu.W"].Enabled &&
                            target.IsValidTarget(W.Range) && (!Q.Ready || qStack == 1))
                        {
                            W.Cast();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error in MyEventManager.HarassEvent." + ex);
            }
        }