Пример #1
0
 public void DelItem(string Entry)
 {
     DialogResult result = MessageBox.Show("确认删除Entry为【" + Entry + "】的物品吗?\r\n注意:此操作是不可逆的!物品将永久删除。", "删除物品", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
     if (result == DialogResult.Yes)
     {
         StateForm sf = new StateForm();
         Thread Del = new Thread(new ParameterizedThreadStart(sf.DBCMD));
         Del.Start(GetDelSql(Entry));
         sf.ShowDialog();
     }
 }
Пример #2
0
        public void GetItemInfo(string Entry)
        {
            StateForm sf = new StateForm();
                Thread EditAdp = new Thread(new ParameterizedThreadStart(sf.DBAdapter));
                EditAdp.Start("select * from item_template where entry = '" + Entry + "';");
                sf.ShowDialog();
                if (ItemInfo.Stat)
                {
                    AllowableClassList.Text = ItemInfo.AllowableClass;
                    AllowableRaceList.Text = ItemInfo.AllowableRace;
                    Ammo_TypeList.Text = ItemInfo.Ammo_Type;
                    arcane_resTextBox.Text = ItemInfo.Arcane_Res;
                    AreaList.Text = ItemInfo.Area;
                    armorTextBox.Text = ItemInfo.Armor;
                    ArmorDamageModifierTextBox.Text = ItemInfo.ArmorDamageModifier;
                    BagFamilyTextBox.Text = ItemInfo.BagFamily;
                    blockTextBox.Text = ItemInfo.Block;
                    BondingList.Text = ItemInfo.Bonding;
                    BuyCountTextBox.Text = ItemInfo.BuyCount;
                    BuyPriceTextBox.Text = ItemInfo.BuyPrice;
                    ItemClassList.Text = ItemInfo.Class;
                    ContainerSlotsTextBox.Text = ItemInfo.ContainerSlots;
                    delayTextBox.Text = ItemInfo.Delay;
                    RTB_Description.ColorText = ItemInfo.Description;
                    DisenchantIDTextBox.Text = ItemInfo.DisenchantID;
                    DisplayIDList.Text = ItemInfo.DisplayID;
                    dmg_max1TextBox.Text = ItemInfo.Dmg_Max1;
                    dmg_max2TextBox.Text = ItemInfo.Dmg_Max2;
                    dmg_min1TextBox.Text = ItemInfo.Dmg_Min1;
                    dmg_min2TextBox.Text = ItemInfo.Dmg_Min2;
                    dmg_type1List.Text = ItemInfo.Dmg_Type1;
                    dmg_type2List.Text = ItemInfo.Dmg_Type2;
                    DurationTextBox.Text = ItemInfo.Duration;
                    EntryTextBox.Text = ItemInfo.Entry;
                    fire_resTextBox.Text = ItemInfo.Fire_Res;
                    FlagsList.Text = ItemInfo.Flags;
                    FoodTypeTextBox.Text = ItemInfo.FoodType;
                    frost_resTextBox.Text = ItemInfo.Frost_Res;
                    GemPropertiesTextBox.Text = ItemInfo.GemProperties;
                    holy_resTextBox.Text = ItemInfo.Holy_Res;
                    InventoryTypeList.Text = ItemInfo.InventoryType;
                    ItemLevelTextBox.Text = ItemInfo.ItemLevel;
                    ItemLimitCategoryTextBox.Text = ItemInfo.ItemLimitCategory;
                    ItemSetTextBox.Text = ItemInfo.ItemSet;
                    LanguageIDTextBox.Text = ItemInfo.LanguageID;
                    LockIdTextBox.Text = ItemInfo.LockID;
                    MapList.Text = ItemInfo.Map;
                    MaterialList.Text = ItemInfo.Material;
                    maxcountTextBox.Text = ItemInfo.MaxCount;
                    MaxDurabilityTextBox.Text = ItemInfo.MaxDurability;
                    MaxMoneyLootTextBox.Text = ItemInfo.MaxMoneyLoot;
                    MinMoneyLootTextBox.Text = ItemInfo.MinMoneyLoot;
                    RTB_ItemName.ColorText = ItemInfo.Name;
                    nature_resTextBox.Text = ItemInfo.Nature_Res;
                    PageMeterialTextBox.Text = ItemInfo.PageMeterial;
                    PageTextTextBox.Text = ItemInfo.PageText;
                    QualityList.Text = ItemInfo.Quality;
                    RandomPropertyList.Text = ItemInfo.RandomProperty;
                    RandomSuffixList.Text = ItemInfo.RandomSuffix;
                    RangedModRangeTextBox.Text = ItemInfo.RangedModRange;
                    RequiredCityRankTextBox.Text = ItemInfo.RequiredCityRank;
                    RequiredDisenchantSkillTextBox.Text = ItemInfo.RequiredDisenchantSkill;
                    RequiredHonnorRankTextBox.Text = ItemInfo.RequiredHonnorRank;
                    RequiredLevelTextBox.Text = ItemInfo.RequiredLevel;
                    RequiredReputationFactionTextBox.Text = ItemInfo.RequiredReputationFaction;
                    RequiredReputationRankTextBox.Text = ItemInfo.RequiredReputationRank;
                    RequiredSkillTextBox.Text = ItemInfo.RequiredSkill;
                    RequiredSkillRankTextBox.Text = ItemInfo.RequiredSkillRank;
                    RequiredSpellTextBox.Text = ItemInfo.RequiredSpell;
                    ScalingStatDistributionTextBox.Text = ItemInfo.ScalingStatDistribution;
                    ScalingStatValueTextBox.Text = ItemInfo.ScalingStatValue;
                    ScriptNameTextBox.Text = ItemInfo.ScriptName;
                    SellPriceTextBox.Text = ItemInfo.SellPrice;
                    shadow_resTextBox.Text = ItemInfo.Shadow_Res;
                    SheathList.Text = ItemInfo.Sheath;
                    SocketBonusList.Text = ItemInfo.SocketBonus;
                    SocketColor_1List.Text = ItemInfo.SocketColor_1;
                    SocketColor_2List.Text = ItemInfo.SocketColor_2;
                    SocketColor_3List.Text = ItemInfo.SocketColor_3;
                    SocketContent_1TextBox.Text = ItemInfo.SocketContent_1;
                    SocketContent_2TextBox.Text = ItemInfo.SocketContent_2;
                    SocketContent_3TextBox.Text = ItemInfo.SocketContent_3;
                    SpellCategory_1TextBox.Text = ItemInfo.SpellCategory_1;
                    SpellCategory_2TextBox.Text = ItemInfo.SpellCategory_2;
                    SpellCategory_3TextBox.Text = ItemInfo.SpellCategory_3;
                    SpellCategory_4TextBox.Text = ItemInfo.SpellCategory_4;
                    SpellCategory_5TextBox.Text = ItemInfo.SpellCategory_5;
                    SpellCategoryCooldown_1TextBox.Text = ItemInfo.SpellCategoryCooldown_1;
                    SpellCategoryCooldown_2TextBox.Text = ItemInfo.SpellCategoryCooldown_2;
                    SpellCategoryCooldown_3TextBox.Text = ItemInfo.SpellCategoryCooldown_3;
                    SpellCategoryCooldown_4TextBox.Text = ItemInfo.SpellCategoryCooldown_4;
                    SpellCategoryCooldown_5TextBox.Text = ItemInfo.SpellCategoryCooldown_5;
                    SpellCharges_1TextBox.Text = ItemInfo.SpellCharges_1;
                    SpellCharges_2TextBox.Text = ItemInfo.SpellCharges_2;
                    SpellCharges_3TextBox.Text = ItemInfo.SpellCharges_3;
                    SpellCharges_4TextBox.Text = ItemInfo.SpellCharges_4;
                    SpellCharges_5TextBox.Text = ItemInfo.SpellCharges_5;
                    spellcooldown_1TextBox.Text = ItemInfo.SpellCooldown_1;
                    spellcooldown_2TextBox.Text = ItemInfo.SpellCooldown_2;
                    spellcooldown_3TextBox.Text = ItemInfo.SpellCooldown_3;
                    spellcooldown_4TextBox.Text = ItemInfo.SpellCooldown_4;
                    spellcooldown_5TextBox.Text = ItemInfo.SpellCooldown_5;
                    spellid_1List.Text = ItemInfo.SpellID_1;
                    spellid_2List.Text = ItemInfo.SpellID_2;
                    spellid_3List.Text = ItemInfo.SpellID_3;
                    spellid_4List.Text = ItemInfo.SpellID_4;
                    spellid_5List.Text = ItemInfo.SpellID_5;
                    SpellppmRate_1TextBox.Text = ItemInfo.SpellppmRate_1;
                    SpellppmRate_2TextBox.Text = ItemInfo.SpellppmRate_2;
                    SpellppmRate_3TextBox.Text = ItemInfo.SpellppmRate_3;
                    SpellppmRate_4TextBox.Text = ItemInfo.SpellppmRate_4;
                    SpellppmRate_5TextBox.Text = ItemInfo.SpellppmRate_5;
                    spelltrigger_1List.Text = ItemInfo.SpellTrigger_1;
                    spelltrigger_2List.Text = ItemInfo.SpellTrigger_2;
                    spelltrigger_3List.Text = ItemInfo.SpellTrigger_3;
                    spelltrigger_4List.Text = ItemInfo.SpellTrigger_4;
                    spelltrigger_5List.Text = ItemInfo.SpellTrigger_5;
                    StackAbleTextBox.Text = ItemInfo.StackAble;
                    StartQuestTextBox.Text = ItemInfo.StartQuest;
                    Stat_Type1List.Text = ItemInfo.Stat_Type1;
                    Stat_Type2List.Text = ItemInfo.Stat_Type2;
                    Stat_Type3List.Text = ItemInfo.Stat_Type3;
                    Stat_Type4List.Text = ItemInfo.Stat_Type4;
                    Stat_Type5List.Text = ItemInfo.Stat_Type5;
                    Stat_Type6List.Text = ItemInfo.Stat_Type6;
                    Stat_Type7List.Text = ItemInfo.Stat_Type7;
                    Stat_Type8List.Text = ItemInfo.Stat_Type8;
                    Stat_Type9List.Text = ItemInfo.Stat_Type9;
                    Stat_Type10List.Text = ItemInfo.Stat_Type10;
                    Stat_Value1TextBox.Text = ItemInfo.Stat_Value1;
                    Stat_Value2TextBox.Text = ItemInfo.Stat_Value2;
                    Stat_Value3TextBox.Text = ItemInfo.Stat_Value3;
                    Stat_Value4TextBox.Text = ItemInfo.Stat_Value4;
                    Stat_Value5TextBox.Text = ItemInfo.Stat_Value5;
                    Stat_Value6TextBox.Text = ItemInfo.Stat_Value6;
                    Stat_Value7TextBox.Text = ItemInfo.Stat_Value7;
                    Stat_Value8TextBox.Text = ItemInfo.Stat_Value8;
                    Stat_Value9TextBox.Text = ItemInfo.Stat_Value9;
                    Stat_Value10TextBox.Text = ItemInfo.Stat_Value10;
                    StatsCountList.Text = ItemInfo.StatsCount;
                    ItemSubClassList.Text = ItemInfo.SubClass;
                    TotemCategoryTextBox.Text = ItemInfo.TotemCategory;
                    unk0TextBox.Text = ItemInfo.Unk0;
                    if (ConnInfo.Dbstruct == "3.0.0-3.0.9")
                    {
                        dmg_max3TextBox.Text = ItemInfo.Dmg_Max3;
                        dmg_max4TextBox.Text = ItemInfo.Dmg_Max4;
                        dmg_max5TextBox.Text = ItemInfo.Dmg_Max5;
                        dmg_min3TextBox.Text = ItemInfo.Dmg_Min3;
                        dmg_min4TextBox.Text = ItemInfo.Dmg_Min4;
                        dmg_min5TextBox.Text = ItemInfo.Dmg_Min5;
                        dmg_type3List.Text = ItemInfo.Dmg_Type3;
                        dmg_type4List.Text = ItemInfo.Dmg_Type4;
                        dmg_type5List.Text = ItemInfo.Dmg_Type5;
                        label1.Text = "Faction(阵营):";
                    }
                    else if (ConnInfo.Dbstruct == "3.1.X")
                    {
                        label1.Text = "Faction(阵营):";
                    }
                    else if (ConnInfo.Dbstruct == "3.3.X")
                    {
                        HolidayIDTextBox.Text = ItemInfo.HolidayId;
                        label1.Text = "Faction(阵营):";
                    }
                    else if (ConnInfo.Dbstruct == "真爱XV")
                    {
                        HolidayIDTextBox.Text = ItemInfo.HolidayId;
                        label1.Text = "FlagsExtra:";
                    }
                    try
                    {
                        string SubClassNum = GetValue("[0-9]+", ItemClassList.Text);
                        Regex reg = new Regex("\r\n");
                        StreamReader subclassTXT = new StreamReader("Data\\subclass" + SubClassNum + ".txt");
                        string[] EveryLine = reg.Split(subclassTXT.ReadToEnd());
                        subclassTXT.Close();
                        ItemSubClassList.Items.Clear();
                        foreach (string Line in EveryLine)
                        {
                            ItemSubClassList.Items.Add(Line);
                        }
                    }
                    catch (Exception err)
                    {
                        MessageBox.Show(err.Message, "错误");
                        ItemSubClassList.DropDownStyle = ComboBoxStyle.DropDown;
                    }

                }
        }
Пример #3
0
 private void SaveItemInfoBtn_Click(object sender, EventArgs e)
 {
     if (ConnInfo.Stat)
     {
         DialogResult result = MessageBox.Show("确认编辑Entry为【" + EntryTextBox.Text + "】的物品吗?\r\n注意:此操作是不可逆的!原先的物品信息将被覆盖。", "保存物品信息", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
         if (result == DialogResult.Yes)
         {
             StateForm sf = new StateForm();
             Thread Edit = new Thread(new ParameterizedThreadStart(sf.DBCMD));
             Edit.Start(GetEditSql());
             sf.ShowDialog();
         }
     }
     else
     {
         MessageBox.Show("没有连接数据库!", "写入数据库");
     }
 }
Пример #4
0
 private void InsertBtn_Click(object sender, EventArgs e)
 {
     if (ConnInfo.Stat)
     {
         StateForm sf = new StateForm();
         Thread Del = new Thread(new ParameterizedThreadStart(sf.DBCMD));
         Del.Start(GetAddSql());
         sf.ShowDialog();
     }
     else
     {
         MessageBox.Show("没有连接数据库!", "写入数据库");
     }
 }