Advertisement
Guest User

Datapack .dressme

a guest
Oct 10th, 2012
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. Index: data/scripts/handlers/MasterHandler.java===================================================================
  2. --- data/scripts/handlers/MasterHandler.java (revision 7732)
  3. +++ data/scripts/handlers/MasterHandler.java (working copy)
  4. @@ -245,6 +245,7 @@
  5. import handlers.voicedcommandhandlers.Debug;
  6. import handlers.voicedcommandhandlers.Lang;
  7. import handlers.voicedcommandhandlers.TvTVoicedInfo;
  8. +import handlers.voicedcommandhandlers.VisualArmor;
  9. import handlers.voicedcommandhandlers.Wedding;
  10. import handlers.voicedcommandhandlers.stats;
  11.  
  12. @@ -550,6 +551,8 @@
  13. VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Lang());
  14. if (Config.L2JMOD_DEBUG_VOICE_COMMAND)
  15. VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Debug());
  16. +
  17. + VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new VisualArmor());
  18. _log.config("Loaded " + VoicedCommandHandler.getInstance().size() + " VoicedHandlers");
  19. }
  20.  
  21. Index: data/scripts/handlers/voicedcommandhandlers/VisualArmor.java
  22. ===================================================================
  23. --- data/scripts/handlers/voicedcommandhandlers/VisualArmor.java (revision 0)
  24. +++ data/scripts/handlers/voicedcommandhandlers/VisualArmor.java (revision 0)
  25. @@ -0,0 +1,65 @@
  26. +/*
  27. + * This program is free software: you can redistribute it and/or modify it under
  28. + * the terms of the GNU General Public License as published by the Free Software
  29. + * Foundation, either version 3 of the License, or (at your option) any later
  30. + * version.
  31. + *
  32. + * This program is distributed in the hope that it will be useful, but WITHOUT
  33. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  34. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  35. + * details.
  36. + *
  37. + * You should have received a copy of the GNU General Public License along with
  38. + * this program. If not, see <http://www.gnu.org/licenses/>.
  39. + */
  40. +package handlers.voicedcommandhandlers;
  41. +
  42. +import com.l2jserver.extensions.VisualArmorController;
  43. +import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
  44. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  45. +import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
  46. +
  47. +public class VisualArmor implements IVoicedCommandHandler
  48. +{
  49. + private static final String[] VOICED_COMMANDS =
  50. + {
  51. + "dressme", "dressMe", "DressMe", "cloakOn", "cloakOff"
  52. + };
  53. +
  54. +
  55. + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
  56. + {
  57. + if(command.contains("cloakOn"))
  58. + {
  59. + activeChar.visualArmor.weaponLRHANDId =0;
  60. + InventoryUpdate iu = new InventoryUpdate();
  61. + activeChar.sendPacket(iu);
  62. + activeChar.broadcastUserInfo();
  63. + InventoryUpdate iu2 = new InventoryUpdate();
  64. + activeChar.sendPacket(iu2);
  65. + activeChar.broadcastUserInfo();
  66. + activeChar.sendMessage("Cloak enabled.");
  67. + }
  68. + else if(command.contains("cloakOff"))
  69. + {
  70. + activeChar.visualArmor.weaponLRHANDId =1;
  71. + InventoryUpdate iu = new InventoryUpdate();
  72. + activeChar.sendPacket(iu);
  73. + activeChar.broadcastUserInfo();
  74. + InventoryUpdate iu2 = new InventoryUpdate();
  75. + activeChar.sendPacket(iu2);
  76. + activeChar.broadcastUserInfo();
  77. + activeChar.sendMessage("Cloak disabled.");
  78. + }
  79. + else
  80. + VisualArmorController.dressMe(activeChar);
  81. +
  82. + return true;
  83. + }
  84. +
  85. +
  86. + public String[] getVoicedCommandList()
  87. + {
  88. + return VOICED_COMMANDS;
  89. + }
  90. +}
  91. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement