Advertisement
warc222

author AbSoLuTePoWeR vip

Sep 24th, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. gameserver/handler/voicedcommandhandlers/vip.java pigenoume gameserver/handler/voicedcommandhandlers kai kanoume ena untitled text file to onomazoume -> vip.java kai bazoume to parakato code
  2.  
  3.  
  4. /* This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2, or (at your option)
  7. * any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  17. * 02111-1307, USA.
  18. *
  19. * http://www.gnu.org/copyleft/gpl.html
  20. */
  21. package absolute.power.gameserver.handler.voicedcommandhandlers;
  22.  
  23.  
  24. import absolute.power.gameserver.handler.IVoicedCommandHandler;
  25. import absolute.power.gameserver.model.actor.instance.L2PcInstance;
  26. import absolute.power..gameserver.network.serverpackets.InventoryUpdate;
  27.  
  28. /**
  29. * @author AbSoLuTePoWeR
  30. *
  31. */
  32. public class vip implements IVoicedCommandHandler
  33. {
  34. private static final String[] VOICED_COMMANDS = {"vip"};
  35.  
  36. public boolean useVoicedCommand(String command, L2PcInstance player, String target)
  37. {
  38. if(player.isVIP())
  39. {
  40. player.sendMessage("You can't use this command twice.");
  41. return false;
  42. }
  43.  
  44. if (command.equalsIgnoreCase("vip"))
  45. {
  46. if(player.getInventory().getItemByItemId(9999) == null)
  47. {
  48. player.sendMessage("You must got the vip Item!");
  49. return false;
  50. }
  51. player.getInventory().destroyItemByItemId("Item", 9999, 1, player, player.getTarget());
  52. player.setVip(true);
  53. player.sendMessage("You are Vip Player Now, Vip Item has dissapeared!");
  54. }
  55. }
  56. public String[] getVoicedCommandList()
  57. {
  58. return VOICED_COMMANDS;
  59. }
  60. }
  61.  
  62.  
  63. gameserver/handler/voicedcommandhandler.java pigenoume sto voicedcommandhandler.java pou briskete sto gameserver/handler/ kai bazoume to import kai to register.
  64.  
  65. +import absolute.power.gameserver.handler.voicedcommandhandlers.vip;
  66.  
  67. egisterVoicedCommandHandler(new loc());
  68. +registerVoicedCommandHandler(new vip());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement