warc222

Command Items

Oct 4th, 2015
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.65 KB | None | 0 0
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
  16.  
  17. import com.l2jfrozen.Config;
  18. import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
  19. import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  20. import com.l2jfrozen.gameserver.network.serverpackets.ItemList;
  21.  
  22. public class ClassItems implements IVoicedCommandHandler
  23. {
  24. private static String[] _voicedCommands =
  25. {
  26. "dagger",
  27. "bow",
  28. "tank",
  29. "mage",
  30. "duelist",
  31. "tyrant"
  32. };
  33.  
  34. @Override
  35. public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  36. {
  37. if (activeChar.getInventory().getInventoryItemCount(57, 0) < Config.COMMANDS_ITEMS_PRICE)
  38. {
  39. activeChar.sendMessage("You do not have enough Adena to buy this Items!");
  40. return false;
  41. }
  42. if (activeChar.isInOlympiadMode())
  43. {
  44. activeChar.sendMessage("Sorry,you are in the Olympiad now.");
  45. return false;
  46. }
  47. if (activeChar.isInDuel())
  48. {
  49. activeChar.sendMessage("Sorry,you are in a duel!");
  50. return false;
  51. }
  52. if (activeChar.atEvent)
  53. {
  54. activeChar.sendMessage("Sorry,you are on event now.");
  55. return false;
  56. }
  57. if (activeChar.getKarma() > 0)
  58. {
  59. activeChar.sendMessage("Sorry,PK player can't use this.");
  60. return false;
  61. }
  62. if (activeChar.isDead())
  63. {
  64. activeChar.sendMessage("Sorry,Dead player can't take items.");
  65. return false;
  66. }
  67.  
  68. if (command.equalsIgnoreCase("dagger"))
  69. {
  70. activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  71. activeChar.getInventory().addItem("Angel Slayer", 6367, 1, activeChar, activeChar);
  72. activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
  73. activeChar.getInventory().addItem("Dragonic Light", 6379, 1, activeChar, activeChar);
  74. activeChar.getInventory().addItem("Dragonic Boots", 6380, 1, activeChar, activeChar);
  75. activeChar.getInventory().addItem("Dragonic Gloves", 6381, 1, activeChar, activeChar);
  76. activeChar.getInventory().addItem("Dragonic Helmet", 6382, 1, activeChar, activeChar);
  77. activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  78. activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  79. activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  80. activeChar.sendMessage("Now You Have Dagger Items On Your Invetory. Take a Look!.");
  81. }
  82. else if (command.equalsIgnoreCase("bow"))
  83. {
  84. activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  85. activeChar.getInventory().addItem("Draconic Bow", 7577, 1, activeChar, activeChar);
  86. activeChar.getInventory().addItem("Shining Arrows", 1345, 5000, activeChar, activeChar);
  87. activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
  88. activeChar.getInventory().addItem("Draconic Light", 6379, 1, activeChar, activeChar);
  89. activeChar.getInventory().addItem("Draconic Boots", 6380, 1, activeChar, activeChar);
  90. activeChar.getInventory().addItem("Draconic Gloves", 6381, 1, activeChar, activeChar);
  91. activeChar.getInventory().addItem("Draconic Helmet", 6382, 1, activeChar, activeChar);
  92. activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  93. activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  94. activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  95. activeChar.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
  96. }
  97. else if (command.equalsIgnoreCase("tank"))
  98. {
  99. activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  100. activeChar.getInventory().addItem("Forgotten Blade", 6582, 1, activeChar, activeChar);
  101. activeChar.getInventory().addItem("Crusader Shield", 6680, 1, activeChar, activeChar);
  102. activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
  103. activeChar.getInventory().addItem("Imperial Armor", 6373, 1, activeChar, activeChar);
  104. activeChar.getInventory().addItem("Imperial ArmorP2", 6374, 1, activeChar, activeChar);
  105. activeChar.getInventory().addItem("Imperial Gloves", 6375, 1, activeChar, activeChar);
  106. activeChar.getInventory().addItem("Imperial Boots", 6376, 1, activeChar, activeChar);
  107. activeChar.getInventory().addItem("Imperial Helmet", 6378, 1, activeChar, activeChar);
  108. activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  109. activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  110. activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  111. activeChar.sendMessage("Now You Have Tank Items On Your Invetory. Take a Look!.");
  112. }
  113. else if (command.equalsIgnoreCase("duelist"))
  114. {
  115. activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  116. activeChar.getInventory().addItem("Duals", 6580, 1, activeChar, activeChar);
  117. activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
  118. activeChar.getInventory().addItem("Imperial Armor", 6373, 1, activeChar, activeChar);
  119. activeChar.getInventory().addItem("Imperial ArmorP2", 6374, 1, activeChar, activeChar);
  120. activeChar.getInventory().addItem("Imperial Gloves", 6375, 1, activeChar, activeChar);
  121. activeChar.getInventory().addItem("Imperial Boots", 6376, 1, activeChar, activeChar);
  122. activeChar.getInventory().addItem("Imperial Helmet", 6378, 1, activeChar, activeChar);
  123. activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  124. activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  125. activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  126. activeChar.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
  127. }
  128. else if (command.equalsIgnoreCase("tyrant"))
  129. {
  130. activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  131. activeChar.getInventory().addItem("Dualfist", 6372, 1, activeChar, activeChar);
  132. activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
  133. activeChar.getInventory().addItem("Draconic Light", 6379, 1, activeChar, activeChar);
  134. activeChar.getInventory().addItem("Draconic Boots", 6380, 1, activeChar, activeChar);
  135. activeChar.getInventory().addItem("Draconic Gloves", 6381, 1, activeChar, activeChar);
  136. activeChar.getInventory().addItem("Draconic Helmet", 6382, 1, activeChar, activeChar);
  137. activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  138. activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  139. activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  140. activeChar.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
  141. }
  142. else if (command.equalsIgnoreCase("mage"))
  143. {
  144. activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  145. activeChar.getInventory().addItem("Arcana Mace Acumen", 6608, 1, activeChar, activeChar);
  146. activeChar.getInventory().addItem("B.Spirishots", 3952, 5000, activeChar, activeChar);
  147. activeChar.getInventory().addItem("DC Robe", 2407, 1, activeChar, activeChar);
  148. activeChar.getInventory().addItem("DC Gloves", 5767, 1, activeChar, activeChar);
  149. activeChar.getInventory().addItem("DC Boots", 5779, 1, activeChar, activeChar);
  150. activeChar.getInventory().addItem("DC Helmet", 512, 1, activeChar, activeChar);
  151. activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  152. activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  153. activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  154. activeChar.sendMessage("Now You Have Mage Items On Your Invetory. Take a Look!");
  155. }
  156. return true;
  157. }
  158.  
  159. @Override
  160. public String[] getVoicedCommandList()
  161. {
  162. return _voicedCommands;
  163. }
Add Comment
Please, Sign In to add comment