Hello mates.Again a new code by me.Also thanks Coyote for his help :-*
So i didn't find any code for this,so i decided to make it.It's more simple than my previous code.So let's see what i did.
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java (revision 160)
+++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
@@ -210,6 +210,7 @@
import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Banking;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Online;
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Res;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.ServerInfos;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats;
@@ -633,6 +634,9 @@
if(Config.ENABLE_INFOS_VC)
_voicedCommandHandler.registerVoicedCommandHandler(new ServerInfos());
+
+ if(Config.RES_COMMAND)
+ _voicedCommandHandler.registerVoicedCommandHandler(new Res());
_log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers.");
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 160)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -965,6 +965,7 @@
public static int TRADE_UNITS;
public static boolean ONLINE_PLAYERS;
public static boolean ENABLE_INFOS_VC;
+ public static boolean RES_COMMAND;
/** Custom Project Modifications - End */
/** FloodProtector - Start */
@@ -2073,6 +2074,7 @@
TRADE_UNITS = Integer.parseInt(L2JModSettings.getProperty("TradeUnits", "250"));
ONLINE_PLAYERS = Boolean.parseBoolean(L2JModSettings.getProperty("OnlinePLayers", "False"));
ENABLE_INFOS_VC = Boolean.parseBoolean(L2JModSettings.getProperty("InfosVoicedCommand", "False"));
+ RES_COMMAND =Boolean.parseBoolean(L2JModSettings.getProperty("ResVoicedCommand" , "False"));
/** Custom Project Modifications - End */
Index: java/config/l2jmods.properties
===================================================================
--- java/config/l2jmods.properties (revision 160)
+++ java/config/l2jmods.properties (working copy)
@@ -295,8 +295,11 @@
# Default : False
OnlinePLayers = False
# Allow the use of .info command?
# An html window pops up and shows infos to the player
# the admin sets what the html window will show from
# the file at data/html/ServerInfos.htm
InfosVoicedCommand = False
+
+# Allow the use of .res command?
+ResVoicedCommand = False
Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Res.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Res.java (revision 0)
+++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Res.java (revision 0)
@@ -0,0 +1,55 @@
+/*
+ * 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 2, 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
+
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+
+/**
+ * @author Ventic
+ */
+
+public class Res implements IVoicedCommandHandler
+{
+ private static final String[] VOICED_COMMANDS = { "res" };
+
+ public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+ {
+
+ if (command.startsWith("res"))
+ {
+ if (activeChar.isInOlympiadMode())
+ {
+ activeChar.sendMessage("Res in oly? Forget it bro!");
+ return false;
+ }
+
+ activeChar.doRevive();
+ activeChar.sendMessage("Revived!");
+ }
+ return true;
+ }
+
+ public String[] getVoicedCommandList()
+ {
+ return VOICED_COMMANDS;
+ }
+}
Give me feedback plz.
-Ventic