Advertisement
Guest User

User Panel by NeverMore

a guest
Oct 18th, 2012
1,739
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 28.07 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2J_DataPack
  3. Index: dist/game/data/scripts/handlers/MasterHandler.java
  4. ===================================================================
  5. --- dist/game/data/scripts/handlers/MasterHandler.java  (revision 9024)
  6. +++ dist/game/data/scripts/handlers/MasterHandler.java  (working copy)
  7. @@ -284,15 +288,23 @@
  8.  import handlers.voicedcommandhandlers.Debug;
  9.  import handlers.voicedcommandhandlers.Hellbound;
  10. +import handlers.voicedcommandhandlers.UserActions;
  11. +import handlers.voicedcommandhandlers.User;
  12.  import handlers.voicedcommandhandlers.Lang;
  13.  import handlers.voicedcommandhandlers.StatsVCmd;
  14. @@ -603,6 +619,14 @@
  15.             (Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null),
  16.             (Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null),
  17.             (Config.L2JMOD_HELLBOUND_STATUS ? Hellbound.class : null),
  18. +           User.class,
  19. +           UserActions.class,
  20.         },
  21.         {
  22.             // Target Handlers
  23. Index: dist/game/data/scripts/handlers/voicedcommandhandlers/UserActions.java
  24. ===================================================================
  25. --- dist/game/data/scripts/handlers/voicedcommandhandlers/UserActions.java  (revision 0)
  26. +++ dist/game/data/scripts/handlers/voicedcommandhandlers/UserActions.java  (revision 0)
  27. @@ -0,0 +1,261 @@
  28. +/*
  29. + * This program is free software: you can redistribute it and/or modify it under
  30. + * the terms of the GNU General Public License as published by the Free Software
  31. + * Foundation, either version 3 of the License, or (at your option) any later
  32. + * version.
  33. + *
  34. + * This program is distributed in the hope that it will be useful, but WITHOUT
  35. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  36. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  37. + * details.
  38. + *
  39. + * You should have received a copy of the GNU General Public License along with
  40. + * this program. If not, see <http://www.gnu.org/licenses/>.
  41. + */
  42. +package handlers.voicedcommandhandlers;
  43. +
  44. +import com.l2jserver.Config;
  45. +import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
  46. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  47. +import com.l2jserver.gameserver.model.effects.AbnormalEffect;
  48. +import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
  49. +
  50. +/**
  51. + * @author NeverMore
  52. + *
  53. + */
  54. +
  55. +public class UserActions implements IVoicedCommandHandler
  56. +{
  57. +    public static final String[] VOICED_COMMANDS = { "effecton" , "effectoff", "tradeoff", "tradeon" ,"expoff" , "expon", "pmoff", "pmon" };
  58. +  
  59. +   @Override
  60. +   public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
  61. +   {
  62. +           if ((command.startsWith("effecton")))
  63. +           {
  64. +               if (Config.ENABLE_SPECIAL_EFFECT)
  65. +               {
  66. +                   if (L2PcInstance._isoneffect == false)
  67. +                   {
  68. +                           activeChar.startAbnormalEffect(AbnormalEffect.VITALITY);
  69. +                           activeChar.sendMessage("Your custom effect enabled!");
  70. +                           ExShowScreenMessage message1 = new ExShowScreenMessage("Your custom effect is now enabled!", 4000);
  71. +                           activeChar.sendPacket(message1);
  72. +                           L2PcInstance._isoneffect = true;
  73. +                   }
  74. +                   else
  75. +                   {
  76. +                       activeChar.sendMessage("Your effect is already enabled!");
  77. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("Your effect is already enabled!", 4000);
  78. +                       activeChar.sendPacket(message1);   
  79. +                       return false;      
  80. +                   }
  81. +               }
  82. +               else
  83. +               {
  84. +                   activeChar.sendMessage("This command is disabled");
  85. +                   ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
  86. +                   activeChar.sendPacket(message1);
  87. +               }
  88. +           }
  89. +           if ((command.startsWith("effectoff")))
  90. +           {
  91. +               if (Config.ENABLE_SPECIAL_EFFECT)
  92. +               {
  93. +                   if (L2PcInstance._isoneffect == true)
  94. +                   {
  95. +                           activeChar.stopAbnormalEffect(AbnormalEffect.VITALITY);
  96. +                           activeChar.sendMessage("Your custom effect is now disabled!");
  97. +                           ExShowScreenMessage message1 = new ExShowScreenMessage("Your custom effect is now disabled!",4000);
  98. +                           activeChar.sendPacket(message1);
  99. +                           L2PcInstance._isoneffect = false;
  100. +                   }
  101. +                   else
  102. +                   {
  103. +                       activeChar.sendMessage("You dont have effect enabled");
  104. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("You dont have effect enabled", 4000);
  105. +                       activeChar.sendPacket(message1);   
  106. +                       return false;      
  107. +                   }
  108. +               }
  109. +               else
  110. +               {
  111. +                   activeChar.sendMessage("This command is disabled");
  112. +                   ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
  113. +                   activeChar.sendPacket(message1);
  114. +               }
  115. +           }
  116. +           if ((command.startsWith("tradeoff")))
  117. +           {
  118. +               if (Config.ENABLE_TRADE_REFUSAL)
  119. +               {
  120. +                   if (L2PcInstance._istraderefusal == false)
  121. +                   {
  122. +                       activeChar.setTradeRefusal(true);
  123. +                       activeChar.sendMessage("Trade refusal enabled");
  124. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("Trade refusal mode is now enabled!", 4000);
  125. +                       activeChar.sendPacket(message1);
  126. +                       L2PcInstance._istraderefusal = true;
  127. +                   }
  128. +                   else
  129. +                   {
  130. +                       activeChar.sendMessage("You are already in trade refusal mode!");
  131. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("You are already in trade refusal mode!", 4000);
  132. +                       activeChar.sendPacket(message1);   
  133. +                       return false;      
  134. +                   }
  135. +               }
  136. +               else
  137. +               {
  138. +                   activeChar.sendMessage("This command is disabled");
  139. +                   ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
  140. +                   activeChar.sendPacket(message1);
  141. +               }
  142. +           }
  143. +           if ((command.startsWith("tradeon")))
  144. +           {
  145. +               if (Config.ENABLE_TRADE_REFUSAL)
  146. +               {
  147. +                   if (L2PcInstance._istraderefusal == true)
  148. +                   {
  149. +                       activeChar.setTradeRefusal(false);
  150. +                       activeChar.sendMessage("Trade refusal disabled");
  151. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("Trade refusal mode is now disabled!", 4000);
  152. +                       activeChar.sendPacket(message1);
  153. +                   L2PcInstance._istraderefusal = false;
  154. +               }
  155. +                   else
  156. +                   {
  157. +                       activeChar.sendMessage("You are not in trade refusal mode!");
  158. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("You are not in trade refusal mode!", 4000);
  159. +                       activeChar.sendPacket(message1);   
  160. +                       return false;      
  161. +                   }
  162. +               }
  163. +               else
  164. +               {
  165. +                   activeChar.sendMessage("This command is disabled");
  166. +                   ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
  167. +                   activeChar.sendPacket(message1);
  168. +               }
  169. +           }
  170. +           if ((command.startsWith("expoff")))
  171. +           {
  172. +               if (Config.ENABLE_EXP_REFUSAL)
  173. +               {
  174. +                   if (L2PcInstance._isexpsprefusal == false)
  175. +                   {
  176. +                       activeChar.sendMessage("Exp/sp refusal enabled");
  177. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("Exp/sp refusal mode is now enabled!", 4000);
  178. +                       activeChar.sendPacket(message1);
  179. +                       L2PcInstance._isexpsprefusal = true;
  180. +                   }
  181. +                   else
  182. +                   {
  183. +                       activeChar.sendMessage("You are already in exp/sp refusal mode!");
  184. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("You are already in exp/sp refusal mode!", 4000);
  185. +                       activeChar.sendPacket(message1);   
  186. +                       return false;      
  187. +                   }
  188. +               }
  189. +               else
  190. +               {
  191. +                   activeChar.sendMessage("This command is disabled");
  192. +                   ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
  193. +                   activeChar.sendPacket(message1);
  194. +               }
  195. +           }
  196. +           if ((command.startsWith("expon")))
  197. +           {
  198. +               if (Config.ENABLE_TRADE_REFUSAL)
  199. +               {
  200. +                   if (L2PcInstance._isexpsprefusal == true)
  201. +                   {
  202. +                       activeChar.sendMessage("Exp/sp refusal disabled");
  203. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("Exp/sp refusal mode is now disabled!", 4000);
  204. +                       activeChar.sendPacket(message1);
  205. +                       L2PcInstance._isexpsprefusal = false;
  206. +                   }
  207. +                   else
  208. +                   {
  209. +                       activeChar.sendMessage("You are not in exp/sp refusal mode!");
  210. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("You are not in exp/sp refusal mode!", 4000);
  211. +                       activeChar.sendPacket(message1);   
  212. +                       return false;      
  213. +                   }
  214. +               }
  215. +               else
  216. +               {
  217. +                   activeChar.sendMessage("This command is disabled");
  218. +                   ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
  219. +                   activeChar.sendPacket(message1);
  220. +               }
  221. +           }  
  222. +           if ((command.startsWith("pmon")))
  223. +           {
  224. +               if ( Config.ENABLE_PM_REFUSAL)
  225. +               {
  226. +                   if (L2PcInstance._ispmrefusal == true)
  227. +                   {
  228. +                       activeChar.setMessageRefusal(false);
  229. +                       activeChar.sendMessage("Pm refusal mode disabled");
  230. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("Pm refusal mode is now disabled!", 4000);
  231. +                       activeChar.sendPacket(message1);
  232. +                       L2PcInstance._ispmrefusal = false;
  233. +                   }
  234. +                   else
  235. +                   {
  236. +                       activeChar.sendMessage("You are not in pm refusal mode!");
  237. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("You are not in pm refusal mode!", 4000);
  238. +                       activeChar.sendPacket(message1);   
  239. +                       return false;      
  240. +                   }
  241. +               }
  242. +               else
  243. +               {
  244. +                   activeChar.sendMessage("This command is disabled");
  245. +                   ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
  246. +                   activeChar.sendPacket(message1);
  247. +                   return false;                      
  248. +               }
  249. +              
  250. +           }
  251. +           if ((command.startsWith("pmoff")))
  252. +           {
  253. +               if (Config.ENABLE_PM_REFUSAL)
  254. +               {
  255. +                   if (L2PcInstance._ispmrefusal == false)
  256. +                   {
  257. +                       activeChar.setMessageRefusal(true);
  258. +                       activeChar.sendMessage("Pm refusal mode enabled");
  259. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("Pm refusal mode is now enabled!", 4000);
  260. +                       activeChar.sendPacket(message1);
  261. +                       L2PcInstance._ispmrefusal = true;
  262. +                   }
  263. +                   else
  264. +                   {
  265. +                       activeChar.sendMessage("You are already in pm refusal mode!");
  266. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("You are already in pm refusal mode!", 4000);
  267. +                       activeChar.sendPacket(message1);   
  268. +                       return false;  
  269. +                   }
  270. +               }
  271. +               else
  272. +               {
  273. +                   activeChar.sendMessage("This command is disabled");
  274. +                   ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
  275. +                   activeChar.sendPacket(message1);
  276. +                   return false;  
  277. +                  
  278. +               }
  279. +           }
  280. +   return false;      
  281. +   }
  282. +  
  283. +   @Override
  284. +   public String[] getVoicedCommandList()
  285. +   {
  286. +       return VOICED_COMMANDS;
  287. +   }
  288. +}
  289. \ No newline at end of file
  290. Index: dist/game/data/html/userpanel/user2.htm
  291. ===================================================================
  292. --- dist/game/data/html/userpanel/user2.htm (revision 0)
  293. +++ dist/game/data/html/userpanel/user2.htm (revision 0)
  294. @@ -0,0 +1,94 @@
  295. +<html><head><title>User actions</title></head><body>
  296. +<center><br>
  297. +<table width="270" cellpadding="5">
  298. +<tr>
  299. +<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>!
  300. +</tr>
  301. +</table>
  302. +</center>
  303. +<br><font color="333333" align="center">_____________________________________</font><br>
  304. +<center><font color="3399ff">Exp/Sp refusal mode</font></center><br>
  305. +
  306. +<center><table width=230>
  307. +<tr>
  308. +<td align=center>Info</td>
  309. +<td align=center>Status</td>
  310. +<td align=center>On/Off</td>
  311. +</tr>
  312. +<tr><td height="5"></td></tr>
  313. +<tr>
  314. +<td align=center><font color="FF9933">Disable gaining </font></td>
  315. +<td align=center><font color="FFFF33">%exp%</font></td>
  316. +<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>
  317. +</tr>
  318. +<tr>
  319. +<td align=center><font color="FFFF33">exp/sp</font></td>
  320. +<td align=center><font color="FF9933"></font></td>
  321. +<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>
  322. +</tr>
  323. +</table></center><br><font color="333333" align="center">_____________________________________</font><br>
  324. +<center><font color="3399ff">Pm refusal mode</font></center><br>
  325. +
  326. +<center><table width=230>
  327. +<tr>
  328. +<td align=center>Info</td>
  329. +<td align=center>Status</td>
  330. +<td align=center>On/Off</td>
  331. +</tr>
  332. +<tr><td height="5"></td></tr>
  333. +<tr>
  334. +<td align=center><font color="FF9933">Blocks all pm's</font></td>
  335. +<td align=center><font color="FFFF33">%pm%</font></td>
  336. +<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>
  337. +</tr>
  338. +<tr>
  339. +<td align=center><font color="FFFF33"></font></td>
  340. +<td align=center><font color="FF9933"></font></td>
  341. +<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>
  342. +</tr>
  343. +</table></center><br>
  344. +<font color="333333" align="center">_____________________________________</font><br>
  345. +<center><font color="3399ff">Trade refusal mode</font></center><br>
  346. +
  347. +<center><table width=230>
  348. +<tr>
  349. +<td align=center>Info</td>
  350. +<td align=center>Status</td>
  351. +<td align=center>On/Off</td>
  352. +</tr>
  353. +<tr><td height="5"></td></tr>
  354. +<tr>
  355. +<td align=center><font color="FF9933">Blocks all trade's</font></td>
  356. +<td align=center><font color="FFFF33">%trade%</font></td>
  357. +<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>
  358. +</tr>
  359. +<tr>
  360. +<td align=center><font color="FFFF33"></font></td>
  361. +<td align=center><font color="FF9933"></font></td>
  362. +<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>
  363. +</tr>
  364. +</table></center><br>
  365. +<font color="333333" align="center">_______________________________________</font><br>
  366. +<center><font color="3399ff">Custom Effect</font></center><br>
  367. +
  368. +<center><table width=260>
  369. +<tr>
  370. +<td align=center>Info</td>
  371. +<td align=center>Status</td>
  372. +<td align=center>On/Off</td>
  373. +</tr>
  374. +<tr><td height="5"></td></tr>
  375. +<tr>
  376. +<td align=center><font color="FF9933">Enable an</font></td>
  377. +<td align=center><font color="FFFF33">%effect%</font></td>
  378. +<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>
  379. +</tr>
  380. +<tr>
  381. +<td align=center><font color="FF9933"> custom effect</font></td>
  382. +<td align=center><font color="FF9933"></font></td>
  383. +<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>
  384. +</tr>
  385. +</table></center><br><br>
  386. +<font color="333333" align="center">_______________________________________</font>
  387. +<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">
  388. +<br><center><font color=\"A9A9A9\">~ by NeverMore ~</font></center></body></html>
  389. \ No newline at end of file
  390. Index: dist/game/data/html/userpanel/user.htm
  391. ===================================================================
  392. --- dist/game/data/html/userpanel/user.htm  (revision 0)
  393. +++ dist/game/data/html/userpanel/user.htm  (revision 0)
  394. @@ -0,0 +1,37 @@
  395. +<html><head><title>User Panel</title></head><body>
  396. +<center><br>
  397. +<table width="270" cellpadding="5">
  398. +<tr>
  399. +<td valign="top">Hello <font color="3399ff"> %name% </font>,<br1>
  400. +Use this command to enable/disable user actions or learn whatever is related with our server!</td>!
  401. +</tr>
  402. +</table>
  403. +</center>
  404. +<br><font color="333333" align="center">_______________________________________</font><br><br>
  405. +<center>
  406. +<table width=225 border=0><tr><br>
  407. +<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>
  408. +<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>
  409. +</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>
  410. +<font color="333333" align="center">_______________________________________</font><br>
  411. +<center><font color="3399ff">Server Statistics</font></center><br>
  412. +<table border=0 cellspacing=0 cellpadding=2 bgcolor=111111>
  413. +<tr>
  414. +<td fixwidth=11></td>
  415. +<td FIXWIDTH=280>Players Online</td>
  416. +<td FIXWIDTH=470><font color=FF6600>%online%</font></td>
  417. +</tr>
  418. +%serveronline%
  419. +<tr>
  420. +<td fixwidth=11></td>
  421. +<td FIXWIDTH=280>Server Capacity</td>
  422. +<td FIXWIDTH=470><font color=FF6600>%servercapacity%</font></td>
  423. +</tr>
  424. +<tr>
  425. +<td fixwidth=11></td>
  426. +<td FIXWIDTH=280>Server Onl.Time</td>
  427. +<td FIXWIDTH=470><font color=FF6600>%serverruntime%</font></td>
  428. +</tr>
  429. +</table><br><font color="333333" align="center">_______________________________________</font>
  430. +<br>
  431. +<center><font color=\"A9A9A9\">~ By NeverMore ~</font></center></body></html>
  432. Index: dist/game/data/html/userpanel/user1.htm
  433. ===================================================================
  434. --- dist/game/data/html/userpanel/user1.htm (revision 0)
  435. +++ dist/game/data/html/userpanel/user1.htm (revision 0)
  436. @@ -0,0 +1,28 @@
  437. +<html><head><title>Usefull Information</title></head><body>
  438. +<center><br>
  439. +<table width="270" cellpadding="5">
  440. +<tr>
  441. +<td valign="top"><font color="3399ff"> %name% </font>,read this usefull information and learn every feature that our server supports!</td>!
  442. +</tr>
  443. +</table>
  444. +</center>
  445. +<br><font color="333333" align="center">_______________________________________</font><br>
  446. +<center><font color="3399ff">GamePlay Informations</font></center><br>
  447. +<center><table>
  448. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  449. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  450. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  451. +</table></center><br><font color="333333" align="center">_______________________________________</font><br><center><font color="3399ff">Vote Informations</font></center><br>
  452. +<center><table>
  453. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  454. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  455. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  456. +</table></center><br><font color="333333" align="center">_______________________________________</font><br>
  457. +<br><center><font color="3399ff">PvP Informations</font></center><br>
  458. +<center><table>
  459. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  460. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  461. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  462. +</table></center><br><font color="333333" align="center">_______________________________________</font>
  463. +<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">
  464. +<center><font color=\"A9A9A9\">~ By NeverMore ~</font></center></body></html>
  465. \ No newline at end of file
  466. Index: dist/game/data/html/userpanel/user3.htm
  467. ===================================================================
  468. --- dist/game/data/html/userpanel/user3.htm (revision 0)
  469. +++ dist/game/data/html/userpanel/user3.htm (revision 0)
  470. @@ -0,0 +1,28 @@
  471. +<html><head><title>Change log</title></head><body>
  472. +<center><br>
  473. +<table width="270" cellpadding="5">
  474. +<tr>
  475. +<td valign="top"><font color="3399ff"> %name% </font>,here you can read our server changes!</td>!
  476. +</tr>
  477. +</table>
  478. +</center>
  479. +<br><font color="333333" align="center">_______________________________________</font><br>
  480. +<center><font color="3399ff">12/8/2012</font></center><br>
  481. +<center><table>
  482. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  483. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  484. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  485. +</table></center><br><font color="333333" align="center">_______________________________________</font><br><center><font color="3399ff">10/8/2012</font></center><br>
  486. +<center><table>
  487. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  488. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  489. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  490. +</table></center><br><font color="333333" align="center">_______________________________________</font><br>
  491. +<br><center><font color="3399ff">8/8/2012</font></center><br>
  492. +<center><table>
  493. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  494. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  495. +<tr><td><font color="3399ff">*</font>   To.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.doTo.do</td></tr>
  496. +</table></center><br><font color="333333" align="center">_______________________________________</font>
  497. +<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>
  498. +<center><font color=\"A9A9A9\">~ By NeverMore ~</font></center></body></html>
  499. \ No newline at end of file
  500. Index: dist/game/data/scripts/handlers/voicedcommandhandlers/User.java
  501. ===================================================================
  502. --- dist/game/data/scripts/handlers/voicedcommandhandlers/User.java (revision 0)
  503. +++ dist/game/data/scripts/handlers/voicedcommandhandlers/User.java (revision 0)
  504. @@ -0,0 +1,157 @@
  505. +package handlers.voicedcommandhandlers;
  506. +
  507. +import com.l2jserver.Config;
  508. +import com.l2jserver.gameserver.GameTimeController;
  509. +import com.l2jserver.gameserver.cache.HtmCache;
  510. +import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
  511. +import com.l2jserver.gameserver.model.L2World;
  512. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  513. +import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
  514. +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
  515. +
  516. +/**
  517. + * @author NeverMore
  518. + */
  519. +
  520. +public class User implements IVoicedCommandHandler
  521. +{
  522. +       public static final String[] VOICED_COMMANDS = { "user" , "user1", "user2", "user3" };
  523. +      
  524. +       @Override
  525. +   public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
  526. +       {
  527. +              if (Config.SHOW_USER)
  528. +          {
  529. +                  if(command.equalsIgnoreCase("user"))
  530. +                  {
  531. +                      User.showUserPage(activeChar, "user.htm");
  532. +                  }      
  533. +              if(command.equalsIgnoreCase("user1"))
  534. +                  {
  535. +                      User.showUserPage(activeChar, "user1.htm");
  536. +                  }  
  537. +              if(command.equalsIgnoreCase("user2"))
  538. +                  {
  539. +                      User.showUserPage(activeChar, "user2.htm");
  540. +                  }
  541. +              if(command.equalsIgnoreCase("user3"))
  542. +                  {
  543. +                      User.showUserPage(activeChar, "user3.htm");
  544. +                  }
  545. +          }
  546. +              else
  547. +              {
  548. +                       activeChar.sendMessage("This command is disabled");
  549. +                       ExShowScreenMessage message1 = new ExShowScreenMessage("This command is disabled by admin!", 4000);
  550. +                       activeChar.sendPacket(message1);
  551. +                       return false;
  552. +              }    
  553. +           return false;      
  554. +       }        
  555. +      
  556. +       public static String getServerRunTime()
  557. +       {
  558. +          int timeSeconds = (GameTimeController.getGameTicks() - 36000) / 10;
  559. +          String timeResult = "";
  560. +          if (timeSeconds >= 86400)
  561. +              timeResult = Integer.toString(timeSeconds / 86400) + " Days " + Integer.toString((timeSeconds % 86400) / 3600) + " hours";
  562. +          else
  563. +              timeResult = Integer.toString(timeSeconds / 3600) + " Hours " + Integer.toString((timeSeconds % 3600) / 60) + " mins";
  564. +          return timeResult;
  565. +       }
  566. +            
  567. +       public static String getRealOnline()
  568. +       {
  569. +          int counter = 0;
  570. +          for (L2PcInstance onlinePlayer : L2World.getInstance().getAllPlayersArray())
  571. +          {
  572. +              if (onlinePlayer.isOnline() && (onlinePlayer.getClient() != null && !onlinePlayer.getClient().isDetached()))
  573. +              {
  574. +                  counter++;
  575. +              }
  576. +          }
  577. +          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>";
  578. +          return realOnline;
  579. +       }
  580. +      
  581. +       public static void showUserPage(L2PcInstance targetChar, String filename)
  582. +       {
  583. +          String content = HtmCache.getInstance().getHtmForce(targetChar.getHtmlPrefix(), "data/html/userpanel/" + filename);
  584. +          NpcHtmlMessage UserPanelReply = new NpcHtmlMessage(5);
  585. +          UserPanelReply.setHtml(content);
  586. +          UserPanelReply.replace("%online%", String.valueOf(L2World.getInstance().getAllPlayers().size()));
  587. +          UserPanelReply.replace("%name%", String.valueOf(targetChar.getName()));
  588. +          UserPanelReply.replace("%serveronline%", getRealOnline());
  589. +          UserPanelReply.replace("%servercapacity%", Integer.toString(Config.MAXIMUM_ONLINE_USERS));
  590. +          UserPanelReply.replace("%serverruntime%", getServerRunTime());
  591. +          UserPanelReply.replace("%playernumber%", String.valueOf(L2World.getInstance().getAllPlayers().size()));
  592. +              if (!Config.ENABLE_SPECIAL_EFFECT)
  593. +          {
  594. +               UserPanelReply.replace("%effect%", "Disabled");
  595. +          }
  596. +          else if (L2PcInstance._isoneffect == true)
  597. +          {
  598. +              UserPanelReply.replace("%effect%", "ON");
  599. +          }
  600. +          else  
  601. +          {
  602. +              UserPanelReply.replace("%effect%", "OFF");
  603. +          }
  604. +              if (!Config.ENABLE_PM_REFUSAL)
  605. +              {
  606. +                  UserPanelReply.replace("%pm%", "Disabled");
  607. +              }
  608. +              else if (L2PcInstance._ispmrefusal == true)
  609. +              {
  610. +                  UserPanelReply.replace("%pm%", "ON");
  611. +              }
  612. +              else
  613. +              {
  614. +                  UserPanelReply.replace("%pm%", "OFF");
  615. +              }
  616. +              if (!Config.ENABLE_TRADE_REFUSAL)
  617. +              {
  618. +                  UserPanelReply.replace("%trade%", "Disabled");
  619. +              }
  620. +              else if (L2PcInstance._istraderefusal == true)
  621. +              {
  622. +                  UserPanelReply.replace("%trade%", "ON");
  623. +              }
  624. +              else
  625. +              {
  626. +                  UserPanelReply.replace("%trade%", "OFF");
  627. +              }
  628. +              if (!Config.ENABLE_EXP_REFUSAL)
  629. +              {
  630. +               UserPanelReply.replace("%exp%", "Disabled");
  631. +              }
  632. +              else if (L2PcInstance._isexpsprefusal == true)
  633. +              {
  634. +               UserPanelReply.replace("%exp%", "ON");
  635. +              }
  636. +              else
  637. +              {
  638. +               UserPanelReply.replace("%exp%", "OFF");
  639. +              }
  640. +          if (!Config.ENABLE_SPECIAL_EFFECT)
  641. +          {
  642. +              UserPanelReply.replace("%effect%", "Disabled");
  643. +          }
  644. +          else if (L2PcInstance._isoneffect == true)
  645. +          {
  646. +              UserPanelReply.replace("%effect%", "ON");
  647. +          }
  648. +          else  
  649. +          {
  650. +              UserPanelReply.replace("%effect%", "OFF");
  651. +          }           
  652. +              targetChar.sendPacket(UserPanelReply);
  653. +    }
  654. +
  655. +  
  656. +   @Override
  657. +   public String[] getVoicedCommandList()
  658. +       {
  659. +               return VOICED_COMMANDS;
  660. +       }
  661. +}
  662. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement