Example #1
0
        private void exportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (btnSave.Enabled)
            {
                ShowErrorMessage("Game Object in Edit Mode. Save data and try again");
                return;
            }

            BotDataSet.GameObjectsRow row = GetCurrentRow();
            GameObject obj = DataManager.CurWoWVersion.GameObjData[row.NAME];

            if (obj == null)
            {
                ShowErrorMessage("Game Object not found. Restart Bot and try again");
                return;
            }

            string res = DataManager.ExportGameObj(obj, null);

            if (res != null)
            {
                ShowInfoMessage("Game Object successfully exported to file '" + res +
                                "'.\nDon't forget submit updated data (if any) to " +
                                "BabBot forum https://sourceforge.net/apps/phpbb/babbot/");
            }
        }
Example #2
0
        private void bsFKGameObjectsNpcServices_ListChanged(object sender, ListChangedEventArgs e)
        {
            // Set filter on available services
            BotDataSet.GameObjectsRow current = GetCurrentRow();
            DataRowView srv = (DataRowView)fkGameObjectsNpcServices.Current;

            bsServiceTypesFiltered.Filter = "";

            if (srv == null)
            {
                bsServiceTypesFiltered.RemoveFilter();
            }
            else
            {
                DataRow[] cur_srv = DataManager.
                                    GameData.NpcServices.Select("GID=" + current.ID);

                if (cur_srv.Length > 0)
                {
                    string filter = "ID NOT IN (" + cur_srv[0]["SERVICE_ID"];
                    for (int i = 1; i < cur_srv.Length; i++)
                    {
                        filter += "," + cur_srv[i]["SERVICE_ID"];
                    }
                    bsServiceTypesFiltered.Filter = filter + ")";
                }
            }
        }
Example #3
0
        /// <summary>
        /// Change state of current GameObject Row to modified
        /// </summary>
        /// <param name="row">Current GameObject row</param>
        private void SetCurrentRowModified()
        {
            BotDataSet.GameObjectsRow row = GetCurrentRow();

            if (row.RowState == DataRowState.Unchanged)
            {
                row.SetModified();
            }
        }
Example #4
0
        private void AddGameObjCoord(string zone, double x, double y, double z, int type)
        {
            BotDataSet.GameObjectsRow cur_row = GetCurrentRow();

            // Check if new coord not too close
            DataRow[] crows = new DataRow[0];

            DataRow[] zrows = DataManager.GameData.CoordinatesZone.Select("GID=" + cur_row.ID);
            foreach (BotDataSet.CoordinatesZoneRow zrow in zrows)
            {
                DataRow[] coords  = DataManager.GameData.Coordinates.Select("ZONE_ID=" + zrow.ID);
                int       old_idx = crows.Length;
                Array.Resize <DataRow>(ref crows, crows.Length + coords.Length);
                coords.CopyTo(crows, old_idx);
            }

            foreach (BotDataSet.CoordinatesRow row in crows)
            {
                if (Math.Sqrt(Math.Pow((double)(row.X - x), 2) +
                              Math.Pow((double)(row.Y - y), 2) +
                              Math.Pow((double)(row.Z - z), 2)) < 5)
                {
                    ShowErrorMessage("New coordinates located in less than 5 yards with [" +
                                     row.COORD + "]");
                    return;
                }
            }

            // Check if zone exists
            object   zx   = cbCoordZone.Items;
            DataView view = ((DataRowView)fKGameObjectsCoordinatesZone.Current).DataView;

            DataRowView[] rows = view.FindRows(zone);

            BotDataSet.CoordinatesZoneRow zone_row = null;
            if (rows.Length == 0)
            {
                zone_row = DataManager.GameData.CoordinatesZone.
                           AddCoordinatesZoneRow(GetCurrentRow(), zone);
            }
            else
            {
                zone_row = (BotDataSet.CoordinatesZoneRow)rows[0].Row;
            }

            DataManager.GameData.Coordinates.AddCoordinatesRow(zone_row, x, y, z, type);

            // Select last row
            lbCoordinates.SelectedIndex = lbCoordinates.Items.Count - 1;

            IsChanged = true;
        }
Example #5
0
        private void gameObjectsBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            BotDataSet.GameObjectsRow row = GetCurrentRow();
            if (row == null)
            {
                return;
            }

            cbPlayerTarget.SelectedIndex = row.TYPE_ID;

            // Clear description
            tbDescr.Text = "";
        }
Example #6
0
        private void recordRouteFromNPCToolStripMenuItem_Click(object sender, EventArgs e)
        {
            object obj = bsGameObjects.Current;
            object q   = fkGameObjectsQuestList.Current;
            object qi  = fKQuestListQuestItemsObjectives.Current;

            if ((obj == null) || (q == null) || (qi == null))
            {
                return;
            }

            BotDataSet.GameObjectsRow obj_row = (BotDataSet.GameObjectsRow)
                                                    ((DataRowView)obj).Row;

            BotDataSet.QuestListRow q_row = (BotDataSet.QuestListRow)
                                                ((DataRowView)q).Row;

            BotDataSet.QuestItemsRow qi_row = (BotDataSet.QuestItemsRow)
                                                  ((DataRowView)qi).Row;

            Program.mainForm.OpenRouteRecording(obj_row.NAME, q_row.TITLE, qi_row.NAME);
        }
Example #7
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if ((tbDescr.Enabled) && tbDescr.Text.Equals(""))
            {
                ShowErrorMessage("Description is required for selected service\n" +
                                 "i.e class name for class_trainer and so on");
                return;
            }

            DataRowView srv_row = (DataRowView)bsServiceTypesFiltered.Current;

            if (srv_row == null)
            {
                return;
            }

            BotDataSet.ServiceTypesRow srow    = (BotDataSet.ServiceTypesRow)srv_row.Row;
            BotDataSet.GameObjectsRow  cur_row = GetCurrentRow();

            DataManager.GameData.NpcServices.AddNpcServicesRow(cur_row, srow, srow.NAME, tbDescr.Text);

            IsChanged = true;
        }