DocumentSkill.java 64 KB

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