using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.SqlClient; namespace Item_Creator { class Item { public static void Create(string ItemKey, int CharacterNumber, int Slot, int StorageType, int ItemID) { using (SqlConnection SQLConnection = new SqlConnection(Main.SQLInformation)) { SQLConnection.Open(); SqlCommand ExecuteCommand = new SqlCommand("INSERT INTO tItem (nItemKey, nStorageType, nOwner, nStorage, nItemID, nFlags) VALUES (@ItemKey, @StorageType, @Owner, @Slot, @ItemID, @Flags)", SQLConnection); ExecuteCommand.Parameters.AddWithValue("@ItemKey", ItemKey); ExecuteCommand.Parameters.AddWithValue("@StorageType", StorageType); ExecuteCommand.Parameters.AddWithValue("@Owner", CharacterNumber); ExecuteCommand.Parameters.AddWithValue("@Slot", Slot); ExecuteCommand.Parameters.AddWithValue("@ItemID", ItemID); ExecuteCommand.Parameters.AddWithValue("@Flags", 0); ExecuteCommand.ExecuteNonQuery(); } } public static void InsertArmorStats(string ItemKey, int UpEffect, int STR, int END, int DEX, int INT, int SPR) { SQL.InsertDataValue(ItemKey, 800, UpEffect); SQL.InsertDataValue(ItemKey, 801, 0); SQL.InsertDataValue(ItemKey, 802, 0); SQL.InsertDataValue(ItemKey, 803, 11); SQL.InsertDataValue(ItemKey, 804, 0); SQL.InsertDataValue(ItemKey, 805, STR); SQL.InsertDataValue(ItemKey, 806, 1); SQL.InsertDataValue(ItemKey, 807, END); SQL.InsertDataValue(ItemKey, 808, 2); SQL.InsertDataValue(ItemKey, 809, DEX); SQL.InsertDataValue(ItemKey, 810, 3); SQL.InsertDataValue(ItemKey, 811, INT); SQL.InsertDataValue(ItemKey, 812, 4); SQL.InsertDataValue(ItemKey, 813, SPR); SQL.InsertDataValue(ItemKey, 820, 0); SQL.InsertDataValue(ItemKey, 821, 0); } public static void InsertAmountValue(string ItemKey, int Amount) { SQL.InsertDataValue(ItemKey, 1, Amount); } public static void InsertJewelStats(string ItemKey, int UpEffect, int STR, int END, int DEX, int INT, int SPR) { SQL.InsertDataValue(ItemKey, 400, 11); SQL.InsertDataValue(ItemKey, 401, 0); SQL.InsertDataValue(ItemKey, 402, STR); SQL.InsertDataValue(ItemKey, 403, 1); SQL.InsertDataValue(ItemKey, 404, END); SQL.InsertDataValue(ItemKey, 405, 2); SQL.InsertDataValue(ItemKey, 406, DEX); SQL.InsertDataValue(ItemKey, 407, 3); SQL.InsertDataValue(ItemKey, 408, INT); SQL.InsertDataValue(ItemKey, 409, 4); SQL.InsertDataValue(ItemKey, 410, SPR); SQL.InsertDataValue(ItemKey, 417, 0); SQL.InsertDataValue(ItemKey, 418, UpEffect); SQL.InsertDataValue(ItemKey, 419, 0); SQL.InsertDataValue(ItemKey, 420, 0); SQL.InsertDataValue(ItemKey, 421, 0); SQL.InsertDataValue(ItemKey, 422, 0); SQL.InsertDataValue(ItemKey, 423, 0); SQL.InsertDataValue(ItemKey, 424, 0); SQL.InsertDataValue(ItemKey, 425, 0); } public static void InsertShieldStats(string ItemKey, int UpEffect, int STR, int END, int DEX, int INT, int SPR) { SQL.InsertDataValue(ItemKey, 700, UpEffect); SQL.InsertDataValue(ItemKey, 701, 0); SQL.InsertDataValue(ItemKey, 702, 0); SQL.InsertDataValue(ItemKey, 703, 11); SQL.InsertDataValue(ItemKey, 704, 0); SQL.InsertDataValue(ItemKey, 705, STR); SQL.InsertDataValue(ItemKey, 706, 1); SQL.InsertDataValue(ItemKey, 707, END); SQL.InsertDataValue(ItemKey, 708, 2); SQL.InsertDataValue(ItemKey, 709, DEX); SQL.InsertDataValue(ItemKey, 710, 3); SQL.InsertDataValue(ItemKey, 711, INT); SQL.InsertDataValue(ItemKey, 712, 4); SQL.InsertDataValue(ItemKey, 713, SPR); SQL.InsertDataValue(ItemKey, 720, 0); SQL.InsertDataValue(ItemKey, 721, 0); } public static void InsertWeaponStats(string ItemKey, int UpEffect, int STR, int END, int DEX, int INT, int SPR) { SQL.InsertDataValue(ItemKey, 500, UpEffect); SQL.InsertDataValue(ItemKey, 501, 0); SQL.InsertDataValue(ItemKey, 502, 0); SQL.InsertDataValue(ItemKey, 503, 11); SQL.InsertDataValue(ItemKey, 504, 0); SQL.InsertDataValue(ItemKey, 505, STR); SQL.InsertDataValue(ItemKey, 506, 1); SQL.InsertDataValue(ItemKey, 507, END); SQL.InsertDataValue(ItemKey, 508, 2); SQL.InsertDataValue(ItemKey, 509, DEX); SQL.InsertDataValue(ItemKey, 510, 3); SQL.InsertDataValue(ItemKey, 511, INT); SQL.InsertDataValue(ItemKey, 512, 4); SQL.InsertDataValue(ItemKey, 513, SPR); SQL.InsertDataValue(ItemKey, 520, 65535); SQL.InsertDataValue(ItemKey, 521, 0); } } }