Exemple #1
0
        public override bool Initialize()
        {
            if (!base.Initialize())
                return false;

            _thoughtContext = new ThoughtContext() {Plugin = this};

            _brain = new Brain();

            _brain.Thoughts.Add(new AnalyzeThought());
            _brain.Thoughts.Add(new AcquireTargetThought());
            _brain.Thoughts.Add(new MoveToMouseThought());
            _brain.Thoughts.Add(new KillStealThought());
            _brain.Thoughts.Add(new WardJumpThought());
            _brain.Thoughts.Add(new FullComboThought());
            _brain.Thoughts.Add(new HarassThought());
            _brain.Thoughts.Add(new FarmThought());

            return true;
        }
        public static bool WardJump(ThoughtContext context, float x, float y)
        {
            if (!context.Plugin.E.IsReady())
                return false;

            foreach (var obj in ObjectManager.Get<Obj_AI_Hero>().Where(z => z.IsAlly))
            {
                if (IsValidJumpTarget(obj))
                {
                    context.Plugin.E.CastOnUnit(obj, true);
                    LastWardJump = Environment.TickCount + 2000;
                    return true;
                }
            }

            foreach (var obj in ObjectManager.Get<Obj_AI_Minion>().Where(z => z.IsAlly))
            {
                if (IsValidJumpTarget(obj))
                {
                    context.Plugin.E.CastOnUnit(obj, true);
                    LastWardJump = Environment.TickCount + 2000;
                    return true;
                }
            }

            foreach (var obj in ObjectManager.Get<Obj_AI_Minion>().Where(z => !z.IsAlly))
            {
                if (IsValidJumpTarget(obj))
                {
                    context.Plugin.E.CastOnUnit(obj, true);
                    LastWardJump = Environment.TickCount + 2000;
                    return true;
                }
            }

            foreach (var obj in ObjectManager.Get<Obj_AI_Base>().Where(IsWard))
            {
                if (IsValidJumpTarget(obj))
                {
                    context.Plugin.E.CastOnUnit(obj, true);
                    LastWardJump = Environment.TickCount + 2000;
                    return true;
                }
            }

            if (Environment.TickCount >= LastWardJump)
            {
                var wardSlot = Items.GetWardSlot();

                if (wardSlot != null)
                {
                    wardSlot.UseItem(new Vector3(x, y, 0));
                    LastWardJump = Environment.TickCount + 2000;
                }
            }

            return true;
        }