public static void TpTarget(EliteAPI api) { EliteAPI.TargetInfo t = api.Target.GetTargetInfo(); string targetName = t.TargetName; if (targetName.Length == 0) { Chat.SendEcho(api, "Target not selected."); return; } EliteAPI.XiEntity e = api.Entity.GetEntity((int)t.TargetIndex); Structs.WarpPoint wp = new Structs.WarpPoint(); Structs.Position p = new Structs.Position(); p.X = e.X; p.Y = e.Z; p.Z = e.Y; wp.pos = p; wp.zone = api.Player.ZoneId; Chat.SendEcho(api, "Approaching " + targetName + "."); Player.Warp(api, wp); }
private void Victory() { var rndX = new Random(); var rndY = new Random(); this.Level++; this.Player.Direction = Settings.PlayerSettings.Direction; this.Player.Position = Settings.PlayerSettings.Position; this.Player.Board.Exit = new BaseFlag { Position = new Structs.Position { X = rndX.Next(1, this.Player.Board.Width - 1), Y = rndY.Next(1, this.Player.Board.Height - 1) } }; this.Player.Board.Enemies.Clear(); for (var i = 1; i <= this.Level + 2; i++) { var pos = new Structs.Position { X = rndX.Next(1, this.Player.Board.Width - 1) }; while (pos.Equals(this.Player.Board.Exit.Position)) { pos = new Structs.Position { X = rndX.Next(1, this.Player.Board.Width - 1), Y = rndY.Next(1, this.Player.Board.Height - 1) }; } var enemy = new BaseEnemy { Position = pos }; this.Player.Board.Enemies.Add(enemy); } sound.Play(this.Settings.SoundSettings.VictoryFileName); }