Guest User

Untitled

a guest
Jul 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. /// <summary>
  2. /// Takes a link from WowArmory talent spec, and builds a list to follow ingame!
  3. /// </summary>
  4. /// <param name="specLink">Link to a talent spec from WowArmory</param>
  5. public static void BuildSpecXml(string specLink, string charClass)
  6. {
  7. int counter = 1;
  8. var xElement = new XElement("TalentList");
  9. var matches = regex.Matches(specLink);
  10.  
  11. int numberOfTabs = 3;
  12.  
  13. foreach (CurrentTalent o in TalentList)
  14. {
  15. for (int i = 1; i <= numberOfTabs; i++)
  16. {
  17. int talentsInTab = 28;
  18.  
  19. for (int j = 1; j <= talentsInTab; j++)
  20. {
  21. if (i == o.tabIndex && j == o.talentIndex)
  22. {
  23. var test = new XElement("Talent",
  24. new XElement("Name", o.Name),
  25. new XElement("TabIndex", o.tabIndex),
  26. new XElement("TalentIndex", o.talentIndex),
  27. new XElement("CurrentRank", matches[counter].Value),
  28. new XElement("MaxRank", o.maxRank),
  29. new XElement("Tier", o.tier));
  30. xElement.Add(test);
  31.  
  32. counter++;
  33. }
  34. }
  35. }
  36. }
  37.  
  38. xElement.Save(String.Format(@"C:\{0}.xml", charClass));
  39. }
Add Comment
Please, Sign In to add comment