private static void Obj_AI_Base_OnTeleport(Obj_AI_Base sender, GameObjectTeleportEventArgs args) { var packet = Packet.S2C.Teleport.Decoded(sender, args); var lastPosition = LastPositions.FirstOrDefault(e => e.Hero.NetworkId == packet.UnitNetworkId); if (lastPosition != null) { switch (packet.Status) { case Packet.S2C.Teleport.Status.Start: lastPosition.IsTeleporting = true; break; case Packet.S2C.Teleport.Status.Abort: lastPosition.IsTeleporting = false; break; case Packet.S2C.Teleport.Status.Finish: lastPosition.Teleported = true; lastPosition.IsTeleporting = false; lastPosition.LastSeen = Game.Time; break; } } }
private static void Game_OnGameLoad(EventArgs args) { config = new Menu("RandomUlt Beta VH", "RandomUlt Beta", true); Menu RandomUltM = new Menu("Cài đặt", "Options"); positions = new LastPositions(RandomUltM); config.AddSubMenu(RandomUltM); config.AddItem(new MenuItem("RandomUlt ", "Việt Hóa By MaddMonkeyy")); config.AddToMainMenu(); Notifications.AddNotification(new Notification("Source by Soresu", 3000, true).SetTextColor(Color.Peru)); }
private static void Game_OnGameLoad(EventArgs args) { config = new Menu("RandomUlt Beta", "RandomUlt Beta", true); Menu RandomUltM = new Menu("Options", "Options"); positions = new LastPositions(RandomUltM); config.AddSubMenu(RandomUltM); config.AddItem(new MenuItem("RandomUlt ", "by Soresu")); config.AddToMainMenu(); Notifications.AddNotification(new Notification("RandomUlt by Soresu", 3000, true).SetTextColor(Color.Peru)); }
public void SetLastPosition(string gumpID, Point position) { if (LastPositions.ContainsKey(gumpID)) { LastPositions[gumpID] = position; } else { LastPositions.Add(gumpID, position); } }
public Point GetLastPosition(string gumpID, Point defaultPosition) { Point value; if (LastPositions.TryGetValue(gumpID, out value)) { return(value); } else { return(defaultPosition); } }
public static void Load() { var spawn = ObjectManager.Get <Obj_SpawnPoint>().Where(s => s.IsEnemy).FirstOrDefault(); SpawnPoint = spawn != null ? spawn.Position : Vector3.Zero; foreach (var enemy in HeroManager.Enemies) { var eStruct = new LastPositionStruct(enemy) { LastPosition = SpawnPoint }; LastPositions.Add(eStruct); } Obj_AI_Base.OnTeleport += Obj_AI_Base_OnTeleport; Game.OnUpdate += Game_OnUpdate; }
public async void addToLastPositions(Position p) { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () => { // Remember 3 last positions and throw away first added item if (LastPositions.Count >= 4) { LastPositions.RemoveAt(0); } // Add the next position LastPositions.Add(p); // Set size relative to order moved in for (int counter = 1; counter < LastPositions.Count; counter++) { LastPositions[counter].Size = 25 - (5 * counter); } Changed("LastPositions"); }); }
public static List <LastPositionStruct> GetLastPositionsInRange(Obj_AI_Base unit, float range, float time) { return(LastPositions.Where(lp => lp.LastPosition.Distance(unit.Position) < range && !lp.Hero.IsDead && Game.Time - lp.LastSeen < time).ToList()); }
public static List <LastPositionStruct> GetLastPositionsInRange(Vector3 pos, float range, float time) { return(LastPositions.Where(lp => lp.LastPosition.Distance(pos) < range && !lp.Hero.IsDead && Game.Time - lp.LastSeen < time).ToList()); }
private static void Game_OnGameLoad(EventArgs args) { positions = new LastPositions(); }
public static void Game_OnGameLoad() { config = MainMenu.AddMenu("随机大招", "RandomUlt Beta"); RandomUltM = config.AddSubMenu("Options", "Options"); positions = new LastPositions(RandomUltM); }
public static void Game_OnGameLoad() { config = MainMenu.AddMenu("RandomUlt Beta", "RandomUlt Beta"); RandomUltM = config.AddSubMenu("Options", "Options"); positions = new LastPositions(RandomUltM); }