DocumentSkill.java 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621
  1. /*
  2. * Copyright (C) 2004-2015 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.ArrayList;
  22. import java.util.List;
  23. import java.util.logging.Level;
  24. import org.w3c.dom.Document;
  25. import org.w3c.dom.NamedNodeMap;
  26. import org.w3c.dom.Node;
  27. import com.l2jserver.gameserver.data.xml.impl.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 ArrayList<>();
  53. public List<Skill> currentSkills = new ArrayList<>();
  54. }
  55. private SkillInfo _currentSkill;
  56. private final List<Skill> _skillsInFile = new ArrayList<>();
  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 ArrayList<>(_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. }