DocumentSkill.java 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622
  1. /*
  2. * Copyright (C) 2004-2014 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.gameserver.engines.skills;
  20. import java.io.File;
  21. import java.util.List;
  22. import java.util.logging.Level;
  23. import javolution.util.FastList;
  24. import org.w3c.dom.Document;
  25. import org.w3c.dom.NamedNodeMap;
  26. import org.w3c.dom.Node;
  27. import com.l2jserver.gameserver.datatables.EnchantSkillGroupsData;
  28. import com.l2jserver.gameserver.engines.DocumentBase;
  29. import com.l2jserver.gameserver.model.StatsSet;
  30. import com.l2jserver.gameserver.model.conditions.Condition;
  31. import com.l2jserver.gameserver.model.skills.EffectScope;
  32. import com.l2jserver.gameserver.model.skills.Skill;
  33. /**
  34. * @author mkizub
  35. */
  36. public class DocumentSkill extends DocumentBase
  37. {
  38. public static class SkillInfo
  39. {
  40. public int id;
  41. public String name;
  42. public StatsSet[] sets;
  43. public StatsSet[] enchsets1;
  44. public StatsSet[] enchsets2;
  45. public StatsSet[] enchsets3;
  46. public StatsSet[] enchsets4;
  47. public StatsSet[] enchsets5;
  48. public StatsSet[] enchsets6;
  49. public StatsSet[] enchsets7;
  50. public StatsSet[] enchsets8;
  51. public int currentLevel;
  52. public List<Skill> skills = new FastList<>();
  53. public List<Skill> currentSkills = new FastList<>();
  54. }
  55. private SkillInfo _currentSkill;
  56. private final List<Skill> _skillsInFile = new FastList<>();
  57. public DocumentSkill(File file)
  58. {
  59. super(file);
  60. }
  61. private void setCurrentSkill(SkillInfo skill)
  62. {
  63. _currentSkill = skill;
  64. }
  65. @Override
  66. protected StatsSet getStatsSet()
  67. {
  68. return _currentSkill.sets[_currentSkill.currentLevel];
  69. }
  70. public List<Skill> getSkills()
  71. {
  72. return _skillsInFile;
  73. }
  74. @Override
  75. protected String getTableValue(String name)
  76. {
  77. try
  78. {
  79. return _tables.get(name)[_currentSkill.currentLevel];
  80. }
  81. catch (RuntimeException e)
  82. {
  83. _log.log(Level.SEVERE, "Error in table: " + name + " of Skill Id " + _currentSkill.id, e);
  84. return "";
  85. }
  86. }
  87. @Override
  88. protected String getTableValue(String name, int idx)
  89. {
  90. try
  91. {
  92. return _tables.get(name)[idx - 1];
  93. }
  94. catch (RuntimeException e)
  95. {
  96. _log.log(Level.SEVERE, "wrong level count in skill Id " + _currentSkill.id + " name: " + name + " index : " + idx, e);
  97. return "";
  98. }
  99. }
  100. @Override
  101. protected void parseDocument(Document doc)
  102. {
  103. for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
  104. {
  105. if ("list".equalsIgnoreCase(n.getNodeName()))
  106. {
  107. for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
  108. {
  109. if ("skill".equalsIgnoreCase(d.getNodeName()))
  110. {
  111. setCurrentSkill(new SkillInfo());
  112. parseSkill(d);
  113. _skillsInFile.addAll(_currentSkill.skills);
  114. resetTable();
  115. }
  116. }
  117. }
  118. else if ("skill".equalsIgnoreCase(n.getNodeName()))
  119. {
  120. setCurrentSkill(new SkillInfo());
  121. parseSkill(n);
  122. _skillsInFile.addAll(_currentSkill.skills);
  123. }
  124. }
  125. }
  126. protected void parseSkill(Node n)
  127. {
  128. NamedNodeMap attrs = n.getAttributes();
  129. int enchantLevels1 = 0;
  130. int enchantLevels2 = 0;
  131. int enchantLevels3 = 0;
  132. int enchantLevels4 = 0;
  133. int enchantLevels5 = 0;
  134. int enchantLevels6 = 0;
  135. int enchantLevels7 = 0;
  136. int enchantLevels8 = 0;
  137. int skillId = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
  138. String skillName = attrs.getNamedItem("name").getNodeValue();
  139. String levels = attrs.getNamedItem("levels").getNodeValue();
  140. int lastLvl = Integer.parseInt(levels);
  141. if (attrs.getNamedItem("enchantGroup1") != null)
  142. {
  143. enchantLevels1 = EnchantSkillGroupsData.getInstance().addNewRouteForSkill(skillId, lastLvl, 1, Integer.parseInt(attrs.getNamedItem("enchantGroup1").getNodeValue()));
  144. }
  145. if (attrs.getNamedItem("enchantGroup2") != null)
  146. {
  147. enchantLevels2 = EnchantSkillGroupsData.getInstance().addNewRouteForSkill(skillId, lastLvl, 2, Integer.parseInt(attrs.getNamedItem("enchantGroup2").getNodeValue()));
  148. }
  149. if (attrs.getNamedItem("enchantGroup3") != null)
  150. {
  151. enchantLevels3 = EnchantSkillGroupsData.getInstance().addNewRouteForSkill(skillId, lastLvl, 3, Integer.parseInt(attrs.getNamedItem("enchantGroup3").getNodeValue()));
  152. }
  153. if (attrs.getNamedItem("enchantGroup4") != null)
  154. {
  155. enchantLevels4 = EnchantSkillGroupsData.getInstance().addNewRouteForSkill(skillId, lastLvl, 4, Integer.parseInt(attrs.getNamedItem("enchantGroup4").getNodeValue()));
  156. }
  157. if (attrs.getNamedItem("enchantGroup5") != null)
  158. {
  159. enchantLevels5 = EnchantSkillGroupsData.getInstance().addNewRouteForSkill(skillId, lastLvl, 5, Integer.parseInt(attrs.getNamedItem("enchantGroup5").getNodeValue()));
  160. }
  161. if (attrs.getNamedItem("enchantGroup6") != null)
  162. {
  163. enchantLevels6 = EnchantSkillGroupsData.getInstance().addNewRouteForSkill(skillId, lastLvl, 6, Integer.parseInt(attrs.getNamedItem("enchantGroup6").getNodeValue()));
  164. }
  165. if (attrs.getNamedItem("enchantGroup7") != null)
  166. {
  167. enchantLevels7 = EnchantSkillGroupsData.getInstance().addNewRouteForSkill(skillId, lastLvl, 7, Integer.parseInt(attrs.getNamedItem("enchantGroup7").getNodeValue()));
  168. }
  169. if (attrs.getNamedItem("enchantGroup8") != null)
  170. {
  171. enchantLevels8 = EnchantSkillGroupsData.getInstance().addNewRouteForSkill(skillId, lastLvl, 8, Integer.parseInt(attrs.getNamedItem("enchantGroup8").getNodeValue()));
  172. }
  173. _currentSkill.id = skillId;
  174. _currentSkill.name = skillName;
  175. _currentSkill.sets = new StatsSet[lastLvl];
  176. _currentSkill.enchsets1 = new StatsSet[enchantLevels1];
  177. _currentSkill.enchsets2 = new StatsSet[enchantLevels2];
  178. _currentSkill.enchsets3 = new StatsSet[enchantLevels3];
  179. _currentSkill.enchsets4 = new StatsSet[enchantLevels4];
  180. _currentSkill.enchsets5 = new StatsSet[enchantLevels5];
  181. _currentSkill.enchsets6 = new StatsSet[enchantLevels6];
  182. _currentSkill.enchsets7 = new StatsSet[enchantLevels7];
  183. _currentSkill.enchsets8 = new StatsSet[enchantLevels8];
  184. for (int i = 0; i < lastLvl; i++)
  185. {
  186. _currentSkill.sets[i] = new StatsSet();
  187. _currentSkill.sets[i].set("skill_id", _currentSkill.id);
  188. _currentSkill.sets[i].set("level", i + 1);
  189. _currentSkill.sets[i].set("name", _currentSkill.name);
  190. }
  191. if (_currentSkill.sets.length != lastLvl)
  192. {
  193. throw new RuntimeException("Skill id=" + skillId + " number of levels missmatch, " + lastLvl + " levels expected");
  194. }
  195. Node first = n.getFirstChild();
  196. for (n = first; n != null; n = n.getNextSibling())
  197. {
  198. if ("table".equalsIgnoreCase(n.getNodeName()))
  199. {
  200. parseTable(n);
  201. }
  202. }
  203. for (int i = 1; i <= lastLvl; i++)
  204. {
  205. for (n = first; n != null; n = n.getNextSibling())
  206. {
  207. if ("set".equalsIgnoreCase(n.getNodeName()))
  208. {
  209. // Extractable item skills by Zoey76
  210. if ("capsuled_items_skill".equalsIgnoreCase(n.getAttributes().getNamedItem("name").getNodeValue()))
  211. {
  212. setExtractableSkillData(_currentSkill.sets[i - 1], getTableValue("#extractableItems", i));
  213. }
  214. else
  215. {
  216. parseBeanSet(n, _currentSkill.sets[i - 1], i);
  217. }
  218. }
  219. }
  220. }
  221. for (int i = 0; i < enchantLevels1; i++)
  222. {
  223. _currentSkill.enchsets1[i] = new StatsSet();
  224. _currentSkill.enchsets1[i].set("skill_id", _currentSkill.id);
  225. // currentSkill.enchsets1[i] = currentSkill.sets[currentSkill.sets.length-1];
  226. _currentSkill.enchsets1[i].set("level", i + 101);
  227. _currentSkill.enchsets1[i].set("name", _currentSkill.name);
  228. // currentSkill.enchsets1[i].set("skillType", "NOTDONE");
  229. for (n = first; n != null; n = n.getNextSibling())
  230. {
  231. if ("set".equalsIgnoreCase(n.getNodeName()))
  232. {
  233. parseBeanSet(n, _currentSkill.enchsets1[i], _currentSkill.sets.length);
  234. }
  235. }
  236. for (n = first; n != null; n = n.getNextSibling())
  237. {
  238. if ("enchant1".equalsIgnoreCase(n.getNodeName()))
  239. {
  240. parseBeanSet(n, _currentSkill.enchsets1[i], i + 1);
  241. }
  242. }
  243. }
  244. if (_currentSkill.enchsets1.length != enchantLevels1)
  245. {
  246. throw new RuntimeException("Skill id=" + skillId + " number of levels missmatch, " + enchantLevels1 + " levels expected");
  247. }
  248. for (int i = 0; i < enchantLevels2; i++)
  249. {
  250. _currentSkill.enchsets2[i] = new StatsSet();
  251. // currentSkill.enchsets2[i] = currentSkill.sets[currentSkill.sets.length-1];
  252. _currentSkill.enchsets2[i].set("skill_id", _currentSkill.id);
  253. _currentSkill.enchsets2[i].set("level", i + 201);
  254. _currentSkill.enchsets2[i].set("name", _currentSkill.name);
  255. // currentSkill.enchsets2[i].set("skillType", "NOTDONE");
  256. for (n = first; n != null; n = n.getNextSibling())
  257. {
  258. if ("set".equalsIgnoreCase(n.getNodeName()))
  259. {
  260. parseBeanSet(n, _currentSkill.enchsets2[i], _currentSkill.sets.length);
  261. }
  262. }
  263. for (n = first; n != null; n = n.getNextSibling())
  264. {
  265. if ("enchant2".equalsIgnoreCase(n.getNodeName()))
  266. {
  267. parseBeanSet(n, _currentSkill.enchsets2[i], i + 1);
  268. }
  269. }
  270. }
  271. if (_currentSkill.enchsets2.length != enchantLevels2)
  272. {
  273. throw new RuntimeException("Skill id=" + skillId + " number of levels missmatch, " + enchantLevels2 + " levels expected");
  274. }
  275. for (int i = 0; i < enchantLevels3; i++)
  276. {
  277. _currentSkill.enchsets3[i] = new StatsSet();
  278. _currentSkill.enchsets3[i].set("skill_id", _currentSkill.id);
  279. _currentSkill.enchsets3[i].set("level", i + 301);
  280. _currentSkill.enchsets3[i].set("name", _currentSkill.name);
  281. for (n = first; n != null; n = n.getNextSibling())
  282. {
  283. if ("set".equalsIgnoreCase(n.getNodeName()))
  284. {
  285. parseBeanSet(n, _currentSkill.enchsets3[i], _currentSkill.sets.length);
  286. }
  287. }
  288. for (n = first; n != null; n = n.getNextSibling())
  289. {
  290. if ("enchant3".equalsIgnoreCase(n.getNodeName()))
  291. {
  292. parseBeanSet(n, _currentSkill.enchsets3[i], i + 1);
  293. }
  294. }
  295. }
  296. if (_currentSkill.enchsets3.length != enchantLevels3)
  297. {
  298. throw new RuntimeException("Skill id=" + skillId + " number of levels missmatch, " + enchantLevels3 + " levels expected");
  299. }
  300. for (int i = 0; i < enchantLevels4; i++)
  301. {
  302. _currentSkill.enchsets4[i] = new StatsSet();
  303. _currentSkill.enchsets4[i].set("skill_id", _currentSkill.id);
  304. _currentSkill.enchsets4[i].set("level", i + 401);
  305. _currentSkill.enchsets4[i].set("name", _currentSkill.name);
  306. for (n = first; n != null; n = n.getNextSibling())
  307. {
  308. if ("set".equalsIgnoreCase(n.getNodeName()))
  309. {
  310. parseBeanSet(n, _currentSkill.enchsets4[i], _currentSkill.sets.length);
  311. }
  312. }
  313. for (n = first; n != null; n = n.getNextSibling())
  314. {
  315. if ("enchant4".equalsIgnoreCase(n.getNodeName()))
  316. {
  317. parseBeanSet(n, _currentSkill.enchsets4[i], i + 1);
  318. }
  319. }
  320. }
  321. if (_currentSkill.enchsets4.length != enchantLevels4)
  322. {
  323. throw new RuntimeException("Skill id=" + skillId + " number of levels missmatch, " + enchantLevels4 + " levels expected");
  324. }
  325. for (int i = 0; i < enchantLevels5; i++)
  326. {
  327. _currentSkill.enchsets5[i] = new StatsSet();
  328. _currentSkill.enchsets5[i].set("skill_id", _currentSkill.id);
  329. _currentSkill.enchsets5[i].set("level", i + 501);
  330. _currentSkill.enchsets5[i].set("name", _currentSkill.name);
  331. for (n = first; n != null; n = n.getNextSibling())
  332. {
  333. if ("set".equalsIgnoreCase(n.getNodeName()))
  334. {
  335. parseBeanSet(n, _currentSkill.enchsets5[i], _currentSkill.sets.length);
  336. }
  337. }
  338. for (n = first; n != null; n = n.getNextSibling())
  339. {
  340. if ("enchant5".equalsIgnoreCase(n.getNodeName()))
  341. {
  342. parseBeanSet(n, _currentSkill.enchsets5[i], i + 1);
  343. }
  344. }
  345. }
  346. if (_currentSkill.enchsets5.length != enchantLevels5)
  347. {
  348. throw new RuntimeException("Skill id=" + skillId + " number of levels missmatch, " + enchantLevels5 + " levels expected");
  349. }
  350. for (int i = 0; i < enchantLevels6; i++)
  351. {
  352. _currentSkill.enchsets6[i] = new StatsSet();
  353. _currentSkill.enchsets6[i].set("skill_id", _currentSkill.id);
  354. _currentSkill.enchsets6[i].set("level", i + 601);
  355. _currentSkill.enchsets6[i].set("name", _currentSkill.name);
  356. for (n = first; n != null; n = n.getNextSibling())
  357. {
  358. if ("set".equalsIgnoreCase(n.getNodeName()))
  359. {
  360. parseBeanSet(n, _currentSkill.enchsets6[i], _currentSkill.sets.length);
  361. }
  362. }
  363. for (n = first; n != null; n = n.getNextSibling())
  364. {
  365. if ("enchant6".equalsIgnoreCase(n.getNodeName()))
  366. {
  367. parseBeanSet(n, _currentSkill.enchsets6[i], i + 1);
  368. }
  369. }
  370. }
  371. if (_currentSkill.enchsets6.length != enchantLevels6)
  372. {
  373. throw new RuntimeException("Skill id=" + skillId + " number of levels missmatch, " + enchantLevels6 + " levels expected");
  374. }
  375. for (int i = 0; i < enchantLevels7; i++)
  376. {
  377. _currentSkill.enchsets7[i] = new StatsSet();
  378. _currentSkill.enchsets7[i].set("skill_id", _currentSkill.id);
  379. _currentSkill.enchsets7[i].set("level", i + 701);
  380. _currentSkill.enchsets7[i].set("name", _currentSkill.name);
  381. for (n = first; n != null; n = n.getNextSibling())
  382. {
  383. if ("set".equalsIgnoreCase(n.getNodeName()))
  384. {
  385. parseBeanSet(n, _currentSkill.enchsets7[i], _currentSkill.sets.length);
  386. }
  387. }
  388. for (n = first; n != null; n = n.getNextSibling())
  389. {
  390. if ("enchant7".equalsIgnoreCase(n.getNodeName()))
  391. {
  392. parseBeanSet(n, _currentSkill.enchsets7[i], i + 1);
  393. }
  394. }
  395. }
  396. if (_currentSkill.enchsets7.length != enchantLevels7)
  397. {
  398. throw new RuntimeException("Skill id=" + skillId + " number of levels missmatch, " + enchantLevels7 + " levels expected");
  399. }
  400. for (int i = 0; i < enchantLevels8; i++)
  401. {
  402. _currentSkill.enchsets8[i] = new StatsSet();
  403. _currentSkill.enchsets8[i].set("skill_id", _currentSkill.id);
  404. _currentSkill.enchsets8[i].set("level", i + 801);
  405. _currentSkill.enchsets8[i].set("name", _currentSkill.name);
  406. for (n = first; n != null; n = n.getNextSibling())
  407. {
  408. if ("set".equalsIgnoreCase(n.getNodeName()))
  409. {
  410. parseBeanSet(n, _currentSkill.enchsets8[i], _currentSkill.sets.length);
  411. }
  412. }
  413. for (n = first; n != null; n = n.getNextSibling())
  414. {
  415. if ("enchant8".equalsIgnoreCase(n.getNodeName()))
  416. {
  417. parseBeanSet(n, _currentSkill.enchsets8[i], i + 1);
  418. }
  419. }
  420. }
  421. if (_currentSkill.enchsets8.length != enchantLevels8)
  422. {
  423. throw new RuntimeException("Skill id=" + skillId + " number of levels missmatch, " + enchantLevels8 + " levels expected");
  424. }
  425. makeSkills();
  426. for (int i = 0; i < lastLvl; i++)
  427. {
  428. _currentSkill.currentLevel = i;
  429. for (n = first; n != null; n = n.getNextSibling())
  430. {
  431. if ("cond".equalsIgnoreCase(n.getNodeName()))
  432. {
  433. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  434. Node msg = n.getAttributes().getNamedItem("msg");
  435. Node msgId = n.getAttributes().getNamedItem("msgId");
  436. if ((condition != null) && (msg != null))
  437. {
  438. condition.setMessage(msg.getNodeValue());
  439. }
  440. else if ((condition != null) && (msgId != null))
  441. {
  442. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  443. Node addName = n.getAttributes().getNamedItem("addName");
  444. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  445. {
  446. condition.addName();
  447. }
  448. }
  449. _currentSkill.currentSkills.get(i).attach(condition, false);
  450. }
  451. else if ("for".equalsIgnoreCase(n.getNodeName()))
  452. {
  453. parseTemplate(n, _currentSkill.currentSkills.get(i));
  454. }
  455. else if ("startEffects".equalsIgnoreCase(n.getNodeName()))
  456. {
  457. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  458. }
  459. else if ("channelingEffects".equalsIgnoreCase(n.getNodeName()))
  460. {
  461. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  462. }
  463. else if ("pveEffects".equalsIgnoreCase(n.getNodeName()))
  464. {
  465. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  466. }
  467. else if ("pvpEffects".equalsIgnoreCase(n.getNodeName()))
  468. {
  469. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  470. }
  471. else if ("endEffects".equalsIgnoreCase(n.getNodeName()))
  472. {
  473. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  474. }
  475. else if ("selfEffects".equalsIgnoreCase(n.getNodeName()))
  476. {
  477. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  478. }
  479. }
  480. }
  481. for (int i = lastLvl; i < (lastLvl + enchantLevels1); i++)
  482. {
  483. _currentSkill.currentLevel = i - lastLvl;
  484. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundStartEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  485. for (n = first; n != null; n = n.getNextSibling())
  486. {
  487. if ("enchant1cond".equalsIgnoreCase(n.getNodeName()))
  488. {
  489. foundCond = true;
  490. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  491. Node msg = n.getAttributes().getNamedItem("msg");
  492. Node msgId = n.getAttributes().getNamedItem("msgId");
  493. if ((condition != null) && (msg != null))
  494. {
  495. condition.setMessage(msg.getNodeValue());
  496. }
  497. else if ((condition != null) && (msgId != null))
  498. {
  499. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  500. Node addName = n.getAttributes().getNamedItem("addName");
  501. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  502. {
  503. condition.addName();
  504. }
  505. }
  506. _currentSkill.currentSkills.get(i).attach(condition, false);
  507. }
  508. else if ("enchant1for".equalsIgnoreCase(n.getNodeName()))
  509. {
  510. foundFor = true;
  511. parseTemplate(n, _currentSkill.currentSkills.get(i));
  512. }
  513. else if ("enchant1startEffects".equalsIgnoreCase(n.getNodeName()))
  514. {
  515. foundStartEffects = true;
  516. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  517. }
  518. else if ("enchant1channelingEffects".equalsIgnoreCase(n.getNodeName()))
  519. {
  520. foundChannelingEffects = true;
  521. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  522. }
  523. else if ("enchant1pveEffects".equalsIgnoreCase(n.getNodeName()))
  524. {
  525. foundPveEffects = true;
  526. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  527. }
  528. else if ("enchant1pvpEffects".equalsIgnoreCase(n.getNodeName()))
  529. {
  530. foundPvpEffects = true;
  531. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  532. }
  533. else if ("enchant1endEffects".equalsIgnoreCase(n.getNodeName()))
  534. {
  535. foundEndEffects = true;
  536. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  537. }
  538. else if ("enchant1selfEffects".equalsIgnoreCase(n.getNodeName()))
  539. {
  540. foundSelfEffects = true;
  541. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  542. }
  543. }
  544. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  545. if (!foundCond || !foundFor || !foundChannelingEffects || !foundStartEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  546. {
  547. _currentSkill.currentLevel = lastLvl - 1;
  548. for (n = first; n != null; n = n.getNextSibling())
  549. {
  550. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  551. {
  552. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  553. Node msg = n.getAttributes().getNamedItem("msg");
  554. Node msgId = n.getAttributes().getNamedItem("msgId");
  555. if ((condition != null) && (msg != null))
  556. {
  557. condition.setMessage(msg.getNodeValue());
  558. }
  559. else if ((condition != null) && (msgId != null))
  560. {
  561. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  562. Node addName = n.getAttributes().getNamedItem("addName");
  563. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  564. {
  565. condition.addName();
  566. }
  567. }
  568. _currentSkill.currentSkills.get(i).attach(condition, false);
  569. }
  570. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  571. {
  572. parseTemplate(n, _currentSkill.currentSkills.get(i));
  573. }
  574. else if (!foundStartEffects && "startEffects".equalsIgnoreCase(n.getNodeName()))
  575. {
  576. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  577. }
  578. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  579. {
  580. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  581. }
  582. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  583. {
  584. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  585. }
  586. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  587. {
  588. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  589. }
  590. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  591. {
  592. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  593. }
  594. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  595. {
  596. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  597. }
  598. }
  599. }
  600. }
  601. for (int i = lastLvl + enchantLevels1; i < (lastLvl + enchantLevels1 + enchantLevels2); i++)
  602. {
  603. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundStartEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  604. _currentSkill.currentLevel = i - lastLvl - enchantLevels1;
  605. for (n = first; n != null; n = n.getNextSibling())
  606. {
  607. if ("enchant2cond".equalsIgnoreCase(n.getNodeName()))
  608. {
  609. foundCond = true;
  610. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  611. Node msg = n.getAttributes().getNamedItem("msg");
  612. Node msgId = n.getAttributes().getNamedItem("msgId");
  613. if ((condition != null) && (msg != null))
  614. {
  615. condition.setMessage(msg.getNodeValue());
  616. }
  617. else if ((condition != null) && (msgId != null))
  618. {
  619. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  620. Node addName = n.getAttributes().getNamedItem("addName");
  621. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  622. {
  623. condition.addName();
  624. }
  625. }
  626. _currentSkill.currentSkills.get(i).attach(condition, false);
  627. }
  628. else if ("enchant2for".equalsIgnoreCase(n.getNodeName()))
  629. {
  630. foundFor = true;
  631. parseTemplate(n, _currentSkill.currentSkills.get(i));
  632. }
  633. else if ("enchant2startEffects".equalsIgnoreCase(n.getNodeName()))
  634. {
  635. foundStartEffects = true;
  636. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  637. }
  638. else if ("enchant2channelingEffects".equalsIgnoreCase(n.getNodeName()))
  639. {
  640. foundChannelingEffects = true;
  641. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  642. }
  643. else if ("enchant2pveEffects".equalsIgnoreCase(n.getNodeName()))
  644. {
  645. foundPveEffects = true;
  646. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  647. }
  648. else if ("enchant2pvpEffects".equalsIgnoreCase(n.getNodeName()))
  649. {
  650. foundPvpEffects = true;
  651. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  652. }
  653. else if ("enchant2endEffects".equalsIgnoreCase(n.getNodeName()))
  654. {
  655. foundEndEffects = true;
  656. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  657. }
  658. else if ("enchant2selfEffects".equalsIgnoreCase(n.getNodeName()))
  659. {
  660. foundSelfEffects = true;
  661. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  662. }
  663. }
  664. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  665. if (!foundCond || !foundFor || !foundChannelingEffects || !foundStartEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  666. {
  667. _currentSkill.currentLevel = lastLvl - 1;
  668. for (n = first; n != null; n = n.getNextSibling())
  669. {
  670. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  671. {
  672. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  673. Node msg = n.getAttributes().getNamedItem("msg");
  674. Node msgId = n.getAttributes().getNamedItem("msgId");
  675. if ((condition != null) && (msg != null))
  676. {
  677. condition.setMessage(msg.getNodeValue());
  678. }
  679. else if ((condition != null) && (msgId != null))
  680. {
  681. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  682. Node addName = n.getAttributes().getNamedItem("addName");
  683. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  684. {
  685. condition.addName();
  686. }
  687. }
  688. _currentSkill.currentSkills.get(i).attach(condition, false);
  689. }
  690. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  691. {
  692. parseTemplate(n, _currentSkill.currentSkills.get(i));
  693. }
  694. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  695. {
  696. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  697. }
  698. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  699. {
  700. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  701. }
  702. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  703. {
  704. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  705. }
  706. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  707. {
  708. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  709. }
  710. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  711. {
  712. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  713. }
  714. }
  715. }
  716. }
  717. for (int i = lastLvl + enchantLevels1 + enchantLevels2; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3); i++)
  718. {
  719. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundStartEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  720. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2;
  721. for (n = first; n != null; n = n.getNextSibling())
  722. {
  723. if ("enchant3cond".equalsIgnoreCase(n.getNodeName()))
  724. {
  725. foundCond = true;
  726. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  727. Node msg = n.getAttributes().getNamedItem("msg");
  728. Node msgId = n.getAttributes().getNamedItem("msgId");
  729. if ((condition != null) && (msg != null))
  730. {
  731. condition.setMessage(msg.getNodeValue());
  732. }
  733. else if ((condition != null) && (msgId != null))
  734. {
  735. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  736. Node addName = n.getAttributes().getNamedItem("addName");
  737. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  738. {
  739. condition.addName();
  740. }
  741. }
  742. _currentSkill.currentSkills.get(i).attach(condition, false);
  743. }
  744. else if ("enchant3for".equalsIgnoreCase(n.getNodeName()))
  745. {
  746. foundFor = true;
  747. parseTemplate(n, _currentSkill.currentSkills.get(i));
  748. }
  749. else if ("enchant3startEffects".equalsIgnoreCase(n.getNodeName()))
  750. {
  751. foundStartEffects = true;
  752. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  753. }
  754. else if ("enchant3channelingEffects".equalsIgnoreCase(n.getNodeName()))
  755. {
  756. foundChannelingEffects = true;
  757. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  758. }
  759. else if ("enchant3pveEffects".equalsIgnoreCase(n.getNodeName()))
  760. {
  761. foundPveEffects = true;
  762. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  763. }
  764. else if ("enchant3pvpEffects".equalsIgnoreCase(n.getNodeName()))
  765. {
  766. foundPvpEffects = true;
  767. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  768. }
  769. else if ("enchant3endEffects".equalsIgnoreCase(n.getNodeName()))
  770. {
  771. foundEndEffects = true;
  772. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  773. }
  774. else if ("enchant3selfEffects".equalsIgnoreCase(n.getNodeName()))
  775. {
  776. foundSelfEffects = true;
  777. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  778. }
  779. }
  780. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  781. if (!foundCond || !foundFor || !foundChannelingEffects || !foundStartEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  782. {
  783. _currentSkill.currentLevel = lastLvl - 1;
  784. for (n = first; n != null; n = n.getNextSibling())
  785. {
  786. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  787. {
  788. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  789. Node msg = n.getAttributes().getNamedItem("msg");
  790. Node msgId = n.getAttributes().getNamedItem("msgId");
  791. if ((condition != null) && (msg != null))
  792. {
  793. condition.setMessage(msg.getNodeValue());
  794. }
  795. else if ((condition != null) && (msgId != null))
  796. {
  797. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  798. Node addName = n.getAttributes().getNamedItem("addName");
  799. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  800. {
  801. condition.addName();
  802. }
  803. }
  804. _currentSkill.currentSkills.get(i).attach(condition, false);
  805. }
  806. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  807. {
  808. parseTemplate(n, _currentSkill.currentSkills.get(i));
  809. }
  810. else if (!foundStartEffects && "startEffects".equalsIgnoreCase(n.getNodeName()))
  811. {
  812. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  813. }
  814. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  815. {
  816. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  817. }
  818. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  819. {
  820. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  821. }
  822. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  823. {
  824. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  825. }
  826. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  827. {
  828. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  829. }
  830. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  831. {
  832. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  833. }
  834. }
  835. }
  836. }
  837. for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4); i++)
  838. {
  839. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundStartEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  840. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3;
  841. for (n = first; n != null; n = n.getNextSibling())
  842. {
  843. if ("enchant4cond".equalsIgnoreCase(n.getNodeName()))
  844. {
  845. foundCond = true;
  846. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  847. Node msg = n.getAttributes().getNamedItem("msg");
  848. Node msgId = n.getAttributes().getNamedItem("msgId");
  849. if ((condition != null) && (msg != null))
  850. {
  851. condition.setMessage(msg.getNodeValue());
  852. }
  853. else if ((condition != null) && (msgId != null))
  854. {
  855. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  856. Node addName = n.getAttributes().getNamedItem("addName");
  857. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  858. {
  859. condition.addName();
  860. }
  861. }
  862. _currentSkill.currentSkills.get(i).attach(condition, false);
  863. }
  864. else if ("enchant4for".equalsIgnoreCase(n.getNodeName()))
  865. {
  866. foundFor = true;
  867. parseTemplate(n, _currentSkill.currentSkills.get(i));
  868. }
  869. else if ("enchant4startEffects".equalsIgnoreCase(n.getNodeName()))
  870. {
  871. foundStartEffects = true;
  872. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  873. }
  874. else if ("enchant4channelingEffects".equalsIgnoreCase(n.getNodeName()))
  875. {
  876. foundChannelingEffects = true;
  877. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  878. }
  879. else if ("enchant4pveEffects".equalsIgnoreCase(n.getNodeName()))
  880. {
  881. foundPveEffects = true;
  882. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  883. }
  884. else if ("enchant4pvpEffects".equalsIgnoreCase(n.getNodeName()))
  885. {
  886. foundPvpEffects = true;
  887. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  888. }
  889. else if ("enchant4endEffects".equalsIgnoreCase(n.getNodeName()))
  890. {
  891. foundEndEffects = true;
  892. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  893. }
  894. else if ("enchant4selfEffects".equalsIgnoreCase(n.getNodeName()))
  895. {
  896. foundSelfEffects = true;
  897. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  898. }
  899. }
  900. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  901. if (!foundCond || !foundFor || !foundChannelingEffects || !foundStartEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  902. {
  903. _currentSkill.currentLevel = lastLvl - 1;
  904. for (n = first; n != null; n = n.getNextSibling())
  905. {
  906. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  907. {
  908. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  909. Node msg = n.getAttributes().getNamedItem("msg");
  910. Node msgId = n.getAttributes().getNamedItem("msgId");
  911. if ((condition != null) && (msg != null))
  912. {
  913. condition.setMessage(msg.getNodeValue());
  914. }
  915. else if ((condition != null) && (msgId != null))
  916. {
  917. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  918. Node addName = n.getAttributes().getNamedItem("addName");
  919. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  920. {
  921. condition.addName();
  922. }
  923. }
  924. _currentSkill.currentSkills.get(i).attach(condition, false);
  925. }
  926. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  927. {
  928. parseTemplate(n, _currentSkill.currentSkills.get(i));
  929. }
  930. else if (!foundStartEffects && "startEffects".equalsIgnoreCase(n.getNodeName()))
  931. {
  932. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  933. }
  934. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  935. {
  936. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  937. }
  938. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  939. {
  940. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  941. }
  942. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  943. {
  944. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  945. }
  946. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  947. {
  948. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  949. }
  950. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  951. {
  952. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  953. }
  954. }
  955. }
  956. }
  957. for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5); i++)
  958. {
  959. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundStartEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  960. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4;
  961. for (n = first; n != null; n = n.getNextSibling())
  962. {
  963. if ("enchant5cond".equalsIgnoreCase(n.getNodeName()))
  964. {
  965. foundCond = true;
  966. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  967. Node msg = n.getAttributes().getNamedItem("msg");
  968. Node msgId = n.getAttributes().getNamedItem("msgId");
  969. if ((condition != null) && (msg != null))
  970. {
  971. condition.setMessage(msg.getNodeValue());
  972. }
  973. else if ((condition != null) && (msgId != null))
  974. {
  975. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  976. Node addName = n.getAttributes().getNamedItem("addName");
  977. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  978. {
  979. condition.addName();
  980. }
  981. }
  982. _currentSkill.currentSkills.get(i).attach(condition, false);
  983. }
  984. else if ("enchant5for".equalsIgnoreCase(n.getNodeName()))
  985. {
  986. foundFor = true;
  987. parseTemplate(n, _currentSkill.currentSkills.get(i));
  988. }
  989. else if ("enchant5startEffects".equalsIgnoreCase(n.getNodeName()))
  990. {
  991. foundStartEffects = true;
  992. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  993. }
  994. else if ("enchant5channelingEffects".equalsIgnoreCase(n.getNodeName()))
  995. {
  996. foundChannelingEffects = true;
  997. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  998. }
  999. else if ("enchant5pveEffects".equalsIgnoreCase(n.getNodeName()))
  1000. {
  1001. foundPveEffects = true;
  1002. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1003. }
  1004. else if ("enchant5pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1005. {
  1006. foundPvpEffects = true;
  1007. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1008. }
  1009. else if ("enchant5endEffects".equalsIgnoreCase(n.getNodeName()))
  1010. {
  1011. foundEndEffects = true;
  1012. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1013. }
  1014. else if ("enchant5selfEffects".equalsIgnoreCase(n.getNodeName()))
  1015. {
  1016. foundSelfEffects = true;
  1017. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1018. }
  1019. }
  1020. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  1021. if (!foundCond || !foundFor || !foundChannelingEffects || !foundStartEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  1022. {
  1023. _currentSkill.currentLevel = lastLvl - 1;
  1024. for (n = first; n != null; n = n.getNextSibling())
  1025. {
  1026. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  1027. {
  1028. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1029. Node msg = n.getAttributes().getNamedItem("msg");
  1030. Node msgId = n.getAttributes().getNamedItem("msgId");
  1031. if ((condition != null) && (msg != null))
  1032. {
  1033. condition.setMessage(msg.getNodeValue());
  1034. }
  1035. else if ((condition != null) && (msgId != null))
  1036. {
  1037. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1038. Node addName = n.getAttributes().getNamedItem("addName");
  1039. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1040. {
  1041. condition.addName();
  1042. }
  1043. }
  1044. _currentSkill.currentSkills.get(i).attach(condition, false);
  1045. }
  1046. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  1047. {
  1048. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1049. }
  1050. else if (!foundStartEffects && "startEffects".equalsIgnoreCase(n.getNodeName()))
  1051. {
  1052. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  1053. }
  1054. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1055. {
  1056. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1057. }
  1058. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  1059. {
  1060. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1061. }
  1062. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1063. {
  1064. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1065. }
  1066. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  1067. {
  1068. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1069. }
  1070. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  1071. {
  1072. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1073. }
  1074. }
  1075. }
  1076. }
  1077. for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6); i++)
  1078. {
  1079. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundStartEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  1080. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4 - enchantLevels5;
  1081. for (n = first; n != null; n = n.getNextSibling())
  1082. {
  1083. if ("enchant6cond".equalsIgnoreCase(n.getNodeName()))
  1084. {
  1085. foundCond = true;
  1086. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1087. Node msg = n.getAttributes().getNamedItem("msg");
  1088. Node msgId = n.getAttributes().getNamedItem("msgId");
  1089. if ((condition != null) && (msg != null))
  1090. {
  1091. condition.setMessage(msg.getNodeValue());
  1092. }
  1093. else if ((condition != null) && (msgId != null))
  1094. {
  1095. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1096. Node addName = n.getAttributes().getNamedItem("addName");
  1097. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1098. {
  1099. condition.addName();
  1100. }
  1101. }
  1102. _currentSkill.currentSkills.get(i).attach(condition, false);
  1103. }
  1104. else if ("enchant6for".equalsIgnoreCase(n.getNodeName()))
  1105. {
  1106. foundFor = true;
  1107. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1108. }
  1109. else if ("enchant6startEffects".equalsIgnoreCase(n.getNodeName()))
  1110. {
  1111. foundStartEffects = true;
  1112. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  1113. }
  1114. else if ("enchant6channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1115. {
  1116. foundChannelingEffects = true;
  1117. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1118. }
  1119. else if ("enchant6pveEffects".equalsIgnoreCase(n.getNodeName()))
  1120. {
  1121. foundPveEffects = true;
  1122. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1123. }
  1124. else if ("enchant6pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1125. {
  1126. foundPvpEffects = true;
  1127. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1128. }
  1129. else if ("enchant6endEffects".equalsIgnoreCase(n.getNodeName()))
  1130. {
  1131. foundEndEffects = true;
  1132. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1133. }
  1134. else if ("enchant6selfEffects".equalsIgnoreCase(n.getNodeName()))
  1135. {
  1136. foundSelfEffects = true;
  1137. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1138. }
  1139. }
  1140. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  1141. if (!foundCond || !foundFor || !foundChannelingEffects || !foundStartEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  1142. {
  1143. _currentSkill.currentLevel = lastLvl - 1;
  1144. for (n = first; n != null; n = n.getNextSibling())
  1145. {
  1146. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  1147. {
  1148. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1149. Node msg = n.getAttributes().getNamedItem("msg");
  1150. Node msgId = n.getAttributes().getNamedItem("msgId");
  1151. if ((condition != null) && (msg != null))
  1152. {
  1153. condition.setMessage(msg.getNodeValue());
  1154. }
  1155. else if ((condition != null) && (msgId != null))
  1156. {
  1157. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1158. Node addName = n.getAttributes().getNamedItem("addName");
  1159. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1160. {
  1161. condition.addName();
  1162. }
  1163. }
  1164. _currentSkill.currentSkills.get(i).attach(condition, false);
  1165. }
  1166. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  1167. {
  1168. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1169. }
  1170. else if (!foundStartEffects && "startEffects".equalsIgnoreCase(n.getNodeName()))
  1171. {
  1172. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  1173. }
  1174. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1175. {
  1176. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1177. }
  1178. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  1179. {
  1180. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1181. }
  1182. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1183. {
  1184. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1185. }
  1186. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  1187. {
  1188. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1189. }
  1190. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  1191. {
  1192. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1193. }
  1194. }
  1195. }
  1196. }
  1197. for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6 + enchantLevels7); i++)
  1198. {
  1199. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundStartEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  1200. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4 - enchantLevels5 - enchantLevels6;
  1201. for (n = first; n != null; n = n.getNextSibling())
  1202. {
  1203. if ("enchant7cond".equalsIgnoreCase(n.getNodeName()))
  1204. {
  1205. foundCond = true;
  1206. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1207. Node msg = n.getAttributes().getNamedItem("msg");
  1208. Node msgId = n.getAttributes().getNamedItem("msgId");
  1209. if ((condition != null) && (msg != null))
  1210. {
  1211. condition.setMessage(msg.getNodeValue());
  1212. }
  1213. else if ((condition != null) && (msgId != null))
  1214. {
  1215. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1216. Node addName = n.getAttributes().getNamedItem("addName");
  1217. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1218. {
  1219. condition.addName();
  1220. }
  1221. }
  1222. _currentSkill.currentSkills.get(i).attach(condition, false);
  1223. }
  1224. else if ("enchant7for".equalsIgnoreCase(n.getNodeName()))
  1225. {
  1226. foundFor = true;
  1227. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1228. }
  1229. else if ("enchant7startEffects".equalsIgnoreCase(n.getNodeName()))
  1230. {
  1231. foundStartEffects = true;
  1232. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  1233. }
  1234. else if ("enchant7channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1235. {
  1236. foundChannelingEffects = true;
  1237. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1238. }
  1239. else if ("enchant7pveEffects".equalsIgnoreCase(n.getNodeName()))
  1240. {
  1241. foundPveEffects = true;
  1242. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1243. }
  1244. else if ("enchant7pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1245. {
  1246. foundPvpEffects = true;
  1247. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1248. }
  1249. else if ("enchant7endEffects".equalsIgnoreCase(n.getNodeName()))
  1250. {
  1251. foundEndEffects = true;
  1252. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1253. }
  1254. else if ("enchant7selfEffects".equalsIgnoreCase(n.getNodeName()))
  1255. {
  1256. foundSelfEffects = true;
  1257. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1258. }
  1259. }
  1260. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  1261. if (!foundCond || !foundFor || !foundChannelingEffects || !foundStartEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  1262. {
  1263. _currentSkill.currentLevel = lastLvl - 1;
  1264. for (n = first; n != null; n = n.getNextSibling())
  1265. {
  1266. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  1267. {
  1268. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1269. Node msg = n.getAttributes().getNamedItem("msg");
  1270. Node msgId = n.getAttributes().getNamedItem("msgId");
  1271. if ((condition != null) && (msg != null))
  1272. {
  1273. condition.setMessage(msg.getNodeValue());
  1274. }
  1275. else if ((condition != null) && (msgId != null))
  1276. {
  1277. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1278. Node addName = n.getAttributes().getNamedItem("addName");
  1279. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1280. {
  1281. condition.addName();
  1282. }
  1283. }
  1284. _currentSkill.currentSkills.get(i).attach(condition, false);
  1285. }
  1286. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  1287. {
  1288. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1289. }
  1290. else if (!foundChannelingEffects && "startEffects".equalsIgnoreCase(n.getNodeName()))
  1291. {
  1292. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  1293. }
  1294. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1295. {
  1296. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1297. }
  1298. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  1299. {
  1300. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1301. }
  1302. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1303. {
  1304. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1305. }
  1306. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  1307. {
  1308. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1309. }
  1310. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  1311. {
  1312. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1313. }
  1314. }
  1315. }
  1316. }
  1317. for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6 + enchantLevels7; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6 + enchantLevels7 + enchantLevels8); i++)
  1318. {
  1319. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundStartEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  1320. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4 - enchantLevels5 - enchantLevels6 - enchantLevels7;
  1321. for (n = first; n != null; n = n.getNextSibling())
  1322. {
  1323. if ("enchant8cond".equalsIgnoreCase(n.getNodeName()))
  1324. {
  1325. foundCond = true;
  1326. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1327. Node msg = n.getAttributes().getNamedItem("msg");
  1328. Node msgId = n.getAttributes().getNamedItem("msgId");
  1329. if ((condition != null) && (msg != null))
  1330. {
  1331. condition.setMessage(msg.getNodeValue());
  1332. }
  1333. else if ((condition != null) && (msgId != null))
  1334. {
  1335. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1336. Node addName = n.getAttributes().getNamedItem("addName");
  1337. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1338. {
  1339. condition.addName();
  1340. }
  1341. }
  1342. _currentSkill.currentSkills.get(i).attach(condition, false);
  1343. }
  1344. else if ("enchant8for".equalsIgnoreCase(n.getNodeName()))
  1345. {
  1346. foundFor = true;
  1347. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1348. }
  1349. else if ("enchant8startEffects".equalsIgnoreCase(n.getNodeName()))
  1350. {
  1351. foundStartEffects = true;
  1352. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  1353. }
  1354. else if ("enchant8channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1355. {
  1356. foundChannelingEffects = true;
  1357. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1358. }
  1359. else if ("enchant8pveEffects".equalsIgnoreCase(n.getNodeName()))
  1360. {
  1361. foundPveEffects = true;
  1362. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1363. }
  1364. else if ("enchant8pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1365. {
  1366. foundPvpEffects = true;
  1367. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1368. }
  1369. else if ("enchant8endEffects".equalsIgnoreCase(n.getNodeName()))
  1370. {
  1371. foundEndEffects = true;
  1372. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1373. }
  1374. else if ("enchant8selfEffects".equalsIgnoreCase(n.getNodeName()))
  1375. {
  1376. foundSelfEffects = true;
  1377. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1378. }
  1379. }
  1380. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  1381. if (!foundCond || !foundFor || !foundChannelingEffects || !foundStartEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  1382. {
  1383. _currentSkill.currentLevel = lastLvl - 1;
  1384. for (n = first; n != null; n = n.getNextSibling())
  1385. {
  1386. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  1387. {
  1388. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1389. Node msg = n.getAttributes().getNamedItem("msg");
  1390. Node msgId = n.getAttributes().getNamedItem("msgId");
  1391. if ((condition != null) && (msg != null))
  1392. {
  1393. condition.setMessage(msg.getNodeValue());
  1394. }
  1395. else if ((condition != null) && (msgId != null))
  1396. {
  1397. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1398. Node addName = n.getAttributes().getNamedItem("addName");
  1399. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1400. {
  1401. condition.addName();
  1402. }
  1403. }
  1404. _currentSkill.currentSkills.get(i).attach(condition, false);
  1405. }
  1406. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  1407. {
  1408. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1409. }
  1410. else if (!foundStartEffects && "startEffects".equalsIgnoreCase(n.getNodeName()))
  1411. {
  1412. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.START);
  1413. }
  1414. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1415. {
  1416. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1417. }
  1418. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  1419. {
  1420. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1421. }
  1422. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1423. {
  1424. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1425. }
  1426. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  1427. {
  1428. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1429. }
  1430. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  1431. {
  1432. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1433. }
  1434. }
  1435. }
  1436. }
  1437. _currentSkill.skills.addAll(_currentSkill.currentSkills);
  1438. }
  1439. private void makeSkills()
  1440. {
  1441. int count = 0;
  1442. _currentSkill.currentSkills = new FastList<>(_currentSkill.sets.length + _currentSkill.enchsets1.length + _currentSkill.enchsets2.length + _currentSkill.enchsets3.length + _currentSkill.enchsets4.length + _currentSkill.enchsets5.length + _currentSkill.enchsets6.length + _currentSkill.enchsets7.length + _currentSkill.enchsets8.length);
  1443. StatsSet set;
  1444. for (int i = 0; i < _currentSkill.sets.length; i++)
  1445. {
  1446. set = _currentSkill.sets[i];
  1447. try
  1448. {
  1449. _currentSkill.currentSkills.add(i, new Skill(set));
  1450. count++;
  1451. }
  1452. catch (Exception e)
  1453. {
  1454. _log.log(Level.SEVERE, "Skill id=" + set.getInt("skill_id") + "level" + set.getInt("level"), e);
  1455. }
  1456. }
  1457. int _count = count;
  1458. for (int i = 0; i < _currentSkill.enchsets1.length; i++)
  1459. {
  1460. set = _currentSkill.enchsets1[i];
  1461. try
  1462. {
  1463. _currentSkill.currentSkills.add(_count + i, new Skill(set));
  1464. count++;
  1465. }
  1466. catch (Exception e)
  1467. {
  1468. _log.log(Level.SEVERE, "Skill id=" + set.getInt("skill_id") + "level" + set.getInt("level"), e);
  1469. }
  1470. }
  1471. _count = count;
  1472. for (int i = 0; i < _currentSkill.enchsets2.length; i++)
  1473. {
  1474. set = _currentSkill.enchsets2[i];
  1475. try
  1476. {
  1477. _currentSkill.currentSkills.add(_count + i, new Skill(set));
  1478. count++;
  1479. }
  1480. catch (Exception e)
  1481. {
  1482. _log.log(Level.SEVERE, "Skill id=" + set.getInt("skill_id") + "level" + set.getInt("level"), e);
  1483. }
  1484. }
  1485. _count = count;
  1486. for (int i = 0; i < _currentSkill.enchsets3.length; i++)
  1487. {
  1488. set = _currentSkill.enchsets3[i];
  1489. try
  1490. {
  1491. _currentSkill.currentSkills.add(_count + i, new Skill(set));
  1492. count++;
  1493. }
  1494. catch (Exception e)
  1495. {
  1496. _log.log(Level.SEVERE, "Skill id=" + set.getInt("skill_id") + "level" + set.getInt("level"), e);
  1497. }
  1498. }
  1499. _count = count;
  1500. for (int i = 0; i < _currentSkill.enchsets4.length; i++)
  1501. {
  1502. set = _currentSkill.enchsets4[i];
  1503. try
  1504. {
  1505. _currentSkill.currentSkills.add(_count + i, new Skill(set));
  1506. count++;
  1507. }
  1508. catch (Exception e)
  1509. {
  1510. _log.log(Level.SEVERE, "Skill id=" + set.getInt("skill_id") + "level" + set.getInt("level"), e);
  1511. }
  1512. }
  1513. _count = count;
  1514. for (int i = 0; i < _currentSkill.enchsets5.length; i++)
  1515. {
  1516. set = _currentSkill.enchsets5[i];
  1517. try
  1518. {
  1519. _currentSkill.currentSkills.add(_count + i, new Skill(set));
  1520. count++;
  1521. }
  1522. catch (Exception e)
  1523. {
  1524. _log.log(Level.SEVERE, "Skill id=" + set.getInt("skill_id") + "level" + set.getInt("level"), e);
  1525. }
  1526. }
  1527. _count = count;
  1528. for (int i = 0; i < _currentSkill.enchsets6.length; i++)
  1529. {
  1530. set = _currentSkill.enchsets6[i];
  1531. try
  1532. {
  1533. _currentSkill.currentSkills.add(_count + i, new Skill(set));
  1534. count++;
  1535. }
  1536. catch (Exception e)
  1537. {
  1538. _log.log(Level.SEVERE, "Skill id=" + set.getInt("skill_id") + "level" + set.getInt("level"), e);
  1539. }
  1540. }
  1541. _count = count;
  1542. for (int i = 0; i < _currentSkill.enchsets7.length; i++)
  1543. {
  1544. set = _currentSkill.enchsets7[i];
  1545. try
  1546. {
  1547. _currentSkill.currentSkills.add(_count + i, new Skill(set));
  1548. count++;
  1549. }
  1550. catch (Exception e)
  1551. {
  1552. _log.log(Level.SEVERE, "Skill id=" + set.getInt("skill_id") + "level" + set.getInt("level"), e);
  1553. }
  1554. }
  1555. _count = count;
  1556. for (int i = 0; i < _currentSkill.enchsets8.length; i++)
  1557. {
  1558. set = _currentSkill.enchsets8[i];
  1559. try
  1560. {
  1561. _currentSkill.currentSkills.add(_count + i, new Skill(set));
  1562. count++;
  1563. }
  1564. catch (Exception e)
  1565. {
  1566. _log.log(Level.SEVERE, "Skill id=" + set.getInt("skill_id") + "level" + set.getInt("level"), e);
  1567. }
  1568. }
  1569. }
  1570. }