Guest User

White Devs Gift

a guest
Sep 3rd, 2011
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.05 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2_GameServer_It
  3. Index: java/net/sf/l2j/gameserver/GameServer.java
  4. ===================================================================
  5. --- java/net/sf/l2j/gameserver/GameServer.java (revision 4894)
  6. +++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
  7. @@ -198,6 +198,7 @@
  8. import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
  9. import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
  10. import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats;
  11. +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.playerevent;
  12. import net.sf.l2j.gameserver.idfactory.IdFactory;
  13. import net.sf.l2j.gameserver.instancemanager.AuctionManager;
  14. import net.sf.l2j.gameserver.instancemanager.BoatManager;
  15. @@ -592,7 +593,10 @@
  16.  
  17. if(Config.L2JMOD_ALLOW_WEDDING)
  18. _voicedCommandHandler.registerVoicedCommandHandler(new Wedding());
  19. -
  20. +
  21. + if(Config.EnableEvent)
  22. + _voicedCommandHandler.registerVoicedCommandHandler(new playerevent());
  23. +
  24. _log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers.");
  25.  
  26.  
  27. Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/playerevent.java
  28. ===================================================================
  29. --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/playerevent.java (revision 0)
  30. +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/playerevent.java (revision 0)
  31. @@ -0,0 +1,61 @@
  32. +/*
  33. + * This program is free software: you can redistribute it and/or modify it under
  34. + * the terms of the GNU General Public License as published by the Free Software
  35. + * Foundation, either version 3 of the License, or (at your option) any later
  36. + * version.
  37. + *
  38. + * This program is distributed in the hope that it will be useful, but WITHOUT
  39. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  40. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  41. + * details.
  42. + * * You should have received a copy of the GNU General Public License along with
  43. + * this program. If not, see <http://www.gnu.org/licenses/>.
  44. + */
  45. +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
  46. +
  47. +import net.sf.l2j.Config;
  48. +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
  49. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  50. +import net.sf.l2j.util.Rnd;
  51. +
  52. +public class playerevent implements IVoicedCommandHandler
  53. +{
  54. + private static final String[] VOICED_COMMANDS = { "event" };
  55. +
  56. + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  57. + {
  58. + if (command.equalsIgnoreCase("event"))
  59. + {
  60. + if(Config.EnableEvent);
  61. +
  62. + activeChar.getInventory().destroyItemByItemId("Item", 3470, 10, activeChar, activeChar.getTarget());
  63. + switch (Rnd.get(2))
  64. + {
  65. + case 0:
  66. + {
  67. +
  68. + activeChar.addItem("You Won!.", 3470, 2*10, activeChar, true);
  69. + activeChar.setTitle("Winner!");
  70. + activeChar.sendMessage("Your are lucky player... "+activeChar.getName());
  71. + break;
  72. + }
  73. + case 1:
  74. + {
  75. + activeChar.setTitle("Loser!");
  76. + activeChar.sendMessage("You lost! "+activeChar.getName());
  77. + activeChar.addItem("Take back a refund.", 3470, 5, activeChar, true);
  78. +
  79. +
  80. + break;
  81. + }
  82. + }
  83. + }
  84. + return true;
  85. + }
  86. + public String[] getVoicedCommandList()
  87. + {
  88. + return VOICED_COMMANDS;
  89. + }
  90. +
  91. + }
  92. +
  93. \ No newline at end of file
  94. Index: java/net/sf/l2j/Config.java
  95. ===================================================================
  96. --- java/net/sf/l2j/Config.java (revision 4894)
  97. +++ java/net/sf/l2j/Config.java (working copy)
  98. @@ -881,6 +881,7 @@
  99. public static boolean L2JMOD_WEDDING_SAMESEX;
  100. public static boolean L2JMOD_WEDDING_FORMALWEAR;
  101. public static int L2JMOD_WEDDING_DIVORCE_COSTS;
  102. + public static boolean EnableEvent;
  103.  
  104. // Packet information
  105. /** Count the amount of packets per minute ? */
  106. @@ -1858,7 +1859,8 @@
  107. L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
  108. L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
  109. L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
  110. -
  111. + EnableEvent = Boolean.parseBoolean(L2JModSettings.getProperty("EnableEvent", "False"));
  112. +
  113. if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
  114. {
  115. TVT_EVENT_ENABLED = false;
  116. Index: java/config/l2jmods.properties
  117. ===================================================================
  118. --- java/config/l2jmods.properties (revision 4894)
  119. +++ java/config/l2jmods.properties (working copy)
  120. @@ -132,3 +132,13 @@
  121. # ex.: 1;2;3;4;5;6
  122. # no ";" at the start or end
  123. TvTEventDoorsCloseOpenOnStartEnd =
  124. +
  125. +# -------------------------- #
  126. +# Player Event - White Devs
  127. +# -------------------------- #
  128. +# By pressing .event you have 50% to win or lose!
  129. +# Its a fun event coded by White Devs
  130. +
  131. +# Enable Event Config
  132. +# Default: False
  133. +EnableEvent = False
  134. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment