Sarada-L2

Iten Reward Grade D Itens L2jFrozen Yo: Sarada

Dec 6th, 2020 (edited)
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.97 KB | None | 0 0
  1. Index: com/l2jfrozen/gameserver/handler/itemhandlers/GradeDReward.java
  2.  
  3. +package com.l2jfrozen.gameserver.handler.itemhandlers;
  4. +
  5. +import com.l2jfrozen.Config;
  6. +import com.l2jfrozen.gameserver.handler.IItemHandler;
  7. +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
  8. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  9. +import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
  10. +import com.l2jfrozen.gameserver.model.base.ClassId;
  11. +import com.l2jfrozen.gameserver.network.serverpackets.ItemList;
  12. +import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser;
  13. +
  14. +public class GradeDReward implements IItemHandler
  15. +{
  16. + private static final int ITEM_IDS[] = { Config.REWARD_ITEM_D};
  17. + @Override
  18. + public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
  19. + {
  20. + if (!(playable instanceof L2PcInstance))
  21. + return;
  22. +
  23. + L2PcInstance activeChar = (L2PcInstance)playable;
  24. +
  25. + if (activeChar.isInOlympiadMode())
  26. + {
  27. + activeChar.sendMessage("This item cannot be used on Olympiad Games.");
  28. + return;
  29. + }
  30. +
  31. + if (activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false))
  32. + {
  33. + //Heavy
  34. + if (activeChar.getClassId() == ClassId.warrior)
  35. + {
  36. + //Armor
  37. + L2ItemInstance item1 = activeChar.getInventory().addItem("Armor", 352, 1, activeChar, null);
  38. + L2ItemInstance item2 = activeChar.getInventory().addItem("Armor", 2378, 1, activeChar, null);
  39. + L2ItemInstance item3 = activeChar.getInventory().addItem("Armor", 2411, 1, activeChar, null);
  40. + L2ItemInstance item4 = activeChar.getInventory().addItem("Armor", 2425, 1, activeChar, null);
  41. + L2ItemInstance item5 = activeChar.getInventory().addItem("Armor", 2449, 1, activeChar, null);
  42. +
  43. + //Weapon
  44. + L2ItemInstance item6 = activeChar.getInventory().addItem("Weapon", 2525, 1, activeChar, null);
  45. +
  46. + //Jewels
  47. + L2ItemInstance item7 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  48. + L2ItemInstance item8 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  49. + L2ItemInstance item9 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  50. + L2ItemInstance item10 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  51. + L2ItemInstance item11 = activeChar.getInventory().addItem("Necklace", 913, 1, activeChar, null);
  52. +
  53. + //Equipp
  54. + activeChar.getInventory().equipItemAndRecord(item1);
  55. + activeChar.getInventory().equipItemAndRecord(item2);
  56. + activeChar.getInventory().equipItemAndRecord(item3);
  57. + activeChar.getInventory().equipItemAndRecord(item4);
  58. + activeChar.getInventory().equipItemAndRecord(item5);
  59. + activeChar.getInventory().equipItemAndRecord(item6);
  60. + activeChar.getInventory().equipItemAndRecord(item7);
  61. + activeChar.getInventory().equipItemAndRecord(item8);
  62. + activeChar.getInventory().equipItemAndRecord(item9);
  63. + activeChar.getInventory().equipItemAndRecord(item10);
  64. + activeChar.getInventory().equipItemAndRecord(item11);
  65. +
  66. + //Secund Weapon
  67. + activeChar.getInventory().addItem("Weapon", 297, 1, activeChar, null);
  68. +
  69. + //Misc
  70. + activeChar.getInventory().addItem("Soul Shot Grade D", 1463, 2000, activeChar, null);
  71. + activeChar.getInventory().addItem("Mana Potion", 728, 100, activeChar, null);
  72. + activeChar.getInventory().addItem("Greater Healing Potion", 1539, 20, activeChar, null);
  73. + activeChar.getInventory().addItem("Scroll of Scape", 736, 5, activeChar, null);
  74. +
  75. + activeChar.getInventory().updateDatabase();
  76. + activeChar.sendPacket(new ItemList(activeChar, true));
  77. +
  78. + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
  79. + MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2024, 1, 1, 0);
  80. + activeChar.broadcastPacket(MSU);
  81. + }
  82. + //Heavy
  83. + if (activeChar.getClassId() == ClassId.knight || activeChar.getClassId() == ClassId.elvenKnight || activeChar.getClassId() == ClassId.palusKnight || activeChar.getClassId() == ClassId.scavenger || activeChar.getClassId() == ClassId.artisan)
  84. + {
  85. + //Armor
  86. + L2ItemInstance item1 = activeChar.getInventory().addItem("Armor", 352, 1, activeChar, null);
  87. + L2ItemInstance item2 = activeChar.getInventory().addItem("Armor", 2378, 1, activeChar, null);
  88. + L2ItemInstance item3 = activeChar.getInventory().addItem("Armor", 2411, 1, activeChar, null);
  89. + L2ItemInstance item4 = activeChar.getInventory().addItem("Armor", 2425, 1, activeChar, null);
  90. + L2ItemInstance item5 = activeChar.getInventory().addItem("Armor", 2449, 1, activeChar, null);
  91. +
  92. + //Weapon
  93. + L2ItemInstance item6 = activeChar.getInventory().addItem("Weapon", 2499, 1, activeChar, null);
  94. +
  95. + //Jewels
  96. + L2ItemInstance item7 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  97. + L2ItemInstance item8 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  98. + L2ItemInstance item9 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  99. + L2ItemInstance item10 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  100. + L2ItemInstance item11 = activeChar.getInventory().addItem("Necklace", 913, 1, activeChar, null);
  101. +
  102. + //Shield
  103. + L2ItemInstance item12 = activeChar.getInventory().addItem("Shield", 2493, 1, activeChar, null);
  104. +
  105. + //Equipp
  106. + activeChar.getInventory().equipItemAndRecord(item1);
  107. + activeChar.getInventory().equipItemAndRecord(item2);
  108. + activeChar.getInventory().equipItemAndRecord(item3);
  109. + activeChar.getInventory().equipItemAndRecord(item4);
  110. + activeChar.getInventory().equipItemAndRecord(item5);
  111. + activeChar.getInventory().equipItemAndRecord(item6);
  112. + activeChar.getInventory().equipItemAndRecord(item7);
  113. + activeChar.getInventory().equipItemAndRecord(item8);
  114. + activeChar.getInventory().equipItemAndRecord(item9);
  115. + activeChar.getInventory().equipItemAndRecord(item10);
  116. + activeChar.getInventory().equipItemAndRecord(item11);
  117. + activeChar.getInventory().equipItemAndRecord(item12);
  118. +
  119. + //Secund Weapon
  120. + activeChar.getInventory().addItem("Weapon", 159, 1, activeChar, null);
  121. +
  122. + //Misc
  123. + activeChar.getInventory().addItem("Soul Shot Grade D", 1463, 2000, activeChar, null);
  124. + activeChar.getInventory().addItem("Mana Potion", 728, 100, activeChar, null);
  125. + activeChar.getInventory().addItem("Greater Healing Potion", 1539, 20, activeChar, null);
  126. + activeChar.getInventory().addItem("Scroll of Scape", 736, 5, activeChar, null);
  127. +
  128. + activeChar.getInventory().updateDatabase();
  129. + activeChar.sendPacket(new ItemList(activeChar, true));
  130. +
  131. + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
  132. + MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2024, 1, 1, 0);
  133. + activeChar.broadcastPacket(MSU);
  134. + }
  135. + //Light
  136. + if (activeChar.getClassId() == ClassId.rogue || activeChar.getClassId() == ClassId.elvenScout || activeChar.getClassId() == ClassId.assassin)
  137. + {
  138. + //Armor
  139. + L2ItemInstance item1 = activeChar.getInventory().addItem("Armor", 395, 1, activeChar, null);
  140. + L2ItemInstance item2 = activeChar.getInventory().addItem("Armor", 417, 1, activeChar, null);
  141. + L2ItemInstance item3 = activeChar.getInventory().addItem("Armor", 2424, 1, activeChar, null);
  142. + L2ItemInstance item4 = activeChar.getInventory().addItem("Armor", 2448, 1, activeChar, null);
  143. + L2ItemInstance item5 = activeChar.getInventory().addItem("Armor", 2412, 1, activeChar, null);
  144. +
  145. + //Weapon
  146. + L2ItemInstance item6 = activeChar.getInventory().addItem("Weapon", 225, 1, activeChar, null);
  147. +
  148. + //Jewels
  149. + L2ItemInstance item7 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  150. + L2ItemInstance item8 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  151. + L2ItemInstance item9 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  152. + L2ItemInstance item10 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  153. + L2ItemInstance item11 = activeChar.getInventory().addItem("Necklace", 913, 1, activeChar, null);
  154. +
  155. + //Equipp
  156. + activeChar.getInventory().equipItemAndRecord(item1);
  157. + activeChar.getInventory().equipItemAndRecord(item2);
  158. + activeChar.getInventory().equipItemAndRecord(item3);
  159. + activeChar.getInventory().equipItemAndRecord(item4);
  160. + activeChar.getInventory().equipItemAndRecord(item5);
  161. + activeChar.getInventory().equipItemAndRecord(item6);
  162. + activeChar.getInventory().equipItemAndRecord(item7);
  163. + activeChar.getInventory().equipItemAndRecord(item8);
  164. + activeChar.getInventory().equipItemAndRecord(item9);
  165. + activeChar.getInventory().equipItemAndRecord(item10);
  166. + activeChar.getInventory().equipItemAndRecord(item11);
  167. +
  168. + //Secund Weapon
  169. + activeChar.getInventory().addItem("Weapon", 280, 1, activeChar, null);
  170. +
  171. + //Misc
  172. + activeChar.getInventory().addItem("Soul Shot Grade D", 1463, 2000, activeChar, null);
  173. + activeChar.getInventory().addItem("Arrow D", 1341, 2000, activeChar, null);
  174. + activeChar.getInventory().addItem("Mana Potion", 728, 100, activeChar, null);
  175. + activeChar.getInventory().addItem("Greater Healing Potion", 1539, 20, activeChar, null);
  176. + activeChar.getInventory().addItem("Scroll of Scape", 736, 5, activeChar, null);
  177. +
  178. + activeChar.getInventory().updateDatabase();
  179. + activeChar.sendPacket(new ItemList(activeChar, true));
  180. +
  181. + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
  182. + MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2024, 1, 1, 0);
  183. + activeChar.broadcastPacket(MSU);
  184. + }
  185. + //Robe
  186. + if (activeChar.getClassId() == ClassId.wizard || activeChar.getClassId() == ClassId.cleric || activeChar.getClassId() == ClassId.elvenWizard || activeChar.getClassId() == ClassId.oracle || activeChar.getClassId() == ClassId.darkWizard || activeChar.getClassId() == ClassId.shillienOracle || activeChar.getClassId() == ClassId.orcShaman)
  187. + {
  188. + //Armor
  189. + L2ItemInstance item1 = activeChar.getInventory().addItem("Armor", 437, 1, activeChar, null);
  190. + L2ItemInstance item2 = activeChar.getInventory().addItem("Armor", 470, 1, activeChar, null);
  191. + L2ItemInstance item3 = activeChar.getInventory().addItem("Armor", 2450, 1, activeChar, null);
  192. + L2ItemInstance item4 = activeChar.getInventory().addItem("Armor", 2426, 1, activeChar, null);
  193. + L2ItemInstance item5 = activeChar.getInventory().addItem("Armor", 2412, 1, activeChar, null);
  194. +
  195. + //Weapon
  196. + L2ItemInstance item6 = activeChar.getInventory().addItem("Weapon", 189, 1, activeChar, null);
  197. +
  198. + //Jewels
  199. + L2ItemInstance item7 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  200. + L2ItemInstance item8 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  201. + L2ItemInstance item9 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  202. + L2ItemInstance item10 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  203. + L2ItemInstance item11 = activeChar.getInventory().addItem("Necklace", 913, 1, activeChar, null);
  204. +
  205. + //Shield
  206. + L2ItemInstance item12 = activeChar.getInventory().addItem("Shield", 629, 1, activeChar, null);
  207. +
  208. + //Equipp
  209. + activeChar.getInventory().equipItemAndRecord(item1);
  210. + activeChar.getInventory().equipItemAndRecord(item2);
  211. + activeChar.getInventory().equipItemAndRecord(item3);
  212. + activeChar.getInventory().equipItemAndRecord(item4);
  213. + activeChar.getInventory().equipItemAndRecord(item5);
  214. + activeChar.getInventory().equipItemAndRecord(item6);
  215. + activeChar.getInventory().equipItemAndRecord(item7);
  216. + activeChar.getInventory().equipItemAndRecord(item8);
  217. + activeChar.getInventory().equipItemAndRecord(item9);
  218. + activeChar.getInventory().equipItemAndRecord(item10);
  219. + activeChar.getInventory().equipItemAndRecord(item11);
  220. + activeChar.getInventory().equipItemAndRecord(item12);
  221. +
  222. + //Misc
  223. + activeChar.getInventory().addItem("Spirit Shot Grade D", 3948, 2000, activeChar, null);
  224. + activeChar.getInventory().addItem("Mana Potion", 728, 100, activeChar, null);
  225. + activeChar.getInventory().addItem("Greater Healing Potion", 1539, 20, activeChar, null);
  226. + activeChar.getInventory().addItem("Scroll of Scape", 736, 5, activeChar, null);
  227. +
  228. + activeChar.getInventory().updateDatabase();
  229. + activeChar.sendPacket(new ItemList(activeChar, true));
  230. +
  231. + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
  232. + MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2024, 1, 1, 0);
  233. + activeChar.broadcastPacket(MSU);
  234. + }
  235. + //Heavy
  236. + if (activeChar.getClassId() == ClassId.orcRaider)
  237. + {
  238. + //Armor
  239. + L2ItemInstance item1 = activeChar.getInventory().addItem("Armor", 352, 1, activeChar, null);
  240. + L2ItemInstance item2 = activeChar.getInventory().addItem("Armor", 2378, 1, activeChar, null);
  241. + L2ItemInstance item3 = activeChar.getInventory().addItem("Armor", 2411, 1, activeChar, null);
  242. + L2ItemInstance item4 = activeChar.getInventory().addItem("Armor", 2425, 1, activeChar, null);
  243. + L2ItemInstance item5 = activeChar.getInventory().addItem("Armor", 2449, 1, activeChar, null);
  244. +
  245. + //Weapon
  246. + L2ItemInstance item6 = activeChar.getInventory().addItem("Weapon", 70, 1, activeChar, null);
  247. +
  248. + //Jewels
  249. + L2ItemInstance item7 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  250. + L2ItemInstance item8 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  251. + L2ItemInstance item9 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  252. + L2ItemInstance item10 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  253. + L2ItemInstance item11 = activeChar.getInventory().addItem("Necklace", 913, 1, activeChar, null);
  254. +
  255. + //Equipp
  256. + activeChar.getInventory().equipItemAndRecord(item1);
  257. + activeChar.getInventory().equipItemAndRecord(item2);
  258. + activeChar.getInventory().equipItemAndRecord(item3);
  259. + activeChar.getInventory().equipItemAndRecord(item4);
  260. + activeChar.getInventory().equipItemAndRecord(item5);
  261. + activeChar.getInventory().equipItemAndRecord(item6);
  262. + activeChar.getInventory().equipItemAndRecord(item7);
  263. + activeChar.getInventory().equipItemAndRecord(item8);
  264. + activeChar.getInventory().equipItemAndRecord(item9);
  265. + activeChar.getInventory().equipItemAndRecord(item10);
  266. + activeChar.getInventory().equipItemAndRecord(item11);
  267. +
  268. + //Secund Weapon
  269. + activeChar.getInventory().addItem("Weapon", 297, 1, activeChar, null);
  270. +
  271. + //Misc
  272. + activeChar.getInventory().addItem("Soul Shot Grade D", 1463, 2000, activeChar, null);
  273. + activeChar.getInventory().addItem("Mana Potion", 728, 100, activeChar, null);
  274. + activeChar.getInventory().addItem("Greater Healing Potion", 1539, 20, activeChar, null);
  275. + activeChar.getInventory().addItem("Scroll of Scape", 736, 5, activeChar, null);
  276. +
  277. + activeChar.getInventory().updateDatabase();
  278. + activeChar.sendPacket(new ItemList(activeChar, true));
  279. +
  280. + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
  281. + MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2024, 1, 1, 0);
  282. + activeChar.broadcastPacket(MSU);
  283. + }
  284. + //Light
  285. + if (activeChar.getClassId() == ClassId.orcMonk)
  286. + {
  287. + //Armor
  288. + L2ItemInstance item1 = activeChar.getInventory().addItem("Armor", 395, 1, activeChar, null);
  289. + L2ItemInstance item2 = activeChar.getInventory().addItem("Armor", 417, 1, activeChar, null);
  290. + L2ItemInstance item3 = activeChar.getInventory().addItem("Armor", 2424, 1, activeChar, null);
  291. + L2ItemInstance item4 = activeChar.getInventory().addItem("Armor", 2448, 1, activeChar, null);
  292. + L2ItemInstance item5 = activeChar.getInventory().addItem("Armor", 2412, 1, activeChar, null);
  293. +
  294. + //Weapon
  295. + L2ItemInstance item6 = activeChar.getInventory().addItem("Weapon", 262, 1, activeChar, null);
  296. +
  297. + //Jewels
  298. + L2ItemInstance item7 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  299. + L2ItemInstance item8 = activeChar.getInventory().addItem("Ring", 881, 1, activeChar, null);
  300. + L2ItemInstance item9 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  301. + L2ItemInstance item10 = activeChar.getInventory().addItem("Earring", 850, 1, activeChar, null);
  302. + L2ItemInstance item11 = activeChar.getInventory().addItem("Necklace", 913, 1, activeChar, null);
  303. +
  304. + //Equipp
  305. + activeChar.getInventory().equipItemAndRecord(item1);
  306. + activeChar.getInventory().equipItemAndRecord(item2);
  307. + activeChar.getInventory().equipItemAndRecord(item3);
  308. + activeChar.getInventory().equipItemAndRecord(item4);
  309. + activeChar.getInventory().equipItemAndRecord(item5);
  310. + activeChar.getInventory().equipItemAndRecord(item6);
  311. + activeChar.getInventory().equipItemAndRecord(item7);
  312. + activeChar.getInventory().equipItemAndRecord(item8);
  313. + activeChar.getInventory().equipItemAndRecord(item9);
  314. + activeChar.getInventory().equipItemAndRecord(item10);
  315. + activeChar.getInventory().equipItemAndRecord(item11);
  316. +
  317. + //Misc
  318. + activeChar.getInventory().addItem("Soul Shot Grade D", 1463, 2000, activeChar, null);
  319. + activeChar.getInventory().addItem("Arrow D", 1341, 2000, activeChar, null);
  320. + activeChar.getInventory().addItem("Mana Potion", 728, 100, activeChar, null);
  321. + activeChar.getInventory().addItem("Greater Healing Potion", 1539, 20, activeChar, null);
  322. + activeChar.getInventory().addItem("Scroll of Scape", 736, 5, activeChar, null);
  323. +
  324. + activeChar.getInventory().updateDatabase();
  325. + activeChar.sendPacket(new ItemList(activeChar, true));
  326. +
  327. + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
  328. + MagicSkillUser MSU = new MagicSkillUser(activeChar, activeChar, 2024, 1, 1, 0);
  329. + activeChar.broadcastPacket(MSU);
  330. + }
  331. + }
  332. + }
  333. +
  334. + @Override
  335. + public int[] getItemIds()
  336. + {
  337. + return ITEM_IDS;
  338. + }
  339. +}
  340.  
  341. Index: com/l2jfrozen/gameserver/handler/itemhandlers.java
  342.  
  343. import com.l2jfrozen.gameserver.GameServer;
  344. +import com.l2jfrozen.gameserver.handler.itemhandlers.GradeDReward;
  345.  
  346. _datatable = new TreeMap<>();
  347. +registerItemHandler(new GradeDReward());
  348.  
  349.  
  350.  
  351. Index: com/l2jfrozen/Config.java
  352.  
  353. public static boolean ENABLE_ANTI_PVP_FARM_MSG;
  354. +public static int REWARD_ITEM_D;
  355.  
  356.  
  357. GM_CRITANNOUNCER_NAME = Boolean.parseBoolean(otherSettings.getProperty("GMShowCritAnnouncerName", "False"));
  358. +REWARD_ITEM_D = Integer.parseInt(item.getProperty("ItemRewardGradeDCoinID", "0"));
  359.  
  360.  
  361. Index: gameserver\config\head\other.properties
  362.  
  363. GMShowCritAnnouncerName = False
  364.  
  365. +#=============================================================
  366. +# Item Renawrd Grade D
  367. +#=============================================================
  368. +#Item Coin Grade D
  369. +#Recompensa vem quando tiver primeira job feita
  370. +ItemRewardGradeDCoinID = 6392
  371.  
Add Comment
Please, Sign In to add comment