Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();


            if (textBox2.Text == "")
            {
                MessageBox.Show("Text should not be empty", "Error");
                return;
            }


            MySqlConnection connection  = new MySqlConnection("datasource=" + mainmenu.textbox_mysql_hostname.Text + ";port=" + mainmenu.textbox_mysql_port.Text + ";username="******";password="******"REPLACE INTO " + mainmenu.textbox_mysql_worldDB.Text + ".creature_text " +
                                          "(entry, text, type, probability, language) " +
                                          "VALUES (" +
                                          textBox61.Text + ", '" + // entry
                                          textBox2.Text + "', " +  // text
                                          textBox4.Text + ", " +   // type
                                          textBox10.Text + ", " +  // probability
                                          textBox1.Text + ");" +   // language

                                          "REPLACE INTO " + mainmenu.textbox_mysql_worldDB.Text + ".smart_scripts " +
                                          "(entryorguid, event_type, action_type, event_chance, event_param1, event_param2, event_param3, event_param4) " +
                                          "VALUES (" +
                                          textBox61.Text + ", " + // entryorguid
                                          textBox20.Text + ", " + // event_type
                                          textBox16.Text + ", " + // action_type
                                          textBox23.Text + ", " + // event_chance
                                          textBox11.Text + ", " + // event_param1
                                          textBox5.Text + ", " +  // event_param2
                                          textBox18.Text + ", " + // event_param3
                                          textBox17.Text + ");"   // event_param4
            ;

            connection.Open();
            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            // Test
            try
            {
                if (command.ExecuteNonQuery() == 1)
                {
                    label9.Visible = true;
                }
                else
                {
                    label9.Visible = true;
                    //MessageBox.Show("Data Not Inserted");
                    //label2.ForeColor = Color.Red;
                    //label2.Text = "Eroare!";
                    //MessageBox.Show("Unable to connect to any of the specified MySQL hosts.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            connection.Close();
        }
Ejemplo n.º 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();

            try
            {
                string           myConnection  = "datasource=" + mainmenu.textbox_mysql_hostname.Text + ";port=" + mainmenu.textbox_mysql_port.Text + ";username="******";password="******"select * from auth.account;");
                MySqlCommandBuilder cb = new MySqlCommandBuilder(myDataAdapter);
                myConn.Open();
                DataSet ds = new DataSet();

                label_mysql_status2.Text      = "Connected!";
                label_mysql_status2.ForeColor = Color.LawnGreen;

                myConn.Close();
            }
            catch (Exception /*ex*/)
            {
                //MessageBox.Show(ex.Message);
                label_mysql_status2.Text      = "Connection Lost - MySQL is not running";
                label_mysql_status2.ForeColor = Color.Red;
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();


            if (textBox2.Text == "")
            {
                MessageBox.Show("Text should not be empty", "Error");
                return;
            }


            MySqlConnection connection = new MySqlConnection(
                "datasource=" + form_MM.GetHost() + ";" +
                "port=" + form_MM.GetPort() + ";" +
                "username="******";" +
                "password="******";"
                );

            string insertQuery = $"INSERT INTO { form_MM.GetWorldDB() }.creature_text " +
                                 "(entry, text, type, probability, language) " + Environment.NewLine +
                                 "VALUES (" +
                                 textBox61.Text + ", '" +                      // entry
                                 textBox2.Text + "', " +                       // text
                                 textBox4.Text + ", " +                        // type
                                 textBox10.Text + ", " +                       // probability
                                 textBox1.Text + "); " + Environment.NewLine + // language

                                 $"INSERT INTO { form_MM.GetWorldDB() }.smart_scripts " +
                                 "(entryorguid, event_type, action_type, event_chance, event_param1, event_param2, event_param3, event_param4) " + Environment.NewLine +
                                 "VALUES (" +
                                 textBox61.Text + ", " +                       // entryorguid
                                 textBox20.Text + ", " +                       // event_type
                                 textBox16.Text + ", " +                       // action_type
                                 textBox23.Text + ", " +                       // event_chance
                                 textBox11.Text + ", " +                       // event_param1
                                 textBox5.Text + ", " +                        // event_param2
                                 textBox18.Text + ", " +                       // event_param3
                                 textBox17.Text + "); " + Environment.NewLine; // event_param4


            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            try
            {
                connection.Open();
                command.ExecuteNonQuery();
                label9.Visible = true;
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("ERROR: " + ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                connection.Close();
            }
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();


            if (textBox65.Text == "")
            {
                MessageBox.Show("Item ID should not be empty", "Error");
                return;
            }
            if (textBox65.Text == "0")
            {
                MessageBox.Show("Item ID should not be 0", "Error");
                return;
            }

            MySqlConnection connection  = new MySqlConnection("datasource=" + mainmenu.textbox_mysql_hostname.Text + ";port=" + mainmenu.textbox_mysql_port.Text + ";username="******";password="******"INSERT INTO " + mainmenu.textbox_mysql_worldDB.Text + ".creature_loot_template " +
                                          "(Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount, Comment) " +
                                          "VALUES (" +
                                          textBox61.Text + ", " + // Entry
                                          textBox65.Text + ", " + // ItemID
                                          textBox1.Text + ", " +  // Reference
                                          textBox2.Text + ", " +  // Chance
                                          textBox4.Text + ", " +  // QuestRequired
                                          textBox3.Text + ", " +  // LootMode
                                          textBox8.Text + ", " +  // GroupId
                                          textBox7.Text + ", " +  // MinCount
                                          textBox6.Text + ", " +  // MaxCount
                                          "'" + textBox5.Text +   // Comment
                                          "');";

            connection.Open();
            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            // Test
            try
            {
                if (command.ExecuteNonQuery() == 1)
                {
                    label9.Visible = true;
                }
                else
                {
                    label9.Visible = true;
                    //MessageBox.Show("Data Not Inserted");
                    //label2.ForeColor = Color.Red;
                    //label2.Text = "Eroare!";
                    //MessageBox.Show("Unable to connect to any of the specified MySQL hosts.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            connection.Close();
        }
Ejemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();


            if (textBox65.Text == "")
            {
                MessageBox.Show("Item ID should not be empty", "Error");
                return;
            }
            if (textBox65.Text == "0")
            {
                MessageBox.Show("Item ID should not be 0", "Error");
                return;
            }

            MySqlConnection connection = new MySqlConnection(
                "datasource=" + form_MM.GetHost() +
                ";port=" + form_MM.GetPort() +
                ";username="******";password="******"INSERT INTO { form_MM.GetWorldDB() }.creature_loot_template " +
                                 "(Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount, Comment) \n" +
                                 "VALUES (" +
                                 textBox61.Text + ", " + // Entry
                                 textBox65.Text + ", " + // ItemID
                                 textBox1.Text + ", " +  // Reference
                                 textBox2.Text + ", " +  // Chance
                                 textBox4.Text + ", " +  // QuestRequired
                                 textBox3.Text + ", " +  // LootMode
                                 textBox8.Text + ", " +  // GroupId
                                 textBox7.Text + ", " +  // MinCount
                                 textBox6.Text + ", " +  // MaxCount
                                 "'" + textBox5.Text +   // Comment
                                 "');";


            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            // Test
            try
            {
                connection.Open();
                command.ExecuteNonQuery();
                label9.Visible = true;
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("ERROR: " + ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                connection.Close();
            }
        }
Ejemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();
            var           npc      = new NPC_Creator();

            if (textBox5.Text == "")
            {
                MessageBox.Show("Option Text should not be empty", "Error");
                return;
            }

            MySqlConnection connection = new MySqlConnection(
                "datasource=" + form_MM.GetHost() + ";" +
                "port=" + form_MM.GetPort() + ";" +
                "username="******";" +
                "password="******"INSERT INTO " + form_MM.GetWorldDB() + ".gossip_menu_option " +
                                 "(menu_id, id, option_icon, option_text, OptionBroadcastTextID, option_id, npc_option_npcflag, " +
                                 "action_menu_id, action_poi_id, box_coded, box_money, box_text, BoxBroadcastTextID, VerifiedBuild) \n" +
                                 "VALUES (" +
                                 textBox61.Text + ", " +            // menu_id
                                 numericUpDown1.Text + ", " +       // id
                                 textBox_option_icon.Text + ", '" + // option_icon
                                 textBox5.Text + "', " +            // option_text
                                 textBox4.Text + ", " +             // OptionBroadcastTextID
                                 textBox_option_id.Text + ", " +    // option_id
                                 textBox7.Text + ", " +             // npc_option_npcflag
                                 textBox6.Text + ", " +             // action_menu_id
                                 textBox3.Text + ", " +             // action_poi_id
                                 textBox2.Text + ", " +             // box_coded
                                 textBox10.Text + ", '" +           // box_money
                                 textBox9.Text + "', " +            // box_text
                                 textBox11.Text + ", " +            // BoxBroadcastTextID
                                 textBox12.Text + ");";             // VerifiedBuild


            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            try
            {
                connection.Open();
                command.ExecuteNonQuery();
                label9.Visible = true;
            }
            catch (MySqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                connection.Close();
            }
        }
Ejemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();


            if (textBox1.Text == "")
            {
                MessageBox.Show("Item ID should not be empty", "Error");
                return;
            }
            if (textBox1.Text == "0")
            {
                MessageBox.Show("Item ID should not be 0", "Error");
                return;
            }

            MySqlConnection connection  = new MySqlConnection("datasource=" + mainmenu.textbox_mysql_hostname.Text + ";port=" + mainmenu.textbox_mysql_port.Text + ";username="******";password="******"INSERT INTO " + mainmenu.textbox_mysql_worldDB.Text + ".npc_vendor " +
                                          "(entry, slot, item, maxcount, incrtime, ExtendedCost, VerifiedBuild) " +
                                          "VALUES (" +
                                          textBox61.Text + ", " + // entry
                                          textBox65.Text + ", " + // slot
                                          textBox1.Text + ", " +  // item
                                          textBox2.Text + ", " +  // maxcount
                                          textBox4.Text + ", " +  // incrtime
                                          textBox3.Text + ", " +  // ExtendedCost
                                          textBox5.Text +         // VerifiedBuild
                                          ");";

            connection.Open();
            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            // Test
            try
            {
                if (command.ExecuteNonQuery() == 1)
                {
                    label9.Visible = true;
                }
                else
                {
                    label9.Visible = true;
                    //MessageBox.Show("Data Not Inserted");
                    //label2.ForeColor = Color.Red;
                    //label2.Text = "Eroare!";
                    //MessageBox.Show("Unable to connect to any of the specified MySQL hosts.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            connection.Close();
        }
Ejemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();


            if (textBox1.Text == "")
            {
                MessageBox.Show("Item ID should not be empty", "Error");
                return;
            }
            if (textBox1.Text == "0")
            {
                MessageBox.Show("Item ID should not be 0", "Error");
                return;
            }

            MySqlConnection connection = new MySqlConnection(
                $"datasource={ form_MM.GetHost() };" +
                $"port={ form_MM.GetPort() };" +
                $"username={ form_MM.GetUser() };" +
                $"password={ form_MM.GetPass() };"
                );
            string insertQuery = $"INSERT INTO { form_MM.GetWorldDB() }.npc_vendor " +
                                 "(entry, slot, item, maxcount, incrtime, ExtendedCost, VerifiedBuild) " + Environment.NewLine +
                                 "VALUES (" +
                                 textBox61.Text + ", " + // entry
                                 textBox65.Text + ", " + // slot
                                 textBox1.Text + ", " +  // item
                                 textBox2.Text + ", " +  // maxcount
                                 textBox4.Text + ", " +  // incrtime
                                 textBox3.Text + ", " +  // ExtendedCost
                                 textBox5.Text +         // VerifiedBuild
                                 "); ";


            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            try
            {
                connection.Open();
                command.ExecuteNonQuery();
                label9.Visible = true;
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("ERROR: " + ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                connection.Close();
            }
        }
Ejemplo n.º 9
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();


            if (textBox1.Text == "")
            {
                MessageBox.Show("Item ID should not be empty", "Error");
                return;
            }
            if (textBox1.Text == "0")
            {
                MessageBox.Show("Item ID should not be 0", "Error");
                return;
            }

            MySqlConnection connection = new MySqlConnection(
                "datasource=" + form_MM.GetHost() + ";" +
                "port=" + form_MM.GetPort() + ";" +
                "username="******";" +
                "password="******";"
                );
            string insertQuery = "INSERT INTO " + form_MM.GetWorldDB() + ".npc_vendor " +
                                 "(entry, slot, item, maxcount, incrtime, ExtendedCost, VerifiedBuild) \n" +
                                 "VALUES (" +
                                 textBox61.Text + ", " + // entry
                                 textBox65.Text + ", " + // slot
                                 textBox1.Text + ", " +  // item
                                 textBox2.Text + ", " +  // maxcount
                                 textBox4.Text + ", " +  // incrtime
                                 textBox3.Text + ", " +  // ExtendedCost
                                 textBox5.Text +         // VerifiedBuild
                                 ");";

            connection.Open();
            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            try
            {
                if (command.ExecuteNonQuery() == 1)
                {
                    label9.Visible = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            connection.Close();
        }
Ejemplo n.º 10
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();


            if (textBox5.Text == "")
            {
                MessageBox.Show("Option Text should not be empty", "Error");
                return;
            }

            MySqlConnection connection  = new MySqlConnection("datasource=" + mainmenu.textbox_mysql_hostname.Text + ";port=" + mainmenu.textbox_mysql_port.Text + ";username="******";password="******"INSERT INTO " + mainmenu.textbox_mysql_worldDB.Text + ".gossip_menu_option " +
                                          "(menu_id, id, option_icon, option_text, OptionBroadcastTextID, option_id, npc_option_npcflag, action_menu_id, action_poi_id, box_coded, box_money, box_text, BoxBroadcastTextID, VerifiedBuild) " +
                                          "VALUES (" +
                                          textBox61.Text + ", " +            // menu_id
                                          numericUpDown1.Text + ", " +       // id
                                          textBox_option_icon.Text + ", '" + // option_icon
                                          textBox5.Text + "', " +            // option_text
                                          textBox4.Text + ", " +             // OptionBroadcastTextID
                                          textBox_option_id.Text + ", " +    // option_id
                                          textBox7.Text + ", " +             // npc_option_npcflag
                                          textBox6.Text + ", " +             // action_menu_id
                                          textBox3.Text + ", " +             // action_poi_id
                                          textBox2.Text + ", " +             // box_coded
                                          textBox10.Text + ", '" +           // box_money
                                          textBox9.Text + "', " +            // box_text
                                          textBox11.Text + ", " +            // BoxBroadcastTextID
                                          textBox12.Text + ");";             // VerifiedBuild

            connection.Open();
            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            try
            {
                if (command.ExecuteNonQuery() == 1)
                {
                    label9.Visible = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            connection.Close();
        }
Ejemplo n.º 11
0
        private void button_execute_query_Click(object sender, EventArgs e)
        {
            Form_ItemCreator frm = new Form_ItemCreator();

            if (frm.textBox1.Text == "")
            {
                MessageBox.Show("Entry column should not be empty", "Error");
                return;
            }

            //Clipboard.SetText(Form_ItemCreator.stringSQLShare);
            Form_MainMenu   mainmenu    = new Form_MainMenu();
            MySqlConnection connection  = new MySqlConnection("datasource=" + mainmenu.textbox_mysql_hostname.Text + ";port=" + mainmenu.textbox_mysql_port.Text + ";username="******";password="******"Data Not Inserted");
                    //label2.ForeColor = Color.Red;
                    //label2.Text = "Eroare!";
                    //MessageBox.Show("Unable to connect to any of the specified MySQL hosts.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            connection.Close();
        }
Ejemplo n.º 12
0
        private void button_execute_query_Click(object sender, EventArgs e)
        {
            Form_ItemCreator frm = new Form_ItemCreator();

            if (frm.NUD_item_Entry.Text == "")
            {
                MessageBox.Show("Entry column should not be empty", "Error");
                return;
            }

            //Clipboard.SetText(Form_ItemCreator.stringSQLShare);
            Form_MainMenu   mainmenu   = new Form_MainMenu();
            MySqlConnection connection = new MySqlConnection(
                "datasource=" + form_MM.GetHost() + ";" +
                "port=" + form_MM.GetPort() + ";" +
                "username="******";" +
                "password="******";"
                );
            string insertQuery = Form_ItemCreator.stringSQLShare;

            connection.Open();
            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            // Test
            try
            {
                //frm.label_query_executed_successfully.Visible = true;
                if (command.ExecuteNonQuery() == 1)
                {
                    // this.Close();
                    //frm.label83.ForeColor = Color.GreenYellow;
                    label_query_executed_successfully.Visible = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            connection.Close();
        }
Ejemplo n.º 13
0
 public ControlPanel(Form_MainMenu form_MainMenu)
 {
     InitializeComponent();
     form_MM = form_MainMenu;
 }
Ejemplo n.º 14
0
 public GenerateLoot(Form_MainMenu form_MainMenu)
 {
     InitializeComponent();
     form_MM = form_MainMenu;
 }
Ejemplo n.º 15
0
 public Spawn_NPC(Form_MainMenu form_MainMenu)
 {
     InitializeComponent();
     form_MM = form_MainMenu;
 }
Ejemplo n.º 16
0
 public AddGossipMenus(Form_MainMenu _form_MainMenu)
 {
     InitializeComponent();
     form_MM = _form_MainMenu;
 }
Ejemplo n.º 17
0
 public BackToMainMenu(Form_MainMenu form_MainMenu)
 {
     InitializeComponent();
     form_MM = form_MainMenu;
 }
Ejemplo n.º 18
0
        private void BackToMainMenu_Load(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();

            label_version.Text = mainmenu.version;

            //try
            //{
            //    string myConnection = "datasource=" + mainmenu.textbox_mysql_hostname.Text + ";port=" + mainmenu.textbox_mysql_port.Text + ";username="******";password="******"Connected!";
            //    form_itemCreator.label_mysql_status2.ForeColor = Color.LawnGreen;
            //    label_mysql_status.Text = "Connected!";
            //    label_mysql_status.ForeColor = Color.LawnGreen;

            //    mainmenu.textbox_mysql_username.Visible = true;
            //    mainmenu.textbox_mysql_pass.Visible = true;
            //mainmenu.tabControl1.Visible = false;
            if (form_MM.CB_NoMySQL.Checked)
            {
                //Start without mysql con
                label_mysql_status.Visible = false;
                label85.Visible            = false;
                timer1.Start();
                timer2.Stop();
            }
            else
            {
                label_mysql_status.Visible = true;
                label85.Visible            = true;
                timer1.Stop();
                timer2.Start();
            }

            //    myConn.Close();
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message);
            //}
        }
Ejemplo n.º 19
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();


            if (textBox1.Text == "")
            {
                MessageBox.Show("Mount Model ID should not be empty", "Error");
                return;
            }
            if (textBox65.Text == "")
            {
                MessageBox.Show("Path ID should not be empty", "Error");
                return;
            }
            if (textBox2.Text == "")
            {
                MessageBox.Show("Bytes1 should not be empty", "Error");
                return;
            }
            if (textBox4.Text == "")
            {
                MessageBox.Show("Bytes2 should not be empty", "Error");
                return;
            }

            MySqlConnection connection  = new MySqlConnection("datasource=" + mainmenu.textbox_mysql_hostname.Text + ";port=" + mainmenu.textbox_mysql_port.Text + ";username="******";password="******"REPLACE INTO " + mainmenu.textbox_mysql_worldDB.Text + ".creature_template_addon " +
                                          "(entry, path_id, mount, bytes1, bytes2, emote, auras) " +
                                          "VALUES (" +
                                          textBox61.Text + ", " + // entry
                                          textBox65.Text + ", " + // path_id
                                          textBox1.Text + ", " +  // mount
                                          textBox2.Text + ", " +  // bytes1
                                          textBox4.Text + ", " +  // bytes2
                                          textBox3.Text + ", '" + // emote
                                          textBox5.Text +         // auras
                                          "');";

            connection.Open();
            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            // Test
            try
            {
                if (command.ExecuteNonQuery() == 1)
                {
                    label9.Visible = true;
                }
                else
                {
                    label9.Visible = true;
                    //MessageBox.Show("Data Not Inserted");
                    //label2.ForeColor = Color.Red;
                    //label2.Text = "Eroare!";
                    //MessageBox.Show("Unable to connect to any of the specified MySQL hosts.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            connection.Close();
        }
Ejemplo n.º 20
0
 public MakeNpcSay(Form_MainMenu _form_MainMenu)
 {
     InitializeComponent();
     form_MM = _form_MainMenu;
 }
Ejemplo n.º 21
0
 public AccountCreator(Form_MainMenu form_MainMenu)
 {
     InitializeComponent();
     form_MM = form_MainMenu;
 }
Ejemplo n.º 22
0
 public Disable_Form(Form_MainMenu form_MainMenu)
 {
     InitializeComponent();
     form_MM = form_MainMenu;
 }
Ejemplo n.º 23
0
 public MountNPC(Form_MainMenu _form_MainMenu)
 {
     InitializeComponent();
     form_MM = _form_MainMenu;
 }
Ejemplo n.º 24
0
 public QuestTemplate(Form_MainMenu form_MainMenu)
 {
     InitializeComponent();
     form_MM = form_MainMenu;
 }
Ejemplo n.º 25
0
        private void label83_Click(object sender, EventArgs e)
        {
            uint flags_dis_spell_st = 0;
            uint flags_dis_map_st   = 0;
            uint flags_dis_vmap_st  = 0;

            string[] checkedIndicies1 = Properties.Settings.Default.FlagsDisableSpell.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            for (int i1 = 0; i1 < checkedIndicies1.Length; i1++)
            {
                int idx;
                if ((int.TryParse(checkedIndicies1[i1], out idx)))
                {
                    switch (idx)
                    {
                    case 0:     // Spell enabled
                        flags_dis_spell_st += 0;
                        break;

                    case 1:     // Spell disabled for players
                        flags_dis_spell_st += 1;
                        break;

                    case 2:     // Spell disabled for creatures
                        flags_dis_spell_st += 2;
                        break;

                    case 3:     // Spell disabled for pets
                        flags_dis_spell_st += 4;
                        break;

                    case 4:     // Spell completely disabled (used for no logner existing spells in DBCs)
                        flags_dis_spell_st += 8;
                        break;

                    case 5:     // Spell disabled for MapId
                        flags_dis_spell_st += 16;
                        break;

                    case 6:     // Spell disabled for AreaId
                        flags_dis_spell_st += 32;
                        break;

                    case 7:     // Line of Sight (LOS) is disabled for this spell (replaces "vmap.ignoreSpellIds" config option)
                        flags_dis_spell_st += 64;
                        break;
                    }
                }
            }

            string[] checkedIndicies2 = Properties.Settings.Default.FlagsDisableMap.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            for (int i1 = 0; i1 < checkedIndicies2.Length; i1++)
            {
                int idx;
                if ((int.TryParse(checkedIndicies2[i1], out idx)))
                {
                    switch (idx)
                    {
                    case 0:     // DUNGEON_STATUSFLAG_NORMAL OR RAID_STATUSFLAG_10MAN_NORMAL
                        flags_dis_map_st += 1;
                        break;

                    case 1:     // DUNGEON_STATUSFLAG_HEROIC OR RAID_STATUSFLAG_25MAN_NORMAL
                        flags_dis_map_st += 2;
                        break;

                    case 2:     // RAID_STATUSFLAG_10MAN_HEROIC
                        flags_dis_map_st += 4;
                        break;

                    case 3:     // RAID_STATUSFLAG_25MAN_HEROIC
                        flags_dis_map_st += 8;
                        break;
                    }
                }
            }

            string[] checkedIndicies3 = Properties.Settings.Default.FlagsDisableVmap.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            for (int i1 = 0; i1 < checkedIndicies3.Length; i1++)
            {
                int idx;
                if ((int.TryParse(checkedIndicies3[i1], out idx)))
                {
                    switch (idx)
                    {
                    case 0:     // VMAP_DISABLE_AREAFLAG
                        flags_dis_vmap_st += 1;
                        break;

                    case 1:     // VMAP_DISABLE_HEIGHT
                        flags_dis_vmap_st += 2;
                        break;

                    case 2:     // VMAP_DISABLE_LOS
                        flags_dis_vmap_st += 4;
                        break;

                    case 3:     // VMAP_LIQUIDSTATUS
                        flags_dis_vmap_st += 8;
                        break;
                    }
                }
            }

            Form_MainMenu mainmenu = new Form_MainMenu();
            // Prepare SQL
            // select insertion columns
            string BuildSQLFile;

            BuildSQLFile  = "INSERT INTO " + mainmenu.textbox_mysql_worldDB.Text + ".disables ";
            BuildSQLFile += "(sourceType, entry, flags, params_0, params_1, comment)";

            //Values
            BuildSQLFile += "VALUES\n ";
            BuildSQLFile += "(";

            if (textBox_SourceType.Text == "1" /*DISABLE_TYPE_QUEST*/)
            {
                BuildSQLFile += "1, " + textBox_entry.Text + ", 0" + ", ";
            }
            else if (textBox_SourceType.Text == "3" /*DISABLE_TYPE_BATTLEGROUND*/)
            {
                BuildSQLFile += "3, " + textBox_entry.Text + ", 0" + ", ";
            }
            else if (textBox_SourceType.Text == "4" /*DISABLE_TYPE_ACHIEVEMENT_CRITERIA*/)
            {
                BuildSQLFile += "4, " + textBox_entry.Text + ", 0" + ", ";
            }
            else if (textBox_SourceType.Text == "5" /*DISABLE_TYPE_OUTDOORPVP*/)
            {
                BuildSQLFile += "5, " + textBox_entry.Text + ", 0" + ", ";
            }
            else if (textBox_SourceType.Text == "7" /*DISABLE_TYPE_MMAP*/)
            {
                BuildSQLFile += "7, " + textBox_entry.Text + ", 0" + ", ";
            }
            else if (textBox_SourceType.Text == "8" /*DISABLE_TYPE_LFG_MAP*/)
            {
                BuildSQLFile += "8, " + textBox_entry.Text + ", 0" + ", ";
            }

            else
            {
                BuildSQLFile += textBox_SourceType.Text + ", " + textBox_entry.Text + ", "; // sourceType
            }

            //BuildSQLFile += textBox_entry.Text + ", "; // entry

            if (button_flags_dis_spell.Visible == true)
            {
                BuildSQLFile += flags_dis_spell_st + ", ";                                         // flags_disable_spell
            }
            else if (button_flags_dis_map.Visible == true)
            {
                BuildSQLFile += flags_dis_map_st + ", ";                                            // flags_disable_map
            }
            else if (button_flags_dis_vmap.Visible == true)
            {
                BuildSQLFile += flags_dis_vmap_st + ", ";         // flags_disable_vmap
            }
            BuildSQLFile += "'" + textBox_params_0.Text + "', '"; // params_0
            BuildSQLFile += textBox_params_1.Text + "', '";       // params_1
            BuildSQLFile += textBox_comment.Text + "');";         // comment

            stringSQLShare   = BuildSQLFile;
            stringEntryShare = textBox_entry.Text;

            if (textBox_entry.Text == "0")
            {
                MessageBox.Show("Entry should not be 0", "Error");
                return;
            }
            else if (textBox_entry.Text == "")
            {
                MessageBox.Show("Entry should not be empty", "Error");
                return;
            }

            using (var sfd = new SaveFileDialog())
            {
                sfd.Filter      = "sql files (*.sql)|*.sql";
                sfd.FilterIndex = 2;
                sfd.FileName    = "Disable_" + stringEntryShare;

                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    File.WriteAllText(sfd.FileName, stringSQLShare);
                    label88.Visible = true;
                }
            }
        }
Ejemplo n.º 26
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_MainMenu mainmenu = new Form_MainMenu();


            if (textBox1.Text == "")
            {
                MessageBox.Show("Mount Model ID should not be empty", "Error");
                return;
            }
            if (textBox65.Text == "")
            {
                MessageBox.Show("Path ID should not be empty", "Error");
                return;
            }
            if (textBox2.Text == "")
            {
                MessageBox.Show("Bytes1 should not be empty", "Error");
                return;
            }
            if (textBox4.Text == "")
            {
                MessageBox.Show("Bytes2 should not be empty", "Error");
                return;
            }

            MySqlConnection connection = new MySqlConnection(
                "datasource=" + form_MM.GetHost() + ";" +
                "port=" + form_MM.GetPort() + ";" +
                "username="******";" +
                "password="******";"
                );

            string insertQuery = "INSERT INTO " + form_MM.GetWorldDB() + ".creature_template_addon " +
                                 "(entry, path_id, mount, bytes1, bytes2, emote, auras) " +
                                 "VALUES (" +
                                 textBox61.Text + ", " + // entry
                                 textBox65.Text + ", " + // path_id
                                 textBox1.Text + ", " +  // mount
                                 textBox2.Text + ", " +  // bytes1
                                 textBox4.Text + ", " +  // bytes2
                                 textBox3.Text + ", '" + // emote
                                 textBox5.Text +         // auras
                                 "');";


            MySqlCommand command = new MySqlCommand(insertQuery, connection);

            try
            {
                connection.Open();
                command.ExecuteNonQuery();
                label9.Visible = true;
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("ERROR: " + ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                connection.Close();
            }
        }
Ejemplo n.º 27
0
 public AddVendorItems(Form_MainMenu form_MainMenu)
 {
     InitializeComponent();
     form_MM = form_MainMenu;
 }
Ejemplo n.º 28
0
        private void GenerateSql()
        {
            uint flags_dis_spell_st = 0;
            uint flags_dis_map_st   = 0;
            uint flags_dis_vmap_st  = 0;

            string[] checkedIndicies1 = Properties.Settings.Default.FlagsDisableSpell.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            for (int i1 = 0; i1 < checkedIndicies1.Length; i1++)
            {
                int idx;
                if ((int.TryParse(checkedIndicies1[i1], out idx)))
                {
                    switch (idx)
                    {
                    case 0:     // Spell enabled
                        flags_dis_spell_st += 0;
                        break;

                    case 1:     // Spell disabled for players
                        flags_dis_spell_st += 1;
                        break;

                    case 2:     // Spell disabled for creatures
                        flags_dis_spell_st += 2;
                        break;

                    case 3:     // Spell disabled for pets
                        flags_dis_spell_st += 4;
                        break;

                    case 4:     // Spell completely disabled (used for no logner existing spells in DBCs)
                        flags_dis_spell_st += 8;
                        break;

                    case 5:     // Spell disabled for MapId
                        flags_dis_spell_st += 16;
                        break;

                    case 6:     // Spell disabled for AreaId
                        flags_dis_spell_st += 32;
                        break;

                    case 7:     // Line of Sight (LOS) is disabled for this spell (replaces "vmap.ignoreSpellIds" config option)
                        flags_dis_spell_st += 64;
                        break;
                    }
                }
            }

            string[] checkedIndicies2 = Properties.Settings.Default.FlagsDisableMap.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            for (int i1 = 0; i1 < checkedIndicies2.Length; i1++)
            {
                int idx;
                if ((int.TryParse(checkedIndicies2[i1], out idx)))
                {
                    switch (idx)
                    {
                    case 0:     // DUNGEON_STATUSFLAG_NORMAL OR RAID_STATUSFLAG_10MAN_NORMAL
                        flags_dis_map_st += 1;
                        break;

                    case 1:     // DUNGEON_STATUSFLAG_HEROIC OR RAID_STATUSFLAG_25MAN_NORMAL
                        flags_dis_map_st += 2;
                        break;

                    case 2:     // RAID_STATUSFLAG_10MAN_HEROIC
                        flags_dis_map_st += 4;
                        break;

                    case 3:     // RAID_STATUSFLAG_25MAN_HEROIC
                        flags_dis_map_st += 8;
                        break;
                    }
                }
            }

            string[] checkedIndicies3 = Properties.Settings.Default.FlagsDisableVmap.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            for (int i1 = 0; i1 < checkedIndicies3.Length; i1++)
            {
                int idx;
                if ((int.TryParse(checkedIndicies3[i1], out idx)))
                {
                    switch (idx)
                    {
                    case 0:     // VMAP_DISABLE_AREAFLAG
                        flags_dis_vmap_st += 1;
                        break;

                    case 1:     // VMAP_DISABLE_HEIGHT
                        flags_dis_vmap_st += 2;
                        break;

                    case 2:     // VMAP_DISABLE_LOS
                        flags_dis_vmap_st += 4;
                        break;

                    case 3:     // VMAP_LIQUIDSTATUS
                        flags_dis_vmap_st += 8;
                        break;
                    }
                }
            }

            Form_MainMenu mainmenu = new Form_MainMenu();
            // Prepare SQL
            // select insertion columns
            string BuildSQLFile;

            BuildSQLFile  = "INSERT INTO " + form_MM.GetWorldDB() + ".disables ";
            BuildSQLFile += "(sourceType, entry, flags, params_0, params_1, comment) ";

            //Values
            BuildSQLFile += "VALUES " + Environment.NewLine;
            BuildSQLFile += "(";

            if (textBox_SourceType.Text == "1" /*DISABLE_TYPE_QUEST*/)
            {
                BuildSQLFile += "1, " + textBox_entry.Text + ", 0" + ", ";
            }
            else if (textBox_SourceType.Text == "3" /*DISABLE_TYPE_BATTLEGROUND*/)
            {
                BuildSQLFile += "3, " + textBox_entry.Text + ", 0" + ", ";
            }
            else if (textBox_SourceType.Text == "4" /*DISABLE_TYPE_ACHIEVEMENT_CRITERIA*/)
            {
                BuildSQLFile += "4, " + textBox_entry.Text + ", 0" + ", ";
            }
            else if (textBox_SourceType.Text == "5" /*DISABLE_TYPE_OUTDOORPVP*/)
            {
                BuildSQLFile += "5, " + textBox_entry.Text + ", 0" + ", ";
            }
            else if (textBox_SourceType.Text == "7" /*DISABLE_TYPE_MMAP*/)
            {
                BuildSQLFile += "7, " + textBox_entry.Text + ", 0" + ", ";
            }
            else if (textBox_SourceType.Text == "8" /*DISABLE_TYPE_LFG_MAP*/)
            {
                BuildSQLFile += "8, " + textBox_entry.Text + ", 0" + ", ";
            }

            else
            {
                BuildSQLFile += textBox_SourceType.Text + ", " + textBox_entry.Text + ", "; // sourceType
            }

            //BuildSQLFile += textBox_entry.Text + ", "; // entry

            if (button_flags_dis_spell.Visible == true)
            {
                BuildSQLFile += flags_dis_spell_st + ", ";                                         // flags_disable_spell
            }
            else if (button_flags_dis_map.Visible == true)
            {
                BuildSQLFile += flags_dis_map_st + ", ";                                            // flags_disable_map
            }
            else if (button_flags_dis_vmap.Visible == true)
            {
                BuildSQLFile += flags_dis_vmap_st + ", ";         // flags_disable_vmap
            }
            BuildSQLFile += "'" + textBox_params_0.Text + "', '"; // params_0
            BuildSQLFile += textBox_params_1.Text + "', '";       // params_1
            BuildSQLFile += textBox_comment.Text + "'); ";        // comment

            stringSQLShare   = BuildSQLFile;
            stringEntryShare = textBox_entry.Text;
        }
Ejemplo n.º 29
0
 public SaveOptionsDialog(Form_MainMenu form_MainMenu)
 {
     InitializeComponent();
     form_MM = form_MainMenu;
 }