Example #1
0
        private static void ELogic(Obj_AI_Hero target)
        {
            if (!E.CanCast(target) || target.HasBuffOfType(BuffType.SpellShield)) return;

            var tower = target.GetMostCloseTower();
            if (tower != null && tower.IsAlly && E.CanCast(target) && target.Distance(tower)<tower.AttackRange + E.Range)
            {
                if (target.Distance(tower) < Player.Distance(tower))
                {
                    E.Cast(target);
                }
                else
                {
                    E.CastToReverse(target);
                }
            }

            var adc = GetAdc();
            if (adc!=null)
            {
                if (target.IsFleeing(Player))
                {
                    E.Cast(target);
                }
                else if (target.IsHunting(Player))
                {
                    E.CastToReverse(target);
                }
            }

            //if (target.HealthPercent>Player.HealthPercent)
            //{
            //	E.Cast(target);
            //}
            //else
            //{
            //	E.CastToReverse(target);
            //}
            if (target.Distance(Player)>E.Range/2 || Player.HealthPercent<50)
            {
                E.CastToReverse(target);
            }
        }