public async Task LoadIntersections() { JArray jArrayIntersections = new JArray(); DataTable dt = dB.Reader($"Select ID from {general.Table_General} WHERE Status='not edited' AND Room <> ? order by ClassOrder limit 1", Currentroom); bool isOtherConferenceFinished = dt.Rows.Count == 0 ? true : false; if (GetCurrentStateOfConference() == "completed" || isOtherConferenceFinished) //when the conference is completed, we dont have to load all the intersections again { jArrayIntersections.Add(""); } else { string otherclassname = dt.Rows[0]["ID"].ToString(); MyClasses currentClass = GetClass(GetCurrentClassName()); MyClasses otherclass = GetClass(otherclassname); //List<Teacher> otherClassTeachers = otherclass.Teachers.Select(teacherId => GetTeacher(teacherId)).ToList(); //List<Teacher> currentClassTeachers = currentClass.Teachers.Select(teacherId => GetTeacher(teacherId)).ToList(); List <string> otherClassTeacherIDs = otherclass.Teachers.Select(teacher => GetTeacher(teacher).ID).ToList(); List <string> currentClassTeacherIDs = currentClass.Teachers.Select(teacher => GetTeacher(teacher).ID).ToList(); List <string> intersectionIDs = otherClassTeacherIDs.Intersect(currentClassTeacherIDs).ToList(); List <Teacher> intersectedTeachers = intersectionIDs.Select(intersection => GetTeacher(intersection)).ToList(); jArrayIntersections = new JArray(JsonConvert.SerializeObject(intersectedTeachers)); } await Clients.All.SendAsync("ReveiveIntersections", jArrayIntersections); }
private void open_assignments_file() //opens the file of assignments { using (var file = new System.IO.StreamReader(@"saves\StudentAssignments.txt")) { string line; while ((line = file.ReadLine()) != null) { Assignment homework = new Assignment(); homework.AssignName = line; line = file.ReadLine(); homework.Notes = line; line = file.ReadLine(); homework.ClassName = line; line = file.ReadLine(); homework.DueDate = line; if (MyClasses.Contains(homework.ClassName)) { MyAssignments.Add(homework); viewAssignmentList.Items.Add(homework); } } } }
void btnClrInventory_Click(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { lstInventory.Clear(); cmbSelectClass.Selected = 0; cmbWieldAttrib.Selected = 0; cmbDamageType.Selected = 0; cmbLevel.Selected = 0; cmbArmorSet.Selected = 0; cmbMaterial.Selected = 0; cmbCoverage.Selected = 0; cmbArmorLevel.Selected = 0; cmbSalvWork.Selected = 0; cmbEmbue.Selected = 0; objEmbueTypeInt = 0; objDamageTypeInt = 0; objLevelInt = 1; objWieldAttrInt = 0; objSalvWork = "None"; objClassName = null; objMat = 0; objCovers = 0; objArmorLevel = 1; objArmorSet = 0; newDoc = null; xdoc = null; childElements = null; elements = null; txbSelect.Text = ""; mySelect = ""; }
void btnGetInventory_Click(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { Mishna.PluginCore.Util.WriteToChat("ToonInventoryButton was clicked"); m = 500; xdocToonInventory = new XDocument(new XElement("Objs")); doGetInventory(); }
private void lstObjects_Selected(object sender, MyClasses.MetaViewWrappers.MVListSelectEventArgs e) { //Set this object as the current selection in the game. // int objectguid = PluginCore.objecttracker[e.Row].Guid; // PluginCore.host.Actions.SelectItem(objectguid); }
private void chkArmorTink_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) { try { bArmorTink = e.Checked; Util.WriteToChat("ArmorTink = " + bEnabled); SaveSettings(); } catch (Exception ex) { Util.LogError(ex); } }
private void CheckButton1_CheckedChanged(object sender, EventArgs e) { int id = 12; var MyImageArray = MyClasses.FnLoadDocumentImages(); for (int i = 0; i < MyImageArray.Length; i++) { string s = id + "_" + i; MyClasses.FnSaveDocumentImage(MyImageArray[i], s); } openFileDialog1.ShowDialog(); pictureBox1.ImageLocation = openFileDialog1.FileName; }
void chkStats_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) { try { mMainSettings.btoonStatsEnabled = e.Checked; SaveSettings(); if (mMainSettings.btoonStatsEnabled) { getStats(); } } catch (Exception ex) { LogError(ex); } }
private void open_classes_file() //reads the class names from a file, allowing the user to select a class from the combobox when creating an assignment { using (var file = new System.IO.StreamReader(@"saves\StudentClassInfo.txt")) { string line; string className; while ((line = file.ReadLine()) != null) { className = line; line = file.ReadLine(); line = file.ReadLine(); line = file.ReadLine(); line = file.ReadLine(); Classbox.Items.Add(className); MyClasses.Add(className); } } }
public MainPage() { this.InitializeComponent(); MyClasses.Add(new Items { Name = "Nico", Complete = false }); MyClasses.Add(new Items { Name = "LIU", Complete = true }); MyClasses.Add(new Items { Name = "He", Complete = true }); MyClasses.Add(new Items { Name = "Wei", Complete = false }); MyClasses.Add(new Items { Name = "Dong", Complete = true }); MyClasses.Add(new Items { Name = "Ming", Complete = false }); }
void cmbWieldAttrib_Change(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { try { int tempeWieldAttrInt = cmbWieldAttrib.Selected; findWieldAttrInt(tempeWieldAttrInt); } catch (Exception ex) { Mishna.PluginCore.Util.LogError(ex); } }
private void lstInventory_Selected(object sender, MyClasses.MetaViewWrappers.MVListSelectEventArgs e) { try { xdoc = XDocument.Load(inventorySelect); IListRow row = lstInventory[e.Row]; // the object name is included in the text file on this row objID = Convert.ToInt32(row[3][0]); elements = xdoc.Element("Objs").Descendants("Obj"); element = new XElement(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where (p.Element("ObjID").Value.ToLower().Contains(objID.ToString())) select p)); xdoc = null; List<XElement> ElementsList = new List<XElement>(); childElements = element.Descendants(); foreach (XElement childElement in childElements) { ElementsList.Add(childElement); } objName = ElementsList[1].Value; toonName = ElementsList[3].Value; message = objName + ", " + toonName; switch (objClass) { case 0: objAl = ElementsList[8].Value; objWork = ElementsList[15].Value; objTinks = ElementsList[16].Value; objLevel = ElementsList[28].Value; objArmorSet = Convert.ToInt32(ElementsList[9].Value); objCovers = Convert.ToInt32(ElementsList[10].Value); objSpells = ElementsList[41].Value.ToString(); findArmorSetName(objArmorSet); findCoversName(objCovers); objMissD = ((Math.Round(Convert.ToDouble(ElementsList[34].Value), 2) - 1) * 100).ToString(); if (Convert.ToDouble(objMissD) < 0) { objMissD = "0"; } objManaC = (Math.Round(Convert.ToDouble(ElementsList[33].Value), 2) * 100).ToString(); objMagicD = ((Math.Round(Convert.ToDouble(ElementsList[32].Value), 2) - 1) * 100).ToString(); if (Convert.ToDouble(objMagicD) < 0) { objMagicD = "0"; } objMelD = Math.Round(((Convert.ToDouble(ElementsList[31].Value) - 1) * 100), 2).ToString(); if (Convert.ToDouble(objMelD) < 0) { objMelD = "0"; } objElemvsMons = Math.Round(((Convert.ToDouble(ElementsList[30].Value) - 1) * 100), 2).ToString(); if (Convert.ToDouble(objElemvsMons) < 0) { objElemvsMons = "0"; } objEmbueTypeInt = Convert.ToInt32(ElementsList[24].Value); objAttack = Math.Round((Convert.ToDouble(ElementsList[36].Value)-1) * 100).ToString(); if (Convert.ToDouble(objAttack) < 0) { objAttack = "0"; } objMaxDam = ElementsList[38].Value.ToString(); objVar = Math.Round(Convert.ToDouble(ElementsList[39].Value), 2).ToString(); objBurden = ElementsList[43].Value; objStack = ElementsList[44].Value; if (ElementsList[45].Value != "0") { string objAcid = ((Math.Round(Convert.ToDouble(ElementsList[45].Value), 4))).ToString(); string objLight = ((Math.Round(Convert.ToDouble(ElementsList[46].Value), 4))).ToString(); string objFire = ((Math.Round(Convert.ToDouble(ElementsList[47].Value), 4))).ToString(); string objCold = ((Math.Round(Convert.ToDouble(ElementsList[48].Value), 4))).ToString(); string objBludg = ((Math.Round(Convert.ToDouble(ElementsList[49].Value), 4))).ToString(); string objSlash = ((Math.Round(Convert.ToDouble(ElementsList[50].Value), 4))).ToString(); string objPierce = ((Math.Round(Convert.ToDouble(ElementsList[51].Value), 4))).ToString(); objProts = objSlash + "/" + objPierce + "/" + objBludg + "/" + objFire + "/" + objCold + "/" + objAcid + "/" + objLight; } else { objProts = ""; } if (objProts != "") { message = message + ", Al: " + objAl + ", Prots: " + objProts + ", Work: " + objWork + ", Burden: " + objBurden + " , Number: " + objStack + " , Tinks: " + objTinks + ", Level: " + objLevel + ", " + objArmorSetName + " Set, " + objSpells + ", covers: " + objCoversName + ", ManaC: " + objManaC + ", MeleeD: " + objMelD + ", MagicD: " + objMagicD + ", MissileD: " + objMissD + ", ElemVsMonster: " + objElemvsMons + ", Attack: " + objAttack + ", MaxDam: " + objMaxDam + ", Variance: " + objVar + ", Embue: " + objEmbueTypeStr; } else { message = message + ", Al: " + objAl + ", Work: " + objWork + ", Burden: " + objBurden + " , Number: " + objStack + " , Tinks: " + objTinks + ", Level: " + objLevel + ", " + objArmorSetName + " Set, " + objSpells + ", covers: " + objCoversName + ", ManaC: " + objManaC + ", MeleeD: " + objMelD + ", MagicD: " + objMagicD + ", MissileD: " + objMissD + ", ElemVsMonster: " + objElemvsMons + ", Attack: " + objAttack + ", MaxDam: " + objMaxDam + ", Variance: " + objVar + ", Embue: " + objEmbueTypeStr; } break; // * case 1: case 2: case 11: if (objClass == 1) { objAl = ElementsList[8].Value; objWork = ElementsList[15].Value; objTinks = ElementsList[16].Value; if (ElementsList[45].Value != "0" && ElementsList[1].Value.Contains("Covenant")) { string objAcid = ((Math.Round(Convert.ToDouble(ElementsList[45].Value), 4))).ToString(); string objLight = ((Math.Round(Convert.ToDouble(ElementsList[46].Value), 4))).ToString(); string objFire = ((Math.Round(Convert.ToDouble(ElementsList[47].Value), 4))).ToString(); string objCold = ((Math.Round(Convert.ToDouble(ElementsList[48].Value), 4))).ToString(); string objBludg = ((Math.Round(Convert.ToDouble(ElementsList[49].Value), 4))).ToString(); string objSlash = ((Math.Round(Convert.ToDouble(ElementsList[50].Value), 4))).ToString(); string objPierce = ((Math.Round(Convert.ToDouble(ElementsList[51].Value), 4))).ToString(); objProts = objSlash + "/" + objPierce + "/" + objBludg + "/" + objFire + "/" + objCold + "/" + objAcid + "/" + objLight; } else { objProts = ""; } if (objProts != "") { message = message + ", Al: " + objAl + " " + objProts + ", Work: " + objWork + ", Tinks: " + objTinks; } else { message = message + ", Al: " + objAl + ", Work: " + objWork + ", Tinks: " + objTinks; } } if (objClass == 1 || objClass == 2) { objCovers = Convert.ToInt32(ElementsList[10].Value); findCoversName(objCovers); message = message + ", Covers: " + objCoversName; } if (objClass == 1 || objClass == 2 || objName.Contains("Aetheria")) { objLevel = ElementsList[28].Value; objArmorSet = Convert.ToInt32(ElementsList[9].Value); objSpells = ElementsList[41].Value.ToString(); findArmorSetName(objArmorSet); objBurden = ElementsList[43].Value; message = message + ", Level: " + objLevel + ", Set: " + objArmorSetName + ", Spells: " + objSpells; } break; if (objClass == 11 && !objName.Contains("Aetheria")) { objStack = ElementsList[44].Value; message = message + ", # in Stack: " + objStack; } case 3: objLevel = ElementsList[28].Value; objSpells = ElementsList[41].Value.ToString(); message = message + ", Level: " + objLevel + ", " + objSpells; break; case 4: objWork = ElementsList[15].Value; objTinks = ElementsList[16].Value; objLevel = ElementsList[28].Value; objDamageTypeInt = Convert.ToInt32(ElementsList[42].Value); objMissD = ((Math.Round(Convert.ToDouble(ElementsList[34].Value), 2) - 1) * 100).ToString(); if (Convert.ToDouble(objMissD) < 0) { objMissD = "0"; } objManaC = (Math.Round(Convert.ToDouble(ElementsList[33].Value), 2) * 100).ToString(); objMagicD = ((Math.Round(Convert.ToDouble(ElementsList[32].Value), 2) - 1) * 100).ToString(); if (Convert.ToDouble(objMagicD) < 0) { objMagicD = "0"; } objMelD = Math.Round(((Convert.ToDouble(ElementsList[31].Value) - 1) * 100), 2).ToString(); objElemvsMons = Math.Round(((Convert.ToDouble(ElementsList[30].Value) - 1) * 100), 2).ToString(); objEmbueTypeInt = Convert.ToInt32(ElementsList[24].Value); findEmbueTypeStr(objEmbueTypeInt); findDamageType(); objSpells = ElementsList[41].Value.ToString(); message = message + ", Damage: " + objDamageType + ", Wield Level: " + objLevel + ", ElemVsMonster: " + objElemvsMons + ", ManaC: " + objManaC + ", MeleeD: " + objMelD + ", MagicD: " + objMagicD + ", MissileD: " + objMissD + ", Embue: " + objEmbueTypeStr + ", Work: " + objWork + ", Tinks: " + objTinks + ", " + objSpells; break; case 5: objDamageTypeInt = Convert.ToInt32(ElementsList[29].Value); findDamageType(); objAttack = Math.Round((Convert.ToDouble(ElementsList[36].Value)-1) * 100).ToString(); if (Convert.ToDouble(objAttack) < 0) { objAttack = "0"; } objMaxDam = ElementsList[38].Value.ToString(); objMaxDamLong = Convert.ToInt32(objMaxDam); objDVar = (Convert.ToDouble(ElementsList[39].Value)); objMinDam = Math.Round(objMaxDamLong - ((objDVar)*(objMaxDamLong)),2).ToString(); objEmbueTypeInt = Convert.ToInt32(ElementsList[24].Value); findEmbueTypeStr(objEmbueTypeInt); objWork = ElementsList[15].Value.ToString(); objTinks = ElementsList[16].Value.ToString(); objLevel = ElementsList[28].Value.ToString(); objMissD = ((Math.Round(Convert.ToDouble(ElementsList[34].Value), 2) - 1) * 100).ToString(); if (Convert.ToDouble(objMissD) < 0) { objMissD = "0"; } objMagicD = ((Math.Round(Convert.ToDouble(ElementsList[32].Value), 2) - 1) * 100).ToString(); if (Convert.ToDouble(objMagicD) < 0) { objMagicD = "0"; } objMelD = Math.Round(((Convert.ToDouble(ElementsList[31].Value) - 1) * 100), 2).ToString(); objSpells = ElementsList[41].Value.ToString(); message = message + " , Damage: " + objDamageType + ", WieldLevel: " + objLevel + ", Attack: " + objAttack + ", MeleeD: " + objMelD + " Min-Max Damage: " + objMinDam + "-" + objMaxDam + " , Embue: " + objEmbueTypeStr + ", Work: " + objWork + ", Tinks: " + objTinks + ", MissD: " + objMissD + ", MagicD " + objMagicD + ", " + objSpells; break; case 6: objDamageTypeInt = Convert.ToInt32(ElementsList[29].Value); findDamageType(); objWork = ElementsList[15].Value.ToString(); objTinks = ElementsList[16].Value.ToString(); objLevel = ElementsList[28].Value.ToString(); string objElDam = ElementsList[21].Value.ToString(); string objDamBon = ((Math.Round(Convert.ToDouble(ElementsList[37].Value), 2) - 1) * 100).ToString(); objMissD = ((Math.Round(Convert.ToDouble(ElementsList[34].Value), 2) - 1) * 100).ToString(); if (Convert.ToDouble(objMissD) < 0) { objMissD = "0"; } objMagicD = ((Math.Round(Convert.ToDouble(ElementsList[32].Value), 2) - 1) * 100).ToString(); if (Convert.ToDouble(objMagicD) < 0) { objMagicD = "0"; } objMelD = Math.Round(((Convert.ToDouble(ElementsList[31].Value) - 1) * 100), 2).ToString(); if (Convert.ToDouble(objDamBon) < 0) { objDamBon = "0"; } objSpells = ElementsList[41].Value.ToString(); message = message + ", Damage Type: " + objDamageType + ", WieldLevel: " + objLevel + ", Elem Dmg: " + objElDam + ", Damage Bonus: " + objDamBon + "MelD: " + objMelD + ", MissD: " + objMissD + ", MagicD: " + objMagicD + ", Work: " + objWork + ", Tinks: " + objTinks + ", " + objSpells; break; case 7: string objSalvWork = ElementsList[35].Value.ToString(); objBurden = ElementsList[43].Value; long objMat = Convert.ToInt32(ElementsList[7].Value); findMaterialName(objMat); Mishna.PluginCore.Util.WriteToChat("Material" + objMatName); message = message + ", Material: " + objMatName + ", Work: " + objSalvWork + ", Burden: " + objBurden; break; default: objBurden = ElementsList[43].Value; objStack = ElementsList[44].Value; objSpells = ElementsList[41].Value.ToString(); message = message + ", Burden: " + objBurden + ", Number: " + objStack + ", Spells: " + objSpells; break; } Mishna.PluginCore.Util.WriteToChat(message); message = null; elements = null; childElements = null; element = null; } catch (Exception ex) { Mishna.PluginCore.Util.LogError(ex); } }
//private void chkCalcMajors_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) //{ // try // { // bCalcMajors = e.Checked; // Util.WriteToChat("Calculate Majors = " + bCalcMajors); // SaveSettings(); // } // catch (Exception ex) { Util.LogError(ex); } //} //private void chkJourneymanPet_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) //{ // try // { // bJourneymanPet = e.Checked; // Util.WriteToChat("Journeyman Pet = " + bJourneymanPet); // SaveSettings(); // } // catch (Exception ex) { Util.LogError(ex); } //} //private void chkArtisanPet_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) //{ // try // { // bArtisanPet = e.Checked; // Util.WriteToChat("Artisan Pet = " + bMasterPet); // SaveSettings(); // } // catch (Exception ex) { Util.LogError(ex); } //} // private void chkMasterPet_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) //{ // try // { // bMasterPet = e.Checked; // Util.WriteToChat("Master Pet = " + bMasterPet); // SaveSettings(); // } // catch (Exception ex) { Util.LogError(ex); } //} private void chkBuffingWand_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) { try { // saveEquip(Skill, objSelectedID); } catch (Exception ex) { Util.LogError(ex); } }
void cmbSelectClass_Change(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { try { objClass = cmbSelectClass.Selected; findClassName(objClass); } catch (Exception ex) { Mishna.PluginCore.Util.LogError(ex); } }
void cmbEmbue_Change(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { try { int tempeEmbueInt = cmbEmbue.Selected; findEmbueTypeInt(tempeEmbueInt); } catch (Exception ex) { Mishna.PluginCore.Util.LogError(ex); } }
void cmbSalvWork_Change(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { try { int tempeSalvWorkInt = cmbSalvWork.Selected; findobjSalvWork(tempeSalvWorkInt); } catch (Exception ex) { Mishna.PluginCore.Util.LogError(ex); } }
//Provides a modified overload for lstSelect to display lists where only purpose is to select an item for the rules part of the //program. This overload uses spellinfo as opposed to IDNameLoadable list private string lstSelect(List<spellinfo> lst, MyClasses.MetaViewWrappers.IList lstvue, MyClasses.MetaViewWrappers.MVListSelectEventArgs margs, int mlist) { try { MyClasses.MetaViewWrappers.IListRow row = null; row = lstvue[margs.Row]; mchecked = Convert.ToBoolean(row[0][0]); sname = (Convert.ToString(row[1][0])); string snum = Convert.ToString(row[2][0]); if (mchecked) { return snum; } else { return ""; } } catch (Exception ex) { LogError(ex); return null; } }
void btnLstInventory_Click(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { try{ Mishna.PluginCore.Util.WriteToChat("I am at The list inventory section"); XDocument tempDoc = new XDocument(new XElement("Objs")); tempDoc.Save(inventorySelect); tempDoc = null; mySelect = null; if (txbSelect.Text != null) { mySelect = txbSelect.Text.Trim(); mySelect = mySelect.ToLower(); } else { mySelect = null; } xdoc = XDocument.Load(genInventoryFilename); }//end of try // catch (Exception ex) { Mishna.PluginCore.Util.LogError(ex); } try { switch (objClass) { case 0: if (mySelect != null && mySelect != "") { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect) select p)); } else if (mySelect == null || mySelect == "") { Mishna.PluginCore.Util.WriteToChat("You must choose a class or type something inbox");} break; case 1: case 2: case 11: if (mySelect != null && mySelect.Trim() != "") { if (objArmorSet == 0 && objArmorLevel == 1 && objCovers == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName)&& (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objArmorSet > 0 && objArmorLevel == 1 && objCovers == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjSet").Value == objArmorSet.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if ((objArmorLevel > 1 || objArmorLevel < 1) && objArmorSet == 0 && objCovers == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objArmorLevel.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objCovers > 0 && objArmorSet == 0 && objArmorLevel == 1 ) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjCovers").Value == objCovers.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objArmorSet > 0 && (objArmorLevel < 1 || objArmorLevel > 1) && objCovers == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjSet").Value == objArmorSet.ToString() && p.Element("ObjWieldValue").Value == objArmorLevel.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objArmorSet > 0 && objCovers > 0 && objArmorLevel == 1 ) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjSet").Value == objArmorSet.ToString() && p.Element("ObjCovers").Value == objCovers.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objArmorSet == 0 && (objArmorLevel > 1 || objArmorLevel < 1) && objCovers > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objArmorLevel.ToString() && p.Element("ObjCovers").Value == objCovers.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objArmorSet > 0 && (objArmorLevel > 1 || objArmorLevel < 1) && objCovers > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjSet").Value == objArmorSet.ToString() && p.Element("ObjWieldValue").Value == objArmorLevel.ToString() && p.Element("ObjCovers").Value == objCovers.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } } else { if (objArmorSet == 0 && objArmorLevel == 1 && objCovers == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) select p)); } else if (objArmorSet > 0 && objArmorLevel == 1 && objCovers == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjSet").Value == objArmorSet.ToString() select p)); } else if ((objArmorLevel > 1 || objArmorLevel < 1) && objArmorSet == 0 && objCovers == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objArmorLevel.ToString() select p)); } else if (objCovers > 0 && objArmorSet == 0 && objArmorLevel == 1 ) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjCovers").Value == objCovers.ToString() select p)); } else if (objArmorSet > 0 && (objArmorLevel < 1 || objArmorLevel > 1) && objCovers == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjSet").Value == objArmorSet.ToString() && p.Element("ObjWieldValue").Value == objArmorLevel.ToString() select p)); } else if (objArmorSet > 0 && objCovers > 0 && objArmorLevel == 1 ) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjSet").Value == objArmorSet.ToString() && p.Element("ObjCovers").Value == objCovers.ToString() select p)); } else if (objArmorSet == 0 && (objArmorLevel > 1 || objArmorLevel < 1) && objCovers > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objArmorLevel.ToString() && p.Element("ObjCovers").Value == objCovers.ToString() select p)); } else if (objArmorSet > 0 && (objArmorLevel > 1 || objArmorLevel < 1) && objCovers > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjSet").Value == objArmorSet.ToString() && p.Element("ObjWieldValue").Value == objArmorLevel.ToString() && p.Element("ObjCovers").Value == objCovers.ToString() select p)); } } //end of if spells break; case 5: if (mySelect != null && mySelect != "") { if (objWieldAttrInt == 0 && objDamageTypeInt == 0 && objLevelInt == 1 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt == 0 && objLevelInt == 1 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objDamageTypeInt > 0 && objWieldAttrInt == 0 && objLevelInt == 1 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if ((objLevelInt < 1 || objLevelInt > 1) && objWieldAttrInt == 0 && objDamageTypeInt == 0 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objEmbueTypeInt > 0 && objWieldAttrInt == 0 && objDamageTypeInt == 1 && objLevelInt == 1 ) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt > 0 && objLevelInt ==1 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objWieldAttrInt > 0 && (objLevelInt < 1 || objLevelInt > 1) && objDamageTypeInt == 0 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objWieldAttrInt > 0 && objEmbueTypeInt > 0 && objDamageTypeInt == 0 && objLevelInt == 1 ) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objDamageTypeInt > 0 && (objLevelInt < 1 || objLevelInt > 1) && objWieldAttrInt == 0 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objDamageTypeInt > 0 && (objLevelInt < 1 || objLevelInt > 1) && objWieldAttrInt == 0 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objDamageTypeInt > 0 && objEmbueTypeInt > 0 && objWieldAttrInt == 0 && (objLevelInt == 1)) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if ((objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0 && objWieldAttrInt == 0 && objDamageTypeInt == 0 ) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt > 0 && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt > 0 && objEmbueTypeInt > 0 && objLevelInt == 1 ) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt == 0 && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objWieldAttrInt == 0 && objDamageTypeInt > 0 && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt > 0 && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } } //end of case 5 with spells else { if (objWieldAttrInt == 0 && objDamageTypeInt == 0 && objLevelInt == 1 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt == 0 && objLevelInt == 1 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() select p)); } else if (objDamageTypeInt > 0 && objWieldAttrInt == 0 && objLevelInt == 1 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() select p)); } else if ((objLevelInt < 1 || objLevelInt > 1) && objWieldAttrInt == 0 && objDamageTypeInt == 0 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() select p)); } else if (objEmbueTypeInt > 0 && objWieldAttrInt == 0 && objDamageTypeInt == 1 && objLevelInt == 1) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt > 0 && objLevelInt == 1 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() select p)); } else if (objWieldAttrInt > 0 && (objLevelInt < 1 || objLevelInt > 1) && objDamageTypeInt == 0 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() select p)); } else if (objWieldAttrInt > 0 && objEmbueTypeInt > 0 && objDamageTypeInt == 0 && objLevelInt == 1) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() select p)); } else if (objDamageTypeInt > 0 && (objLevelInt < 1 || objLevelInt > 1) && objWieldAttrInt == 0 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() select p)); } else if (objDamageTypeInt > 0 && objEmbueTypeInt > 0 && objWieldAttrInt == 0 && (objLevelInt == 1)) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() select p)); } else if ((objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0 && objWieldAttrInt == 0 && objDamageTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt > 0 && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt > 0 && objEmbueTypeInt > 0 && objLevelInt == 1) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt == 0 && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() select p)); } else if (objWieldAttrInt == 0 && objDamageTypeInt > 0 && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() select p)); } else if (objWieldAttrInt > 0 && objDamageTypeInt > 0 && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldAttr").Value == objWieldAttrInt.ToString() && p.Element("ObjDamage").Value == objDamageTypeInt.ToString() && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == (objEmbueTypeInt.ToString()) select p)); } } //end of case 5 no spells break; case 4: case 6: if (mySelect != null && mySelect != "") { if (objDamageTypeInt == 0 && objMagicDamageInt == 0 && objLevelInt == 1 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } if ((objDamageTypeInt > 0 || objMagicDamageInt > 0) && (objLevelInt == 1) && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && (p.Element("ObjDamage").Value == objDamageTypeInt.ToString() || p.Element("ObjMagicDamage").Value == objDamageTypeInt.ToString()) && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } if ((objLevelInt < 1 || objLevelInt > 1) && objDamageTypeInt == 0 && objMagicDamageInt == 0 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } if (objEmbueTypeInt > 0 && objDamageTypeInt == 0 && objMagicDamageInt == 0 && objLevelInt == 1) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } if ((objDamageTypeInt > 0 || objMagicDamageInt > 0) && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && (p.Element("ObjDamage").Value == objDamageTypeInt.ToString() || p.Element("ObjMagicDamage").Value == objDamageTypeInt.ToString()) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } if ((objDamageTypeInt > 0 || objMagicDamageInt > 0) && objEmbueTypeInt > 0 && objLevelInt == 1 ) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && (p.Element("ObjDamage").Value == objDamageTypeInt.ToString() || p.Element("ObjMagicDamage").Value == objDamageTypeInt.ToString()) && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } if ((objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0 && objDamageTypeInt == 0 && objMagicDamageInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } if ((objDamageTypeInt > 0 || objMagicDamageInt > 0) && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && (p.Element("ObjDamage").Value == objDamageTypeInt.ToString() || p.Element("ObjMagicDamage").Value == objDamageTypeInt.ToString()) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } } else { if (objDamageTypeInt == 0 && objMagicDamageInt == 0 && (objLevelInt == 1) && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) select p)); } if ((objDamageTypeInt > 0 || objMagicDamageInt > 0) && (objLevelInt == 1) && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && (p.Element("ObjDamage").Value == objDamageTypeInt.ToString() || p.Element("ObjMagicDamage").Value == objDamageTypeInt.ToString()) select p)); } if ((objLevelInt < 1 || objLevelInt > 1) && objDamageTypeInt == 0 && objMagicDamageInt == 0 && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() select p)); } if (objEmbueTypeInt > 0 && objDamageTypeInt == 0 && objMagicDamageInt == 0 && (objLevelInt == 1)) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() select p)); } if ((objDamageTypeInt > 0 || objMagicDamageInt > 0) && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt == 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && (p.Element("ObjDamage").Value == objDamageTypeInt.ToString() || p.Element("ObjMagicDamage").Value == objDamageTypeInt.ToString()) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() select p)); } if ((objDamageTypeInt > 0 || objMagicDamageInt > 0) && objEmbueTypeInt > 0 && objLevelInt == 1) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && (p.Element("ObjDamage").Value == objDamageTypeInt.ToString() || p.Element("ObjMagicDamage").Value == objDamageTypeInt.ToString()) && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() select p)); } if ((objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0 && objDamageTypeInt == 0 && objMagicDamageInt == 0 ) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() select p)); } if ((objDamageTypeInt > 0 || objMagicDamageInt > 0) && (objLevelInt < 1 || objLevelInt > 1) && objEmbueTypeInt > 0) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && (p.Element("ObjDamage").Value == objDamageTypeInt.ToString() || p.Element("ObjMagicDamage").Value == objDamageTypeInt.ToString()) && p.Element("ObjWieldValue").Value == objLevelInt.ToString() && p.Element("ObjEmbue").Value == objEmbueTypeInt.ToString() select p)); } } break; case 7: if ((objClassName.Contains("Salvage")) && (objSalvWork == "None")) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjMaterial").Value == objMat.ToString() select p)); } else if ((objClassName.Contains("Salvage")) && ((objSalvWork == "1,2,3,4,5,6") || (objSalvWork == "7,8") || (objSalvWork == "9"))) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjMaterial").Value == objMat.ToString() && objSalvWork.Contains(p.Element("ObjWork").Value.Substring(0, 1)) select p)); } else if ((objClassName.Contains("Salvage")) && (objSalvWork == "10")) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && p.Element("ObjMaterial").Value == objMat.ToString() && objSalvWork.ToString() == p.Element("ObjWork").Value select p)); } break; default: if (objClassName != null && mySelect != null && mySelect.Trim() != "") { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) && (p.Element("ObjName").Value.ToLower().Contains(mySelect) || p.Element("ObjSpellXml").Value.ToLower().Contains(mySelect)) select p)); } else if (objClassName != null && (mySelect == null || mySelect.Trim() == "")) { newDoc = new XDocument(new XElement("Objs", from p in xdoc.Element("Objs").Descendants("Obj") where p.Element("ObjClass").Value.Contains(objClassName) select p)); } break; } //end of switch if ((mySelect != null || mySelect.Trim() != "") && objClassName != "None") { xdoc = null; newDoc.Save(inventorySelect); newDoc = null; } else { Mishna.PluginCore.Util.WriteToChat("You must choose a class or type something inbox"); } } //end of try // catch (Exception ex) { Mishna.PluginCore.Util.LogError(ex); } newDoc = XDocument.Load(inventorySelect); IEnumerable<XElement> childElements = newDoc.Element("Objs").Descendants("Obj"); foreach (XElement childElement in childElements) { objIcon = Convert.ToInt32(childElement.Element("ObjIcon").Value); objName = childElement.Element("ObjName").Value; toonName = childElement.Element("ToonName").Value.ToString(); long objID = Convert.ToInt32(childElement.Element("ObjID").Value); string objIDstr = objID.ToString(); IListRow newRow = lstInventory.AddRow(); newRow[0][1] = objIcon; newRow[1][0] = objName; newRow[2][0] = toonName; newRow[3][0] = objIDstr; } newDoc = null; }
private void nbSetupsetup_Change(object sender, MyClasses.MetaViewWrappers.MVIndexChangeEventArgs e) { //try //{ // if (e.Index == 2) // { // populateMobsListBox(); // } // else if (e.Index == 1) // { // //fixed spelling from thropy // populateTrophysListBox(); // } //} //catch (Exception ex) { LogError(ex); } }
private void Txt_NationalCode_KeyPress(object sender, KeyPressEventArgs e) { MyClasses.FnAcceptDigit(e); }
private void chkBuffOnStart_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) { try { bBuffOnStart = e.Checked; Util.WriteToChat("Buff on start = " + bBuffOnStart); SaveSettings(); } catch (Exception ex) { Util.LogError(ex); } }
private void chkEnterSpamRare_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) { try { bEnterSpamRare = e.Checked; Util.WriteToChat("Spam Rare = " + bEnterSpamRare); SaveSettings(); } catch (Exception ex) { Util.LogError(ex); } }
private void chkRareTradeChan_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) { try { bRareTradeChan = e.Checked; Util.WriteToChat("Rare Trade Channel = " + bRareTradeChan); SaveSettings(); } catch (Exception ex) { Util.LogError(ex); } }
void chkInventoryBurden_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) { try { binventoryBurdenEnabled = e.Checked; SaveSettings(); } catch (Exception ex) { Mishna.PluginCore.Util.LogError(ex); } }
void btnGetToonStats_Click(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { getStats(); }
void chkQuickSlotsv_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) { try { bquickSlotsvEnabled = e.Checked; SaveSettings(); if (bquickSlotsvEnabled) { quickSlotsvEnabled(); } else if (!bquickSlotsvEnabled) { quickSlotsvNotEnabled(); } } catch (Exception ex) { Mishna.PluginCore.Util.LogError(ex); } }
void btnGetBurden_Click(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { if(!programinv.Contains("armor")) { getBurden = true; doUpdateInventory(); } }
void btnUpdateInventory_Click(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { Mishna.PluginCore.Util.WriteToChat("The button to update inventory was clicked"); doUpdateInventory(); }
void btnGetInventory_Click(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { m = 500; doGetInventory(); }
void cmbMaterial_Change(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { try { int tempeMaterialInt = cmbMaterial.Selected; findMaterial(tempeMaterialInt); } catch (Exception ex) { Mishna.PluginCore.Util.LogError(ex); } }
void btnItemsWaiting_Click(object sender, MyClasses.MetaViewWrappers.MVControlEventArgs e) { if(!programinv.Contains("armor")) { if (!mMainSettings.binventoryWaitingEnabled) { mMainSettings.binventoryWaitingEnabled = true; } else { mMainSettings.binventoryWaitingEnabled = false; } } }
private void Btn_Clear_CheckedChanged(object sender, EventArgs e) { MyClasses.FnClearForm_No_GridControl(this.Controls); }
private void chkUseRares_Change(object sender, MyClasses.MetaViewWrappers.MVCheckBoxChangeEventArgs e) { try { bUseRares = e.Checked; Util.WriteToChat("Use Rares = " + bUseRares); SaveSettings(); } catch (Exception ex) { Util.LogError(ex); } }
private void Txt_FileNo_KeyPress(object sender, KeyPressEventArgs e) { MyClasses.FnAcceptDigit(e); }
public bool IsMy(EducationClass @class) { return(MyClasses != null && MyClasses.Any(c => c.Id == @class.Id)); }