Exemplo n.º 1
0
        private void ShowForm(object sender, EventArgs e)
        {
            switch (_bType)
            {
            case BType.SPELL:
            {
                FormSearchSpell _form = new FormSearchSpell(ComboboxValue);
                _form.ShowDialog();
                if (_form.DialogResult == DialogResult.OK)
                {
                    _combobox.SetValue(_form.Spell.ID);
                }
                _form.Dispose();
            }
            break;

            case BType.FLAG:
            {
                FormCalculateFlags _form = new FormCalculateFlags(_type, ComboboxValue, String.Empty);
                _form.ShowDialog();
                if (_form.DialogResult == DialogResult.OK)
                {
                    _combobox.SetValue(_form.Flags);
                }
                _form.Dispose();
            }
            break;

            case BType.TEXT:
            {
                MySQLConnenct.SelectAIText();
                ParentForm._tPanel.SelectedIndex = 1;
            }
            break;

            case BType.SUMMON:
            {
                MySQLConnenct.SelectAIText();
                ParentForm._tPanel.SelectedIndex = 2;
            }
            break;

            default:
            {
                FormDbSearch _form = new FormDbSearch(_bType, ComboboxValue);
                _form.ShowDialog();
                if (_form.DialogResult == DialogResult.OK)
                {
                    _combobox.SetValue(_form.Value);
                }
                _form.Dispose();
            }
            break;
            }

            if (_comboboxAdditional != null)
            {
                _comboboxAdditional.SetValue(_additionalValue);
            }
        }
Exemplo n.º 2
0
        private void _lvGossip_menu_SelectedIndexChanged(object sender, EventArgs e)
        {
            _tbCreatureGossip.Clear();
            if (_lvGossip_menu.SelectedIndices.Count > 0)
            {
                GossipMenu GossipCreature = MySQLConnenct.GossipMenu[_lvGossip_menu.SelectedIndices[0]];
                MySQLConnenct.SelectGossipCrearture(GossipCreature.Entry, 0);

                if (MySQLConnenct.GossipMenuCreature.Count > 0)
                {
                    _lvGossip_Creature.Visible         = true;
                    _lblnpctext.Visible                = false;
                    _lvGossip_Creature.VirtualListSize = MySQLConnenct.GossipMenuCreature.Count;
                    _lvGossip_Creature.Refresh();
                    StringBuilder sb = new StringBuilder();

                    for (int i = 0; i < _lvGossip_Creature.VirtualListSize; i++)
                    {
                        if (i > -1)
                        {
                            if (i != (_lvGossip_Creature.VirtualListSize))
                            {
                                sb.Append(",");
                                sb.Append(_lvGossip_Creature.Items[i].Text);
                            }
                            else
                            {
                                sb.Append(_lvGossip_Creature.Items[i].Text);
                            }
                        }
                    }
                    sb.Remove(0, 1);
                    _tbCreatureGossip.Text = sb.ToString();
                }
                else
                {
                    _lvGossip_Creature.Visible = false;
                    _lblnpctext.Visible        = true;
                }


                _tbGossipEntry.Text = GossipCreature.Entry.ToString();
                _GossipTextID.Text  = GossipCreature.TextID.ToString();
                _cbGossipCondtion_1.SelectedValue = GossipCreature.cond_1;
                _cbCondtion1Value_1.SetValue(GossipCreature.cond_1_val_1);
                _cbCondtion1Value_2.SetValue(GossipCreature.cond_1_val_2);
                _cbGossipCondtion_2.SelectedValue = GossipCreature.cond_2;
                _cbCondtion2Value_1.SetValue(GossipCreature.cond_2_val_1);
                _cbCondtion2Value_2.SetValue(GossipCreature.cond_2_val_2);

                MySQLConnenct.SelectNpcText(GossipCreature.TextID);
                _lvNpc_text.VirtualListSize = MySQLConnenct.npc_text.Count;
                _lvNpc_text.Refresh();
            }
        }
Exemplo n.º 3
0
 private void _bFilterMenuOption_Click(object sender, EventArgs e)
 {
     if (_rbGossipMenuOption.Checked)
     {
         if (_tbfilterGossipMenu.Text.Length > 0)
         {
             MySQLConnenct.SelectGossipOption(_tbfilterGossipMenu.Text.ToInt32());
         }
         else
         {
             MySQLConnenct.SelectGossipOption(0);
         }
         _lvGossip_Option.VirtualListSize = MySQLConnenct.GossipMenuOption.Count;
         _lvGossip_Option.Refresh();
     }
 }
Exemplo n.º 4
0
 private void _bGossipSearch_Click(object sender, EventArgs e)
 {
     if (_rbTextID.Checked)
     {
         if (_tbFilterGossip.Text.Length > 0)
         {
             MySQLConnenct.SelectNpcText(_tbFilterGossip.Text.ToInt32());
         }
         else
         {
             MySQLConnenct.SelectNpcText(0);
         }
         _lvNpc_text.VirtualListSize = MySQLConnenct.npc_text.Count;
         _lvNpc_text.Refresh();
     }
     else if (_rbGossip.Checked)
     {
         if (_tbFilterGossip.Text.Length > 0)
         {
             MySQLConnenct.SelectGossip(_tbFilterGossip.Text.ToInt32());
         }
         else
         {
             MySQLConnenct.SelectGossip(0);
         }
         _lvGossip_menu.VirtualListSize = MySQLConnenct.GossipMenu.Count;
         _lvGossip_menu.Refresh();
     }
     else
     {
         if (_tbFilterGossip.Text.Length > 0)
         {
             MySQLConnenct.SelectGossipCrearture(0, _tbFilterGossip.Text.ToInt32());
         }
         else
         {
             MySQLConnenct.SelectGossipCrearture(0, 0);
         }
         _lvGossip_Creature.VirtualListSize = MySQLConnenct.GossipMenuCreature.Count;
         _lvGossip_Creature.Refresh();
     }
 }
Exemplo n.º 5
0
        private void CreateQuery()
        {
            int id       = _tbFilterNum.GetIntValue();
            int creature = _tbFilterCreat.GetIntValue();
            int etype    = _cbFilteEventType.GetIntValue();
            int atype    = _cbFilteActionType.GetIntValue();

            string fquery = "SELECT * FROM `creature_ai_scripts` WHERE ";
            string squery = "";

            squery += (id > 0) ? String.Format("id = {0} || ", id) : "";
            squery += (creature > 0) ? String.Format("creature_id = {0} || ", creature) : "";
            squery += (etype > -1) ? String.Format("event_type = {0} || ", etype) : "";
            squery += (atype > -1) ? String.Format("action1_type = {0} || action2_type = {0} || action3_type = {0} || ", atype) : "";

            string q = (squery.Length == 0) ? fquery.Remove(fquery.Length - 6) : fquery + squery.Remove(squery.Length - 3);

            MySQLConnenct.SelectAIScript(q);
            _lvScripts.VirtualListSize = MySQLConnenct.AIScript.Count;
        }
Exemplo n.º 6
0
        public static void FillColumnsFromDatabase(this ListView lv, string sTable)
        {
            lv.Columns.Clear();
            lv.View = View.Details;

            StringCollection fldCol = new StringCollection();

            fldCol = MySQLConnenct.GetColumns(sTable);

            if (fldCol == null)
            {
                return;
            }

            foreach (string Column in fldCol)
            {
                ColumnHeader ch = new ColumnHeader();
                ch.Text = Column;
                lv.Columns.Add(ch);
            }
        }
Exemplo n.º 7
0
 private void button5_Click(object sender, EventArgs e)
 {
     using (StreamWriter sw = new StreamWriter("log.sql", true, Encoding.UTF8))
         sw.WriteLine(rtbTextOut.Text);
     MySQLConnenct.Insert(rtbTextOut.Text);
 }
Exemplo n.º 8
0
 private void _bSummonSearch_Click(object sender, EventArgs e)
 {
     MySQLConnenct.SelectAISummon();
     _lvSummon.VirtualListSize = MySQLConnenct.AISummon.Count;
 }
Exemplo n.º 9
0
 private void _bTextSearch_Click(object sender, EventArgs e)
 {
     MySQLConnenct.SelectAIText();
     _lvText.VirtualListSize = MySQLConnenct.AIText.Count;
 }
Exemplo n.º 10
0
 private void bNpcTextRecord_Click(object sender, EventArgs e)
 {
     using (StreamWriter sw = new StreamWriter("NEW_NPC_TEXT_SQL.sql", true, Encoding.UTF8))
         sw.WriteLine(_gpText.Text);
     MySQLConnenct.Insert(_gpText.Text);
 }
Exemplo n.º 11
0
 private void _bFilterNpcText_Click(object sender, EventArgs e)
 {
     MySQLConnenct.SelectNpcText(_tbFilterNpcText.Text.ToInt32());
     _lvNpcText.VirtualListSize = MySQLConnenct.npc_text.Count;
     _lvNpcText.Refresh();
 }
Exemplo n.º 12
0
 private void _bGossipOptionRecord_Click(object sender, EventArgs e)
 {
     using (StreamWriter sw = new StreamWriter("NEW_GOSSIP_SQL.sql", true, Encoding.UTF8))
         sw.WriteLine(rtbGossipOptionMenuOut.Text);
     MySQLConnenct.Insert(rtbGossipOptionMenuOut.Text);
 }
Exemplo n.º 13
0
 private void _bWriteSummon_Click(object sender, EventArgs e)
 {
     using (StreamWriter sw = new StreamWriter("NEW_EVENTAI_SQL.sql", true, Encoding.UTF8))
         sw.WriteLine(_rtbSummon.Text);
     MySQLConnenct.Insert(_rtbSummon.Text);
 }
Exemplo n.º 14
0
 private void WriteFiles_Click(object sender, EventArgs e)
 {
     using (StreamWriter sw = new StreamWriter("NEW_EVENTAI_SQL.sql", true, Encoding.UTF8))
         sw.WriteLine(rtbScriptOut.Text);
     MySQLConnenct.Insert(rtbScriptOut.Text);
 }