DocumentSkill.java 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542
  1. /*
  2. * Copyright (C) 2004-2013 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 ("channelingEffects".equalsIgnoreCase(n.getNodeName()))
  457. {
  458. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  459. }
  460. else if ("pveEffects".equalsIgnoreCase(n.getNodeName()))
  461. {
  462. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  463. }
  464. else if ("pvpEffects".equalsIgnoreCase(n.getNodeName()))
  465. {
  466. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  467. }
  468. else if ("endEffects".equalsIgnoreCase(n.getNodeName()))
  469. {
  470. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  471. }
  472. else if ("selfEffects".equalsIgnoreCase(n.getNodeName()))
  473. {
  474. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  475. }
  476. }
  477. }
  478. for (int i = lastLvl; i < (lastLvl + enchantLevels1); i++)
  479. {
  480. _currentSkill.currentLevel = i - lastLvl;
  481. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  482. for (n = first; n != null; n = n.getNextSibling())
  483. {
  484. if ("enchant1cond".equalsIgnoreCase(n.getNodeName()))
  485. {
  486. foundCond = true;
  487. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  488. Node msg = n.getAttributes().getNamedItem("msg");
  489. Node msgId = n.getAttributes().getNamedItem("msgId");
  490. if ((condition != null) && (msg != null))
  491. {
  492. condition.setMessage(msg.getNodeValue());
  493. }
  494. else if ((condition != null) && (msgId != null))
  495. {
  496. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  497. Node addName = n.getAttributes().getNamedItem("addName");
  498. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  499. {
  500. condition.addName();
  501. }
  502. }
  503. _currentSkill.currentSkills.get(i).attach(condition, false);
  504. }
  505. else if ("enchant1for".equalsIgnoreCase(n.getNodeName()))
  506. {
  507. foundFor = true;
  508. parseTemplate(n, _currentSkill.currentSkills.get(i));
  509. }
  510. else if ("enchant1channelingEffects".equalsIgnoreCase(n.getNodeName()))
  511. {
  512. foundChannelingEffects = true;
  513. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  514. }
  515. else if ("enchant1pveEffects".equalsIgnoreCase(n.getNodeName()))
  516. {
  517. foundPveEffects = true;
  518. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  519. }
  520. else if ("enchant1pvpEffects".equalsIgnoreCase(n.getNodeName()))
  521. {
  522. foundPvpEffects = true;
  523. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  524. }
  525. else if ("enchant1endEffects".equalsIgnoreCase(n.getNodeName()))
  526. {
  527. foundEndEffects = true;
  528. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  529. }
  530. else if ("enchant1selfEffects".equalsIgnoreCase(n.getNodeName()))
  531. {
  532. foundSelfEffects = true;
  533. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  534. }
  535. }
  536. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  537. if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  538. {
  539. _currentSkill.currentLevel = lastLvl - 1;
  540. for (n = first; n != null; n = n.getNextSibling())
  541. {
  542. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  543. {
  544. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  545. Node msg = n.getAttributes().getNamedItem("msg");
  546. Node msgId = n.getAttributes().getNamedItem("msgId");
  547. if ((condition != null) && (msg != null))
  548. {
  549. condition.setMessage(msg.getNodeValue());
  550. }
  551. else if ((condition != null) && (msgId != null))
  552. {
  553. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  554. Node addName = n.getAttributes().getNamedItem("addName");
  555. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  556. {
  557. condition.addName();
  558. }
  559. }
  560. _currentSkill.currentSkills.get(i).attach(condition, false);
  561. }
  562. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  563. {
  564. parseTemplate(n, _currentSkill.currentSkills.get(i));
  565. }
  566. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  567. {
  568. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  569. }
  570. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  571. {
  572. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  573. }
  574. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  575. {
  576. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  577. }
  578. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  579. {
  580. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  581. }
  582. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  583. {
  584. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  585. }
  586. }
  587. }
  588. }
  589. for (int i = lastLvl + enchantLevels1; i < (lastLvl + enchantLevels1 + enchantLevels2); i++)
  590. {
  591. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  592. _currentSkill.currentLevel = i - lastLvl - enchantLevels1;
  593. for (n = first; n != null; n = n.getNextSibling())
  594. {
  595. if ("enchant2cond".equalsIgnoreCase(n.getNodeName()))
  596. {
  597. foundCond = true;
  598. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  599. Node msg = n.getAttributes().getNamedItem("msg");
  600. Node msgId = n.getAttributes().getNamedItem("msgId");
  601. if ((condition != null) && (msg != null))
  602. {
  603. condition.setMessage(msg.getNodeValue());
  604. }
  605. else if ((condition != null) && (msgId != null))
  606. {
  607. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  608. Node addName = n.getAttributes().getNamedItem("addName");
  609. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  610. {
  611. condition.addName();
  612. }
  613. }
  614. _currentSkill.currentSkills.get(i).attach(condition, false);
  615. }
  616. else if ("enchant2for".equalsIgnoreCase(n.getNodeName()))
  617. {
  618. foundFor = true;
  619. parseTemplate(n, _currentSkill.currentSkills.get(i));
  620. }
  621. else if ("enchant2channelingEffects".equalsIgnoreCase(n.getNodeName()))
  622. {
  623. foundChannelingEffects = true;
  624. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  625. }
  626. else if ("enchant2pveEffects".equalsIgnoreCase(n.getNodeName()))
  627. {
  628. foundPveEffects = true;
  629. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  630. }
  631. else if ("enchant2pvpEffects".equalsIgnoreCase(n.getNodeName()))
  632. {
  633. foundPvpEffects = true;
  634. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  635. }
  636. else if ("enchant2endEffects".equalsIgnoreCase(n.getNodeName()))
  637. {
  638. foundEndEffects = true;
  639. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  640. }
  641. else if ("enchant2selfEffects".equalsIgnoreCase(n.getNodeName()))
  642. {
  643. foundSelfEffects = true;
  644. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  645. }
  646. }
  647. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  648. if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  649. {
  650. _currentSkill.currentLevel = lastLvl - 1;
  651. for (n = first; n != null; n = n.getNextSibling())
  652. {
  653. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  654. {
  655. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  656. Node msg = n.getAttributes().getNamedItem("msg");
  657. Node msgId = n.getAttributes().getNamedItem("msgId");
  658. if ((condition != null) && (msg != null))
  659. {
  660. condition.setMessage(msg.getNodeValue());
  661. }
  662. else if ((condition != null) && (msgId != null))
  663. {
  664. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  665. Node addName = n.getAttributes().getNamedItem("addName");
  666. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  667. {
  668. condition.addName();
  669. }
  670. }
  671. _currentSkill.currentSkills.get(i).attach(condition, false);
  672. }
  673. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  674. {
  675. parseTemplate(n, _currentSkill.currentSkills.get(i));
  676. }
  677. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  678. {
  679. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  680. }
  681. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  682. {
  683. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  684. }
  685. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  686. {
  687. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  688. }
  689. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  690. {
  691. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  692. }
  693. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  694. {
  695. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  696. }
  697. }
  698. }
  699. }
  700. for (int i = lastLvl + enchantLevels1 + enchantLevels2; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3); i++)
  701. {
  702. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  703. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2;
  704. for (n = first; n != null; n = n.getNextSibling())
  705. {
  706. if ("enchant3cond".equalsIgnoreCase(n.getNodeName()))
  707. {
  708. foundCond = true;
  709. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  710. Node msg = n.getAttributes().getNamedItem("msg");
  711. Node msgId = n.getAttributes().getNamedItem("msgId");
  712. if ((condition != null) && (msg != null))
  713. {
  714. condition.setMessage(msg.getNodeValue());
  715. }
  716. else if ((condition != null) && (msgId != null))
  717. {
  718. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  719. Node addName = n.getAttributes().getNamedItem("addName");
  720. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  721. {
  722. condition.addName();
  723. }
  724. }
  725. _currentSkill.currentSkills.get(i).attach(condition, false);
  726. }
  727. else if ("enchant3for".equalsIgnoreCase(n.getNodeName()))
  728. {
  729. foundFor = true;
  730. parseTemplate(n, _currentSkill.currentSkills.get(i));
  731. }
  732. else if ("enchant3channelingEffects".equalsIgnoreCase(n.getNodeName()))
  733. {
  734. foundChannelingEffects = true;
  735. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  736. }
  737. else if ("enchant3pveEffects".equalsIgnoreCase(n.getNodeName()))
  738. {
  739. foundPveEffects = true;
  740. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  741. }
  742. else if ("enchant3pvpEffects".equalsIgnoreCase(n.getNodeName()))
  743. {
  744. foundPvpEffects = true;
  745. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  746. }
  747. else if ("enchant3endEffects".equalsIgnoreCase(n.getNodeName()))
  748. {
  749. foundEndEffects = true;
  750. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  751. }
  752. else if ("enchant3selfEffects".equalsIgnoreCase(n.getNodeName()))
  753. {
  754. foundSelfEffects = true;
  755. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  756. }
  757. }
  758. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  759. if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  760. {
  761. _currentSkill.currentLevel = lastLvl - 1;
  762. for (n = first; n != null; n = n.getNextSibling())
  763. {
  764. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  765. {
  766. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  767. Node msg = n.getAttributes().getNamedItem("msg");
  768. Node msgId = n.getAttributes().getNamedItem("msgId");
  769. if ((condition != null) && (msg != null))
  770. {
  771. condition.setMessage(msg.getNodeValue());
  772. }
  773. else if ((condition != null) && (msgId != null))
  774. {
  775. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  776. Node addName = n.getAttributes().getNamedItem("addName");
  777. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  778. {
  779. condition.addName();
  780. }
  781. }
  782. _currentSkill.currentSkills.get(i).attach(condition, false);
  783. }
  784. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  785. {
  786. parseTemplate(n, _currentSkill.currentSkills.get(i));
  787. }
  788. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  789. {
  790. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  791. }
  792. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  793. {
  794. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  795. }
  796. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  797. {
  798. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  799. }
  800. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  801. {
  802. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  803. }
  804. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  805. {
  806. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  807. }
  808. }
  809. }
  810. }
  811. for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4); i++)
  812. {
  813. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  814. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3;
  815. for (n = first; n != null; n = n.getNextSibling())
  816. {
  817. if ("enchant4cond".equalsIgnoreCase(n.getNodeName()))
  818. {
  819. foundCond = true;
  820. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  821. Node msg = n.getAttributes().getNamedItem("msg");
  822. Node msgId = n.getAttributes().getNamedItem("msgId");
  823. if ((condition != null) && (msg != null))
  824. {
  825. condition.setMessage(msg.getNodeValue());
  826. }
  827. else if ((condition != null) && (msgId != null))
  828. {
  829. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  830. Node addName = n.getAttributes().getNamedItem("addName");
  831. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  832. {
  833. condition.addName();
  834. }
  835. }
  836. _currentSkill.currentSkills.get(i).attach(condition, false);
  837. }
  838. else if ("enchant4for".equalsIgnoreCase(n.getNodeName()))
  839. {
  840. foundFor = true;
  841. parseTemplate(n, _currentSkill.currentSkills.get(i));
  842. }
  843. else if ("enchant4channelingEffects".equalsIgnoreCase(n.getNodeName()))
  844. {
  845. foundChannelingEffects = true;
  846. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  847. }
  848. else if ("enchant4pveEffects".equalsIgnoreCase(n.getNodeName()))
  849. {
  850. foundPveEffects = true;
  851. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  852. }
  853. else if ("enchant4pvpEffects".equalsIgnoreCase(n.getNodeName()))
  854. {
  855. foundPvpEffects = true;
  856. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  857. }
  858. else if ("enchant4endEffects".equalsIgnoreCase(n.getNodeName()))
  859. {
  860. foundEndEffects = true;
  861. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  862. }
  863. else if ("enchant4selfEffects".equalsIgnoreCase(n.getNodeName()))
  864. {
  865. foundSelfEffects = true;
  866. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  867. }
  868. }
  869. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  870. if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  871. {
  872. _currentSkill.currentLevel = lastLvl - 1;
  873. for (n = first; n != null; n = n.getNextSibling())
  874. {
  875. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  876. {
  877. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  878. Node msg = n.getAttributes().getNamedItem("msg");
  879. Node msgId = n.getAttributes().getNamedItem("msgId");
  880. if ((condition != null) && (msg != null))
  881. {
  882. condition.setMessage(msg.getNodeValue());
  883. }
  884. else if ((condition != null) && (msgId != null))
  885. {
  886. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  887. Node addName = n.getAttributes().getNamedItem("addName");
  888. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  889. {
  890. condition.addName();
  891. }
  892. }
  893. _currentSkill.currentSkills.get(i).attach(condition, false);
  894. }
  895. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  896. {
  897. parseTemplate(n, _currentSkill.currentSkills.get(i));
  898. }
  899. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  900. {
  901. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  902. }
  903. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  904. {
  905. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  906. }
  907. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  908. {
  909. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  910. }
  911. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  912. {
  913. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  914. }
  915. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  916. {
  917. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  918. }
  919. }
  920. }
  921. }
  922. for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5); i++)
  923. {
  924. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  925. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4;
  926. for (n = first; n != null; n = n.getNextSibling())
  927. {
  928. if ("enchant5cond".equalsIgnoreCase(n.getNodeName()))
  929. {
  930. foundCond = true;
  931. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  932. Node msg = n.getAttributes().getNamedItem("msg");
  933. Node msgId = n.getAttributes().getNamedItem("msgId");
  934. if ((condition != null) && (msg != null))
  935. {
  936. condition.setMessage(msg.getNodeValue());
  937. }
  938. else if ((condition != null) && (msgId != null))
  939. {
  940. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  941. Node addName = n.getAttributes().getNamedItem("addName");
  942. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  943. {
  944. condition.addName();
  945. }
  946. }
  947. _currentSkill.currentSkills.get(i).attach(condition, false);
  948. }
  949. else if ("enchant5for".equalsIgnoreCase(n.getNodeName()))
  950. {
  951. foundFor = true;
  952. parseTemplate(n, _currentSkill.currentSkills.get(i));
  953. }
  954. else if ("enchant5channelingEffects".equalsIgnoreCase(n.getNodeName()))
  955. {
  956. foundChannelingEffects = true;
  957. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  958. }
  959. else if ("enchant5pveEffects".equalsIgnoreCase(n.getNodeName()))
  960. {
  961. foundPveEffects = true;
  962. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  963. }
  964. else if ("enchant5pvpEffects".equalsIgnoreCase(n.getNodeName()))
  965. {
  966. foundPvpEffects = true;
  967. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  968. }
  969. else if ("enchant5endEffects".equalsIgnoreCase(n.getNodeName()))
  970. {
  971. foundEndEffects = true;
  972. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  973. }
  974. else if ("enchant5selfEffects".equalsIgnoreCase(n.getNodeName()))
  975. {
  976. foundSelfEffects = true;
  977. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  978. }
  979. }
  980. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  981. if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  982. {
  983. _currentSkill.currentLevel = lastLvl - 1;
  984. for (n = first; n != null; n = n.getNextSibling())
  985. {
  986. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  987. {
  988. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  989. Node msg = n.getAttributes().getNamedItem("msg");
  990. Node msgId = n.getAttributes().getNamedItem("msgId");
  991. if ((condition != null) && (msg != null))
  992. {
  993. condition.setMessage(msg.getNodeValue());
  994. }
  995. else if ((condition != null) && (msgId != null))
  996. {
  997. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  998. Node addName = n.getAttributes().getNamedItem("addName");
  999. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1000. {
  1001. condition.addName();
  1002. }
  1003. }
  1004. _currentSkill.currentSkills.get(i).attach(condition, false);
  1005. }
  1006. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  1007. {
  1008. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1009. }
  1010. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1011. {
  1012. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1013. }
  1014. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  1015. {
  1016. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1017. }
  1018. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1019. {
  1020. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1021. }
  1022. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  1023. {
  1024. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1025. }
  1026. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  1027. {
  1028. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1029. }
  1030. }
  1031. }
  1032. }
  1033. for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6); i++)
  1034. {
  1035. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  1036. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4 - enchantLevels5;
  1037. for (n = first; n != null; n = n.getNextSibling())
  1038. {
  1039. if ("enchant6cond".equalsIgnoreCase(n.getNodeName()))
  1040. {
  1041. foundCond = true;
  1042. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1043. Node msg = n.getAttributes().getNamedItem("msg");
  1044. Node msgId = n.getAttributes().getNamedItem("msgId");
  1045. if ((condition != null) && (msg != null))
  1046. {
  1047. condition.setMessage(msg.getNodeValue());
  1048. }
  1049. else if ((condition != null) && (msgId != null))
  1050. {
  1051. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1052. Node addName = n.getAttributes().getNamedItem("addName");
  1053. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1054. {
  1055. condition.addName();
  1056. }
  1057. }
  1058. _currentSkill.currentSkills.get(i).attach(condition, false);
  1059. }
  1060. else if ("enchant6for".equalsIgnoreCase(n.getNodeName()))
  1061. {
  1062. foundFor = true;
  1063. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1064. }
  1065. else if ("enchant6channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1066. {
  1067. foundChannelingEffects = true;
  1068. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1069. }
  1070. else if ("enchant6pveEffects".equalsIgnoreCase(n.getNodeName()))
  1071. {
  1072. foundPveEffects = true;
  1073. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1074. }
  1075. else if ("enchant6pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1076. {
  1077. foundPvpEffects = true;
  1078. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1079. }
  1080. else if ("enchant6endEffects".equalsIgnoreCase(n.getNodeName()))
  1081. {
  1082. foundEndEffects = true;
  1083. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1084. }
  1085. else if ("enchant6selfEffects".equalsIgnoreCase(n.getNodeName()))
  1086. {
  1087. foundSelfEffects = true;
  1088. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1089. }
  1090. }
  1091. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  1092. if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  1093. {
  1094. _currentSkill.currentLevel = lastLvl - 1;
  1095. for (n = first; n != null; n = n.getNextSibling())
  1096. {
  1097. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  1098. {
  1099. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1100. Node msg = n.getAttributes().getNamedItem("msg");
  1101. Node msgId = n.getAttributes().getNamedItem("msgId");
  1102. if ((condition != null) && (msg != null))
  1103. {
  1104. condition.setMessage(msg.getNodeValue());
  1105. }
  1106. else if ((condition != null) && (msgId != null))
  1107. {
  1108. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1109. Node addName = n.getAttributes().getNamedItem("addName");
  1110. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1111. {
  1112. condition.addName();
  1113. }
  1114. }
  1115. _currentSkill.currentSkills.get(i).attach(condition, false);
  1116. }
  1117. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  1118. {
  1119. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1120. }
  1121. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1122. {
  1123. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1124. }
  1125. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  1126. {
  1127. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1128. }
  1129. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1130. {
  1131. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1132. }
  1133. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  1134. {
  1135. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1136. }
  1137. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  1138. {
  1139. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1140. }
  1141. }
  1142. }
  1143. }
  1144. for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6 + enchantLevels7); i++)
  1145. {
  1146. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  1147. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4 - enchantLevels5 - enchantLevels6;
  1148. for (n = first; n != null; n = n.getNextSibling())
  1149. {
  1150. if ("enchant7cond".equalsIgnoreCase(n.getNodeName()))
  1151. {
  1152. foundCond = true;
  1153. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1154. Node msg = n.getAttributes().getNamedItem("msg");
  1155. Node msgId = n.getAttributes().getNamedItem("msgId");
  1156. if ((condition != null) && (msg != null))
  1157. {
  1158. condition.setMessage(msg.getNodeValue());
  1159. }
  1160. else if ((condition != null) && (msgId != null))
  1161. {
  1162. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1163. Node addName = n.getAttributes().getNamedItem("addName");
  1164. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1165. {
  1166. condition.addName();
  1167. }
  1168. }
  1169. _currentSkill.currentSkills.get(i).attach(condition, false);
  1170. }
  1171. else if ("enchant7for".equalsIgnoreCase(n.getNodeName()))
  1172. {
  1173. foundFor = true;
  1174. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1175. }
  1176. else if ("enchant7channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1177. {
  1178. foundChannelingEffects = true;
  1179. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1180. }
  1181. else if ("enchant7pveEffects".equalsIgnoreCase(n.getNodeName()))
  1182. {
  1183. foundPveEffects = true;
  1184. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1185. }
  1186. else if ("enchant7pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1187. {
  1188. foundPvpEffects = true;
  1189. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1190. }
  1191. else if ("enchant7endEffects".equalsIgnoreCase(n.getNodeName()))
  1192. {
  1193. foundEndEffects = true;
  1194. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1195. }
  1196. else if ("enchant7selfEffects".equalsIgnoreCase(n.getNodeName()))
  1197. {
  1198. foundSelfEffects = true;
  1199. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1200. }
  1201. }
  1202. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  1203. if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  1204. {
  1205. _currentSkill.currentLevel = lastLvl - 1;
  1206. for (n = first; n != null; n = n.getNextSibling())
  1207. {
  1208. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  1209. {
  1210. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1211. Node msg = n.getAttributes().getNamedItem("msg");
  1212. Node msgId = n.getAttributes().getNamedItem("msgId");
  1213. if ((condition != null) && (msg != null))
  1214. {
  1215. condition.setMessage(msg.getNodeValue());
  1216. }
  1217. else if ((condition != null) && (msgId != null))
  1218. {
  1219. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1220. Node addName = n.getAttributes().getNamedItem("addName");
  1221. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1222. {
  1223. condition.addName();
  1224. }
  1225. }
  1226. _currentSkill.currentSkills.get(i).attach(condition, false);
  1227. }
  1228. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  1229. {
  1230. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1231. }
  1232. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1233. {
  1234. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1235. }
  1236. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  1237. {
  1238. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1239. }
  1240. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1241. {
  1242. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1243. }
  1244. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  1245. {
  1246. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1247. }
  1248. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  1249. {
  1250. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1251. }
  1252. }
  1253. }
  1254. }
  1255. for (int i = lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6 + enchantLevels7; i < (lastLvl + enchantLevels1 + enchantLevels2 + enchantLevels3 + enchantLevels4 + enchantLevels5 + enchantLevels6 + enchantLevels7 + enchantLevels8); i++)
  1256. {
  1257. boolean foundCond = false, foundFor = false, foundChannelingEffects = false, foundPveEffects = false, foundPvpEffects = false, foundEndEffects = false, foundSelfEffects = false;
  1258. _currentSkill.currentLevel = i - lastLvl - enchantLevels1 - enchantLevels2 - enchantLevels3 - enchantLevels4 - enchantLevels5 - enchantLevels6 - enchantLevels7;
  1259. for (n = first; n != null; n = n.getNextSibling())
  1260. {
  1261. if ("enchant8cond".equalsIgnoreCase(n.getNodeName()))
  1262. {
  1263. foundCond = true;
  1264. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1265. Node msg = n.getAttributes().getNamedItem("msg");
  1266. Node msgId = n.getAttributes().getNamedItem("msgId");
  1267. if ((condition != null) && (msg != null))
  1268. {
  1269. condition.setMessage(msg.getNodeValue());
  1270. }
  1271. else if ((condition != null) && (msgId != null))
  1272. {
  1273. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1274. Node addName = n.getAttributes().getNamedItem("addName");
  1275. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1276. {
  1277. condition.addName();
  1278. }
  1279. }
  1280. _currentSkill.currentSkills.get(i).attach(condition, false);
  1281. }
  1282. else if ("enchant8for".equalsIgnoreCase(n.getNodeName()))
  1283. {
  1284. foundFor = true;
  1285. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1286. }
  1287. else if ("enchant8channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1288. {
  1289. foundChannelingEffects = true;
  1290. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1291. }
  1292. else if ("enchant8pveEffects".equalsIgnoreCase(n.getNodeName()))
  1293. {
  1294. foundPveEffects = true;
  1295. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1296. }
  1297. else if ("enchant8pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1298. {
  1299. foundPvpEffects = true;
  1300. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1301. }
  1302. else if ("enchant8endEffects".equalsIgnoreCase(n.getNodeName()))
  1303. {
  1304. foundEndEffects = true;
  1305. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1306. }
  1307. else if ("enchant8selfEffects".equalsIgnoreCase(n.getNodeName()))
  1308. {
  1309. foundSelfEffects = true;
  1310. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1311. }
  1312. }
  1313. // If none found, the enchanted skill will take effects from maxLvL of norm skill
  1314. if (!foundCond || !foundFor || !foundChannelingEffects || !foundPveEffects || !foundPvpEffects || !foundEndEffects || !foundSelfEffects)
  1315. {
  1316. _currentSkill.currentLevel = lastLvl - 1;
  1317. for (n = first; n != null; n = n.getNextSibling())
  1318. {
  1319. if (!foundCond && "cond".equalsIgnoreCase(n.getNodeName()))
  1320. {
  1321. Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
  1322. Node msg = n.getAttributes().getNamedItem("msg");
  1323. Node msgId = n.getAttributes().getNamedItem("msgId");
  1324. if ((condition != null) && (msg != null))
  1325. {
  1326. condition.setMessage(msg.getNodeValue());
  1327. }
  1328. else if ((condition != null) && (msgId != null))
  1329. {
  1330. condition.setMessageId(Integer.decode(getValue(msgId.getNodeValue(), null)));
  1331. Node addName = n.getAttributes().getNamedItem("addName");
  1332. if ((addName != null) && (Integer.decode(getValue(msgId.getNodeValue(), null)) > 0))
  1333. {
  1334. condition.addName();
  1335. }
  1336. }
  1337. _currentSkill.currentSkills.get(i).attach(condition, false);
  1338. }
  1339. else if (!foundFor && "for".equalsIgnoreCase(n.getNodeName()))
  1340. {
  1341. parseTemplate(n, _currentSkill.currentSkills.get(i));
  1342. }
  1343. else if (!foundChannelingEffects && "channelingEffects".equalsIgnoreCase(n.getNodeName()))
  1344. {
  1345. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.CHANNELING);
  1346. }
  1347. else if (!foundPveEffects && "pveEffects".equalsIgnoreCase(n.getNodeName()))
  1348. {
  1349. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVE);
  1350. }
  1351. else if (!foundPvpEffects && "pvpEffects".equalsIgnoreCase(n.getNodeName()))
  1352. {
  1353. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.PVP);
  1354. }
  1355. else if (!foundEndEffects && "endEffects".equalsIgnoreCase(n.getNodeName()))
  1356. {
  1357. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.END);
  1358. }
  1359. else if (!foundSelfEffects && "selfEffects".equalsIgnoreCase(n.getNodeName()))
  1360. {
  1361. parseTemplate(n, _currentSkill.currentSkills.get(i), EffectScope.SELF);
  1362. }
  1363. }
  1364. }
  1365. }
  1366. _currentSkill.skills.addAll(_currentSkill.currentSkills);
  1367. }
  1368. private void makeSkills()
  1369. {
  1370. int count = 0;
  1371. _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);
  1372. for (int i = 0; i < _currentSkill.sets.length; i++)
  1373. {
  1374. try
  1375. {
  1376. _currentSkill.currentSkills.add(i, _currentSkill.sets[i].getEnum("skillType", L2SkillType.class, L2SkillType.DUMMY).makeSkill(_currentSkill.sets[i]));
  1377. count++;
  1378. }
  1379. catch (Exception e)
  1380. {
  1381. _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);
  1382. }
  1383. }
  1384. int _count = count;
  1385. for (int i = 0; i < _currentSkill.enchsets1.length; i++)
  1386. {
  1387. try
  1388. {
  1389. _currentSkill.currentSkills.add(_count + i, _currentSkill.enchsets1[i].getEnum("skillType", L2SkillType.class, L2SkillType.DUMMY).makeSkill(_currentSkill.enchsets1[i]));
  1390. count++;
  1391. }
  1392. catch (Exception e)
  1393. {
  1394. _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);
  1395. }
  1396. }
  1397. _count = count;
  1398. for (int i = 0; i < _currentSkill.enchsets2.length; i++)
  1399. {
  1400. try
  1401. {
  1402. _currentSkill.currentSkills.add(_count + i, _currentSkill.enchsets2[i].getEnum("skillType", L2SkillType.class, L2SkillType.DUMMY).makeSkill(_currentSkill.enchsets2[i]));
  1403. count++;
  1404. }
  1405. catch (Exception e)
  1406. {
  1407. _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);
  1408. }
  1409. }
  1410. _count = count;
  1411. for (int i = 0; i < _currentSkill.enchsets3.length; i++)
  1412. {
  1413. try
  1414. {
  1415. _currentSkill.currentSkills.add(_count + i, _currentSkill.enchsets3[i].getEnum("skillType", L2SkillType.class, L2SkillType.DUMMY).makeSkill(_currentSkill.enchsets3[i]));
  1416. count++;
  1417. }
  1418. catch (Exception e)
  1419. {
  1420. _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);
  1421. }
  1422. }
  1423. _count = count;
  1424. for (int i = 0; i < _currentSkill.enchsets4.length; i++)
  1425. {
  1426. try
  1427. {
  1428. _currentSkill.currentSkills.add(_count + i, _currentSkill.enchsets4[i].getEnum("skillType", L2SkillType.class, L2SkillType.DUMMY).makeSkill(_currentSkill.enchsets4[i]));
  1429. count++;
  1430. }
  1431. catch (Exception e)
  1432. {
  1433. _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);
  1434. }
  1435. }
  1436. _count = count;
  1437. for (int i = 0; i < _currentSkill.enchsets5.length; i++)
  1438. {
  1439. try
  1440. {
  1441. _currentSkill.currentSkills.add(_count + i, _currentSkill.enchsets5[i].getEnum("skillType", L2SkillType.class, L2SkillType.DUMMY).makeSkill(_currentSkill.enchsets5[i]));
  1442. count++;
  1443. }
  1444. catch (Exception e)
  1445. {
  1446. _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);
  1447. }
  1448. }
  1449. _count = count;
  1450. for (int i = 0; i < _currentSkill.enchsets6.length; i++)
  1451. {
  1452. try
  1453. {
  1454. _currentSkill.currentSkills.add(_count + i, _currentSkill.enchsets6[i].getEnum("skillType", L2SkillType.class, L2SkillType.DUMMY).makeSkill(_currentSkill.enchsets6[i]));
  1455. count++;
  1456. }
  1457. catch (Exception e)
  1458. {
  1459. _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);
  1460. }
  1461. }
  1462. _count = count;
  1463. for (int i = 0; i < _currentSkill.enchsets7.length; i++)
  1464. {
  1465. try
  1466. {
  1467. _currentSkill.currentSkills.add(_count + i, _currentSkill.enchsets7[i].getEnum("skillType", L2SkillType.class, L2SkillType.DUMMY).makeSkill(_currentSkill.enchsets7[i]));
  1468. count++;
  1469. }
  1470. catch (Exception e)
  1471. {
  1472. _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);
  1473. }
  1474. }
  1475. _count = count;
  1476. for (int i = 0; i < _currentSkill.enchsets8.length; i++)
  1477. {
  1478. try
  1479. {
  1480. _currentSkill.currentSkills.add(_count + i, _currentSkill.enchsets8[i].getEnum("skillType", L2SkillType.class, L2SkillType.DUMMY).makeSkill(_currentSkill.enchsets8[i]));
  1481. count++;
  1482. }
  1483. catch (Exception e)
  1484. {
  1485. _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);
  1486. }
  1487. }
  1488. }
  1489. }