示例#1
0
        private static void Game_OnProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            var heroA = hero as AIHeroClient;

            if (!getCheckBoxItem("enemy.ward"))
            {
                return;
            }

            if (hero.IsEnemy && hero is AIHeroClient && hero.LSIsValid())
            {
                WardData wardData;
                if (WardDatabase.WardspellNames.TryGetValue(args.SData.Name.ToLower(), out wardData))
                {
                    var pos = args.End.ToVector2();

                    if (args.SData.Name.ToLower().Contains("TrinketTotem") || args.SData.Name.ToLower().Contains("trinkettotem"))
                    {
                        wardData.Duration = 1000 * (60 + (int)Math.Round(3.5 * (heroA.Level - 1))); // Not sure.
                    }

                    DelayAction.Add((float)50, () =>
                    {
                        if (Wards.Any(ward => ward.Position.ToVector2().Distance(pos) < 50 && Variables.TickCount - ward.Timestamp < 100))
                        {
                            return;
                        }

                        var newWard = new WardTrackerInfo(wardData, pos.To3D(), null)
                        {
                            StartPos = args.Start.ToVector2(),
                            EndPos   = args.End.ToVector2()
                        };

                        Wards.Add(newWard);
                    });
                }
            }
        }
示例#2
0
        private static void Game_OnProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            if (!Tracker.Menu["ward.tracker"]["enemy.ward"])
            {
                return;
            }

            if (hero.IsEnemy && hero is Obj_AI_Hero && hero.IsValid())
            {
                WardData wardData;
                if (WardDatabase.WardspellNames.TryGetValue(args.SData.Name.ToLower(), out wardData))
                {
                    var pos = args.End.ToVector2();

                    DelayAction.Add((float)50, () =>
                    {
                        if (Wards.Any(ward => ward.Position.ToVector2().Distance(pos) < 50 &&
                                      Variables.TickCount - ward.Timestamp < 100))
                        {
                            return;
                        }

                        var newWard = new WardTrackerInfo(
                            wardData,
                            pos.ToVector3(),
                            null
                            )
                        {
                            StartPos = args.Start.ToVector2(),
                            EndPos   = args.End.ToVector2()
                        };
                        Wards.Add(newWard);
                    });
                }
            }
        }
示例#3
0
        private static void Game_OnCreateObj(GameObject sender, EventArgs args)
        {
            /*if (sender.Name.ToLower().Contains("minion")
            || sender.Name.ToLower().Contains("turret"))
            || {
            ||  return;
            || }
            ||
            || if (sender.IsValid<MissileClient>())
            || {
            ||  var tMissile = sender as MissileClient;
            ||  if (tMissile.SpellCaster.Type != GameObjectType.obj_AI_Hero)
            ||  {
            ||      return;
            ||  }
            || }
            ||
            || ConsolePrinter.Print(sender.Type + " : " + sender.Name);*/

            if (!Tracker.Menu["ward.tracker"]["enemy.ward"])
            {
                return;
            }

            //Visible ward placement
            var      obj = sender as Obj_AI_Minion;
            WardData wardData;

            if (obj != null && obj.IsEnemy &&
                WardDatabase.WardObjNames.TryGetValue(obj.CharData.BaseSkinName.ToLower(), out wardData))
            {
                var timestamp = Variables.TickCount - (obj.MaxMana - obj.Mana) * 1000;

                WardTrackerInfo newWard = new WardTrackerInfo(
                    wardData,
                    obj.Position,
                    obj,
                    !obj.IsVisible && args == null,
                    timestamp
                    );

                Wards.Add(newWard);

                DelayAction.Add((float)500, () =>
                {
                    if (newWard.WardObject != null && newWard.WardObject.IsValid && !newWard.WardObject.IsDead)
                    {
                        timestamp = Variables.TickCount - (obj.MaxMana - obj.Mana) * 1000;

                        newWard.Timestamp = timestamp;

                        foreach (var ward in Wards)
                        {
                            if (ward.WardObject == null)
                            {
                                //Check for Process Spell wards
                                if (ward.Position.Distance(sender.Position) < 550 &&
                                    Math.Abs(ward.Timestamp - timestamp) < 2000)
                                {
                                    var ward1 = ward;
                                    DelayAction.Add(0, () => Wards.Remove(ward1));
                                    break;
                                }
                            }
                        }
                    }
                });
            }

            //FOW placement
            var missile = sender as MissileClient;

            if (missile != null && missile.SpellCaster.IsEnemy)
            {
                if (missile.SData.Name.ToLower() == "itemplacementmissile")// && !missile.SpellCaster.IsVisible)
                {
                    var dir = (missile.EndPosition.ToVector2() - missile.StartPosition.ToVector2()).Normalized();
                    var pos = missile.StartPosition.ToVector2() + dir * 500;

                    if (Wards.Any(ward => ward.Position.ToVector2().Distance(pos) < 750 &&
                                  Variables.TickCount - ward.Timestamp < 50))
                    {
                        return;
                    }

                    DelayAction.Add((float)100, () =>
                    {
                        if (Wards.Any(ward => ward.Position.ToVector2().Distance(pos) < 750 &&
                                      Variables.TickCount - ward.Timestamp < 125))
                        {
                            return;
                        }

                        var newWard = new WardTrackerInfo(
                            WardDatabase.MissileWardData,
                            pos.ToVector3(),
                            null,
                            true
                            )
                        {
                            StartPos = missile.StartPosition.ToVector2(),
                            EndPos   = missile.EndPosition.ToVector2()
                        };


                        Wards.Add(newWard);
                    });
                }
            }
        }
示例#4
0
        private static void Game_OnProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            var heroA = hero as AIHeroClient;
            if (!getCheckBoxItem("enemy.ward"))
            {
                return;
            }

            if (hero.IsEnemy && hero is AIHeroClient && hero.LSIsValid())
            {
                WardData wardData;
                if (WardDatabase.WardspellNames.TryGetValue(args.SData.Name.ToLower(), out wardData))
                {
                    var pos = args.End.ToVector2();

                    if (args.SData.Name.ToLower().Contains("TrinketTotem") || args.SData.Name.ToLower().Contains("trinkettotem"))
                    {
                        wardData.Duration = 1000 * (60 + (int)Math.Round(3.5 * (heroA.Level - 1))); // Not sure.
                    }

                    DelayAction.Add((float)50, () =>
                    {
                        if (Wards.Any(ward => ward.Position.ToVector2().Distance(pos) < 50 && Variables.TickCount - ward.Timestamp < 100))
                        {
                            return;
                        }

                        var newWard = new WardTrackerInfo(wardData, pos.To3D(), null)
                        {
                            StartPos = args.Start.ToVector2(),
                            EndPos = args.End.ToVector2()
                        };

                        Wards.Add(newWard);
                    });
                }
            }
        }
示例#5
0
        private static void Game_OnCreateObj(GameObject sender, EventArgs args)
        {
            if (!getCheckBoxItem("enemy.ward"))
            {
                return;
            }

            //Visible ward placement
            var obj = sender as Obj_AI_Minion;
            WardData wardData;

            if (obj != null && obj.IsEnemy
                && WardDatabase.WardObjNames.TryGetValue(obj.CharData.BaseSkinName.ToLower(), out wardData))
            {
                var timestamp = Variables.TickCount - (obj.MaxMana - obj.Mana) * 1000;

                WardTrackerInfo newWard = new WardTrackerInfo(
                            wardData,
                            obj.Position,
                            obj,
                            !obj.IsVisible && args == null,
                            timestamp
                            );

                Wards.Add(newWard);

                DelayAction.Add((float)500, () =>
                {
                    if (newWard.WardObject != null && newWard.WardObject.IsValid && !newWard.WardObject.IsDead)
                    {
                        timestamp = Variables.TickCount - (obj.MaxMana - obj.Mana) * 1000;

                        newWard.Timestamp = timestamp;

                        foreach (var ward in Wards)
                        {
                            if (ward.WardObject == null)
                            {
                                //Check for Process Spell wards
                                if (ward.Position.Distance(sender.Position) < 550
                                        && Math.Abs(ward.Timestamp - timestamp) < 2000)
                                {
                                    var ward1 = ward;
                                    DelayAction.Add(0, () => Wards.Remove(ward1));
                                    break;
                                }
                            }
                        }
                    }
                });

            }

            //FOW placement
            var missile = sender as MissileClient;

            if (missile != null && missile.SpellCaster.IsEnemy)
            {
                if (missile.SData.Name.ToLower() == "itemplacementmissile")// && !missile.SpellCaster.IsVisible)
                {
                    var dir = (missile.EndPosition.ToVector2() - missile.StartPosition.ToVector2()).LSNormalized();
                    var pos = missile.StartPosition.ToVector2() + dir * 500;

                    if (Wards.Any(ward => ward.Position.ToVector2().Distance(pos) < 750
                                          && Variables.TickCount - ward.Timestamp < 50))
                    {
                        return;
                    }

                    DelayAction.Add((float)100, () =>
                    {
                        if (Wards.Any(ward => ward.Position.ToVector2().Distance(pos) < 750
                                              && Variables.TickCount - ward.Timestamp < 125))
                        {
                            return;
                        }

                        var newWard = new WardTrackerInfo(
                            WardDatabase.MissileWardData,
                            pos.ToVector3(),
                            null,
                            true
                            )
                        {
                            StartPos = missile.StartPosition.ToVector2(),
                            EndPos = missile.EndPosition.ToVector2()
                        };

                        Wards.Add(newWard);
                    });
                }
            }
        }
示例#6
0
        private static void Game_OnProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            if (!Tracker.Menu["ward.tracker"]["enemy.ward"])
            {
                return;
            }

            if (hero.IsEnemy && hero is Obj_AI_Hero && hero.IsValid())
            {
                WardData wardData;
                if (WardDatabase.WardspellNames.TryGetValue(args.SData.Name.ToLower(), out wardData))
                {
                    var pos = args.End.ToVector2();

                    DelayAction.Add((float) 50, () =>
                    {
                        if (Wards.Any(ward => ward.Position.ToVector2().Distance(pos) < 50
                                              && Variables.TickCount - ward.Timestamp < 100))
                        {
                            return;
                        }

                        var newWard = new WardTrackerInfo(
                            wardData,
                            pos.ToVector3(),
                            null
                            )
                        {
                            StartPos = args.Start.ToVector2(),
                            EndPos = args.End.ToVector2()
                        };
                        Wards.Add(newWard);
                    });
                }
            }
        }