private void CreateSpellIndex() { // Irq: Some spells are null in spellfilter, this exception puts spacers in the list when a NULL spell is returned //for (int spellid = 0; spellid <= fs.SpellTable.Length; spellid++) for (int spellid = 0; spellid < fs.SpellTable.Length + 200; spellid++) { spellinfo tsinfo = new spellinfo(); try { Spell tspell = fs.SpellTable.GetById(spellid); tsinfo.spellid = spellid; tsinfo.spellname = tspell.Name; tsinfo.spellschool = tspell.School.Name; tsinfo.irresistable = tspell.IsIrresistible; tsinfo.isdebuff = tspell.IsDebuff; tsinfo.isoffensive = tspell.IsOffensive; tsinfo.spellicon = tspell.IconId; tsinfo.isuntargeted = tspell.IsUntargetted; tsinfo.isfellowship = tspell.IsFellowship; tsinfo.duration = tspell.Duration; tsinfo.animation = tspell.TargetEffect; switch (tspell.ComponentIDs[0]) { case 112: //Platnium Scarab tsinfo.spelllevel = 7; break; case 192: //Dark Scarab tsinfo.spelllevel = 0; break; case 193: //Mana Scarab tsinfo.spelllevel = 8; break; default: tsinfo.spelllevel = tspell.ComponentIDs[0]; //Minor/Moderate/Major/Epic are somewhat random in assignment of scarab. if (tsinfo.spellname.Contains("Minor")) { tsinfo.spelllevel = 11; } //if (tsinfo.spellname.Contains("Moderate")) { tsinfo.spelllevel = 12; } if (tsinfo.spellname.Contains("Major")) { tsinfo.spelllevel = 13; } if (tsinfo.spellname.Contains("Epic")) { tsinfo.spelllevel = 14; } if (tsinfo.spellname.Contains("Legendary")) { tsinfo.spelllevel = 15; } break; } nDataTable.SpellIndex.Add(tsinfo); } catch { spellinfo tspellcatch = new spellinfo(); tspellcatch.spellid = spellid; tspellcatch.spellname = spellid.ToString() + "Spell"; nDataTable.SpellIndex.Add(tspellcatch); } } }
private void CreateItemSpellsList() { try { var spl1 = from spels in SpellIndex where spels.isdebuff == false && spels.isoffensive == false && spels.irresistable == true && ((spels.isuntargeted == true) || (spels.spelllevel > 10)) && spels.isfellowship == false select spels; var spl2 = from spels1 in spl1 where (spels1.spellid != 6) && (spels1.spellid < 1157 || spels1.spellid > 1301) && (spels1.spellid < 1644 || spels1.spellid > 1708) && (spels1.spellid < 1997 || spels1.spellid > 2051) && (spels1.spellid < 2332 || spels1.spellid > 2410) && (spels1.spellid < 2628 || spels1.spellid > 3050) && (spels1.spellid < 3204 || spels1.spellid > 3249) && (spels1.spellid < 3320 || spels1.spellid > 3478) && (spels1.spellid < 3530 || spels1.spellid > 3759) && (spels1.spellid != 3810) && (spels1.spellid < 3848 || spels1.spellid > 3913) && (spels1.spellid < 3977 || spels1.spellid > 3983) && (spels1.spellid < 4022 || spels1.spellid > 4221) && (spels1.spellid < 4240 || spels1.spellid > 4245) && (spels1.spellid < 4647 || spels1.spellid > 4658) && (spels1.spellid < 4754 || spels1.spellid > 4759) && (spels1.spellid < 4981 || spels1.spellid > 5026) && (spels1.spellid < 5137 || spels1.spellid > 5154) && (spels1.spellid < 5184 || spels1.spellid > 5329) && (spels1.spellid < 5435 || spels1.spellid > 5779) && (spels1.spellid < 5898 || spels1.spellid > 6038) && (spels1.spellid < 6108 || spels1.spellid > 6120) && spels1.spellid < 6127 select spels1; var cspells = from spl in SpellIndex where spl.spellname.Contains("Shroud of") || spl.spellname.Contains("Cloaked") || spl.spellname == "Horizon's Blades" || spl.spellname == "Tectonic Rifts" || spl.spellname == "Nuhmudira's Spines" || spl.spellname == "Searing Disc" || spl.spellname == "Cassius' Ring of Fire" || spl.spellname == "Halo of Frost" || spl.spellname == "Eye of the Storm" || spl.spellid == 5361 //Clouded Soul is 5331 and 5361. 5331 has a 700 cast level and very high damage compared to cloak damage proc. orderby spl.spellname ascending select spl; foreach(var spel in spl2) { if(!spel.spellname.Contains("Bane") && !spel.spellname.Contains("Hunter") && !spel.spellname.Contains("Thirst") && !spel.spellname.Contains("Link") && !spel.spellname.Contains("Defender")) { ItemsSpellList.Add(spel); } } foreach(var selectedspell in cspells) { selectedspell.spelllevel = 20; ItemsSpellList.Add(selectedspell); } spellinfo damageabsorb = new spellinfo(); damageabsorb.spellname = "Damage Absorb"; damageabsorb.spelllevel = 20; damageabsorb.spellid = 10000; ItemsSpellList.Add(damageabsorb); if(writelists) { FileInfo logFile = new FileInfo(GearDir + @"\ItemSpells.csv"); if (logFile.Exists) { logFile.Delete(); } StreamWriter writer0 = new StreamWriter(logFile.FullName, true); StringBuilder output = new StringBuilder(); output.Append("Indexed to SpellID\n\nSpell ID,Spell Name,Spell Level,Spell Icon,Spell School,IsResistable,IsDebuff,IsOffensive,\n"); foreach (var si in spl2) { output.Append(si.spellid.ToString() + "," + si.spellname.ToString() + "," + si.spelllevel.ToString() + "," + si.spellicon.ToString() + "," + si.spellschool.ToString() + "," + si.irresistable.ToString() + "," + si.isdebuff.ToString() + "," + si.isoffensive.ToString() + "," + si.isuntargeted.ToString() + "\n"); } writer0.WriteLine(output); writer0.Close(); } } catch{} }
private void CreateItemSpellsList() { try { var spl1 = from spels in nDataTable.SpellIndex where spels.isdebuff == false && spels.isoffensive == false && spels.irresistable == true && ((spels.isuntargeted == true) || (spels.spelllevel > 10)) && spels.isfellowship == false select spels; var spl2 = from spels1 in spl1 where (spels1.spellid != 6) && (spels1.spellid < 1157 || spels1.spellid > 1301) && (spels1.spellid < 1644 || spels1.spellid > 1708) && (spels1.spellid < 1997 || spels1.spellid > 2051) && (spels1.spellid < 2332 || spels1.spellid > 2410) && (spels1.spellid < 2628 || spels1.spellid > 3050) && (spels1.spellid < 3204 || spels1.spellid > 3249) && (spels1.spellid < 3320 || spels1.spellid > 3478) && (spels1.spellid < 3530 || spels1.spellid > 3759) && (spels1.spellid != 3810) && (spels1.spellid < 3848 || spels1.spellid > 3913) && (spels1.spellid < 3977 || spels1.spellid > 3983) && (spels1.spellid < 4022 || spels1.spellid > 4221) && (spels1.spellid < 4240 || spels1.spellid > 4245) && (spels1.spellid < 4647 || spels1.spellid > 4658) && (spels1.spellid < 4754 || spels1.spellid > 4759) && (spels1.spellid < 4981 || spels1.spellid > 5026) && (spels1.spellid < 5137 || spels1.spellid > 5154) && (spels1.spellid < 5184 || spels1.spellid > 5329) && (spels1.spellid < 5435 || spels1.spellid > 5779) && (spels1.spellid < 5898 || spels1.spellid > 6038) && (spels1.spellid < 6108 || spels1.spellid > 6120) && spels1.spellid < 6127 select spels1; var cspells = from spl in nDataTable.SpellIndex where spl.spellname.Contains("Shroud of") || spl.spellname.Contains("Cloaked") || spl.spellname == "Horizon's Blades" || spl.spellname == "Tectonic Rifts" || spl.spellname == "Nuhmudira's Spines" || spl.spellname == "Searing Disc" || spl.spellname == "Cassius' Ring of Fire" || spl.spellname == "Halo of Frost" || spl.spellname == "Eye of the Storm" || spl.spellid == 5361 //Clouded Soul is 5331 and 5361. 5331 has a 700 cast level and very high damage compared to cloak damage proc. orderby spl.spellname ascending select spl; foreach(var spel in spl2) { if(!spel.spellname.Contains("Bane") && !spel.spellname.Contains("Hunter") && !spel.spellname.Contains("Thirst") && !spel.spellname.Contains("Link") && !spel.spellname.Contains("Defender") && !spel.spellname.Contains("Impen")) { nDataTable.ItemsSpellList.Add(spel); } } foreach(var selectedspell in cspells) { selectedspell.spelllevel = 20; nDataTable.ItemsSpellList.Add(selectedspell); } spellinfo damageabsorb = new spellinfo(); damageabsorb.spellname = "Damage Absorb"; damageabsorb.spelllevel = 20; damageabsorb.spellid = 10000; nDataTable.ItemsSpellList.Add(damageabsorb); } catch{} }
private void CreateSpellIndex() { // Irq: Some spells are null in spellfilter, this exception puts spacers in the list when a NULL spell is returned //for (int spellid = 0; spellid <= FileService.SpellTable.Length; spellid++) for (int spellid = 0; spellid < 7000; spellid++) { spellinfo tsinfo = new spellinfo(); try { Spell tspell = fileservice.SpellTable.GetById(spellid); tsinfo.spellid = spellid; tsinfo.spellname = tspell.Name; tsinfo.spellschool = tspell.School.Name; tsinfo.irresistable = tspell.IsIrresistible; tsinfo.isdebuff = tspell.IsDebuff; tsinfo.isoffensive = tspell.IsOffensive; tsinfo.spellicon = tspell.IconId; tsinfo.componentIds = tspell.ComponentIDs; tsinfo.isuntargeted = tspell.IsUntargetted; tsinfo.isfellowship = tspell.IsFellowship; tsinfo.duration = tspell.Duration; tsinfo.animation = tspell.TargetEffect; switch (tspell.ComponentIDs[0]) { case 112: //Platnium Scarab tsinfo.spelllevel = 7; break; case 192: //Dark Scarab tsinfo.spelllevel = 0; break; case 193: //Mana Scarab tsinfo.spelllevel = 8; break; default: tsinfo.spelllevel = tspell.ComponentIDs[0]; //Minor/Moderate/Major/Epic are somewhat random in assignment of scarab. if (tsinfo.spellname.Contains("Minor")) { tsinfo.spelllevel = 11; } //if (tsinfo.spellname.Contains("Moderate")) { tsinfo.spelllevel = 12; } if (tsinfo.spellname.Contains("Major")) { tsinfo.spelllevel = 13; } if (tsinfo.spellname.Contains("Epic")) { tsinfo.spelllevel = 14; } if (tsinfo.spellname.Contains("Legendary")) { tsinfo.spelllevel = 15; } break; } SpellIndex.Add(tsinfo); } catch { spellinfo tspellcatch = new spellinfo(); tspellcatch.spellid = spellid; tspellcatch.spellname = spellid.ToString() + "Spell"; SpellIndex.Add(tspellcatch); } } if (writelists) { FileInfo logFile = new FileInfo(GearDir + @"\SpellIndex.csv"); if (logFile.Exists) { logFile.Delete(); } StreamWriter writer0 = new StreamWriter(logFile.FullName, true); StringBuilder output = new StringBuilder(); output.Append("Indexed to SpellID\n\nSpell ID,Spell Name,Spell Level,Spell Icon,Spell School,IrResistable,IsDebuff,IsOffensive,IsUntargeted\n"); foreach (spellinfo si in SpellIndex) { output.Append(si.spellid.ToString() + "," + si.spellname.ToString() + "," + si.spelllevel.ToString() + "," + si.spellicon.ToString() + "," + si.spellschool.ToString() + "," + si.irresistable.ToString() + "," + si.isdebuff.ToString() + "," + si.isoffensive.ToString() + si.isuntargeted.ToString() + "\n"); } writer0.WriteLine(output); writer0.Close(); } }