public void tPets_Import() { AllLists.tpet_MenuData.Clear(); LoadFromDatabase.LoadFromDatabaseSQL = "SELECT * FROM t_attack_pet ORDER BY a_index"; foreach (DataRow row in (InternalDataCollectionBase)mySQL.GetFromQuery(LoadFromDatabase.LoadFromDatabaseSQL).Rows) { t_attkpet tAttkpet = new t_attkpet(); tAttkpet.index = Convert.ToInt32(row["a_index"]); tAttkpet.enable = Convert.ToInt32(row["a_enable"]); tAttkpet.name = Convert.ToString(row["a_name"]); //dethunter12 6/27/2018 pet editor test speed tAttkpet.type = Convert.ToInt32(row["a_type"]); tAttkpet.str = Convert.ToInt32(row["a_str"]); tAttkpet.con = Convert.ToInt32(row["a_con"]); tAttkpet.dex = Convert.ToInt32(row["a_dex"]); tAttkpet.intel = Convert.ToInt32(row["a_int"]); tAttkpet.itemidx = Convert.ToInt32(row["a_item_idx"]); tAttkpet.maxFaith = Convert.ToInt32(row["a_maxFaith"]); tAttkpet.maxStm = Convert.ToInt32(row["a_maxStm"]); tAttkpet.maxHP = Convert.ToInt32(row["a_maxHP"]); tAttkpet.maxMP = Convert.ToInt32(row["a_maxMP"]); tAttkpet.recoverHP = Convert.ToInt32(row["a_recoverHP"]); tAttkpet.recoverMP = Convert.ToInt32(row["a_recoverMP"]); tAttkpet.delay = Convert.ToInt32(row["a_delay"]); tAttkpet.AISlot = Convert.ToInt32(row["a_AISlot"]); tAttkpet.afterDead = Convert.ToInt32(row["a_after_dead"]); tAttkpet.attack = Convert.ToInt32(row["a_attack"]); tAttkpet.defense = Convert.ToInt32(row["a_defence"]); tAttkpet.mAttack = Convert.ToInt32(row["a_Mattack"]); tAttkpet.mDefense = Convert.ToInt32(row["a_Mdefence"]); tAttkpet.hitPoint = Convert.ToInt32(row["a_hitpoint"]); tAttkpet.avoidPoint = Convert.ToInt32(row["a_avoidpoint"]); tAttkpet.mavoidPoint = Convert.ToInt32(row["a_Mavoidpoint"]); tAttkpet.attackSpeed = Convert.ToInt32(row["a_attackSpeed"]); tAttkpet.Deadly = Convert.ToInt32(row["a_deadly"]); tAttkpet.Critical = Convert.ToInt32(row["a_critical"]); tAttkpet.awful = Convert.ToInt32(row["a_awful"]); tAttkpet.strong = Convert.ToInt32(row["a_strong"]); tAttkpet.normal = Convert.ToInt32(row["a_normal"]); tAttkpet.weak = Convert.ToInt32(row["a_week"]); tAttkpet.bagicSkill1 = Convert.ToInt32(row["a_bagic_skill1"]); tAttkpet.bagicSkill2 = Convert.ToInt32(row["a_bagic_skill2"]); tAttkpet.flag = Convert.ToInt32(row["a_flag"]); tAttkpet.transType = Convert.ToInt32(row["a_trans_type"]); tAttkpet.transStart = Convert.ToInt32(row["a_trans_start"]); tAttkpet.transEnd = Convert.ToInt32(row["a_trans_end"]); tAttkpet.smcFileName1 = Convert.ToString(row["a_smcFileName_1"]).Replace('/', '\\'); //dethunter12 7/10/2018 tAttkpet.aniIdle1 = Convert.ToString(row["a_ani_idle1_1"]); tAttkpet.aniIdle1_2 = Convert.ToString(row["a_ani_idle2_1"]); tAttkpet.aniAttack1 = Convert.ToString(row["a_ani_attack1_1"]); tAttkpet.aniAttack1_2 = Convert.ToString(row["a_ani_attack2_1"]); tAttkpet.aniDamage1 = Convert.ToString(row["a_ani_damage_1"]); tAttkpet.aniDie1 = Convert.ToString(row["a_ani_die_1"]); tAttkpet.aniWalk1 = Convert.ToString(row["a_ani_walk_1"]); tAttkpet.aniRun1 = Convert.ToString(row["a_ani_run_1"]); tAttkpet.aniLevelup1 = Convert.ToString(row["a_ani_levelup_1"]); tAttkpet.mount1 = Convert.ToInt32(row["a_mount_1"]); tAttkpet.summonSkill1 = Convert.ToInt32(row["a_summon_skill_1"]); tAttkpet.speed1 = Convert.ToInt32(row["a_speed_1"]); tAttkpet.smcFileName2 = Convert.ToString(row["a_smcFileName_2"]).Replace('/', '\\'); //dethunter12 7/10/2018 tAttkpet.aniIdle2 = Convert.ToString(row["a_ani_idle1_2"]); tAttkpet.aniIdle2_2 = Convert.ToString(row["a_ani_idle2_2"]); tAttkpet.aniAttack2 = Convert.ToString(row["a_ani_attack1_2"]); tAttkpet.aniAttack2_2 = Convert.ToString(row["a_ani_attack2_2"]); tAttkpet.aniDamage1_2 = Convert.ToString(row["a_ani_damage_2"]); tAttkpet.aniDie1_2 = Convert.ToString(row["a_ani_die_2"]); tAttkpet.aniWalk1_2 = Convert.ToString(row["a_ani_walk_2"]); tAttkpet.aniRun1_2 = Convert.ToString(row["a_ani_run_2"]); tAttkpet.aniLevelup1_2 = Convert.ToString(row["a_ani_levelup_2"]); tAttkpet.mount1_2 = Convert.ToInt32(row["a_mount_2"]); tAttkpet.summonSkill1_2 = Convert.ToInt32(row["a_summon_skill_2"]); // tAttkpet.speed1_2 = Convert.ToInt32(row["a_speed_2"]); AllLists.tpet_MenuData.Add(tAttkpet); AllLists.tpet_Menu.Add(tAttkpet.index.ToString() + " - " + tAttkpet.name.ToString()); } }
public static void tattkpet_Update(t_attkpet attkpet) { try { using (MySqlConnection mySqlConnection = new MySqlConnection(mySQL.ConnectionString)) //dethunter12 7/9/2018 update pet insert query { MySqlCommand mySqlCommand = new MySqlCommand(); mySqlConnection.Open(); mySqlCommand.Connection = mySqlConnection; string str = "INSERT INTO t_attack_pet (" + "a_index, " + "a_enable ," + "a_type ," + "a_name ," + "a_str ," + "a_con ," + "a_dex ," + "a_int ," + "a_item_idx ," + "a_maxFaith ," + "a_maxStm ," + "a_maxHP ," + "a_maxMP ," + "a_recoverHP ," + "a_recoverMP ," + "a_delay ," + "a_AISlot ," + "a_after_dead ," + "a_attack ," + "a_defence ," + "a_Mattack ," + "a_Mdefence ," + "a_hitpoint ," + "a_avoidpoint ," + "a_Mavoidpoint ," + "a_attackSpeed ," + "a_deadly ," + "a_critical ," + "a_awful ," + "a_normal ," + "a_week ," + "a_bagic_skill1 ," + "a_bagic_skill2 ," + "a_flag ," + "a_trans_type ," + "a_trans_start ," + "a_trans_end ," + "a_smcFileName_1 ," + "a_ani_idle1_1 ," + "a_ani_idle2_1 ," + "a_ani_attack1_1 ," + "a_ani_attack2_1 ," + "a_ani_damage_1 ," + "a_ani_die_1 ," + "a_ani_walk_1 ," + "a_ani_run_1 ," + "a_ani_levelup_1 ," + "a_mount_1 ," + "a_summon_skill_1 ," + "a_speed_1 ," + "a_smcFileName_2 ," + "a_ani_idle1_2 ," + "a_ani_idle2_2 ," + "a_ani_attack1_2 ," + "a_ani_attack2_2 ," + "a_ani_damage_2 ," + "a_ani_die_2 ," + "a_ani_walk_2 ," + "a_ani_run_2 ," + "a_ani_levelup_2 ," + "a_summon_skill_2 ," + "a_speed_2 ," + ")" + "VALUES (" + "@index, " + "@enable ," + "@type ," + "@name ," + "@str ," + "@con ," + "@dex ," + "@intel ," + "@itemidx ," + "@maxFaith ," + "@maxStm ," + "@maxHP ," + "@maxMP ," + "@recoverHP ," + "@recoverMP ," + "@delay ," + "@AISlot ," + "@afterDead ," + "@attack ," + "@defense ," + "@mAttack ," + "@mDefense ," + "@hitPoint ," + "@avoidPoint ," + "@mavoidPoint ," + "@attackSpeed ," + "@Deadly ," + "@Critical ," + "@awful ," + "@strong ," + "@normal ," + "@weak ," + "@bagicSkill1 ," + "@bagicSkill2 ," + "@flag ," + "@transType ," + "@transStart ," + "@transEnd ," + "@smcFileName1 ," + "@aniIdle1 ," + "@aniIdle2 ," + "@aniAttack1 ," + "@aniAttack2 ," + "@aniDamage1 ," + "@aniDie1 ," + "@aniWalk1 ," + "@aniRun1 ," + "@aniLevelup1 ," + "@mount1 ," + "@summonSkill1 ," + "@speed1 ," + "@smcFileName2 ," + "@aniIdle1_2 ," + "@aniIdle2_2 ," + "@aniAttack1_2 ," + "@aniAttack2_2 ," + "@aniDamage1_2 ," + "@aniDie1_2 ," + "@aniWalk1_2 ," + "@aniRun1_2 ," + "@aniLevelup1_2 ," + "@mount1_2 ," + "@summonSkill1_2 ," + "@speed1_2 ," + ")"; mySqlCommand.CommandText = str; mySqlCommand.Prepare(); mySqlCommand.Parameters.AddWithValue("@index", attkpet.index); mySqlCommand.Parameters.AddWithValue("@enable", attkpet.enable); mySqlCommand.Parameters.AddWithValue("@type", attkpet.type); mySqlCommand.Parameters.AddWithValue("@name", attkpet.name); mySqlCommand.Parameters.AddWithValue("@str", attkpet.str); mySqlCommand.Parameters.AddWithValue("@con", attkpet.con); mySqlCommand.Parameters.AddWithValue("@dex", attkpet.dex); mySqlCommand.Parameters.AddWithValue("@intel", attkpet.intel); mySqlCommand.Parameters.AddWithValue("@itemidx", attkpet.itemidx); mySqlCommand.Parameters.AddWithValue("@maxFaith", attkpet.maxFaith); mySqlCommand.Parameters.AddWithValue("@maxStm", attkpet.maxStm); mySqlCommand.Parameters.AddWithValue("@maxHP", attkpet.maxHP); mySqlCommand.Parameters.AddWithValue("@maxMP", attkpet.maxMP); mySqlCommand.Parameters.AddWithValue("@recoverHP", attkpet.recoverHP); mySqlCommand.Parameters.AddWithValue("@recoverMP", attkpet.recoverMP); mySqlCommand.Parameters.AddWithValue("@delay", attkpet.delay); mySqlCommand.Parameters.AddWithValue("@AISlot", attkpet.AISlot); mySqlCommand.Parameters.AddWithValue("@afterDead", attkpet.afterDead); mySqlCommand.Parameters.AddWithValue("@attack", attkpet.attack); mySqlCommand.Parameters.AddWithValue("@defense", attkpet.defense); mySqlCommand.Parameters.AddWithValue("@mAttack", attkpet.mAttack); mySqlCommand.Parameters.AddWithValue("@mDefense", attkpet.mDefense); mySqlCommand.Parameters.AddWithValue("@hitPoint", attkpet.hitPoint); mySqlCommand.Parameters.AddWithValue("@avoidPoint", attkpet.avoidPoint); mySqlCommand.Parameters.AddWithValue("@mavoidPoint", attkpet.mavoidPoint); mySqlCommand.Parameters.AddWithValue("@attackSpeed", attkpet.attackSpeed); mySqlCommand.Parameters.AddWithValue("@Deadly", attkpet.Deadly); mySqlCommand.Parameters.AddWithValue("@Critical", attkpet.Critical); mySqlCommand.Parameters.AddWithValue("@awful", attkpet.awful); mySqlCommand.Parameters.AddWithValue("@strong", attkpet.strong); mySqlCommand.Parameters.AddWithValue("@normal", attkpet.normal); mySqlCommand.Parameters.AddWithValue("@weak", attkpet.weak); mySqlCommand.Parameters.AddWithValue("@bagicSkill1", attkpet.bagicSkill1); mySqlCommand.Parameters.AddWithValue("@bagicSkill2", attkpet.bagicSkill2); mySqlCommand.Parameters.AddWithValue("@flag", attkpet.flag); mySqlCommand.Parameters.AddWithValue("@transType", attkpet.transType); mySqlCommand.Parameters.AddWithValue("@transStart", attkpet.transStart); mySqlCommand.Parameters.AddWithValue("@transEnd", attkpet.transEnd); mySqlCommand.Parameters.AddWithValue("@smcFileName1", attkpet.smcFileName1); mySqlCommand.Parameters.AddWithValue("@aniIdle1", attkpet.aniIdle1); mySqlCommand.Parameters.AddWithValue("@aniIdle2", attkpet.aniIdle2); mySqlCommand.Parameters.AddWithValue("@aniAttack1", attkpet.aniAttack1); mySqlCommand.Parameters.AddWithValue("@aniAttack2", attkpet.aniAttack2); mySqlCommand.Parameters.AddWithValue("@aniDamage1", attkpet.aniDamage1); mySqlCommand.Parameters.AddWithValue("@aniDie1", attkpet.aniDie1); mySqlCommand.Parameters.AddWithValue("@aniWalk1", attkpet.aniWalk1); mySqlCommand.Parameters.AddWithValue("@aniRun1", attkpet.aniRun1); mySqlCommand.Parameters.AddWithValue("@aniLevelup1", attkpet.aniLevelup1); mySqlCommand.Parameters.AddWithValue("@mount1", attkpet.mount1); mySqlCommand.Parameters.AddWithValue("@summonSkill1", attkpet.summonSkill1); mySqlCommand.Parameters.AddWithValue("@speed1", attkpet.speed1); mySqlCommand.Parameters.AddWithValue("@smcFileName2", attkpet.smcFileName2); mySqlCommand.Parameters.AddWithValue("@aniIdle1_2", attkpet.aniIdle1_2); mySqlCommand.Parameters.AddWithValue("@aniIdle2_2", attkpet.aniIdle2_2); mySqlCommand.Parameters.AddWithValue("@aniAttack1_2", attkpet.aniAttack1_2); mySqlCommand.Parameters.AddWithValue("@aniAttack2_2", attkpet.aniAttack2_2); mySqlCommand.Parameters.AddWithValue("@aniDamage1_2", attkpet.aniDamage1_2); mySqlCommand.Parameters.AddWithValue("@aniDie1_2", attkpet.aniDie1_2); mySqlCommand.Parameters.AddWithValue("@aniWalk1_2", attkpet.aniWalk1_2); mySqlCommand.Parameters.AddWithValue("@aniRun1_2", attkpet.aniRun1_2); mySqlCommand.Parameters.AddWithValue("@aniLevelup1_2", attkpet.aniLevelup1_2); mySqlCommand.Parameters.AddWithValue("@mount1_2", attkpet.mount1_2); mySqlCommand.Parameters.AddWithValue("@summonSkill1_2", attkpet.summonSkill1_2); mySqlCommand.Parameters.AddWithValue("@speed1_2", attkpet.speed1_2); mySqlCommand.ExecuteNonQuery(); mySqlConnection.Close(); } } catch (MySqlException ex) { int num = (int)MessageBox.Show(ex.Message.ToString()); } }