Jump to content

Recommended Posts

Posted

So I've been receiving pms this week on how to do a voicedcommand with a textbuilder html so I decide to do this rlly quick on l2jfrozen its pretty basic idea atm but you could just extend it i just leave it like this in order to ppl add their own stuff.

 

### Eclipse Workspace Patch 1.0
#P L2jFrozen_GameServer
Index: head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/HtmCmd.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/HtmCmd.java	(revision 0)
+++ head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/HtmCmd.java	(revision 0)
@@ -0,0 +1,153 @@
+package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
+
+
+import javolution.text.TextBuilder;
+
+
+import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
+import com.l2jfrozen.gameserver.model.L2World;
+import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jfrozen.gameserver.network.SystemMessageId;
+import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
+import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
+
+
+/*
+ * @Author Mhoska
+ */
+
+
+public class HtmCmd
+implements IVoicedCommandHandler
+{
+private static final String[] VOICED_COMMANDS = 
+{ 
+	"menu", 
+	"mhoska_menu_"
+};
+
+
+@Override
+public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+{
+  if (command.equalsIgnoreCase("menu"))
+  {
+    showHtm(activeChar);
+  }
+  else if (command.startsWith("mhoska_menu_"))
+  {
+    String addcmd = command.substring(12).trim();
+        	 if (addcmd.startsWith("trade"))
+             {
+                 int flag = Integer.parseInt(addcmd.substring(5).trim());
+                 if (flag == 0)
+                 {
+                         activeChar.setExchangeRefusal(false);
+                     activeChar.sendMessage("You can receive trade invitations now");
+                 }
+                 else 
+                 {
+                         activeChar.setExchangeRefusal(true);
+                     activeChar.sendMessage("You cant receive trade invitations again");
+                 }
+                 showHtm(activeChar);
+                 return true;
+             }
+               
+             if (addcmd.startsWith("pm"))
+             {
+                 int flag = Integer.parseInt(addcmd.substring(2).trim());
+                 if (flag == 0)
+                 {
+                  activeChar.setMessageRefusal(false);
+                  activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_ACCEPTANCE_MODE));
+                 }
+                 else
+                 {
+                 activeChar.setMessageRefusal(true);
+                 activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_REFUSAL_MODE));
+                 }
+                 showHtm(activeChar);
+                 return true;
+             }
+
+        }
+return false; 
+    } 
+
+    	private void showHtm(L2PcInstance activeChar)
+    	  {    
+                NpcHtmlMessage MhoskaInfo = new NpcHtmlMessage(activeChar.getLastQuestNpcObject());
+                TextBuilder Mhoska = new TextBuilder("<html><body>");		
+				//htm start from here i just didnt decide what am i doing yet.				
+                Mhoska.append("<html><head><title>L2JHidden Menu v1</title></head><body>");
+                //elfo's part of the htm
+				Mhoska.append("<center>");
+				Mhoska.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">");
+				Mhoska.append("<tr>");
+				Mhoska.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>");
+				Mhoska.append("<td valign=\"top\"><font color=\"FF6600\">Menu</font>");
+				Mhoska.append("<br1><font color=\"00FF00\">"+activeChar.getName()+"</font>, Welcome there are %online% online players at the moment.</td>");
+				Mhoska.append("</tr>");
+				Mhoska.append("</table>");
+				//ends here.
+				Mhoska.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center><br>");
+				Mhoska.append("</center>");
+				Mhoska.append("<br1>");
+				Mhoska.append("<table bgcolor=\"000000\">");
+				//tr that opens gotta clsoe
+				Mhoska.append("<tr>");
+				Mhoska.append("<td width=5></td>");
+				Mhoska.append("<td width=150>Trade Refusal:</td>");
+				Mhoska.append("<td width=30>%trade%</td>");
+				Mhoska.append("<td width=35><button width=35 height=15 back=\"sek.cbui94\" fore=\"sek.cbui94\" action=\"bypass -h mhoska_menu_trade 0\" value=\"ON\"></td>");
+				Mhoska.append("<td width=35><button width=35 height=15 back=\"sek.cbui94\" fore=\"sek.cbui94\" action=\"bypass -h mhoska_menu_trade 1\" value=\"OFF\"></td>");
+				Mhoska.append("</tr>");
+				//tr that opens gotta close.
+				Mhoska.append("<tr>");
+				Mhoska.append("<td width=5></td>");
+				Mhoska.append("<td width=150>Msg Refusal:</td>");
+				Mhoska.append("<td width=30>%pm%</td>");
+				Mhoska.append("<td width=35><button width=35 height=15 back=\"sek.cbui94\" fore=\"sek.cbui94\" action=\"bypass -h mhoska_menu_pm 0\" value=\"ON\"></td>");
+				Mhoska.append("<td width=35><button width=35 height=15 back=\"sek.cbui94\" fore=\"sek.cbui94\" action=\"bypass -h mhoska_menu_pm 1\" value=\"OFF\"></td>");
+				Mhoska.append("</tr>");
+				Mhoska.append("<br1>");
+				Mhoska.append("</table bgcolor=\"000000\">");
+				Mhoska.append("<br1>");
+				Mhoska.append("<center>");
+				Mhoska.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>");
+				Mhoska.append("<font color=\"FF6600\">L2JHidden</font>");
+				Mhoska.append("</center>");
+				Mhoska.append("</body></html>");
+                MhoskaInfo.setHtml(Mhoska.toString());
+                activeChar.sendPacket(MhoskaInfo);
+                
+                L2World.getInstance();
+                int whoisonline = L2World.getAllPlayersCount();
+                String online = Integer.toString(whoisonline);
+                MhoskaInfo.replace("%online%", online );
+                
+                if (activeChar.getExchangeRefusal())
+                {
+                                MhoskaInfo.replace("%trade%", "OFF");
+                }
+                else
+                        {
+                                MhoskaInfo.replace("%trade%", "ON");
+                        }
+                if (activeChar.getMessageRefusal())
+                        {
+                                MhoskaInfo.replace("%pm%", "OFF");
+                        }
+                else
+                        {
+                                MhoskaInfo.replace("%pm%", "ON");
+                        }                
+		                       
+		  }		
+    @Override
+	public String[] getVoicedCommandList()
+    {
+        return VOICED_COMMANDS;
+    }
+}   
\ No newline at end of file
Index: head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java	(revision 952)
+++ head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java	(working copy)
@@ -28,8 +28,11 @@
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.AwayCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.BankingCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.CTFCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.DMCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.FarmPvpCmd;
+import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.HtmCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Online;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.StatsCmd;
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.TvTCmd;
@@ -113,6 +116,12 @@
			registerVoicedCommandHandler(new Online());
		}

+		registerVoicedCommandHandler(new HtmCmd());

		_log.config("VoicedCommandHandler: Loaded " + _datatable.size() + " handlers.");

	}
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java	(revision 952)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java	(working copy)
@@ -27,6 +27,8 @@
import com.l2jfrozen.gameserver.datatables.sql.AdminCommandAccessRights;
import com.l2jfrozen.gameserver.handler.AdminCommandHandler;
import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
+import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
+import com.l2jfrozen.gameserver.handler.VoicedCommandHandler;
import com.l2jfrozen.gameserver.handler.custom.CustomBypassHandler;
import com.l2jfrozen.gameserver.model.L2Object;
import com.l2jfrozen.gameserver.model.L2World;
@@ -124,6 +126,7 @@
			{
				playerHelp(activeChar, _command.substring(12));
			}
+			
			else if(_command.startsWith("npc_"))
			{
				if(!activeChar.validateBypass(_command))
@@ -286,6 +289,11 @@
			{
				CommunityBoard.getInstance().handleCommands(getClient(), _command);
			}
+			else if (_command.startsWith("mhoska_menu_"))
+            {
+          IVoicedCommandHandler vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler("mhoska_menu_");
+              vch.useVoicedCommand(_command, activeChar, null);
+            }
			else if(_command.startsWith("Quest "))
			{
				if(!activeChar.validateBypass(_command))

 

some ss

 

zb1SK.png

 

if anyone wants to add something else just try it and ill help you guys, i just want you to learn something, not to have everything done and just c/p the code.

 

credits: To me, and elfocrash cos I just steel part of his html troll.

Guest Elfocrash
Posted

Hahaha 95% of the shares after my vote system have it's html structure.

I am flattered huh

Posted

Hahaha 95% of the shares after my vote system have it's html structure.

I am flattered huh

 

its the only html I kinda like on interlude cos html suck in interlude.

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here 👉https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
    • Hello! We are Genesis, small team that works on new Lineage 2 project. Our goal with this project is to create a fresh new place to play — built around real community feedback, with no aggressive pay-to-win donations and with carefully thought-out quality-of-life improvements, balance changes etc. We believe that even tho we all love this game, everyone has at least one or two things they would like to change in the game to make it more enjoyable. Thats why we want the comunity feedback to shape our server. Main information about the server: • Interlude Classic version • Rates: EXP x4 SP x2 Loot x2, Spoil x2 (not set in stone, might be changed) • Local & Server-Side Dualbox Protection • Complete, Clear Website with Integrated Account Panel (Game account creation, direct communication with support, bug reporting, voting and reward system) • Launcher – External Game Login System: manage all your accounts inside the launcher, “Play” button logs you directly into the game server Here are list of few changes we already added/decided to add to the server: • Reworked Client to fit interlude Era with upgraded Classic Ui • Custom Antibot system • Custom AntiDualBox System • Offline shops • Offline shop with buffs (available only in towns) • Mass Sweeper added to the game • Newbie buffs available all the way to lvl 76 (nothing crazy, but its free) • Slight balance change to Destroyer damage with Polearm and Cancel spell from SPS • PvP zones on every Epic spawn spot • Overbuffing blocked • And more! Since we put big focus on community feedback and suggestions, we are looking for people for our internal tests, that will discuss whether current changes „fit” into the game and maybe suggest some changes themselves. If what you’ve just read sounds interesting to you, if you want to help creating server fitted for you, join our server Discord. Help us to understand what Lineage 2 players in 2026 actually expect and need — so we can meet those expectations and avoid becoming just another server that dies a natural death.     Even if you’re not interested in playing right now, but you are a long-time Lineage 2 player, feel free to join our community. We would greatly appreciate your experience and feedback to help us improve and develop our project. Join the growing L2Genesis community: https://discord.gg/mcuHsQzNCm Also check our website: https://l2genesis.com/
    • I messaged you privately. If you want me to help, message me privately.  
    • Hello guys I’m new here, also I’m new on those things I  don’t know anything about programming but I need some help about many things …I want to open a faction server  Firstly , I want to make a classic but with interlude staff like skills items level etc ..so is there any project server interlude -classic ..is there any interlude -classic client ?  what other server doing ?  can I go with interlude and add a patch-interface that will work for all people whos gonna join the server,  that will have inventory stats bars etc from classic , lobby create character ..etc and L2Fonts  for title and names also chat letters  like classic ?  I read about Lucera 2 has an interlude -classic client is it correct ? I also read about a multi protocol ..   also I saw that there is a lot of classic chronicles like 2.0 2.5 2.6 2.7 2.9.5 3.0  what are the differences    I know that the 3.0 add kamael which I don’t want    in conclusion.. I want full interlude staff but classic things    what should I do with client , server files  which is the way to go and with what files    if someone can answer me to all  sorry for my bad English 
    • download link is dead can anyone share again please ?
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..