Пример #1
0
 private void toDBToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (customlistBoxtexts.SelectedIndex != -1)
     {
         SQLCommonExecutes.SaveAllItemsToDB(localized_texts.map);
     }
     else
     {
         MessageBox.Show("There are no scripts selected in the list.");
     }
 }
Пример #2
0
 // Save NPC to DB
 private void databaseToolStripMenuItem_Click(object sender, EventArgs e)
 {
     menuStrip1.Focus();
     if (bIsCreature)
     {
         SQLCommonExecutes.SaveOneItemTODB(creatures.npcList[this.id]);
     }
     else
     {
         SQLCommonExecutes.SaveAllItemsToDB(db_scripts.scriptList[this.id]);
     }
 }
Пример #3
0
 private void toDBToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     menuStrip1.Focus();
     if (customlistBoxsummons.SelectedIndex != -1)
     {
         SQLCommonExecutes.SaveOneItemTODB(summons.map[summon_id]);
     }
     else
     {
         MessageBox.Show("There are no scripts selected in the list.");
     }
 }
Пример #4
0
        private void button_execute_Click(object sender, EventArgs e)
        {
            if (textBox_query.Text.Trim() == "")
            {
                MessageBox.Show("Your query is empty!");
                return;
            }

            if (SQLCommonExecutes.ExecuteDBScript(textBox_query.Text))
            {
                MessageBox.Show("Script executed succesfully!");
            }
        }
Пример #5
0
        private void CompileCreatures_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("This will Save every Creature you touched to the DB and puts Official and your Content together. \n Continue?", "Attempt to Compile", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                if (SQLCommonExecutes.SaveAllItemsToDB(creatures.npcList))
                {
                    SQLConnection.DoNONREADSD2Query("TRUNCATE `eventai_scripts`", false);
                    SQLConnection.DoNONREADSD2Query("INSERT INTO `eventai_scripts` SELECT  * FROM `eventai_scripts_official`", false);

                    SQLCommonExecutes.CompileQuery(creatures.npcList);
                }
            }
        }
Пример #6
0
 private void removescriptnames_Click(object sender, EventArgs e)
 {
     foreach (Form item in MdiParent.MdiChildren)
     {
         if (item is NPCEditor)
         {
             (item as NPCEditor).Controls.Find("setInCreaturetemplateToolStripMenuItem", true)[0].Text = "Set scriptname";
         }
     }
     foreach (KeyValuePair <uint, creature> item in creatures.npcList)
     {
         SQLCommonExecutes.setScriptnameInCreature_template(item.Value.creature_id, true);
         item.Value.activectemplate = false;
     }
     foreach (KeyValuePair <uint, creature> item in creatures.npcList)
     {
         SQLCommonExecutes.setScriptnameInCreature_template(item.Value.creature_id, true);
         item.Value.activectemplate = false;
     }
 }
Пример #7
0
 // Set script name (for eventAI only)
 private void setInCreaturetemplateToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Datastores.dbused)
     {
         if (creatures.npcList[this.id].activectemplate)
         {
             if (SQLCommonExecutes.setScriptnameInCreature_template(this.id, true))
             {
                 creatures.npcList[this.id].activectemplate  = false;
                 setInCreaturetemplateToolStripMenuItem.Text = "Set scriptname";
             }
         }
         else
         {
             if (SQLCommonExecutes.setScriptnameInCreature_template(this.id, false))
             {
                 creatures.npcList[this.id].activectemplate  = true;
                 setInCreaturetemplateToolStripMenuItem.Text = "Remove scriptname";
             }
         }
     }
 }
Пример #8
0
 // Save all npcs to DB (only for eventAI)
 private void databaseToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     menuStrip1.Focus();
     SQLCommonExecutes.SaveAllItemsToDB(creatures.npcList);
 }