Esempio n. 1
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();
            }
        }
Esempio n. 2
0
        private void _bCreateGossip_Click(object sender, EventArgs e)
        {
            string creatureID = "";

            rtbGossipMenuOut.Clear();
            rtbGossipMenuOut.ForeColor = Color.Blue;

            GossipMenu gossip = new GossipMenu();

            gossip.Entry        = _tbGossipEntry.Text.ToInt32();
            gossip.TextID       = _GossipTextID.Text.ToInt32();
            gossip.cond_1       = _cbGossipCondtion_1.GetIntValue();
            gossip.cond_1_val_1 = _cbCondtion1Value_1.GetIntValue();
            gossip.cond_1_val_2 = _cbCondtion1Value_2.GetIntValue();
            gossip.cond_2       = _cbGossipCondtion_2.GetIntValue();
            gossip.cond_2_val_1 = _cbCondtion2Value_1.GetIntValue();
            gossip.cond_2_val_2 = _cbCondtion2Value_2.GetIntValue();


            if (_tbCreatureGossip.Text.Contains(","))
            {
                creatureID = "IN[" + _tbCreatureGossip.Text + "]";
            }
            else
            {
                creatureID = " = " + _tbCreatureGossip.Text;
            }

            StringBuilder sb = new StringBuilder();

            if (_tbCreatureGossip.Text.Length > 0)
            {
                sb.AppendFormatLine("UPDATE `creature_template` SET `gossip_menu_id`='{0}' WHERE `entry`{1};", gossip.Entry, creatureID);
            }

            sb.AppendFormatLine("DELETE FROM `gossip_menu` WHERE (`entry`='{0}') AND (`textid` = '{1}');", gossip.Entry, gossip.TextID);
            sb.AppendFormatLine("INSERT INTO `gossip_menu` VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}');",
                                gossip.Entry, gossip.TextID, gossip.cond_1, gossip.cond_1_val_1, gossip.cond_1_val_2, gossip.cond_2, gossip.cond_2_val_1, gossip.cond_2_val_2);

            rtbGossipMenuOut.Text      = sb.ToString();
            _bWriteFilesGossip.Enabled = true;
        }
Esempio n. 3
0
        private void _bCreateGossip_Click(object sender, EventArgs e)
        {
            string creatureID = "";
            rtbGossipMenuOut.Clear();
            rtbGossipMenuOut.ForeColor = Color.Blue;

            GossipMenu gossip = new GossipMenu();
            gossip.Entry = _tbGossipEntry.Text.ToInt32();
            gossip.TextID = _GossipTextID.Text.ToInt32();
            gossip.cond_1 = _cbGossipCondtion_1.GetIntValue();
            gossip.cond_1_val_1 = _cbCondtion1Value_1.GetIntValue();
            gossip.cond_1_val_2 = _cbCondtion1Value_2.GetIntValue();
            gossip.cond_2 = _cbGossipCondtion_2.GetIntValue();
            gossip.cond_2_val_1 = _cbCondtion2Value_1.GetIntValue();
            gossip.cond_2_val_2 = _cbCondtion2Value_2.GetIntValue();

            if (_tbCreatureGossip.Text.Contains(","))
                creatureID = "IN[" + _tbCreatureGossip.Text + "]";
            else
                creatureID = " = " + _tbCreatureGossip.Text;

            StringBuilder sb = new StringBuilder();
            if (_tbCreatureGossip.Text.Length > 0)
                sb.AppendFormatLine("UPDATE `creature_template` SET `gossip_menu_id`='{0}' WHERE `entry`{1};", gossip.Entry, creatureID);

            sb.AppendFormatLine("DELETE FROM `gossip_menu` WHERE (`entry`='{0}') AND (`textid` = '{1}');", gossip.Entry, gossip.TextID);
            sb.AppendFormatLine("INSERT INTO `gossip_menu` VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}');",
                gossip.Entry, gossip.TextID, gossip.cond_1, gossip.cond_1_val_1, gossip.cond_1_val_2, gossip.cond_2, gossip.cond_2_val_1, gossip.cond_2_val_2);

            rtbGossipMenuOut.Text = sb.ToString();
            _bWriteFilesGossip.Enabled = true;
        }