Example #1
0
            internal bool Cast(Obj_AI_Hero target, bool farmcast = false)
            {
                if (!item.IsReady())
                {
                    return false;
                }

                if (!farmcast)
                {
                    if ((type == ItemCastType.SelfCast || type == ItemCastType.RangeCast) &&
                        Player.CountEnemiesInRange(item.Range) >= eneinrangecount)
                    {
                        item.Cast();
                        return true;
                    }

                    if (type == ItemCastType.TargettedCast && target.IsInRange(item.Range))
                    {
                        item.Cast(target);
                        return true;
                    }
                }

                else if (farmcast)
                {
                    if ((type == ItemCastType.SelfCast || type == ItemCastType.RangeCast) && ObjectManager.Get<Obj_AI_Minion>().Count(x=> x.IsValidTarget(item.Range)) >= minioncount)
                    {
                        item.Cast();
                        return true;
                    }
                }

                return false;
            }
Example #2
0
 void CastQ(Obj_AI_Hero target)
 {
     if (Spells[Q].IsReady() && target != null && target.IsInRange(Qrange))
     {
         UseQ(target, GetHitChance("Hitchance.Q"));
     }
 }