private void DBCEditor_Load(object sender, EventArgs e) { try { DBCStores.InitFiles(); DBCStores.LoadUsersEditorFiles(); } catch (InvalidSignatureException exception) { MessageBox.Show("Invalid DBC Signature: " + "found '" + exception.Message + "' expected '" + DBCStores.Signature + "'."); Close(); } catch (FileNotFoundException exception) { MessageBox.Show("DBC file not found: " + exception.Message); Close(); } ListBox_Users.Items.Clear(); foreach (var user in DBCStores.Users.Records) { ListBox_Users.Items.Add(user); } ListBox_Users.SelectedIndex = 0; }
private void Button_Save_Click(object sender, EventArgs e) { try { DBCStores.SaveUsersEditorFiles(); } catch (Exception exception) { MessageBox.Show(exception.Message); return; } MessageBox.Show("Success!", "Succesfully saved to the DBC File."); }
public Form1() { InitializeComponent(); //Initialise maps and dbc Detour.Initialize(Settings.Default.mmaps); Map.Initialize(Settings.Default.maps); VMap.Initialize(Settings.Default.vmaps); DBCStores.Initialize(Settings.Default.dbc); DrawArea = new Bitmap(260, 260); //pictureBox_maps.Image = DrawArea; timer_ScanInfo.Interval = 100; }
public override void Start() { base.Start(); // Anti-kick for being afk ScheduleAction(() => DoTextEmote(TextEmote.Yawn), DateTime.Now.AddMinutes(5), new TimeSpan(0, 5, 0)); ScheduleAction(() => { if (LoggedIn) { SendPacket(new OutPacket(WorldCommand.CMSG_KEEP_ALIVE)); } }, DateTime.Now.AddSeconds(15), new TimeSpan(0, 0, 30)); #region Begger if (Behavior.Begger) { PushStrategicAI(new BeggerAI()); } #endregion #region FollowGroupLeader if (Behavior.FollowGroupLeader) { PushStrategicAI(new FollowGroupLeaderAI()); } #endregion #region Explorer if (Behavior.Explorer) { AchievementExploreLocation targetLocation = null; List <AchievementExploreLocation> missingLocations = null; Position currentPosition = new Position(); ScheduleAction(() => { if (!Player.IsAlive) { return; } if (targetLocation != null) { if (!HasExploreCriteria(targetLocation.CriteriaID) && (currentPosition - Player).Length > MovementEpsilon) { currentPosition = Player.GetPosition(); return; } targetLocation = null; } currentPosition = Player.GetPosition(); if (missingLocations == null) { missingLocations = DBCStores.GetAchievementExploreLocations(Player.X, Player.Y, Player.Z, Player.MapID); } missingLocations = missingLocations.Where(loc => !HasExploreCriteria(loc.CriteriaID)).ToList(); if (missingLocations.Count == 0) { CancelActionsByFlag(ActionFlag.Movement); return; } float closestDistance = float.MaxValue; var playerPosition = new Point(Player.X, Player.Y, Player.Z); foreach (var missingLoc in missingLocations) { float distance = (missingLoc.Location - playerPosition).Length; if (distance < closestDistance) { closestDistance = distance; targetLocation = missingLoc; } } MoveTo(new Position(targetLocation.Location.X, targetLocation.Location.Y, targetLocation.Location.Z, 0f, Player.MapID)); }, DateTime.Now.AddSeconds(30), new TimeSpan(0, 0, 5)); } #endregion }