Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * This program is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later
- * version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program. If not, see <http://www.gnu.org/licenses/>.
- */
- package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
- import com.l2jfrozen.Config;
- import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
- import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jfrozen.gameserver.network.serverpackets.ItemList;
- public class ClassItems implements IVoicedCommandHandler
- {
- private static String[] _voicedCommands =
- {
- "dagger",
- "bow",
- "tank",
- "mage",
- "duelist",
- "tyrant"
- };
- @Override
- public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- {
- if (activeChar.getInventory().getInventoryItemCount(57, 0) < Config.COMMANDS_ITEMS_PRICE)
- {
- activeChar.sendMessage("You do not have enough Adena to buy this Items!");
- return false;
- }
- if (activeChar.isInOlympiadMode())
- {
- activeChar.sendMessage("Sorry,you are in the Olympiad now.");
- return false;
- }
- if (activeChar.isInDuel())
- {
- activeChar.sendMessage("Sorry,you are in a duel!");
- return false;
- }
- if (activeChar.atEvent)
- {
- activeChar.sendMessage("Sorry,you are on event now.");
- return false;
- }
- if (activeChar.getKarma() > 0)
- {
- activeChar.sendMessage("Sorry,PK player can't use this.");
- return false;
- }
- if (activeChar.isDead())
- {
- activeChar.sendMessage("Sorry,Dead player can't take items.");
- return false;
- }
- if (command.equalsIgnoreCase("dagger"))
- {
- activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
- activeChar.getInventory().addItem("Angel Slayer", 6367, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
- activeChar.getInventory().addItem("Dragonic Light", 6379, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Dragonic Boots", 6380, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Dragonic Gloves", 6381, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Dragonic Helmet", 6382, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
- activeChar.sendMessage("Now You Have Dagger Items On Your Invetory. Take a Look!.");
- }
- else if (command.equalsIgnoreCase("bow"))
- {
- activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
- activeChar.getInventory().addItem("Draconic Bow", 7577, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Shining Arrows", 1345, 5000, activeChar, activeChar);
- activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
- activeChar.getInventory().addItem("Draconic Light", 6379, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Draconic Boots", 6380, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Draconic Gloves", 6381, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Draconic Helmet", 6382, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
- activeChar.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
- }
- else if (command.equalsIgnoreCase("tank"))
- {
- activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
- activeChar.getInventory().addItem("Forgotten Blade", 6582, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Crusader Shield", 6680, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
- activeChar.getInventory().addItem("Imperial Armor", 6373, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Imperial ArmorP2", 6374, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Imperial Gloves", 6375, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Imperial Boots", 6376, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Imperial Helmet", 6378, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
- activeChar.sendMessage("Now You Have Tank Items On Your Invetory. Take a Look!.");
- }
- else if (command.equalsIgnoreCase("duelist"))
- {
- activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
- activeChar.getInventory().addItem("Duals", 6580, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
- activeChar.getInventory().addItem("Imperial Armor", 6373, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Imperial ArmorP2", 6374, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Imperial Gloves", 6375, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Imperial Boots", 6376, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Imperial Helmet", 6378, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
- activeChar.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
- }
- else if (command.equalsIgnoreCase("tyrant"))
- {
- activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
- activeChar.getInventory().addItem("Dualfist", 6372, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Soulshots", 1467, 5000, activeChar, activeChar);
- activeChar.getInventory().addItem("Draconic Light", 6379, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Draconic Boots", 6380, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Draconic Gloves", 6381, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("Draconic Helmet", 6382, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
- activeChar.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
- }
- else if (command.equalsIgnoreCase("mage"))
- {
- activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.COMMANDS_ITEMS_PRICE, activeChar, null);
- activeChar.getInventory().addItem("Arcana Mace Acumen", 6608, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("B.Spirishots", 3952, 5000, activeChar, activeChar);
- activeChar.getInventory().addItem("DC Robe", 2407, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("DC Gloves", 5767, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("DC Boots", 5779, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("DC Helmet", 512, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
- activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar);
- activeChar.sendMessage("Now You Have Mage Items On Your Invetory. Take a Look!");
- }
- return true;
- }
- @Override
- public String[] getVoicedCommandList()
- {
- return _voicedCommands;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement