Advertisement
Guest User

ClassItems

a guest
Feb 25th, 2015
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 8.21 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 net.sf.l2j.gameserver.handler.usercommandhandlers;
  16.  
  17. import net.sf.l2j.Config;
  18. import net.sf.l2j.gameserver.handler.IUserCommandHandler;
  19. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  20.  
  21. public class ClassItems implements IUserCommandHandler
  22. {
  23.     private static final int[] COMMAND_IDS =
  24.     {
  25.         114,
  26.         115,
  27.         116,
  28.         117,
  29.         118,
  30.         119
  31.     };
  32.    
  33.     @Override
  34.     public boolean useUserCommand(int id, L2PcInstance activeChar)
  35.     {
  36.         if (activeChar.getInventory().getInventoryItemCount(57, 0) < Config.COMMANDS_ITEMS_PRICE)
  37.         {
  38.             activeChar.sendMessage("You do not have enough Adena to buy this Items!");
  39.             return false;
  40.         }
  41.         if (activeChar.isInOlympiadMode())
  42.         {
  43.             activeChar.sendMessage("Sorry,you are in the Olympiad now.");
  44.             return false;
  45.         }
  46.         if (activeChar.isInDuel())
  47.         {
  48.             activeChar.sendMessage("Sorry,you are in a duel!");
  49.             return false;
  50.         }
  51.         if (activeChar.getKarma() > 0)
  52.         {
  53.             activeChar.sendMessage("Sorry,PK player can't use this.");
  54.             return false;
  55.         }
  56.         if (activeChar.isDead())
  57.         {
  58.             activeChar.sendMessage("Sorry,Dead player can't take items.");
  59.             return false;
  60.         }
  61.        
  62.         if (id == 114)
  63.         {
  64.             activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  65.             activeChar.getInventory().addItem("Angel Slayer", 6367, 1, activeChar, activeChar);
  66.             activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
  67.             activeChar.getInventory().addItem("Dragonic Light", 6379, 1, activeChar, activeChar);
  68.             activeChar.getInventory().addItem("Dragonic Boots", 6380, 1, activeChar, activeChar);
  69.             activeChar.getInventory().addItem("Dragonic Gloves", 6381, 1, activeChar, activeChar);
  70.             activeChar.getInventory().addItem("Dragonic Helmet", 6382, 1, activeChar, activeChar);
  71.             activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  72.             activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  73.             activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  74.             activeChar.sendMessage("Now You Have Dagger Items On Your Invetory. Take a Look!.");
  75.         }
  76.         else if (id == 115)
  77.         {
  78.             activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  79.             activeChar.getInventory().addItem("Draconic Bow", 7577, 1, activeChar, activeChar);
  80.             activeChar.getInventory().addItem("Shining Arrows", 1345, 5000, activeChar, activeChar);
  81.             activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
  82.             activeChar.getInventory().addItem("Draconic Light", 6379, 1, activeChar, activeChar);
  83.             activeChar.getInventory().addItem("Draconic Boots", 6380, 1, activeChar, activeChar);
  84.             activeChar.getInventory().addItem("Draconic Gloves", 6381, 1, activeChar, activeChar);
  85.             activeChar.getInventory().addItem("Draconic Helmet", 6382, 1, activeChar, activeChar);
  86.             activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  87.             activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  88.             activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  89.             activeChar.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
  90.         }
  91.         else if (id == 116)
  92.         {
  93.             activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  94.             activeChar.getInventory().addItem("Forgotten Blade", 6582, 1, activeChar, activeChar);
  95.             activeChar.getInventory().addItem("Crusader Shield", 6680, 1, activeChar, activeChar);
  96.             activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
  97.             activeChar.getInventory().addItem("Imperial Armor", 6373, 1, activeChar, activeChar);
  98.             activeChar.getInventory().addItem("Imperial ArmorP2", 6374, 1, activeChar, activeChar);
  99.             activeChar.getInventory().addItem("Imperial Gloves", 6375, 1, activeChar, activeChar);
  100.             activeChar.getInventory().addItem("Imperial Boots", 6376, 1, activeChar, activeChar);
  101.             activeChar.getInventory().addItem("Imperial Helmet", 6378, 1, activeChar, activeChar);
  102.             activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  103.             activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  104.             activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  105.             activeChar.sendMessage("Now You Have Tank Items On Your Invetory. Take a Look!.");
  106.         }
  107.         else if (id == 117)
  108.         {
  109.             activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  110.             activeChar.getInventory().addItem("Duals", 6580, 1, activeChar, activeChar);
  111.             activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
  112.             activeChar.getInventory().addItem("Imperial Armor", 6373, 1, activeChar, activeChar);
  113.             activeChar.getInventory().addItem("Imperial ArmorP2", 6374, 1, activeChar, activeChar);
  114.             activeChar.getInventory().addItem("Imperial Gloves", 6375, 1, activeChar, activeChar);
  115.             activeChar.getInventory().addItem("Imperial Boots", 6376, 1, activeChar, activeChar);
  116.             activeChar.getInventory().addItem("Imperial Helmet", 6378, 1, activeChar, activeChar);
  117.             activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  118.             activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  119.             activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  120.             activeChar.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
  121.         }
  122.         else if (id == 118)
  123.         {
  124.             activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  125.             activeChar.getInventory().addItem("Dualfist", 6372, 1, activeChar, activeChar);
  126.             activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
  127.             activeChar.getInventory().addItem("Draconic Light", 6379, 1, activeChar, activeChar);
  128.             activeChar.getInventory().addItem("Draconic Boots", 6380, 1, activeChar, activeChar);
  129.             activeChar.getInventory().addItem("Draconic Gloves", 6381, 1, activeChar, activeChar);
  130.             activeChar.getInventory().addItem("Draconic Helmet", 6382, 1, activeChar, activeChar);
  131.             activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  132.             activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  133.             activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  134.             activeChar.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
  135.         }
  136.         else if (id == 119)
  137.         {
  138.             activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
  139.             activeChar.getInventory().addItem("Arcana Mace Acumen", 6608, 1, activeChar, activeChar);
  140.             activeChar.getInventory().addItem("B.Spirishots", 3952, 5000, activeChar, activeChar);
  141.             activeChar.getInventory().addItem("DC Robe", 2407, 1, activeChar, activeChar);
  142.             activeChar.getInventory().addItem("DC Gloves", 5767, 1, activeChar, activeChar);
  143.             activeChar.getInventory().addItem("DC Boots", 5779, 1, activeChar, activeChar);
  144.             activeChar.getInventory().addItem("DC Helmet", 512, 1, activeChar, activeChar);
  145.             activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
  146.             activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
  147.             activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
  148.             activeChar.sendMessage("Now You Have Mage Items On Your Invetory. Take a Look!");
  149.         }
  150.         return true;
  151.     }
  152.    
  153.     @Override
  154.     public int[] getUserCommandList()
  155.     {
  156.         return COMMAND_IDS;
  157.     }
  158. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement