// Token: 0x060005ED RID: 1517 RVA: 0x0001D97C File Offset: 0x0001BB7C
 public override bool Orbwalk(Unit9 target, bool attack, bool move, ComboModeMenu comboMenu = null)
 {
     if (comboMenu != null && target != null && comboMenu.IsHarassCombo)
     {
         ActiveAbility ability = this.tidebringer.Ability;
         if (ability.CanBeCasted(true))
         {
             Vector3 ownerPosition           = base.Owner.Position;
             float   num                     = base.Owner.GetAttackPoint(null) + Game.Ping / 1000f + 0.3f;
             Vector3 targetPredictedPosition = target.GetPredictedPosition(num);
             Unit9   unit                    = (from x in EntityManager9.Units
                                                where x.IsUnit && !x.Equals(target) && x.IsAlive && x.IsVisible && !x.IsInvulnerable && !x.IsAlly(this.Owner) && x.Distance(target) < ability.Range
                                                orderby Vector3Extensions.AngleBetween(ownerPosition, x.Position, targetPredictedPosition)
                                                select x).FirstOrDefault <Unit9>();
             if (unit != null)
             {
                 Vector3 position = unit.Position;
                 if (this.CanAttack(unit, 0f) && Vector3Extensions.AngleBetween(ownerPosition, position, targetPredictedPosition) < 45f)
                 {
                     base.LastMovePosition = Vector3.Zero;
                     base.LastTarget       = unit;
                     base.OrbwalkSleeper.Sleep(0.05f);
                     return(this.Attack(unit, comboMenu));
                 }
                 float   num2         = Math.Min(Math.Max(unit.Distance(ownerPosition), 150f), base.Owner.GetAttackRange(null, 0f));
                 Vector3 movePosition = Vector3Extensions.Extend2D(position, targetPredictedPosition, -num2);
                 base.OrbwalkSleeper.Sleep(0.05f);
                 return(base.Move(movePosition));
             }
         }
     }
     return(base.Orbwalk(target, attack, move, comboMenu));
 }
Beispiel #2
0
        // Token: 0x060007D3 RID: 2003 RVA: 0x00023DD0 File Offset: 0x00021FD0
        protected override void Execute()
        {
            if (!this.useChains)
            {
                return;
            }
            Hero9 hero = base.Owner.Hero;

            if (!hero.IsValid || !hero.IsAlive)
            {
                return;
            }
            ActiveAbility chains  = hero.Abilities.FirstOrDefault((Ability9 x) => x.Id == AbilityId.ember_spirit_searing_chains) as ActiveAbility;
            ActiveAbility chains2 = chains;

            if (chains2 == null || !chains2.IsValid || !chains.CanBeCasted(true))
            {
                return;
            }
            if (!base.TargetManager.EnemyHeroes.Any((Unit9 x) => chains.CanHit(x)))
            {
                return;
            }
            if (this.menu.fistKey)
            {
                chains.UseAbility(false, false);
            }
            this.useChains = false;
        }
 // Token: 0x0600064D RID: 1613 RVA: 0x0001EAEC File Offset: 0x0001CCEC
 public override bool Orbwalk(Unit9 target, bool attack, bool move, ComboModeMenu comboMenu = null)
 {
     if (target != null)
     {
         if (comboMenu != null && comboMenu.IsAbilityEnabled(this.stomp.Ability) && this.stomp.Ability.CanBeCasted(true))
         {
             return(base.Move(target.GetPredictedPosition(1f)));
         }
         if (!this.damagedUnits.Contains(target))
         {
             return(base.Move(target.Position));
         }
         Unit9 unit = (from x in this.moveUnits
                       where x.IsValid && x.IsAlive && x.Distance(base.Owner) < 1000f
                       orderby x.IsHero descending, x.Distance(base.Owner)
                       select x).FirstOrDefault <Unit9>();
         if (unit != null)
         {
             return(base.Move(unit.Position));
         }
         ActiveAbility activeAbility = base.Owner.Abilities.FirstOrDefault((Ability9 x) => x.Id == AbilityId.elder_titan_return_spirit) as ActiveAbility;
         if (activeAbility != null && activeAbility.CanBeCasted(true) && activeAbility.UseAbility(false, false))
         {
             base.OrbwalkSleeper.Sleep(3f);
             return(true);
         }
     }
     return(base.Orbwalk(target, attack, move, comboMenu));
 }
        // Token: 0x060005EE RID: 1518 RVA: 0x0001DB44 File Offset: 0x0001BD44
        protected override bool UseOrbAbility(Unit9 target, ComboModeMenu comboMenu)
        {
            if (!base.Owner.CanUseAbilities)
            {
                return(false);
            }
            ActiveAbility ability = this.tidebringer.Ability;

            return(comboMenu != null && comboMenu.IsAbilityEnabled(ability) && (ability.CanBeCasted(true) && ability.CanHit(target) && ability.UseAbility(target, false, false)));
        }
Beispiel #5
0
        // Token: 0x06000975 RID: 2421 RVA: 0x00029954 File Offset: 0x00027B54
        public bool CycloneTarget(TargetManager targetManager)
        {
            if (this.cyclone == null)
            {
                return(false);
            }
            ActiveAbility ability = this.cyclone.Ability;

            return(ability.CanBeCasted(true) && ability.CanHit(targetManager.Target) && ability.UseAbility(targetManager.Target, false, false));
        }
Beispiel #6
0
        // Token: 0x06000245 RID: 581 RVA: 0x0000FCEC File Offset: 0x0000DEEC
        public void Toss()
        {
            ActiveAbility tossAbility  = base.Owner.Abilities.FirstOrDefault((Ability9 x) => x.Id == AbilityId.tiny_toss) as ActiveAbility;
            ActiveAbility tossAbility2 = tossAbility;

            if (tossAbility2 == null || !tossAbility2.CanBeCasted(true))
            {
                return;
            }
            Unit9 tower = (from x in EntityManager9.Units
                           where x.IsTower && x.IsAlly(this.Owner) && x.IsAlive
                           orderby x.Distance(this.Owner)
                           select x).FirstOrDefault((Unit9 x) => x.Distance(this.Owner) < 2000f);

            if (tower == null)
            {
                return;
            }
            Unit9 unit = (from x in EntityManager9.Units
                          where x.IsUnit && !x.IsInvulnerable && !x.IsMagicImmune && x.IsAlive && x.IsVisible && x.Distance(this.Owner) < tossAbility.CastRange && x.Distance(tower) < tower.GetAttackRange(null, 0f)
                          orderby x.Distance(tower)
                          select x).FirstOrDefault <Unit9>();

            if (unit == null)
            {
                return;
            }
            Unit9 unit2 = (from x in EntityManager9.Units
                           where x.IsUnit && !x.Equals(this.Owner) && !x.IsInvulnerable && !x.IsMagicImmune && x.IsAlive && x.IsVisible && x.Distance(this.Owner) < tossAbility.Radius
                           orderby x.Distance(this.Owner)
                           select x).FirstOrDefault <Unit9>();

            if (unit2 == null || !unit2.IsHero || unit2.IsIllusion || unit2.IsAlly(base.Owner))
            {
                return;
            }
            tossAbility.UseAbility(unit, false, false);
        }
        // Token: 0x060005EA RID: 1514 RVA: 0x0001D66C File Offset: 0x0001B86C
        public void AutoReturn()
        {
            if (base.ComboSleeper.IsSleeping)
            {
                return;
            }
            if (this.xMark.Position.IsZero)
            {
                return;
            }
            ActiveAbility ability = this.xReturn.Ability;

            if (!ability.CanBeCasted(true))
            {
                return;
            }
            if (!this.torrent.ShouldReturn(this.xReturn.Ability, this.xMark.Position) && !this.ship.ShouldReturn(this.xReturn.Ability, this.xMark.Position))
            {
                return;
            }
            ability.UseAbility(false, false);
            base.ComboSleeper.Sleep(ability.GetCastDelay());
            base.OrbwalkSleeper.Sleep(ability.GetCastDelay());
        }