Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2_GameServer_It
- Index: java/net/sf/l2j/gameserver/GameServer.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/GameServer.java (revision 4894)
- +++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
- @@ -198,6 +198,7 @@
- import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats;
- +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.playerevent;
- import net.sf.l2j.gameserver.idfactory.IdFactory;
- import net.sf.l2j.gameserver.instancemanager.AuctionManager;
- import net.sf.l2j.gameserver.instancemanager.BoatManager;
- @@ -592,7 +593,10 @@
- if(Config.L2JMOD_ALLOW_WEDDING)
- _voicedCommandHandler.registerVoicedCommandHandler(new Wedding());
- -
- +
- + if(Config.EnableEvent)
- + _voicedCommandHandler.registerVoicedCommandHandler(new playerevent());
- +
- _log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers.");
- Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/playerevent.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/playerevent.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/playerevent.java (revision 0)
- @@ -0,0 +1,61 @@
- +/*
- + * 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 net.sf.l2j.gameserver.handler.voicedcommandhandlers;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.util.Rnd;
- +
- +public class playerevent implements IVoicedCommandHandler
- +{
- + private static final String[] VOICED_COMMANDS = { "event" };
- +
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- + {
- + if (command.equalsIgnoreCase("event"))
- + {
- + if(Config.EnableEvent);
- +
- + activeChar.getInventory().destroyItemByItemId("Item", 3470, 10, activeChar, activeChar.getTarget());
- + switch (Rnd.get(2))
- + {
- + case 0:
- + {
- +
- + activeChar.addItem("You Won!.", 3470, 2*10, activeChar, true);
- + activeChar.setTitle("Winner!");
- + activeChar.sendMessage("Your are lucky player... "+activeChar.getName());
- + break;
- + }
- + case 1:
- + {
- + activeChar.setTitle("Loser!");
- + activeChar.sendMessage("You lost! "+activeChar.getName());
- + activeChar.addItem("Take back a refund.", 3470, 5, activeChar, true);
- +
- +
- + break;
- + }
- + }
- + }
- + return true;
- + }
- + public String[] getVoicedCommandList()
- + {
- + return VOICED_COMMANDS;
- + }
- +
- + }
- +
- \ No newline at end of file
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 4894)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -881,6 +881,7 @@
- public static boolean L2JMOD_WEDDING_SAMESEX;
- public static boolean L2JMOD_WEDDING_FORMALWEAR;
- public static int L2JMOD_WEDDING_DIVORCE_COSTS;
- + public static boolean EnableEvent;
- // Packet information
- /** Count the amount of packets per minute ? */
- @@ -1858,7 +1859,8 @@
- L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
- L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
- L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
- -
- + EnableEvent = Boolean.parseBoolean(L2JModSettings.getProperty("EnableEvent", "False"));
- +
- if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
- {
- TVT_EVENT_ENABLED = false;
- Index: java/config/l2jmods.properties
- ===================================================================
- --- java/config/l2jmods.properties (revision 4894)
- +++ java/config/l2jmods.properties (working copy)
- @@ -132,3 +132,13 @@
- # ex.: 1;2;3;4;5;6
- # no ";" at the start or end
- TvTEventDoorsCloseOpenOnStartEnd =
- +
- +# -------------------------- #
- +# Player Event - White Devs
- +# -------------------------- #
- +# By pressing .event you have 50% to win or lose!
- +# Its a fun event coded by White Devs
- +
- +# Enable Event Config
- +# Default: False
- +EnableEvent = False
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment