Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2J_DataPack
- Index: dist/game/data/scripts/handlers/MasterHandler.java
- ===================================================================
- --- dist/game/data/scripts/handlers/MasterHandler.java (revision 9024)
- +++ dist/game/data/scripts/handlers/MasterHandler.java (working copy)
- @@ -284,15 +288,23 @@
- import handlers.voicedcommandhandlers.Debug;
- import handlers.voicedcommandhandlers.Hellbound;
- +import handlers.voicedcommandhandlers.UserActions;
- +import handlers.voicedcommandhandlers.User;
- import handlers.voicedcommandhandlers.Lang;
- import handlers.voicedcommandhandlers.StatsVCmd;
- @@ -603,6 +619,14 @@
- (Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null),
- (Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null),
- (Config.L2JMOD_HELLBOUND_STATUS ? Hellbound.class : null),
- + User.class,
- + UserActions.class,
- },
- {
- // Target Handlers
- Index: dist/game/data/scripts/handlers/voicedcommandhandlers/UserActions.java
- ===================================================================
- --- dist/game/data/scripts/handlers/voicedcommandhandlers/UserActions.java (revision 0)
- +++ dist/game/data/scripts/handlers/voicedcommandhandlers/UserActions.java (revision 0)
- @@ -0,0 +1,261 @@
- +/*
- + * 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 handlers.voicedcommandhandlers;
- +
- +import com.l2jserver.Config;
- +import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
- +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.model.effects.AbnormalEffect;
- +import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
- +
- +/**
- + * @author NeverMore
- + *
- + */
- +
- +public class UserActions implements IVoicedCommandHandler
- +{
- + public static final String[] VOICED_COMMANDS = { "effecton" , "effectoff", "tradeoff", "tradeon" ,"expoff" , "expon", "pmoff", "pmon" };
- +
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
- + {
- + if ((command.startsWith("effecton")))
- + {
- + if (Config.ENABLE_SPECIAL_EFFECT)
- + {
- + if (L2PcInstance._isoneffect == false)
- + {
- + activeChar.startAbnormalEffect(AbnormalEffect.VITALITY);
- + activeChar.sendMessage("Your custom effect enabled!");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("Your custom effect is now enabled!", 4000);
- + activeChar.sendPacket(message1);
- + L2PcInstance._isoneffect = true;
- + }
- + else
- + {
- + activeChar.sendMessage("Your effect is already enabled!");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("Your effect is already enabled!", 4000);
- + activeChar.sendPacket(message1);
- + return false;
- + }
- + }
- + else
- + {
- + activeChar.sendMessage("This command is disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
- + activeChar.sendPacket(message1);
- + }
- + }
- + if ((command.startsWith("effectoff")))
- + {
- + if (Config.ENABLE_SPECIAL_EFFECT)
- + {
- + if (L2PcInstance._isoneffect == true)
- + {
- + activeChar.stopAbnormalEffect(AbnormalEffect.VITALITY);
- + activeChar.sendMessage("Your custom effect is now disabled!");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("Your custom effect is now disabled!",4000);
- + activeChar.sendPacket(message1);
- + L2PcInstance._isoneffect = false;
- + }
- + else
- + {
- + activeChar.sendMessage("You dont have effect enabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("You dont have effect enabled", 4000);
- + activeChar.sendPacket(message1);
- + return false;
- + }
- + }
- + else
- + {
- + activeChar.sendMessage("This command is disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
- + activeChar.sendPacket(message1);
- + }
- + }
- + if ((command.startsWith("tradeoff")))
- + {
- + if (Config.ENABLE_TRADE_REFUSAL)
- + {
- + if (L2PcInstance._istraderefusal == false)
- + {
- + activeChar.setTradeRefusal(true);
- + activeChar.sendMessage("Trade refusal enabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("Trade refusal mode is now enabled!", 4000);
- + activeChar.sendPacket(message1);
- + L2PcInstance._istraderefusal = true;
- + }
- + else
- + {
- + activeChar.sendMessage("You are already in trade refusal mode!");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("You are already in trade refusal mode!", 4000);
- + activeChar.sendPacket(message1);
- + return false;
- + }
- + }
- + else
- + {
- + activeChar.sendMessage("This command is disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
- + activeChar.sendPacket(message1);
- + }
- + }
- + if ((command.startsWith("tradeon")))
- + {
- + if (Config.ENABLE_TRADE_REFUSAL)
- + {
- + if (L2PcInstance._istraderefusal == true)
- + {
- + activeChar.setTradeRefusal(false);
- + activeChar.sendMessage("Trade refusal disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("Trade refusal mode is now disabled!", 4000);
- + activeChar.sendPacket(message1);
- + L2PcInstance._istraderefusal = false;
- + }
- + else
- + {
- + activeChar.sendMessage("You are not in trade refusal mode!");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("You are not in trade refusal mode!", 4000);
- + activeChar.sendPacket(message1);
- + return false;
- + }
- + }
- + else
- + {
- + activeChar.sendMessage("This command is disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
- + activeChar.sendPacket(message1);
- + }
- + }
- + if ((command.startsWith("expoff")))
- + {
- + if (Config.ENABLE_EXP_REFUSAL)
- + {
- + if (L2PcInstance._isexpsprefusal == false)
- + {
- + activeChar.sendMessage("Exp/sp refusal enabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("Exp/sp refusal mode is now enabled!", 4000);
- + activeChar.sendPacket(message1);
- + L2PcInstance._isexpsprefusal = true;
- + }
- + else
- + {
- + activeChar.sendMessage("You are already in exp/sp refusal mode!");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("You are already in exp/sp refusal mode!", 4000);
- + activeChar.sendPacket(message1);
- + return false;
- + }
- + }
- + else
- + {
- + activeChar.sendMessage("This command is disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
- + activeChar.sendPacket(message1);
- + }
- + }
- + if ((command.startsWith("expon")))
- + {
- + if (Config.ENABLE_TRADE_REFUSAL)
- + {
- + if (L2PcInstance._isexpsprefusal == true)
- + {
- + activeChar.sendMessage("Exp/sp refusal disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("Exp/sp refusal mode is now disabled!", 4000);
- + activeChar.sendPacket(message1);
- + L2PcInstance._isexpsprefusal = false;
- + }
- + else
- + {
- + activeChar.sendMessage("You are not in exp/sp refusal mode!");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("You are not in exp/sp refusal mode!", 4000);
- + activeChar.sendPacket(message1);
- + return false;
- + }
- + }
- + else
- + {
- + activeChar.sendMessage("This command is disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
- + activeChar.sendPacket(message1);
- + }
- + }
- + if ((command.startsWith("pmon")))
- + {
- + if ( Config.ENABLE_PM_REFUSAL)
- + {
- + if (L2PcInstance._ispmrefusal == true)
- + {
- + activeChar.setMessageRefusal(false);
- + activeChar.sendMessage("Pm refusal mode disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("Pm refusal mode is now disabled!", 4000);
- + activeChar.sendPacket(message1);
- + L2PcInstance._ispmrefusal = false;
- + }
- + else
- + {
- + activeChar.sendMessage("You are not in pm refusal mode!");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("You are not in pm refusal mode!", 4000);
- + activeChar.sendPacket(message1);
- + return false;
- + }
- + }
- + else
- + {
- + activeChar.sendMessage("This command is disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
- + activeChar.sendPacket(message1);
- + return false;
- + }
- +
- + }
- + if ((command.startsWith("pmoff")))
- + {
- + if (Config.ENABLE_PM_REFUSAL)
- + {
- + if (L2PcInstance._ispmrefusal == false)
- + {
- + activeChar.setMessageRefusal(true);
- + activeChar.sendMessage("Pm refusal mode enabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("Pm refusal mode is now enabled!", 4000);
- + activeChar.sendPacket(message1);
- + L2PcInstance._ispmrefusal = true;
- + }
- + else
- + {
- + activeChar.sendMessage("You are already in pm refusal mode!");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("You are already in pm refusal mode!", 4000);
- + activeChar.sendPacket(message1);
- + return false;
- + }
- + }
- + else
- + {
- + activeChar.sendMessage("This command is disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
- + activeChar.sendPacket(message1);
- + return false;
- +
- + }
- + }
- + return false;
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return VOICED_COMMANDS;
- + }
- +}
- \ No newline at end of file
- Index: dist/game/data/html/userpanel/user2.htm
- ===================================================================
- --- dist/game/data/html/userpanel/user2.htm (revision 0)
- +++ dist/game/data/html/userpanel/user2.htm (revision 0)
- @@ -0,0 +1,94 @@
- +<html><head><title>User actions</title></head><body>
- +<center><br>
- +<table width="270" cellpadding="5">
- +<tr>
- +<td valign="top"><font color="3399ff"> %name% </font>,from here you are able to use many features of our server and make your gameplay easier!</td>!
- +</tr>
- +</table>
- +</center>
- +<br><font color="333333" align="center">_____________________________________</font><br>
- +<center><font color="3399ff">Exp/Sp refusal mode</font></center><br>
- +
- +<center><table width=230>
- +<tr>
- +<td align=center>Info</td>
- +<td align=center>Status</td>
- +<td align=center>On/Off</td>
- +</tr>
- +<tr><td height="5"></td></tr>
- +<tr>
- +<td align=center><font color="FF9933">Disable gaining </font></td>
- +<td align=center><font color="FFFF33">%exp%</font></td>
- +<td align=center><button value="Enable" action="bypass -h voice .expoff $UserActions" width=65 height=16 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
- +</tr>
- +<tr>
- +<td align=center><font color="FFFF33">exp/sp</font></td>
- +<td align=center><font color="FF9933"></font></td>
- +<td align=center><button value="Disable" action="bypass -h voice .expon $UserActions" width=65 height=16 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
- +</tr>
- +</table></center><br><font color="333333" align="center">_____________________________________</font><br>
- +<center><font color="3399ff">Pm refusal mode</font></center><br>
- +
- +<center><table width=230>
- +<tr>
- +<td align=center>Info</td>
- +<td align=center>Status</td>
- +<td align=center>On/Off</td>
- +</tr>
- +<tr><td height="5"></td></tr>
- +<tr>
- +<td align=center><font color="FF9933">Blocks all pm's</font></td>
- +<td align=center><font color="FFFF33">%pm%</font></td>
- +<td align=center><button value="Enable" action="bypass -h voice .pmoff $UserActions" width=65 height=16 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
- +</tr>
- +<tr>
- +<td align=center><font color="FFFF33"></font></td>
- +<td align=center><font color="FF9933"></font></td>
- +<td align=center><button value="Disable" action="bypass -h voice .pmon $UserActions" width=65 height=16 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
- +</tr>
- +</table></center><br>
- +<font color="333333" align="center">_____________________________________</font><br>
- +<center><font color="3399ff">Trade refusal mode</font></center><br>
- +
- +<center><table width=230>
- +<tr>
- +<td align=center>Info</td>
- +<td align=center>Status</td>
- +<td align=center>On/Off</td>
- +</tr>
- +<tr><td height="5"></td></tr>
- +<tr>
- +<td align=center><font color="FF9933">Blocks all trade's</font></td>
- +<td align=center><font color="FFFF33">%trade%</font></td>
- +<td align=center><button value="Enable" action="bypass -h voice .tradeoff $UserActions" width=65 height=16 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
- +</tr>
- +<tr>
- +<td align=center><font color="FFFF33"></font></td>
- +<td align=center><font color="FF9933"></font></td>
- +<td align=center><button value="Disable" action="bypass -h voice .tradeon $UserActions" width=65 height=16 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
- +</tr>
- +</table></center><br>
- +<font color="333333" align="center">_______________________________________</font><br>
- +<center><font color="3399ff">Custom Effect</font></center><br>
- +
- +<center><table width=260>
- +<tr>
- +<td align=center>Info</td>
- +<td align=center>Status</td>
- +<td align=center>On/Off</td>
- +</tr>
- +<tr><td height="5"></td></tr>
- +<tr>
- +<td align=center><font color="FF9933">Enable an</font></td>
- +<td align=center><font color="FFFF33">%effect%</font></td>
- +<td align=center><button value="Enable" action="bypass -h voice .effecton $UserActions" width=65 height=16 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
- +</tr>
- +<tr>
- +<td align=center><font color="FF9933"> custom effect</font></td>
- +<td align=center><font color="FF9933"></font></td>
- +<td align=center><button value="Disable" action="bypass -h voice .effectoff $UserActions" width=65 height=16 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
- +</tr>
- +</table></center><br><br>
- +<font color="333333" align="center">_______________________________________</font>
- +<br><center><button action="bypass -h voice .user $User" value="Back" width=50 height=16 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
- +<br><center><font color=\"A9A9A9\">~ by NeverMore ~</font></center></body></html>
- \ No newline at end of file
- Index: dist/game/data/html/userpanel/user.htm
- ===================================================================
- --- dist/game/data/html/userpanel/user.htm (revision 0)
- +++ dist/game/data/html/userpanel/user.htm (revision 0)
- @@ -0,0 +1,37 @@
- +<html><head><title>User Panel</title></head><body>
- +<center><br>
- +<table width="270" cellpadding="5">
- +<tr>
- +<td valign="top">Hello <font color="3399ff"> %name% </font>,<br1>
- +Use this command to enable/disable user actions or learn whatever is related with our server!</td>!
- +</tr>
- +</table>
- +</center>
- +<br><font color="333333" align="center">_______________________________________</font><br><br>
- +<center>
- +<table width=225 border=0><tr><br>
- +<td><button action="bypass -h voice .user1 $User" value="Usefull Info" width=90 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
- +<td><button action="bypass -h voice .user2 $User" value="User Actions" width=90 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
- +</tr></table></center><br><td><center><button action="bypass -h voice .user3 $User" value="Change log" width=90 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td></center><br><br>
- +<font color="333333" align="center">_______________________________________</font><br>
- +<center><font color="3399ff">Server Statistics</font></center><br>
- +<table border=0 cellspacing=0 cellpadding=2 bgcolor=111111>
- +<tr>
- +<td fixwidth=11></td>
- +<td FIXWIDTH=280>Players Online</td>
- +<td FIXWIDTH=470><font color=FF6600>%online%</font></td>
- +</tr>
- +%serveronline%
- +<tr>
- +<td fixwidth=11></td>
- +<td FIXWIDTH=280>Server Capacity</td>
- +<td FIXWIDTH=470><font color=FF6600>%servercapacity%</font></td>
- +</tr>
- +<tr>
- +<td fixwidth=11></td>
- +<td FIXWIDTH=280>Server Onl.Time</td>
- +<td FIXWIDTH=470><font color=FF6600>%serverruntime%</font></td>
- +</tr>
- +</table><br><font color="333333" align="center">_______________________________________</font>
- +<br>
- +<center><font color=\"A9A9A9\">~ By NeverMore ~</font></center></body></html>
- Index: dist/game/data/html/userpanel/user1.htm
- ===================================================================
- --- dist/game/data/html/userpanel/user1.htm (revision 0)
- +++ dist/game/data/html/userpanel/user1.htm (revision 0)
- @@ -0,0 +1,28 @@
- +<html><head><title>Usefull Information</title></head><body>
- +<center><br>
- +<table width="270" cellpadding="5">
- +<tr>
- +<td valign="top"><font color="3399ff"> %name% </font>,read this usefull information and learn every feature that our server supports!</td>!
- +</tr>
- +</table>
- +</center>
- +<br><font color="333333" align="center">_______________________________________</font><br>
- +<center><font color="3399ff">GamePlay Informations</font></center><br>
- +<center><table>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +</table></center><br><font color="333333" align="center">_______________________________________</font><br><center><font color="3399ff">Vote Informations</font></center><br>
- +<center><table>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +</table></center><br><font color="333333" align="center">_______________________________________</font><br>
- +<br><center><font color="3399ff">PvP Informations</font></center><br>
- +<center><table>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +</table></center><br><font color="333333" align="center">_______________________________________</font>
- +<br><center><button action="bypass -h voice .user $User" value="Back" width=50 height=16 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
- +<center><font color=\"A9A9A9\">~ By NeverMore ~</font></center></body></html>
- \ No newline at end of file
- Index: dist/game/data/html/userpanel/user3.htm
- ===================================================================
- --- dist/game/data/html/userpanel/user3.htm (revision 0)
- +++ dist/game/data/html/userpanel/user3.htm (revision 0)
- @@ -0,0 +1,28 @@
- +<html><head><title>Change log</title></head><body>
- +<center><br>
- +<table width="270" cellpadding="5">
- +<tr>
- +<td valign="top"><font color="3399ff"> %name% </font>,here you can read our server changes!</td>!
- +</tr>
- +</table>
- +</center>
- +<br><font color="333333" align="center">_______________________________________</font><br>
- +<center><font color="3399ff">12/8/2012</font></center><br>
- +<center><table>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +</table></center><br><font color="333333" align="center">_______________________________________</font><br><center><font color="3399ff">10/8/2012</font></center><br>
- +<center><table>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +</table></center><br><font color="333333" align="center">_______________________________________</font><br>
- +<br><center><font color="3399ff">8/8/2012</font></center><br>
- +<center><table>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +<tr><td><font color="3399ff">*</font> To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
- +</table></center><br><font color="333333" align="center">_______________________________________</font>
- +<br><center><button action="bypass -h voice .user $User" value="Back" width=50 height=16 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><br>
- +<center><font color=\"A9A9A9\">~ By NeverMore ~</font></center></body></html>
- \ No newline at end of file
- Index: dist/game/data/scripts/handlers/voicedcommandhandlers/User.java
- ===================================================================
- --- dist/game/data/scripts/handlers/voicedcommandhandlers/User.java (revision 0)
- +++ dist/game/data/scripts/handlers/voicedcommandhandlers/User.java (revision 0)
- @@ -0,0 +1,157 @@
- +package handlers.voicedcommandhandlers;
- +
- +import com.l2jserver.Config;
- +import com.l2jserver.gameserver.GameTimeController;
- +import com.l2jserver.gameserver.cache.HtmCache;
- +import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
- +import com.l2jserver.gameserver.model.L2World;
- +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
- +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
- +
- +/**
- + * @author NeverMore
- + */
- +
- +public class User implements IVoicedCommandHandler
- +{
- + public static final String[] VOICED_COMMANDS = { "user" , "user1", "user2", "user3" };
- +
- + @Override
- + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
- + {
- + if (Config.SHOW_USER)
- + {
- + if(command.equalsIgnoreCase("user"))
- + {
- + User.showUserPage(activeChar, "user.htm");
- + }
- + if(command.equalsIgnoreCase("user1"))
- + {
- + User.showUserPage(activeChar, "user1.htm");
- + }
- + if(command.equalsIgnoreCase("user2"))
- + {
- + User.showUserPage(activeChar, "user2.htm");
- + }
- + if(command.equalsIgnoreCase("user3"))
- + {
- + User.showUserPage(activeChar, "user3.htm");
- + }
- + }
- + else
- + {
- + activeChar.sendMessage("This command is disabled");
- + ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
- + activeChar.sendPacket(message1);
- + return false;
- + }
- + return false;
- + }
- +
- + public static String getServerRunTime()
- + {
- + int timeSeconds = (GameTimeController.getGameTicks() - 36000) / 10;
- + String timeResult = "";
- + if (timeSeconds >= 86400)
- + timeResult = Integer.toString(timeSeconds / 86400) + " Days " + Integer.toString((timeSeconds % 86400) / 3600) + " hours";
- + else
- + timeResult = Integer.toString(timeSeconds / 3600) + " Hours " + Integer.toString((timeSeconds % 3600) / 60) + " mins";
- + return timeResult;
- + }
- +
- + public static String getRealOnline()
- + {
- + int counter = 0;
- + for (L2PcInstance onlinePlayer : L2World.getInstance().getAllPlayersArray())
- + {
- + if (onlinePlayer.isOnline() && (onlinePlayer.getClient() != null && !onlinePlayer.getClient().isDetached()))
- + {
- + counter++;
- + }
- + }
- + String realOnline = "<tr><td fixwidth=11></td><td FIXWIDTH=280>Players Active</td><td FIXWIDTH=470><font color=FF6600>" + counter + "</font></td></tr>" + "<tr><td fixwidth=11></td><td FIXWIDTH=280>Players Shops</td><td FIXWIDTH=470><font color=FF6600>" + (L2World.getInstance().getAllPlayersCount() - counter) + "</font></td></tr>";
- + return realOnline;
- + }
- +
- + public static void showUserPage(L2PcInstance targetChar, String filename)
- + {
- + String content = HtmCache.getInstance().getHtmForce(targetChar.getHtmlPrefix(), "data/html/userpanel/" + filename);
- + NpcHtmlMessage UserPanelReply = new NpcHtmlMessage(5);
- + UserPanelReply.setHtml(content);
- + UserPanelReply.replace("%online%", String.valueOf(L2World.getInstance().getAllPlayers().size()));
- + UserPanelReply.replace("%name%", String.valueOf(targetChar.getName()));
- + UserPanelReply.replace("%serveronline%", getRealOnline());
- + UserPanelReply.replace("%servercapacity%", Integer.toString(Config.MAXIMUM_ONLINE_USERS));
- + UserPanelReply.replace("%serverruntime%", getServerRunTime());
- + UserPanelReply.replace("%playernumber%", String.valueOf(L2World.getInstance().getAllPlayers().size()));
- + if (!Config.ENABLE_SPECIAL_EFFECT)
- + {
- + UserPanelReply.replace("%effect%", "Disabled");
- + }
- + else if (L2PcInstance._isoneffect == true)
- + {
- + UserPanelReply.replace("%effect%", "ON");
- + }
- + else
- + {
- + UserPanelReply.replace("%effect%", "OFF");
- + }
- + if (!Config.ENABLE_PM_REFUSAL)
- + {
- + UserPanelReply.replace("%pm%", "Disabled");
- + }
- + else if (L2PcInstance._ispmrefusal == true)
- + {
- + UserPanelReply.replace("%pm%", "ON");
- + }
- + else
- + {
- + UserPanelReply.replace("%pm%", "OFF");
- + }
- + if (!Config.ENABLE_TRADE_REFUSAL)
- + {
- + UserPanelReply.replace("%trade%", "Disabled");
- + }
- + else if (L2PcInstance._istraderefusal == true)
- + {
- + UserPanelReply.replace("%trade%", "ON");
- + }
- + else
- + {
- + UserPanelReply.replace("%trade%", "OFF");
- + }
- + if (!Config.ENABLE_EXP_REFUSAL)
- + {
- + UserPanelReply.replace("%exp%", "Disabled");
- + }
- + else if (L2PcInstance._isexpsprefusal == true)
- + {
- + UserPanelReply.replace("%exp%", "ON");
- + }
- + else
- + {
- + UserPanelReply.replace("%exp%", "OFF");
- + }
- + if (!Config.ENABLE_SPECIAL_EFFECT)
- + {
- + UserPanelReply.replace("%effect%", "Disabled");
- + }
- + else if (L2PcInstance._isoneffect == true)
- + {
- + UserPanelReply.replace("%effect%", "ON");
- + }
- + else
- + {
- + UserPanelReply.replace("%effect%", "OFF");
- + }
- + targetChar.sendPacket(UserPanelReply);
- + }
- +
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return VOICED_COMMANDS;
- + }
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement