CaFi

Untitled

Mar 23rd, 2014
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 76.01 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2jFrozen_GameServer
  3. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Castle.java
  4. ===================================================================
  5. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Castle.java (revision 0)
  6. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Castle.java (working copy)
  7. @@ -0,0 +1,30 @@
  8. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  9. +
  10. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  11. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  12. +
  13. +public class Castle extends Condition
  14. +{
  15. + public Castle(Object value)
  16. + {
  17. + super(value);
  18. + setName("Have Castle");
  19. + }
  20. +@Override
  21. + public boolean meetConditionRequirements(L2PcInstance player)
  22. + {
  23. + if (getValue() == null)
  24. + {
  25. + return false;
  26. + }
  27. +
  28. + if (player.getClan() != null)
  29. + {
  30. + if ((player.isCastleLord(5)) || (player.isCastleLord(3)) || (player.isCastleLord(7)))
  31. + {
  32. + return true;
  33. + }
  34. + }
  35. + return false;
  36. + }
  37. +}
  38. \ No newline at end of file
  39. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Sub.java
  40. ===================================================================
  41. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Sub.java (revision 0)
  42. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Sub.java (working copy)
  43. @@ -0,0 +1,30 @@
  44. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  45. +
  46. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  47. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  48. +
  49. +public class Sub extends Condition
  50. +{
  51. + public Sub(Object value)
  52. + {
  53. + super(value);
  54. + setName("Subclass Count");
  55. + }
  56. +@Override
  57. + public boolean meetConditionRequirements(L2PcInstance player)
  58. + {
  59. + if (getValue() == null)
  60. + {
  61. + return false;
  62. + }
  63. +
  64. + int val = Integer.parseInt(getValue().toString());
  65. +
  66. + if (player.getSubClasses().size() >= val)
  67. + {
  68. + return true;
  69. + }
  70. +
  71. + return false;
  72. + }
  73. +}
  74. \ No newline at end of file
  75. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/base/Achievement.java
  76. ===================================================================
  77. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/base/Achievement.java (revision 0)
  78. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/base/Achievement.java (working copy)
  79. @@ -0,0 +1,118 @@
  80. +/*
  81. + * This program is free software: you can redistribute it and/or modify it under
  82. + * the terms of the GNU General Public License as published by the Free Software
  83. + * Foundation, either version 3 of the License, or (at your option) any later
  84. + * version.
  85. + *
  86. + * This program is distributed in the hope that it will be useful, but WITHOUT
  87. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  88. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  89. + * details.
  90. + *
  91. + * You should have received a copy of the GNU General Public License along with
  92. + * this program. If not, see <http://www.gnu.org/licenses/>.
  93. + */
  94. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base;
  95. +
  96. +import java.util.logging.Logger;
  97. +
  98. +import javolution.util.FastList;
  99. +import javolution.util.FastMap;
  100. +
  101. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  102. +
  103. +public class Achievement
  104. +{
  105. + private static Logger _log = Logger.getLogger(Achievement.class.getName());
  106. + private final int _id;
  107. + private final String _name;
  108. + private final String _reward;
  109. + private String _description = "No Description!";
  110. + private final boolean _repeatable;
  111. +
  112. + private final FastMap<Integer, Long> _rewardList;
  113. + private final FastList<Condition> _conditions;
  114. +
  115. + public Achievement(int id, String name, String description, String reward, boolean repeatable, FastList<Condition> conditions)
  116. + {
  117. + _rewardList = new FastMap<Integer, Long>();
  118. + _id = id;
  119. + _name = name;
  120. + _description = description;
  121. + _reward = reward;
  122. + _conditions = conditions;
  123. + _repeatable = repeatable;
  124. +
  125. + createRewardList();
  126. + }
  127. +
  128. + private void createRewardList()
  129. + {
  130. + for (String s : _reward.split(";"))
  131. + {
  132. + if (s == null || s.isEmpty())
  133. + continue;
  134. +
  135. + String[] split = s.split(",");
  136. + Integer item = 0;
  137. + Long count = new Long(0);
  138. + try
  139. + {
  140. + item = Integer.valueOf(split[0]);
  141. + count = Long.valueOf(split[1]);
  142. + }
  143. + catch (NumberFormatException nfe)
  144. + {
  145. + _log.warning("AchievementsEngine: Error wrong reward " + nfe);
  146. + }
  147. + _rewardList.put(item, count);
  148. + }
  149. + }
  150. +
  151. + public boolean meetAchievementRequirements(L2PcInstance player)
  152. + {
  153. + for (Condition c : getConditions())
  154. + {
  155. + if (!c.meetConditionRequirements(player))
  156. + {
  157. + return false;
  158. + }
  159. + }
  160. + return true;
  161. + }
  162. +
  163. + public int getID()
  164. + {
  165. + return _id;
  166. + }
  167. +
  168. + public String getName()
  169. + {
  170. + return _name;
  171. + }
  172. +
  173. + public String getDescription()
  174. + {
  175. + return _description;
  176. + }
  177. +
  178. + public String getReward()
  179. + {
  180. + return _reward;
  181. + }
  182. +
  183. + public boolean isRepeatable()
  184. + {
  185. + return _repeatable;
  186. + }
  187. +
  188. + public FastMap<Integer, Long> getRewardList()
  189. + {
  190. + return _rewardList;
  191. + }
  192. +
  193. + public FastList<Condition> getConditions()
  194. + {
  195. + return _conditions;
  196. + }
  197. +}
  198. \ No newline at end of file
  199. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Crp.java
  200. ===================================================================
  201. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Crp.java (revision 0)
  202. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Crp.java (working copy)
  203. @@ -0,0 +1,32 @@
  204. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  205. +
  206. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  207. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  208. +
  209. +public class Crp extends Condition
  210. +{
  211. + public Crp(Object value)
  212. + {
  213. + super(value);
  214. + setName("Clan Reputation");
  215. + }
  216. +@Override
  217. + public boolean meetConditionRequirements(L2PcInstance player)
  218. + {
  219. + if (getValue() == null)
  220. + {
  221. + return false;
  222. + }
  223. +
  224. + if (player.getClan() != null)
  225. + {
  226. + int val = Integer.parseInt(getValue().toString());
  227. +
  228. + if (player.getClan().getReputationScore() >= val)
  229. + {
  230. + return true;
  231. + }
  232. + }
  233. + return false;
  234. + }
  235. +}
  236. \ No newline at end of file
  237. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/base/Condition.java
  238. ===================================================================
  239. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/base/Condition.java (revision 0)
  240. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/base/Condition.java (working copy)
  241. @@ -0,0 +1,45 @@
  242. +/*
  243. + * This program is free software: you can redistribute it and/or modify it under
  244. + * the terms of the GNU General Public License as published by the Free Software
  245. + * Foundation, either version 3 of the License, or (at your option) any later
  246. + * version.
  247. + *
  248. + * This program is distributed in the hope that it will be useful, but WITHOUT
  249. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  250. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  251. + * details.
  252. + *
  253. + * You should have received a copy of the GNU General Public License along with
  254. + * this program. If not, see <http://www.gnu.org/licenses/>.
  255. + */
  256. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base;
  257. +
  258. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  259. +
  260. +public abstract class Condition
  261. +{
  262. + private final Object _value;
  263. + private String _name;
  264. +
  265. + public Condition(Object value)
  266. + {
  267. + this._value = value;
  268. + }
  269. +
  270. + public abstract boolean meetConditionRequirements(L2PcInstance paramL2PcInstance);
  271. +
  272. + public Object getValue()
  273. + {
  274. + return this._value;
  275. + }
  276. +
  277. + public void setName(String s)
  278. + {
  279. + this._name = s;
  280. + }
  281. +
  282. + public String getName()
  283. + {
  284. + return this._name;
  285. + }
  286. +}
  287. \ No newline at end of file
  288. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Level.java
  289. ===================================================================
  290. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Level.java (revision 0)
  291. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Level.java (working copy)
  292. @@ -0,0 +1,30 @@
  293. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  294. +
  295. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  296. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  297. +
  298. +public class Level extends Condition
  299. +{
  300. + public Level(Object value)
  301. + {
  302. + super(value);
  303. + setName("Level");
  304. + }
  305. +@Override
  306. + public boolean meetConditionRequirements(L2PcInstance player)
  307. + {
  308. + if (getValue() == null)
  309. + {
  310. + return false;
  311. + }
  312. +
  313. + int val = Integer.parseInt(getValue().toString());
  314. +
  315. + if (player.getLevel() >= val)
  316. + {
  317. + return true;
  318. + }
  319. +
  320. + return false;
  321. + }
  322. +}
  323. \ No newline at end of file
  324. Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
  325. ===================================================================
  326. --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 1004)
  327. +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy)
  328. @@ -24,6 +24,7 @@
  329. import java.sql.PreparedStatement;
  330. import java.sql.ResultSet;
  331. import java.sql.SQLException;
  332. +import java.sql.Statement;
  333. import java.text.SimpleDateFormat;
  334. import java.util.ArrayList;
  335. import java.util.Arrays;
  336. @@ -75,6 +76,7 @@
  337. import com.l2jfrozen.gameserver.datatables.sql.NpcTable;
  338. import com.l2jfrozen.gameserver.datatables.sql.SkillTreeTable;
  339. import com.l2jfrozen.gameserver.datatables.xml.ExperienceData;
  340. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.AchievementsManager;
  341. import com.l2jfrozen.gameserver.geo.GeoData;
  342. import com.l2jfrozen.gameserver.handler.IItemHandler;
  343. import com.l2jfrozen.gameserver.handler.ItemHandler;
  344. @@ -20309,6 +20311,136 @@
  345. broadcastUserInfo();
  346. }
  347.  
  348. + private final List<Integer> _completedAchievements = new FastList<Integer>();
  349. +
  350. + public long getOnlineTime()
  351. + {
  352. + return _onlineTime;
  353. + }
  354. +
  355. + public List<Integer> getCompletedAchievements()
  356. + {
  357. + return _completedAchievements;
  358. + }
  359. +
  360. + public boolean readyAchievementsList()
  361. + {
  362. + if (_completedAchievements.isEmpty())
  363. + return false;
  364. + return true;
  365. + }
  366. +
  367. + public void saveAchievemntData()
  368. + {
  369. +
  370. + }
  371. +
  372. + @SuppressWarnings("null")
  373. + public void getAchievemntData()
  374. + {
  375. + Connection con = null;
  376. + try
  377. + {
  378. + con = L2DatabaseFactory.getInstance().getConnection();
  379. + PreparedStatement statement;
  380. + PreparedStatement insertStatement;
  381. + ResultSet rs;
  382. +
  383. + statement = con.prepareStatement("SELECT * FROM achievements WHERE owner_id=" + getObjectId());
  384. +
  385. + rs = statement.executeQuery();
  386. +
  387. + String values = "owner_id";
  388. + String in = Integer.toString(getObjectId());
  389. + String questionMarks = in;
  390. + int ilosc = AchievementsManager.getInstance().getAchievementList().size();
  391. +
  392. + if (rs.next())
  393. + {
  394. + _completedAchievements.clear();
  395. + for (int i = 1; i <= ilosc; i++)
  396. + {
  397. + int a = rs.getInt("a" + i);
  398. +
  399. + if (!_completedAchievements.contains(i))
  400. + if (a == 1 || String.valueOf(a).startsWith("1"))
  401. + {
  402. + _completedAchievements.add(i);
  403. + }
  404. + }
  405. + }
  406. + else
  407. + {
  408. + // Player hasnt entry in database, means we have to create it.
  409. + for (int i = 1; i <= ilosc; i++)
  410. + {
  411. + values += ", a" + i;
  412. + questionMarks += ", 0";
  413. + }
  414. +
  415. + String s = "INSERT INTO achievements(" + values + ") VALUES (" + questionMarks + ")";
  416. + insertStatement = con.prepareStatement(s);
  417. +
  418. + insertStatement.execute();
  419. + insertStatement.close();
  420. + }
  421. + }
  422. + catch (SQLException e)
  423. + {
  424. + _log.warning(new StringBuilder().append("[ACHIEVEMENTS SAVE GETDATA]").append(e).toString());
  425. + }
  426. + finally
  427. + {
  428. + try
  429. + {
  430. + con.close();
  431. + }
  432. + catch (Exception e)
  433. + {
  434. + }
  435. + }
  436. + }
  437. +
  438. + @SuppressWarnings("null")
  439. + public void saveAchievementData(int achievementID, int objid)
  440. + {
  441. + Connection con = null;
  442. + try
  443. + {
  444. + con = L2DatabaseFactory.getInstance().getConnection();
  445. + Statement statement = con.createStatement();
  446. + if (achievementID == 4 || achievementID == 6 || achievementID == 11 || achievementID == 13)
  447. + {
  448. + statement.executeUpdate("UPDATE achievements SET a" + achievementID + "=1" + objid + " WHERE owner_id=" + getObjectId());
  449. + }
  450. + else
  451. + {
  452. + statement.executeUpdate("UPDATE achievements SET a" + achievementID + "=1 WHERE owner_id=" + getObjectId());
  453. + }
  454. +
  455. + statement.close();
  456. +
  457. + if (!_completedAchievements.contains(achievementID))
  458. + {
  459. + _completedAchievements.add(achievementID);
  460. + }
  461. + }
  462. + catch (SQLException e)
  463. + {
  464. + _log.warning(new StringBuilder().append("[ACHIEVEMENTS SAVE GETDATA]").append(e).toString());
  465. + }
  466. + finally
  467. + {
  468. + try
  469. + {
  470. + con.close();
  471. + }
  472. + catch (Exception e)
  473. + {
  474. + }
  475. + }
  476. + }
  477. +
  478. public void setHero(boolean hero)
  479. {
  480. _hero = hero;
  481. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/RaidPoints.java
  482. ===================================================================
  483. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/RaidPoints.java (revision 0)
  484. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/RaidPoints.java (working copy)
  485. @@ -0,0 +1,31 @@
  486. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  487. +
  488. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  489. +import com.l2jfrozen.gameserver.managers.RaidBossPointsManager;
  490. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  491. +
  492. +public class RaidPoints extends Condition
  493. +{
  494. + public RaidPoints(Object value)
  495. + {
  496. + super(value);
  497. + setName("Raid Points");
  498. + }
  499. +@Override
  500. + public boolean meetConditionRequirements(L2PcInstance player)
  501. + {
  502. + if (getValue() == null)
  503. + {
  504. + return false;
  505. + }
  506. +
  507. + int val = Integer.parseInt(getValue().toString());
  508. +
  509. + RaidBossPointsManager.getInstance();
  510. + if (RaidBossPointsManager.getPointsByOwnerId(player.getObjectId()) >= val)
  511. + {
  512. + return true;
  513. + }
  514. + return false;
  515. + }
  516. +}
  517. \ No newline at end of file
  518. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Marry.java
  519. ===================================================================
  520. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Marry.java (revision 0)
  521. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Marry.java (working copy)
  522. @@ -0,0 +1,28 @@
  523. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  524. +
  525. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  526. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  527. +
  528. +public class Marry extends Condition
  529. +{
  530. + public Marry(Object value)
  531. + {
  532. + super(value);
  533. + setName("Married");
  534. + }
  535. +@Override
  536. + public boolean meetConditionRequirements(L2PcInstance player)
  537. + {
  538. + if (getValue() == null)
  539. + {
  540. + return false;
  541. + }
  542. +
  543. + if (player.isMarried())
  544. + {
  545. + return true;
  546. + }
  547. +
  548. + return false;
  549. + }
  550. +}
  551. \ No newline at end of file
  552. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Pvp.java
  553. ===================================================================
  554. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Pvp.java (revision 0)
  555. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Pvp.java (working copy)
  556. @@ -0,0 +1,30 @@
  557. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  558. +
  559. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  560. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  561. +
  562. +public class Pvp extends Condition
  563. +{
  564. + public Pvp(Object value)
  565. + {
  566. + super(value);
  567. + setName("PvP Count");
  568. + }
  569. +@Override
  570. + public boolean meetConditionRequirements(L2PcInstance player)
  571. + {
  572. + if (getValue() == null)
  573. + {
  574. + return false;
  575. + }
  576. +
  577. + int val = Integer.parseInt(getValue().toString());
  578. +
  579. + if (player.getPvpKills() >= val)
  580. + {
  581. + return true;
  582. + }
  583. +
  584. + return false;
  585. + }
  586. +}
  587. \ No newline at end of file
  588. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Adena.java
  589. ===================================================================
  590. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Adena.java (revision 0)
  591. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Adena.java (working copy)
  592. @@ -0,0 +1,31 @@
  593. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  594. +
  595. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  596. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  597. +
  598. +public class Adena extends Condition
  599. +{
  600. + public Adena(Object value)
  601. + {
  602. + super(value);
  603. + setName("Adena");
  604. + }
  605. +
  606. +@Override
  607. +public boolean meetConditionRequirements(L2PcInstance player)
  608. + {
  609. + if (getValue() == null)
  610. + {
  611. + return false;
  612. + }
  613. +
  614. + long val = Integer.parseInt(getValue().toString());
  615. +
  616. + if (player.getInventory().getAdena() >= val)
  617. + {
  618. + return true;
  619. + }
  620. +
  621. + return false;
  622. + }
  623. +}
  624. \ No newline at end of file
  625. Index: head-src/com/l2jfrozen/gameserver/GameServer.java
  626. ===================================================================
  627. --- head-src/com/l2jfrozen/gameserver/GameServer.java (revision 1004)
  628. +++ head-src/com/l2jfrozen/gameserver/GameServer.java (working copy)
  629. @@ -75,6 +75,7 @@
  630. import com.l2jfrozen.gameserver.datatables.xml.AugmentationData;
  631. import com.l2jfrozen.gameserver.datatables.xml.ExperienceData;
  632. import com.l2jfrozen.gameserver.datatables.xml.ZoneData;
  633. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.AchievementsManager;
  634. import com.l2jfrozen.gameserver.geo.GeoData;
  635. import com.l2jfrozen.gameserver.geo.geoeditorcon.GeoEditorListener;
  636. import com.l2jfrozen.gameserver.geo.pathfinding.PathFinding;
  637. @@ -227,6 +228,12 @@
  638.  
  639. Util.printSection("World");
  640. L2World.getInstance();
  641. +
  642. + if (Config.ENABLE_EVENT_ACHIEVEMENT)
  643. + {
  644. + AchievementsManager.getInstance();
  645. + }
  646. +
  647. MapRegionTable.getInstance();
  648. Announcements.getInstance();
  649. AutoAnnouncementHandler.getInstance();
  650. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Pk.java
  651. ===================================================================
  652. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Pk.java (revision 0)
  653. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Pk.java (working copy)
  654. @@ -0,0 +1,30 @@
  655. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  656. +
  657. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  658. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  659. +
  660. +public class Pk extends Condition
  661. +{
  662. + public Pk(Object value)
  663. + {
  664. + super(value);
  665. + setName("PK Count");
  666. + }
  667. +@Override
  668. + public boolean meetConditionRequirements(L2PcInstance player)
  669. + {
  670. + if (getValue() == null)
  671. + {
  672. + return false;
  673. + }
  674. +
  675. + int val = Integer.parseInt(getValue().toString());
  676. +
  677. + if (player.getPkKills() >= val)
  678. + {
  679. + return true;
  680. + }
  681. +
  682. + return false;
  683. + }
  684. +}
  685. \ No newline at end of file
  686. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/AchievementsManager.java
  687. ===================================================================
  688. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/AchievementsManager.java (revision 0)
  689. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/AchievementsManager.java (working copy)
  690. @@ -0,0 +1,432 @@
  691. +/*
  692. + * This program is free software: you can redistribute it and/or modify it under
  693. + * the terms of the GNU General Public License as published by the Free Software
  694. + * Foundation, either version 3 of the License, or (at your option) any later
  695. + * version.
  696. + *
  697. + * This program is distributed in the hope that it will be useful, but WITHOUT
  698. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  699. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  700. + * details.
  701. + *
  702. + * You should have received a copy of the GNU General Public License along with
  703. + * this program. If not, see <http://www.gnu.org/licenses/>.
  704. + */
  705. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine;
  706. +
  707. +import java.io.File;
  708. +import java.io.FileInputStream;
  709. +import java.io.InputStreamReader;
  710. +import java.sql.Connection;
  711. +import java.sql.PreparedStatement;
  712. +import java.sql.ResultSet;
  713. +import java.sql.SQLException;
  714. +import java.sql.Statement;
  715. +import java.util.Map;
  716. +import java.util.logging.Logger;
  717. +
  718. +import javax.xml.parsers.DocumentBuilderFactory;
  719. +
  720. +import javolution.util.FastList;
  721. +import javolution.util.FastMap;
  722. +
  723. +import org.w3c.dom.Document;
  724. +import org.w3c.dom.NamedNodeMap;
  725. +import org.w3c.dom.Node;
  726. +import org.xml.sax.InputSource;
  727. +
  728. +import com.l2jfrozen.Config;
  729. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Achievement;
  730. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  731. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Adena;
  732. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Castle;
  733. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.ClanLeader;
  734. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.ClanLevel;
  735. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.CompleteAchievements;
  736. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Crp;
  737. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Hero;
  738. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.HeroCount;
  739. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.ItemsCount;
  740. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Karma;
  741. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Level;
  742. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Mage;
  743. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Marry;
  744. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.MinCMcount;
  745. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Noble;
  746. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.OnlineTime;
  747. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Pk;
  748. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Pvp;
  749. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.RaidKill;
  750. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.RaidPoints;
  751. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.SkillEnchant;
  752. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.Sub;
  753. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.WeaponEnchant;
  754. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.eventKills;
  755. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.eventWins;
  756. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions.events;
  757. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  758. +import com.l2jfrozen.util.database.L2DatabaseFactory;
  759. +
  760. +public class AchievementsManager
  761. +{
  762. + @SuppressWarnings(
  763. + {
  764. + "rawtypes",
  765. + "unchecked"
  766. + })
  767. + private final Map<Integer, Achievement> _achievementList = new FastMap();
  768. +
  769. + @SuppressWarnings(
  770. + {
  771. + "unchecked",
  772. + "rawtypes"
  773. + })
  774. + private final FastList<String> _binded = new FastList();
  775. +
  776. + private static Logger _log = Logger.getLogger(AchievementsManager.class.getName());
  777. +
  778. + public AchievementsManager()
  779. + {
  780. + loadAchievements();
  781. + }
  782. +
  783. + private void loadAchievements()
  784. + {
  785. + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  786. + factory.setValidating(false);
  787. + factory.setIgnoringComments(true);
  788. +
  789. + File file = new File(Config.DATAPACK_ROOT, "data/achievements.xml");
  790. +
  791. + if (!file.exists())
  792. + {
  793. + _log.warning("AchievementsEngine: Error achievements xml file does not exist, check directory!");
  794. + }
  795. + try
  796. + {
  797. + InputSource in = new InputSource(new InputStreamReader(new FileInputStream(file), "UTF-8"));
  798. + in.setEncoding("UTF-8");
  799. + Document doc = factory.newDocumentBuilder().parse(in);
  800. +
  801. + for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
  802. + {
  803. + if (n.getNodeName().equalsIgnoreCase("list"))
  804. + {
  805. + for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
  806. + {
  807. + if (d.getNodeName().equalsIgnoreCase("achievement"))
  808. + {
  809. + int id = checkInt(d, "id");
  810. +
  811. + String name = String.valueOf(d.getAttributes().getNamedItem("name").getNodeValue());
  812. + String description = String.valueOf(d.getAttributes().getNamedItem("description").getNodeValue());
  813. + String reward = String.valueOf(d.getAttributes().getNamedItem("reward").getNodeValue());
  814. + boolean repeat = checkBoolean(d, "repeatable");
  815. +
  816. + FastList<Condition> conditions = conditionList(d.getAttributes());
  817. +
  818. + this._achievementList.put(Integer.valueOf(id), new Achievement(id, name, description, reward, repeat, conditions));
  819. + alterTable(id);
  820. + }
  821. + }
  822. + }
  823. + }
  824. +
  825. + _log.info("AchievementsEngine: loaded " + getAchievementList().size() + " achievements from xml!");
  826. + }
  827. + catch (Exception e)
  828. + {
  829. + _log.warning("AchievementsEngine: Error " + e);
  830. + e.printStackTrace();
  831. + }
  832. + }
  833. +
  834. + public void rewardForAchievement(int achievementID, L2PcInstance player)
  835. + {
  836. + Achievement achievement = this._achievementList.get(Integer.valueOf(achievementID));
  837. +
  838. + for (Integer integer : achievement.getRewardList().keySet())
  839. + {
  840. + int id = integer.intValue();
  841. +
  842. + int count = achievement.getRewardList().get(Integer.valueOf(id)).intValue();
  843. + player.addItem(achievement.getName(), id, count, player, true);
  844. + }
  845. + }
  846. +
  847. + private static boolean checkBoolean(Node d, String nodename)
  848. + {
  849. + boolean b = false;
  850. + try
  851. + {
  852. + b = Boolean.valueOf(d.getAttributes().getNamedItem(nodename).getNodeValue()).booleanValue();
  853. + }
  854. + catch (Exception e)
  855. + {
  856. + }
  857. +
  858. + return b;
  859. + }
  860. +
  861. + private int checkInt(Node d, String nodename)
  862. + {
  863. + int i = 0;
  864. + try
  865. + {
  866. + i = Integer.valueOf(d.getAttributes().getNamedItem(nodename).getNodeValue()).intValue();
  867. + }
  868. + catch (Exception e)
  869. + {
  870. + }
  871. +
  872. + return i;
  873. + }
  874. +
  875. + @SuppressWarnings("null")
  876. + private static void alterTable(int fieldID)
  877. + {
  878. + Connection con = null;
  879. + try
  880. + {
  881. + con = L2DatabaseFactory.getInstance().getConnection();
  882. + Statement statement = con.createStatement();
  883. + statement.executeUpdate("ALTER TABLE achievements ADD a" + fieldID + " INT DEFAULT 0");
  884. + statement.close();
  885. + }
  886. + catch (SQLException e)
  887. + {
  888. + }
  889. + finally
  890. + {
  891. + try
  892. + {
  893. + con.close();
  894. + }
  895. + catch (Exception e)
  896. + {
  897. + }
  898. + }
  899. + }
  900. +
  901. + @SuppressWarnings("unchecked")
  902. + public FastList<Condition> conditionList(NamedNodeMap attributesList)
  903. + {
  904. + @SuppressWarnings("rawtypes")
  905. + FastList conditions = new FastList();
  906. +
  907. + for (int j = 0; j < attributesList.getLength(); j++)
  908. + {
  909. + addToConditionList(attributesList.item(j).getNodeName(), attributesList.item(j).getNodeValue(), conditions);
  910. + }
  911. +
  912. + return conditions;
  913. + }
  914. +
  915. + public Map<Integer, Achievement> getAchievementList()
  916. + {
  917. + return this._achievementList;
  918. + }
  919. +
  920. + public FastList<String> getBinded()
  921. + {
  922. + return this._binded;
  923. + }
  924. +
  925. + public boolean isBinded(int obj, int ach)
  926. + {
  927. + for (String binds : this._binded)
  928. + {
  929. + String[] spl = binds.split("@");
  930. + if ((spl[0].equals(String.valueOf(obj))) && (spl[1].equals(String.valueOf(ach))))
  931. + {
  932. + return true;
  933. + }
  934. + }
  935. + return false;
  936. + }
  937. +
  938. + public static AchievementsManager getInstance()
  939. + {
  940. + return SingletonHolder._instance;
  941. + }
  942. +
  943. + private static void addToConditionList(String nodeName, Object value, FastList<Condition> conditions)
  944. + {
  945. + if (nodeName.equals("minLevel"))
  946. + {
  947. + conditions.add(new Level(value));
  948. + }
  949. + else if (nodeName.equals("minPvPCount"))
  950. + {
  951. + conditions.add(new Pvp(value));
  952. + }
  953. + else if (nodeName.equals("minPkCount"))
  954. + {
  955. + conditions.add(new Pk(value));
  956. + }
  957. + else if (nodeName.equals("minClanLevel"))
  958. + {
  959. + conditions.add(new ClanLevel(value));
  960. + }
  961. + else if (nodeName.equals("mustBeHero"))
  962. + {
  963. + conditions.add(new Hero(value));
  964. + }
  965. + else if (nodeName.equals("mustBeNoble"))
  966. + {
  967. + conditions.add(new Noble(value));
  968. + }
  969. + else if (nodeName.equals("minWeaponEnchant"))
  970. + {
  971. + conditions.add(new WeaponEnchant(value));
  972. + }
  973. + else if (nodeName.equals("minKarmaCount"))
  974. + {
  975. + conditions.add(new Karma(value));
  976. + }
  977. + else if (nodeName.equals("minAdenaCount"))
  978. + {
  979. + conditions.add(new Adena(value));
  980. + }
  981. + else if (nodeName.equals("minClanMembersCount"))
  982. + {
  983. + conditions.add(new MinCMcount(value));
  984. + }
  985. + else if (nodeName.equals("mustBeClanLeader"))
  986. + {
  987. + conditions.add(new ClanLeader(value));
  988. + }
  989. + else if (nodeName.equals("mustBeMarried"))
  990. + {
  991. + conditions.add(new Marry(value));
  992. + }
  993. + else if (nodeName.equals("itemAmmount"))
  994. + {
  995. + conditions.add(new ItemsCount(value));
  996. + }
  997. + else if (nodeName.equals("crpAmmount"))
  998. + {
  999. + conditions.add(new Crp(value));
  1000. + }
  1001. + else if (nodeName.equals("lordOfCastle"))
  1002. + {
  1003. + conditions.add(new Castle(value));
  1004. + }
  1005. + else if (nodeName.equals("mustBeMageClass"))
  1006. + {
  1007. + conditions.add(new Mage(value));
  1008. + }
  1009. + else if (nodeName.equals("minSubclassCount"))
  1010. + {
  1011. + conditions.add(new Sub(value));
  1012. + }
  1013. + else if (nodeName.equals("CompleteAchievements"))
  1014. + {
  1015. + conditions.add(new CompleteAchievements(value));
  1016. + }
  1017. + else if (nodeName.equals("minSkillEnchant"))
  1018. + {
  1019. + conditions.add(new SkillEnchant(value));
  1020. + }
  1021. + else if (nodeName.equals("minOnlineTime"))
  1022. + {
  1023. + conditions.add(new OnlineTime(value));
  1024. + }
  1025. + else if (nodeName.equals("minHeroCount"))
  1026. + {
  1027. + conditions.add(new HeroCount(value));
  1028. + }
  1029. + else if (nodeName.equals("raidToKill"))
  1030. + {
  1031. + conditions.add(new RaidKill(value));
  1032. + }
  1033. + else if (nodeName.equals("raidToKill1"))
  1034. + {
  1035. + conditions.add(new RaidKill(value));
  1036. + }
  1037. + else if (nodeName.equals("raidToKill2"))
  1038. + {
  1039. + conditions.add(new RaidKill(value));
  1040. + }
  1041. + else if (nodeName.equals("minRaidPoints"))
  1042. + {
  1043. + conditions.add(new RaidPoints(value));
  1044. + }
  1045. + else if (nodeName.equals("eventKills"))
  1046. + {
  1047. + conditions.add(new eventKills(value));
  1048. + }
  1049. + else if (nodeName.equals("events"))
  1050. + {
  1051. + conditions.add(new events(value));
  1052. + }
  1053. + else if (nodeName.equals("eventWins"))
  1054. + {
  1055. + conditions.add(new eventWins(value));
  1056. + }
  1057. + }
  1058. +
  1059. + @SuppressWarnings("null")
  1060. + public void loadUsed()
  1061. + {
  1062. + Connection con = null;
  1063. + try
  1064. + {
  1065. + con = L2DatabaseFactory.getInstance().getConnection();
  1066. + String sql = "SELECT ";
  1067. + for (int i = 1; i <= getAchievementList().size(); i++)
  1068. + {
  1069. + if (i != getAchievementList().size())
  1070. + {
  1071. + sql = sql + "a" + i + ",";
  1072. + }
  1073. + else
  1074. + {
  1075. + sql = sql + "a" + i;
  1076. + }
  1077. +
  1078. + }
  1079. +
  1080. + sql = sql + " FROM achievements";
  1081. + PreparedStatement statement = con.prepareStatement(sql);
  1082. +
  1083. + ResultSet rs = statement.executeQuery();
  1084. + while (rs.next())
  1085. + {
  1086. + for (int i = 1; i <= getAchievementList().size(); i++)
  1087. + {
  1088. + String ct = rs.getString(i);
  1089. + if ((ct.length() > 1) && (ct.startsWith("1")))
  1090. + {
  1091. + this._binded.add(ct.substring(ct.indexOf("1") + 1) + "@" + i);
  1092. + }
  1093. + }
  1094. + }
  1095. + statement.close();
  1096. + rs.close();
  1097. + }
  1098. + catch (SQLException e)
  1099. + {
  1100. + _log.warning("[ACHIEVEMENTS SAVE GETDATA]");
  1101. + if (Config.DEVELOPER)
  1102. + {
  1103. + e.printStackTrace();
  1104. + }
  1105. + }
  1106. + finally
  1107. + {
  1108. + try
  1109. + {
  1110. + con.close();
  1111. + }
  1112. + catch (Exception e)
  1113. + {
  1114. + }
  1115. + }
  1116. + }
  1117. +
  1118. + private static class SingletonHolder
  1119. + {
  1120. + protected static final AchievementsManager _instance = new AchievementsManager();
  1121. + }
  1122. +}
  1123. \ No newline at end of file
  1124. Index: config/functions/l2jfrozen.properties
  1125. ===================================================================
  1126. --- config/functions/l2jfrozen.properties (revision 1004)
  1127. +++ config/functions/l2jfrozen.properties (working copy)
  1128. @@ -280,4 +280,14 @@
  1129. ProtectorSkillLevel = 13
  1130. ProtectorSkillTime = 600
  1131. # Npc Protector Message
  1132. -ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
  1133. \ No newline at end of file
  1134. +ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
  1135. +
  1136. +# --------------------------------------------------
  1137. +# Achievements Event
  1138. +# --------------------------------------------------
  1139. +# Enable this event
  1140. +# Default: False
  1141. +AllowAchievement = True
  1142. +
  1143. +# Next configs in datapack section
  1144. +# --> xml folder
  1145. \ No newline at end of file
  1146. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/eventKills.java
  1147. ===================================================================
  1148. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/eventKills.java (revision 0)
  1149. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/eventKills.java (working copy)
  1150. @@ -0,0 +1,26 @@
  1151. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1152. +
  1153. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1154. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1155. +
  1156. +public class eventKills extends Condition
  1157. +{
  1158. + public eventKills(Object value)
  1159. + {
  1160. + super(value);
  1161. + setName("Event Kills");
  1162. + }
  1163. +@Override
  1164. + public boolean meetConditionRequirements(L2PcInstance player)
  1165. + {
  1166. + if (getValue() == null)
  1167. + {
  1168. + return false;
  1169. + }
  1170. +
  1171. + @SuppressWarnings("unused")
  1172. + int val = Integer.parseInt(getValue().toString());
  1173. +
  1174. + return false;
  1175. + }
  1176. +}
  1177. \ No newline at end of file
  1178. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/HeroCount.java
  1179. ===================================================================
  1180. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/HeroCount.java (revision 0)
  1181. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/HeroCount.java (working copy)
  1182. @@ -0,0 +1,43 @@
  1183. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1184. +
  1185. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1186. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1187. +import com.l2jfrozen.gameserver.model.entity.Hero;
  1188. +import com.l2jfrozen.gameserver.templates.StatsSet;
  1189. +
  1190. +public class HeroCount extends Condition
  1191. +{
  1192. + public HeroCount(Object value)
  1193. + {
  1194. + super(value);
  1195. + setName("Hero Count");
  1196. + }
  1197. +
  1198. + @Override
  1199. + public boolean meetConditionRequirements(L2PcInstance player)
  1200. + {
  1201. + if (getValue() == null)
  1202. + {
  1203. + return false;
  1204. + }
  1205. +
  1206. + int val = Integer.parseInt(getValue().toString());
  1207. + for (Integer integer : Hero.getInstance().getHeroes().keySet())
  1208. + {
  1209. + int hero = integer.intValue();
  1210. +
  1211. + if (hero == player.getObjectId())
  1212. + {
  1213. + StatsSet sts = Hero.getInstance().getHeroes().get(Integer.valueOf(hero));
  1214. + if (sts.getString("char_name").equals(player.getName()))
  1215. + {
  1216. + if (sts.getInteger(Hero.COUNT) >= val)
  1217. + {
  1218. + return true;
  1219. + }
  1220. + }
  1221. + }
  1222. + }
  1223. + return false;
  1224. + }
  1225. +}
  1226. \ No newline at end of file
  1227. Index: head-src/com/l2jfrozen/Config.java
  1228. ===================================================================
  1229. --- head-src/com/l2jfrozen/Config.java (revision 1004)
  1230. +++ head-src/com/l2jfrozen/Config.java (working copy)
  1231. @@ -2398,7 +2398,7 @@
  1232. public static String FARM2_CUSTOM_MESSAGE;
  1233. public static String PVP1_CUSTOM_MESSAGE;
  1234. public static String PVP2_CUSTOM_MESSAGE;
  1235. -
  1236. + public static boolean ENABLE_EVENT_ACHIEVEMENT;
  1237. //============================================================
  1238. public static void loadL2JFrozenConfig()
  1239. {
  1240. @@ -2517,6 +2517,8 @@
  1241. FARM2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("Farm2CustomMeesage", "You have been teleported to Farm Zone 2!");
  1242. PVP1_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!");
  1243. PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
  1244. + // Achievment configurations
  1245. + ENABLE_EVENT_ACHIEVEMENT = Boolean.parseBoolean(L2JFrozenSettings.getProperty("AllowAchievement", "False"));
  1246. }
  1247. catch(Exception e)
  1248. {
  1249. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Noble.java
  1250. ===================================================================
  1251. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Noble.java (revision 0)
  1252. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Noble.java (working copy)
  1253. @@ -0,0 +1,28 @@
  1254. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1255. +
  1256. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1257. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1258. +
  1259. +public class Noble extends Condition
  1260. +{
  1261. + public Noble(Object value)
  1262. + {
  1263. + super(value);
  1264. + setName("Noble");
  1265. + }
  1266. +@Override
  1267. + public boolean meetConditionRequirements(L2PcInstance player)
  1268. + {
  1269. + if (getValue() == null)
  1270. + {
  1271. + return false;
  1272. + }
  1273. +
  1274. + if (player.isNoble())
  1275. + {
  1276. + return true;
  1277. + }
  1278. +
  1279. + return false;
  1280. + }
  1281. +}
  1282. \ No newline at end of file
  1283. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/events.java
  1284. ===================================================================
  1285. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/events.java (revision 0)
  1286. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/events.java (working copy)
  1287. @@ -0,0 +1,26 @@
  1288. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1289. +
  1290. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1291. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1292. +
  1293. +public class events extends Condition
  1294. +{
  1295. + public events(Object value)
  1296. + {
  1297. + super(value);
  1298. + setName("Events played");
  1299. + }
  1300. +@Override
  1301. + public boolean meetConditionRequirements(L2PcInstance player)
  1302. + {
  1303. + if (getValue() == null)
  1304. + {
  1305. + return false;
  1306. + }
  1307. +
  1308. + @SuppressWarnings("unused")
  1309. + int val = Integer.parseInt(getValue().toString());
  1310. +
  1311. + return false;
  1312. + }
  1313. +}
  1314. \ No newline at end of file
  1315. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/RaidKill.java
  1316. ===================================================================
  1317. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/RaidKill.java (revision 0)
  1318. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/RaidKill.java (working copy)
  1319. @@ -0,0 +1,39 @@
  1320. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1321. +
  1322. +import java.util.Map;
  1323. +
  1324. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1325. +import com.l2jfrozen.gameserver.managers.RaidBossPointsManager;
  1326. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1327. +
  1328. +public class RaidKill extends Condition
  1329. +{
  1330. + public RaidKill(Object value)
  1331. + {
  1332. + super(value);
  1333. + setName("Raid Kill");
  1334. + }
  1335. +
  1336. + @Override
  1337. + public boolean meetConditionRequirements(L2PcInstance player)
  1338. + {
  1339. + if (getValue() == null)
  1340. + return false;
  1341. +
  1342. + int val = Integer.parseInt(getValue().toString());
  1343. +
  1344. + Map<Integer, Integer> list = RaidBossPointsManager.getList(player);
  1345. + if (list != null)
  1346. + {
  1347. + for (int bid : list.keySet())
  1348. + {
  1349. + if (bid == val)
  1350. + {
  1351. + if (RaidBossPointsManager.getList(player).get(bid) > 0)
  1352. + return true;
  1353. + }
  1354. + }
  1355. + }
  1356. + return false;
  1357. + }
  1358. +}
  1359. \ No newline at end of file
  1360. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/CompleteAchievements.java
  1361. ===================================================================
  1362. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/CompleteAchievements.java (revision 0)
  1363. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/CompleteAchievements.java (working copy)
  1364. @@ -0,0 +1,30 @@
  1365. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1366. +
  1367. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1368. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1369. +
  1370. +public class CompleteAchievements extends Condition
  1371. +{
  1372. + public CompleteAchievements(Object value)
  1373. + {
  1374. + super(value);
  1375. + setName("Complete Achievements");
  1376. + }
  1377. +@Override
  1378. + public boolean meetConditionRequirements(L2PcInstance player)
  1379. + {
  1380. + if (getValue() == null)
  1381. + {
  1382. + return false;
  1383. + }
  1384. +
  1385. + int val = Integer.parseInt(getValue().toString());
  1386. +
  1387. + if (player.getCompletedAchievements().size() >= val)
  1388. + {
  1389. + return true;
  1390. + }
  1391. +
  1392. + return false;
  1393. + }
  1394. +}
  1395. \ No newline at end of file
  1396. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/SkillEnchant.java
  1397. ===================================================================
  1398. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/SkillEnchant.java (revision 0)
  1399. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/SkillEnchant.java (working copy)
  1400. @@ -0,0 +1,39 @@
  1401. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1402. +
  1403. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1404. +import com.l2jfrozen.gameserver.model.L2Skill;
  1405. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1406. +
  1407. +public class SkillEnchant extends Condition
  1408. +{
  1409. + public SkillEnchant(Object value)
  1410. + {
  1411. + super(value);
  1412. + setName("Skill Enchant");
  1413. + }
  1414. +@Override
  1415. + public boolean meetConditionRequirements(L2PcInstance player)
  1416. + {
  1417. + if (getValue() == null)
  1418. + {
  1419. + return false;
  1420. + }
  1421. +
  1422. + int val = Integer.parseInt(getValue().toString());
  1423. +
  1424. + for (L2Skill s : player.getAllSkills())
  1425. + {
  1426. + String lvl = String.valueOf(s.getLevel());
  1427. + if (lvl.length() > 2)
  1428. + {
  1429. + int sklvl = Integer.parseInt(lvl.substring(1));
  1430. + if (sklvl >= val)
  1431. + {
  1432. + return true;
  1433. + }
  1434. + }
  1435. + }
  1436. +
  1437. + return false;
  1438. + }
  1439. +}
  1440. \ No newline at end of file
  1441. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/OnlineTime.java
  1442. ===================================================================
  1443. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/OnlineTime.java (revision 0)
  1444. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/OnlineTime.java (working copy)
  1445. @@ -0,0 +1,29 @@
  1446. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1447. +
  1448. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1449. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1450. +
  1451. +public class OnlineTime extends Condition
  1452. +{
  1453. + public OnlineTime(Object value)
  1454. + {
  1455. + super(value);
  1456. + setName("Online Time");
  1457. + }
  1458. +@Override
  1459. + public boolean meetConditionRequirements(L2PcInstance player)
  1460. + {
  1461. + if (getValue() == null)
  1462. + {
  1463. + return false;
  1464. + }
  1465. +
  1466. + int val = Integer.parseInt(getValue().toString());
  1467. +
  1468. + if (player.getOnlineTime() >= val * 24 * 60 * 60 * 1000)
  1469. + {
  1470. + return true;
  1471. + }
  1472. + return false;
  1473. + }
  1474. +}
  1475. \ No newline at end of file
  1476. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/ClanLeader.java
  1477. ===================================================================
  1478. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/ClanLeader.java (revision 0)
  1479. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/ClanLeader.java (working copy)
  1480. @@ -0,0 +1,31 @@
  1481. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1482. +
  1483. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1484. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1485. +
  1486. +public class ClanLeader extends Condition
  1487. +{
  1488. + public ClanLeader(Object value)
  1489. + {
  1490. + super(value);
  1491. + setName("Be Clan Leader");
  1492. + }
  1493. +@Override
  1494. + public boolean meetConditionRequirements(L2PcInstance player)
  1495. + {
  1496. + if (getValue() == null)
  1497. + {
  1498. + return false;
  1499. + }
  1500. +
  1501. + if (player.getClan() != null)
  1502. + {
  1503. + if (player.isClanLeader())
  1504. + {
  1505. + return true;
  1506. + }
  1507. + }
  1508. +
  1509. + return false;
  1510. + }
  1511. +}
  1512. \ No newline at end of file
  1513. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Karma.java
  1514. ===================================================================
  1515. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Karma.java (revision 0)
  1516. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Karma.java (working copy)
  1517. @@ -0,0 +1,30 @@
  1518. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1519. +
  1520. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1521. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1522. +
  1523. +public class Karma extends Condition
  1524. +{
  1525. + public Karma(Object value)
  1526. + {
  1527. + super(value);
  1528. + setName("Karma Count");
  1529. + }
  1530. +@Override
  1531. + public boolean meetConditionRequirements(L2PcInstance player)
  1532. + {
  1533. + if (getValue() == null)
  1534. + {
  1535. + return false;
  1536. + }
  1537. +
  1538. + int val = Integer.parseInt(getValue().toString());
  1539. +
  1540. + if (player.getKarma() >= val)
  1541. + {
  1542. + return true;
  1543. + }
  1544. +
  1545. + return false;
  1546. + }
  1547. +}
  1548. \ No newline at end of file
  1549. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/WeaponEnchant.java
  1550. ===================================================================
  1551. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/WeaponEnchant.java (revision 0)
  1552. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/WeaponEnchant.java (working copy)
  1553. @@ -0,0 +1,36 @@
  1554. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1555. +
  1556. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1557. +import com.l2jfrozen.gameserver.model.Inventory;
  1558. +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
  1559. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1560. +
  1561. +public class WeaponEnchant extends Condition
  1562. +{
  1563. + public WeaponEnchant(Object value)
  1564. + {
  1565. + super(value);
  1566. + setName("Weapon Enchant");
  1567. + }
  1568. + @Override
  1569. + public boolean meetConditionRequirements(L2PcInstance player)
  1570. + {
  1571. + if (getValue() == null)
  1572. + {
  1573. + return false;
  1574. + }
  1575. +
  1576. + int val = Integer.parseInt(getValue().toString());
  1577. +
  1578. + L2ItemInstance weapon = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
  1579. +
  1580. + if (weapon != null)
  1581. + {
  1582. + if (weapon.getEnchantLevel() >= val)
  1583. + {
  1584. + return true;
  1585. + }
  1586. + }
  1587. + return false;
  1588. + }
  1589. +}
  1590. \ No newline at end of file
  1591. Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2AchievementsInstance.java
  1592. ===================================================================
  1593. --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2AchievementsInstance.java (revision 0)
  1594. +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2AchievementsInstance.java (working copy)
  1595. @@ -0,0 +1,345 @@
  1596. +/*
  1597. + * This program is free software: you can redistribute it and/or modify it under
  1598. + * the terms of the GNU General Public License as published by the Free Software
  1599. + * Foundation, either version 3 of the License, or (at your option) any later
  1600. + * version.
  1601. + *
  1602. + * This program is distributed in the hope that it will be useful, but WITHOUT
  1603. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1604. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1605. + * details.
  1606. + *
  1607. + * You should have received a copy of the GNU General Public License along with
  1608. + * this program. If not, see <http://www.gnu.org/licenses/>.
  1609. + */
  1610. +package com.l2jfrozen.gameserver.model.actor.instance;
  1611. +
  1612. +import java.util.StringTokenizer;
  1613. +
  1614. +import javolution.text.TextBuilder;
  1615. +
  1616. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.AchievementsManager;
  1617. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Achievement;
  1618. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1619. +import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
  1620. +import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
  1621. +
  1622. +public class L2AchievementsInstance extends L2NpcInstance
  1623. +{
  1624. + private boolean first = true;
  1625. +
  1626. + public L2AchievementsInstance(int objectId, L2NpcTemplate template)
  1627. + {
  1628. + super(objectId, template);
  1629. + }
  1630. +
  1631. + @Override
  1632. + public void onBypassFeedback(L2PcInstance player, String command)
  1633. + {
  1634. + if (player == null)
  1635. + {
  1636. + return;
  1637. + }
  1638. + if (command.startsWith("showMyAchievements"))
  1639. + {
  1640. + player.getAchievemntData();
  1641. + showMyAchievements(player);
  1642. + }
  1643. + else if (command.startsWith("achievementInfo"))
  1644. + {
  1645. + StringTokenizer st = new StringTokenizer(command, " ");
  1646. + st.nextToken();
  1647. + int id = Integer.parseInt(st.nextToken());
  1648. +
  1649. + showAchievementInfo(id, player);
  1650. + }
  1651. + else if (command.startsWith("topList"))
  1652. + {
  1653. + showTopListWindow(player);
  1654. + }
  1655. + else if (command.startsWith("showMainWindow"))
  1656. + {
  1657. + showChatWindow(player, 0);
  1658. + }
  1659. + else if (command.startsWith("getReward"))
  1660. + {
  1661. + StringTokenizer st = new StringTokenizer(command, " ");
  1662. + st.nextToken();
  1663. + int id = Integer.parseInt(st.nextToken());
  1664. + if (id == 10)
  1665. + {
  1666. + player.destroyItemByItemId("", 8787, 200, this, true);
  1667. + AchievementsManager.getInstance().rewardForAchievement(id, player);
  1668. + }
  1669. + else if ((id == 4) || (id == 19))
  1670. + {
  1671. + L2ItemInstance weapon = player.getInventory().getPaperdollItem(5);
  1672. + if (weapon != null)
  1673. + {
  1674. + int objid = weapon.getObjectId();
  1675. + if (AchievementsManager.getInstance().getAchievementList().get(Integer.valueOf(id)).meetAchievementRequirements(player))
  1676. + {
  1677. + if (!AchievementsManager.getInstance().isBinded(objid, id))
  1678. + {
  1679. + AchievementsManager.getInstance().getBinded().add(objid + "@" + id);
  1680. + player.saveAchievementData(id, objid);
  1681. + AchievementsManager.getInstance().rewardForAchievement(id, player);
  1682. + }
  1683. + else
  1684. + {
  1685. + player.sendMessage("This item was already used to earn this achievement.");
  1686. + }
  1687. + }
  1688. + else
  1689. + {
  1690. + player.sendMessage("Seems you don't meet the achievements requirements now.");
  1691. + }
  1692. + }
  1693. + else
  1694. + {
  1695. + player.sendMessage("You must equip your weapon in order to get rewarded.");
  1696. + }
  1697. + }
  1698. + else if ((id == 6) || (id == 18))
  1699. + {
  1700. + int clid = player.getClan().getClanId();
  1701. +
  1702. + if (!AchievementsManager.getInstance().isBinded(clid, id))
  1703. + {
  1704. + AchievementsManager.getInstance().getBinded().add(clid + "@" + id);
  1705. + player.saveAchievementData(id, clid);
  1706. + AchievementsManager.getInstance().rewardForAchievement(id, player);
  1707. + }
  1708. + else
  1709. + {
  1710. + player.sendMessage("Current clan was already rewarded for this achievement.");
  1711. + }
  1712. + }
  1713. + else
  1714. + {
  1715. + player.saveAchievementData(id, 0);
  1716. + AchievementsManager.getInstance().rewardForAchievement(id, player);
  1717. + }
  1718. + showMyAchievements(player);
  1719. + }
  1720. + else if (command.startsWith("showMyStats"))
  1721. + {
  1722. + showMyStatsWindow(player);
  1723. + }
  1724. + else if (command.startsWith("showHelpWindow"))
  1725. + {
  1726. + showHelpWindow(player);
  1727. + }
  1728. + }
  1729. +
  1730. + @Override
  1731. + public void showChatWindow(L2PcInstance player, int val)
  1732. + {
  1733. + if (this.first)
  1734. + {
  1735. + AchievementsManager.getInstance().loadUsed();
  1736. + this.first = false;
  1737. + }
  1738. + TextBuilder tb = new TextBuilder();
  1739. + tb.append("<html><title>ByCaFi Achievements Manager</title><body><center><br>");
  1740. + tb.append("Hello <font color=\"LEVEL\">" + player.getName() + "</font><br>Are you looking for challenge?");
  1741. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1\"><br>");
  1742. + tb.append("<button value=\"My Achievems\" action=\"bypass -h npc_%objectId%_showMyAchievements\" back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" width=95 height=21>");
  1743. + tb.append("<button value=\"Statistics\" action=\"bypass -h npc_%objectId%_showMyStats\" back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" width=95 height=21>");
  1744. + tb.append("<button value=\"Help\" action=\"bypass -h npc_%objectId%_showHelpWindow\" back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" width=95 height=21>");
  1745. +
  1746. + NpcHtmlMessage msg = new NpcHtmlMessage(getObjectId());
  1747. + msg.setHtml(tb.toString());
  1748. + msg.replace("%objectId%", String.valueOf(getObjectId()));
  1749. +
  1750. + player.sendPacket(msg);
  1751. + }
  1752. +
  1753. + private void showMyAchievements(L2PcInstance player)
  1754. + {
  1755. + TextBuilder tb = new TextBuilder();
  1756. + tb.append("<html><title>L2DeathForce Achievements Manager</title><body><br>");
  1757. +
  1758. + tb.append("<center><font color=\"LEVEL\">My achievements</font>:</center><br>");
  1759. +
  1760. + if (AchievementsManager.getInstance().getAchievementList().isEmpty())
  1761. + {
  1762. + tb.append("There are no Achievements created yet!");
  1763. + }
  1764. + else
  1765. + {
  1766. + int i = 0;
  1767. +
  1768. + tb.append("<table width=270 border=0 bgcolor=\"33FF33\">");
  1769. + tb.append("<tr><td width=270 align=\"left\">Name:</td><td width=60 align=\"right\">Info:</td><td width=200 align=\"center\">Status:</td></tr></table>");
  1770. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1\"><br>");
  1771. +
  1772. + for (Achievement a : AchievementsManager.getInstance().getAchievementList().values())
  1773. + {
  1774. + tb.append(getTableColor(i));
  1775. + tb.append("<tr><td width=270 align=\"left\">" + a.getName() + "</td><td width=50 align=\"right\"><a action=\"bypass -h npc_%objectId%_achievementInfo " + a.getID() + "\">info</a></td><td width=200 align=\"center\">" + getStatusString(a.getID(), player) + "</td></tr></table>");
  1776. + i++;
  1777. + }
  1778. +
  1779. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1s\"><br>");
  1780. + tb.append("<center><button value=\"Back\" action=\"bypass -h npc_%objectId%_showMainWindow\" back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" width=95 height=21></center>");
  1781. + }
  1782. +
  1783. + NpcHtmlMessage msg = new NpcHtmlMessage(getObjectId());
  1784. + msg.setHtml(tb.toString());
  1785. + msg.replace("%objectId%", String.valueOf(getObjectId()));
  1786. +
  1787. + player.sendPacket(msg);
  1788. + }
  1789. +
  1790. + private void showAchievementInfo(int achievementID, L2PcInstance player)
  1791. + {
  1792. + Achievement a = AchievementsManager.getInstance().getAchievementList().get(Integer.valueOf(achievementID));
  1793. +
  1794. + TextBuilder tb = new TextBuilder();
  1795. + tb.append("<html><title>ByCaFi Achievements Manager</title><body><br>");
  1796. +
  1797. + tb.append("<table width=270 border=0 bgcolor=\"33FF33\">");
  1798. + tb.append("<tr><td width=270 align=\"center\">" + a.getName() + "</td></tr></table><br>");
  1799. + tb.append("<center>Status: " + getStatusString(achievementID, player));
  1800. +
  1801. + if ((a.meetAchievementRequirements(player)) && (!player.getCompletedAchievements().contains(Integer.valueOf(achievementID))))
  1802. + {
  1803. + tb.append("<button value=\"Receive Reward!\" action=\"bypass -h npc_%objectId%_getReward " + a.getID() + "\" back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" width=95 height=21>");
  1804. + }
  1805. +
  1806. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1s\"><br>");
  1807. +
  1808. + tb.append("<table width=270 border=0 bgcolor=\"33FF33\">");
  1809. + tb.append("<tr><td width=270 align=\"center\">Description</td></tr></table><br>");
  1810. + tb.append(a.getDescription());
  1811. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1s\"><br>");
  1812. +
  1813. + tb.append("<table width=270 border=0 bgcolor=\"33FF33\">");
  1814. + tb.append("<tr><td width=270 align=\"left\">Condition:</td><td width=100 align=\"left\">Value:</td><td width=200 align=\"center\">Status:</td></tr></table>");
  1815. + tb.append(getConditionsStatus(achievementID, player));
  1816. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1s\"><br>");
  1817. + tb.append("<center><button value=\"Back\" action=\"bypass -h npc_%objectId%_showMyAchievements\" back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" width=95 height=21></center>");
  1818. +
  1819. + NpcHtmlMessage msg = new NpcHtmlMessage(getObjectId());
  1820. + msg.setHtml(tb.toString());
  1821. + msg.replace("%objectId%", String.valueOf(getObjectId()));
  1822. +
  1823. + player.sendPacket(msg);
  1824. + }
  1825. +
  1826. + private void showMyStatsWindow(L2PcInstance player)
  1827. + {
  1828. + TextBuilder tb = new TextBuilder();
  1829. + tb.append("<html><title>ByCaFi Achievements Manager</title><body><center><br>");
  1830. + tb.append("Check your <font color=\"LEVEL\">Achievements </font>statistics:");
  1831. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1\"><br>");
  1832. +
  1833. + player.getAchievemntData();
  1834. + int completedCount = player.getCompletedAchievements().size();
  1835. +
  1836. + tb.append("You have completed: " + completedCount + "/<font color=\"LEVEL\">" + AchievementsManager.getInstance().getAchievementList().size() + "</font>");
  1837. +
  1838. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1s\"><br>");
  1839. + tb.append("<center><button value=\"Back\" action=\"bypass -h npc_%objectId%_showMainWindow\" back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" width=95 height=21></center>");
  1840. +
  1841. + NpcHtmlMessage msg = new NpcHtmlMessage(getObjectId());
  1842. + msg.setHtml(tb.toString());
  1843. + msg.replace("%objectId%", String.valueOf(getObjectId()));
  1844. +
  1845. + player.sendPacket(msg);
  1846. + }
  1847. +
  1848. + private void showTopListWindow(L2PcInstance player)
  1849. + {
  1850. + TextBuilder tb = new TextBuilder();
  1851. + tb.append("<html><title>ByCaFi Achievements Manager</title><body><center><br>");
  1852. + tb.append("Check your <font color=\"LEVEL\">Achievements </font>Top List:");
  1853. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1\"><br>");
  1854. +
  1855. + tb.append("Not implemented yet!");
  1856. +
  1857. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1s\"><br>");
  1858. + tb.append("<center><button value=\"Back\" action=\"bypass -h npc_%objectId%_showMainWindow\" back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" width=95 height=21></center>");
  1859. +
  1860. + NpcHtmlMessage msg = new NpcHtmlMessage(getObjectId());
  1861. + msg.setHtml(tb.toString());
  1862. + msg.replace("%objectId%", String.valueOf(getObjectId()));
  1863. +
  1864. + player.sendPacket(msg);
  1865. + }
  1866. +
  1867. + private void showHelpWindow(L2PcInstance player)
  1868. + {
  1869. + TextBuilder tb = new TextBuilder();
  1870. + tb.append("<html><title>ByCaFi Achievements Manager</title><body><center><br>");
  1871. + tb.append("Achievements <font color=\"LEVEL\">Help </font>page:");
  1872. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1\"><br>");
  1873. +
  1874. + tb.append("<table><tr><td>You can check the status of your achievements,</td></tr><tr><td>receive reward if every condition of the achievement is meet,</td></tr><tr><td>if not you can check which condition is still not met, by using info button</td></tr></table>");
  1875. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1s\"><br>");
  1876. + tb.append("<table><tr><td><font color=\"FF0000\">Not Completed</font> - you did not meet the achivement requirements.</td></tr>");
  1877. + tb.append("<tr><td><font color=\"LEVEL\">Get Reward</font> - you may receive reward, click info.</td></tr>");
  1878. + tb.append("<tr><td><font color=\"5EA82E\">Completed</font> - achievement completed, reward received.</td></tr></table>");
  1879. +
  1880. + tb.append("<br><img src=\"l2ui.squaregray\" width=\"270\" height=\"1s\"><br>");
  1881. + tb.append("<center><button value=\"Back\" action=\"bypass -h npc_%objectId%_showMainWindow\" back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\" width=95 height=21></center>");
  1882. +
  1883. + NpcHtmlMessage msg = new NpcHtmlMessage(getObjectId());
  1884. + msg.setHtml(tb.toString());
  1885. + msg.replace("%objectId%", String.valueOf(getObjectId()));
  1886. +
  1887. + player.sendPacket(msg);
  1888. + }
  1889. +
  1890. + private String getStatusString(int achievementID, L2PcInstance player)
  1891. + {
  1892. + if (player.getCompletedAchievements().contains(Integer.valueOf(achievementID)))
  1893. + {
  1894. + return "<font color=\"5EA82E\">Completed</font>";
  1895. + }
  1896. +
  1897. + if (AchievementsManager.getInstance().getAchievementList().get(Integer.valueOf(achievementID)).meetAchievementRequirements(player))
  1898. + {
  1899. + return "<font color=\"LEVEL\">Get Reward</font>";
  1900. + }
  1901. +
  1902. + return "<font color=\"FF0000\">Not Completed</font>";
  1903. + }
  1904. +
  1905. + private String getTableColor(int i)
  1906. + {
  1907. + if ((i % 2) == 0)
  1908. + {
  1909. + return "<table width=270 border=0 bgcolor=\"444444\">";
  1910. + }
  1911. +
  1912. + return "<table width=270 border=0>";
  1913. + }
  1914. +
  1915. + private String getConditionsStatus(int achievementID, L2PcInstance player)
  1916. + {
  1917. + int i = 0;
  1918. + String s = "</center>";
  1919. + Achievement a = AchievementsManager.getInstance().getAchievementList().get(Integer.valueOf(achievementID));
  1920. + String completed = "<font color=\"5EA82E\">Completed</font></td></tr></table>";
  1921. + String notcompleted = "<font color=\"FF0000\">Not Completed</font></td></tr></table>";
  1922. +
  1923. + for (Condition c : a.getConditions())
  1924. + {
  1925. + s = s + getTableColor(i);
  1926. + s = s + "<tr><td width=270 align=\"left\">" + c.getName() + "</td><td width=100 align=\"left\">" + c.getValue() + "</td><td width=200 align=\"center\">";
  1927. + i++;
  1928. +
  1929. + if (c.meetConditionRequirements(player))
  1930. + {
  1931. + s = s + completed;
  1932. + }
  1933. + else
  1934. + {
  1935. + s = s + notcompleted;
  1936. + }
  1937. + }
  1938. + return s;
  1939. + }
  1940. +}
  1941. \ No newline at end of file
  1942. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Hero.java
  1943. ===================================================================
  1944. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Hero.java (revision 0)
  1945. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Hero.java (working copy)
  1946. @@ -0,0 +1,28 @@
  1947. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  1948. +
  1949. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  1950. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  1951. +
  1952. +public class Hero extends Condition
  1953. +{
  1954. + public Hero(Object value)
  1955. + {
  1956. + super(value);
  1957. + setName("Hero");
  1958. + }
  1959. +@Override
  1960. + public boolean meetConditionRequirements(L2PcInstance player)
  1961. + {
  1962. + if (getValue() == null)
  1963. + {
  1964. + return false;
  1965. + }
  1966. +
  1967. + if (player.isHero())
  1968. + {
  1969. + return true;
  1970. + }
  1971. +
  1972. + return false;
  1973. + }
  1974. +}
  1975. \ No newline at end of file
  1976. Index: head-src/com/l2jfrozen/gameserver/managers/RaidBossPointsManager.java
  1977. ===================================================================
  1978. --- head-src/com/l2jfrozen/gameserver/managers/RaidBossPointsManager.java (revision 1004)
  1979. +++ head-src/com/l2jfrozen/gameserver/managers/RaidBossPointsManager.java (working copy)
  1980. @@ -262,4 +262,14 @@
  1981.  
  1982. return tmpRanking;
  1983. }
  1984. +
  1985. + public static final RaidBossPointsManager getInstance()
  1986. + {
  1987. + return SingletonHolder._instance;
  1988. + }
  1989. +
  1990. + private static class SingletonHolder
  1991. + {
  1992. + protected static final RaidBossPointsManager _instance = new RaidBossPointsManager();
  1993. + }
  1994. }
  1995. \ No newline at end of file
  1996. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/MinCMcount.java
  1997. ===================================================================
  1998. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/MinCMcount.java (revision 0)
  1999. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/MinCMcount.java (working copy)
  2000. @@ -0,0 +1,32 @@
  2001. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  2002. +
  2003. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  2004. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  2005. +
  2006. +public class MinCMcount extends Condition
  2007. +{
  2008. + public MinCMcount(Object value)
  2009. + {
  2010. + super(value);
  2011. + setName("Clan Members Count");
  2012. + }
  2013. +@Override
  2014. + public boolean meetConditionRequirements(L2PcInstance player)
  2015. + {
  2016. + if (getValue() == null)
  2017. + {
  2018. + return false;
  2019. + }
  2020. +
  2021. + if (player.getClan() != null)
  2022. + {
  2023. + int val = Integer.parseInt(getValue().toString());
  2024. +
  2025. + if (player.getClan().getMembersCount() >= val)
  2026. + {
  2027. + return true;
  2028. + }
  2029. + }
  2030. + return false;
  2031. + }
  2032. +}
  2033. \ No newline at end of file
  2034. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Mage.java
  2035. ===================================================================
  2036. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Mage.java (revision 0)
  2037. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/Mage.java (working copy)
  2038. @@ -0,0 +1,28 @@
  2039. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  2040. +
  2041. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  2042. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  2043. +
  2044. +public class Mage extends Condition
  2045. +{
  2046. + public Mage(Object value)
  2047. + {
  2048. + super(value);
  2049. + setName("Be Mage");
  2050. + }
  2051. +@Override
  2052. + public boolean meetConditionRequirements(L2PcInstance player)
  2053. + {
  2054. + if (getValue() == null)
  2055. + {
  2056. + return false;
  2057. + }
  2058. +
  2059. + if (player.isMageClass())
  2060. + {
  2061. + return true;
  2062. + }
  2063. +
  2064. + return false;
  2065. + }
  2066. +}
  2067. \ No newline at end of file
  2068. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/ItemsCount.java
  2069. ===================================================================
  2070. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/ItemsCount.java (revision 0)
  2071. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/ItemsCount.java (working copy)
  2072. @@ -0,0 +1,43 @@
  2073. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  2074. +
  2075. +import java.util.StringTokenizer;
  2076. +
  2077. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  2078. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  2079. +
  2080. +public class ItemsCount extends Condition
  2081. +{
  2082. + public ItemsCount(Object value)
  2083. + {
  2084. + super(value);
  2085. + setName("Items Count");
  2086. + }
  2087. +@Override
  2088. + public boolean meetConditionRequirements(L2PcInstance player)
  2089. + {
  2090. + if (getValue() == null)
  2091. + {
  2092. + return false;
  2093. + }
  2094. +
  2095. + String s = getValue().toString();
  2096. + StringTokenizer st = new StringTokenizer(s, ",");
  2097. + int id = 0;
  2098. + int ammount = 0;
  2099. + try
  2100. + {
  2101. + id = Integer.parseInt(st.nextToken());
  2102. + ammount = Integer.parseInt(st.nextToken());
  2103. + if (player.getInventory().getInventoryItemCount(id, 0) >= ammount)
  2104. + {
  2105. + return true;
  2106. + }
  2107. + }
  2108. + catch (NumberFormatException nfe)
  2109. + {
  2110. + nfe.printStackTrace();
  2111. + }
  2112. +
  2113. + return false;
  2114. + }
  2115. +}
  2116. \ No newline at end of file
  2117. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/eventWins.java
  2118. ===================================================================
  2119. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/eventWins.java (revision 0)
  2120. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/eventWins.java (working copy)
  2121. @@ -0,0 +1,26 @@
  2122. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  2123. +
  2124. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  2125. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  2126. +
  2127. +public class eventWins extends Condition
  2128. +{
  2129. + public eventWins(Object value)
  2130. + {
  2131. + super(value);
  2132. + setName("Event Wins");
  2133. + }
  2134. +@Override
  2135. + public boolean meetConditionRequirements(L2PcInstance player)
  2136. + {
  2137. + if (getValue() == null)
  2138. + {
  2139. + return false;
  2140. + }
  2141. +
  2142. + @SuppressWarnings("unused")
  2143. + int val = Integer.parseInt(getValue().toString());
  2144. +
  2145. + return false;
  2146. + }
  2147. +}
  2148. \ No newline at end of file
  2149. Index: head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/ClanLevel.java
  2150. ===================================================================
  2151. --- head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/ClanLevel.java (revision 0)
  2152. +++ head-src/com/l2jfrozen/gameserver/eventsmanager/AchievmentsEngine/conditions/ClanLevel.java (working copy)
  2153. @@ -0,0 +1,32 @@
  2154. +package com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.conditions;
  2155. +
  2156. +import com.l2jfrozen.gameserver.eventsmanager.AchievmentsEngine.base.Condition;
  2157. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  2158. +
  2159. +public class ClanLevel extends Condition
  2160. +{
  2161. + public ClanLevel(Object value)
  2162. + {
  2163. + super(value);
  2164. + setName("Clan Level");
  2165. + }
  2166. +@Override
  2167. + public boolean meetConditionRequirements(L2PcInstance player)
  2168. + {
  2169. + if (getValue() == null)
  2170. + {
  2171. + return false;
  2172. + }
  2173. +
  2174. + if (player.getClan() != null)
  2175. + {
  2176. + int val = Integer.parseInt(getValue().toString());
  2177. +
  2178. + if (player.getClan().getLevel() >= val)
  2179. + {
  2180. + return true;
  2181. + }
  2182. + }
  2183. + return false;
  2184. + }
  2185. +}
  2186. \ No newline at end of file
  2187. -------------------------------------------------------------------------------------------------------------------
  2188. sql
  2189. CREATE TABLE `achievements` (
  2190. `owner_id` int(11) NOT NULL DEFAULT '0',
  2191. `a1` int(11) DEFAULT '0',
  2192. `a2` int(11) DEFAULT '0',
  2193. `a3` int(11) DEFAULT '0',
  2194. `a4` int(11) DEFAULT '0',
  2195. `a5` int(11) DEFAULT '0',
  2196. `a6` int(11) DEFAULT '0',
  2197. `a7` int(11) DEFAULT '0',
  2198. `a8` int(11) DEFAULT '0',
  2199. `a9` int(11) DEFAULT '0',
  2200. `a10` int(11) DEFAULT '0',
  2201. `a11` int(11) DEFAULT '0',
  2202. `a12` int(11) DEFAULT '0',
  2203. `a13` int(11) DEFAULT '0',
  2204. `a14` int(11) DEFAULT '0',
  2205. `a15` int(11) DEFAULT '0',
  2206. `a16` int(11) DEFAULT '0',
  2207. `a17` int(11) DEFAULT '0',
  2208. `a18` int(11) DEFAULT '0',
  2209. `a19` int(11) DEFAULT '0',
  2210. `a20` int(11) DEFAULT '0',
  2211. `a21` int(11) DEFAULT '0',
  2212. `a22` int(11) DEFAULT '0',
  2213. `a23` int(11) DEFAULT '0',
  2214. `a24` int(11) DEFAULT '0',
  2215. PRIMARY KEY (`owner_id`)
  2216. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  2217.  
  2218. INSERT INTO `custom_npc` VALUES ('10000', '32226', 'Achievement', '1', 'L2jServer', '1', 'LineageNPC2.K_F1_grand', '11.00', '22.25', '70', 'male', 'L2Achievements', '40', '2444.000000000000000', '2444.000000000000000', '0.000000000000000', '0.000000000000000', '10', '10', '10', '10', '10', '10', '0', '0', '500.00000', '500.00000', '500.00000', '500.00000', '278', '1', '333', '0', '0', '0', '28.00000', '120.00000', '0', '0');
  2219. -----------------------------------------------------------------------------------------------------------------------------------
  2220. xml
  2221. <?xml version='1.0' encoding='UTF-8'?>
  2222. <!-- Achievements -->
  2223. <!-- Max achievements recommended is 60 more will cause client to crash (big html) -->
  2224. <!-- Possible Conditions are: -->
  2225. <!-- minLevel -->
  2226. <!-- minPvPCount -->
  2227. <!-- minPkCount -->
  2228. <!-- minClanLevel -->
  2229. <!-- mustBeHero -->
  2230. <!-- mustBeNoble -->
  2231. <!-- minWeaponEnchant -->
  2232. <!-- minKarmaCount -->
  2233. <!-- minAdenaCount -->
  2234. <!-- minClanMembersCount -->
  2235. <!-- mustBeClanLeader -->
  2236. <!-- mustBeMarried -->
  2237. <!-- itemAmmount -->
  2238. <!-- crpAmmount -->
  2239. <!-- lordOfCastle -->
  2240. <!-- mustBeMageClass -->
  2241. <!-- minSubclassCount -->
  2242. <!-- CompleteAchievements -->
  2243. <!-- minSkillEnchant -->
  2244. <!-- minOnlineTime -->
  2245. <!-- minHeroCount -->
  2246. <!-- raidToKill -->
  2247. <!-- raidToKill1 -->
  2248. <!-- raidToKill2 -->
  2249. <!-- minRaidPoints -->
  2250. <!-- eventKills -->
  2251. <!-- events -->
  2252. <!-- eventWins -->
  2253. <list>
  2254. <achievement id="1" name="Champion" description="Gain level 80" reward="9142,5" minLevel="80"/>
  2255. <achievement id="2" name="Hero" description="Gain hero status" reward="9142,10" mustBeHero="true"/>
  2256. <achievement id="3" name="Noble" description="Gain noblesse status" reward="9142,10" mustBeNoble="true"/>
  2257. <achievement id="4" name="Zaishen" description="Gain a +16 weapon" reward="9142,15" minWeaponEnchant="16" />
  2258. <achievement id="5" name="Norn" description="Gain 4,000 PvPs" reward="9142,15" minPvPCount="4000"/>
  2259. <achievement id="6" name="Commander" description="Be a clan leader of a level 8 clan" reward="9142,10" mustBeClanLeader="true" minClanLevel="8"/>
  2260. <achievement id="7" name="Darkbringer" description="Gain 1,500 PKs" reward="9142,15" minPkCount="1500"/>
  2261. <achievement id="8" name="Bravery" description="Have 3 subclasses" reward="9142,5" minSubclassCount="3"/>
  2262. <achievement id="9" name="Dealer" description="Bring 200 Sprignant fruits" reward="9142,15" itemAmmount="8787,200"/>
  2263. <achievement id="10" name="Gamer" description="Be online for 100 days" reward="9142,10" minOnlineTime="100"/>
  2264. <achievement id="11" name="Conqueror" description="Be clan leader of a clan level 8 that owns a castle" reward="9142,10" lordOfCastle="true" minClanLevel="8" mustBeClanLeader="true"/>
  2265. <achievement id="12" name="Codex" description="Have a +15 skill" reward="9142,15" minSkillEnchant="15"/>
  2266. <achievement id="13" name="Famous" description="Be clean leader of a level 8 clan with 100,000 clan reputation points" reward="9142,15" minClanLevel="8" crpAmmount="100000" mustBeClanLeader="true"/>
  2267. <achievement id="14" name="Myth" description="Have hero status for 15 periods" reward="9142,15" minHeroCount="15"/>
  2268. <achievement id="15" name="Wisdom" description="Kill Hallate, Kernon and Golkonda within 24hours" reward="9142,5" raidToKill="25220" raidToKill1="25054" raidToKill2="25126"/>
  2269. <achievement id="16" name="Slayer" description="Kill Baium and be level 80" reward="9142,5" raidToKill="29020" minLevel="80" />
  2270. <achievement id="17" name="Joker" description="Kill Antharas and be level 80" reward="9142,5" raidToKill="29019" minLevel="80" />
  2271. <achievement id="18" name="Legend" description="Kill Valakas and be level 80" reward="9142,10" raidToKill="29028" minLevel="80" />
  2272. <achievement id="19" name="Lightbringer" description="Claim 1,200 Raid points and be lvl 78" reward="9142,10" minRaidPoints="1200" minLevel="78" />
  2273. <achievement id="20" name="Dominator" description="get 1,500 event kills" reward="9142,15" eventKills="1500" />
  2274. <achievement id="21" name="Winner" description="get 250 event wins" reward="9142,15" eventWins="250" />
  2275. <achievement id="22" name="Eventor" description="play in 250 events" reward="9142,10" events="250" />
  2276. <achievement id="23" name="Vanquisher" description="Complete all personal achievements" reward="9142,40" CompleteAchievements="8" />
  2277. <achievement id="24" name="Tycoon" description="Complete all achievements" reward="9142,60" CompleteAchievements="10" />
  2278. </list>
Advertisement
Add Comment
Please, Sign In to add comment