Jump to content
  • 0

ClassChanger CommunityBoard


Question

9 answers to this question

Recommended Posts

  • 0
Posted (edited)
13 hours ago, John Mouling said:

hello. Could anyone help me please?. I'm looking to make a classchanger in the community. to make class changes as appropriate. Do you have any example code?

You can make a voice classmaster, use buttons for both cb and npc.

Or what is the question?

What source you use?

Edited by Psygrammator
  • 0
Posted (edited)

I added a button in community where you click on it and the idea is that windows shows you wich classes could you change. and click on in and changes your class. Do you have any code to share with me?. or an idea how can i make it?.

Im using mobius

Edited by John Mouling
  • 0
Posted
17 hours ago, John Mouling said:

I added a button in community where you click on it and the idea is that windows shows you wich classes could you change. and click on in and changes your class. Do you have any code to share with me?. or an idea how can i make it?.

Im using mobius

 

 

Bypass is called as a voice command.

 

https://pastebin.com/bmjH9UYD

 

  • 0
Posted
5 hours ago, John Mouling said:

Thanks a lot Psygrammator. This means that i need to use a voicedcommans like .changeclass? could be in community?. because when i edit the button in community like "changeclass" an error show in console. Not handled RequestBypassToServer.

Because his classmaster is tied to instance.

I sent you an analogue of Mobius Classmaster, only rewritten to voice commands.

  • 0
Posted (edited)
17 minutes ago, John Mouling said:

Yes. Thanks. I tested on voicedcommand and it works. but when you click on New ClassButton nothings happen, i will rework. 
Last, i forget to add voicedcommand classmaster into masterhandler.

Check RequestBypassToServer

 

else if (_command.startsWith("voice ."))
{
	final IVoicedCommandHandler vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler("voice");
	if (vch != null)
	{
		vch.useVoicedCommand(_command, player, null);
	}
}

And add class
 

/*
 * This file is part of the L2J Mobius project.
 * 
 * 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 org.l2jmobius.gameserver.handler.voicedcommandhandlers;

import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.handler.VoicedCommandHandler;
import org.l2jmobius.gameserver.model.actor.Player;

/**
 * @author DS
 */
public class VoiceCommand implements IVoicedCommandHandler
{
    private static final String[] COMMANDS =
    {
       "voice"
    };
    
    @Override
    public boolean useVoicedCommand(String command, Player player, String target)
    {
       // only voice commands allowed
       if ((command.length() > 7) && (command.charAt(6) == '.'))
       {
          final String vc;
          final String vparams;
          final int endOfCommand = command.indexOf(' ', 7);
          if (endOfCommand > 0)
          {
             vc = command.substring(7, endOfCommand).trim();
             vparams = command.substring(endOfCommand).trim();
          }
          else
          {
             vc = command.substring(7).trim();
             vparams = null;
          }
          
          if (vc.length() > 0)
          {
             final IVoicedCommandHandler vch = VoicedCommandHandler.getInstance().getVoicedCommandHandler(vc);
             if (vch != null)
             {
                return vch.useVoicedCommand(vc, player, vparams);
             }
          }
       }
       
       return false;
    }
    
    @Override
    public String[] getVoicedCommandList()
    {
       return COMMANDS;
    }
}

 

Or you can find how voice is used in request and change all bypasses in VoiceClassMaster

Edited by Psygrammator
  • 0
Posted

Hi!! i have lost my implementation of that solution. what im doing wrong here?. It opens a communityboard window but without content. its in proceess but i think that i should show a text.

 

/*
 * This file is part of the L2J Mobius project.
 * 
 * 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 java.util.logging.Logger;

import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.enums.Race;
import org.l2jmobius.gameserver.handler.CommunityBoardHandler;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.model.actor.Player;

import ai.others.ClassMaster.ClassMaster;

/**
 * @author juan_
 */
public class ClassMasterVoiced implements IVoicedCommandHandler
{
	private static final Logger LOGGER = Logger.getLogger(ClassMaster.class.getName());
	
	private static final String[] VOICED_COMMANDS = new String[]
	{
		"1stClass",
		"2ndCass",
		"3rdCass",
		"AwakenClass"
	};
	
	/*
	 * (non-Javadoc)
	 * @see org.l2jmobius.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, org.l2jmobius.gameserver.model.actor.Player, java.lang.String)
	 */
	@Override
	public boolean useVoicedCommand(String command, Player player, String params)
	{
		if (command.equalsIgnoreCase("1stClass"))
		{
			getFirstOccupationChangeHtml(player);
		}
		return true;
	}
	
	/*
	 * (non-Javadoc)
	 * @see org.l2jmobius.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
	 */
	@Override
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
	
	private void getFirstOccupationChangeHtml(Player player)
	{
		String htmltext = null;
		
		if (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))
		{
			if (player.getRace() == Race.ERTHEIA)
			{
				CommunityBoardHandler.separateAndSend("SDASDASDSA", player);
			}
			else if (player.getLevel() < 20)
			{
				htmltext = "test_server_helper027.html";
			}
			else
			{
				switch (player.getClassId())
				{
					case FIGHTER:
					{
						htmltext = "test_server_helper026a.html";
						break;
					}
					case MAGE:
					{
						htmltext = "test_server_helper026b.html";
						break;
					}
					case ELVEN_FIGHTER:
					{
						htmltext = "test_server_helper026c.html";
						break;
					}
					case ELVEN_MAGE:
					{
						htmltext = "test_server_helper026d.html";
						break;
					}
					case DARK_FIGHTER:
					{
						htmltext = "test_server_helper026e.html";
						break;
					}
					case DARK_MAGE:
					{
						htmltext = "test_server_helper026f.html";
						break;
					}
					case ORC_FIGHTER:
					{
						htmltext = "test_server_helper026g.html";
						break;
					}
					case ORC_MAGE:
					{
						htmltext = "test_server_helper026h.html";
						break;
					}
					case DWARVEN_FIGHTER:
					{
						htmltext = "test_server_helper026i.html";
						break;
					}
					case MALE_SOLDIER:
					{
						htmltext = "test_server_helper026j.html";
						break;
					}
					case FEMALE_SOLDIER:
					{
						htmltext = "test_server_helper026k.html";
						break;
					}
				}
			}
		}
		else if (player.isInCategory(CategoryType.SECOND_CLASS_GROUP))
		{
			htmltext = "test_server_helper028.html";
		}
		else if (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))
		{
			htmltext = "test_server_helper010.html";
		}
		else if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))
		{
			htmltext = "test_server_helper011.html";
		}
		else if (player.isInCategory(CategoryType.SIXTH_CLASS_GROUP))
		{
			htmltext = "test_server_helper011a.html";
		}
		// CommunityBoardHandler.separateAndSend(htmltext, player);
	}
	
	private String getSecondOccupationChangeHtml(Player player)
	{
		String htmltext = null;
		if (player.isInCategory(CategoryType.SECOND_CLASS_GROUP) || player.isInCategory(CategoryType.FIRST_CLASS_GROUP))
		{
			if (player.getLevel() < 40)
			{
				htmltext = "test_server_helper023.html";
			}
			else
			{
				switch (player.getClassId())
				{
					case FIGHTER:
					{
						htmltext = "test_server_helper012.html";
						break;
					}
					case WARRIOR:
					{
						htmltext = "test_server_helper012a.html";
						break;
					}
					case KNIGHT:
					{
						htmltext = "test_server_helper012b.html";
						break;
					}
					case ROGUE:
					{
						htmltext = "test_server_helper012c.html";
						break;
					}
					case MAGE:
					{
						htmltext = "test_server_helper013.html";
						break;
					}
					case WIZARD:
					{
						htmltext = "test_server_helper013a.html";
						break;
					}
					case CLERIC:
					{
						htmltext = "test_server_helper013b.html";
						break;
					}
					case ELVEN_FIGHTER:
					{
						htmltext = "test_server_helper014.html";
						break;
					}
					case ELVEN_KNIGHT:
					{
						htmltext = "test_server_helper014a.html";
						break;
					}
					case ELVEN_SCOUT:
					{
						htmltext = "test_server_helper014b.html";
						break;
					}
					case ELVEN_MAGE:
					{
						htmltext = "test_server_helper015.html";
						break;
					}
					case ELVEN_WIZARD:
					{
						htmltext = "test_server_helper015a.html";
						break;
					}
					case ORACLE:
					{
						htmltext = "test_server_helper015b.html";
						break;
					}
					case DARK_FIGHTER:
					{
						htmltext = "test_server_helper016.html";
						break;
					}
					case PALUS_KNIGHT:
					{
						htmltext = "test_server_helper016a.html";
						break;
					}
					case ASSASSIN:
					{
						htmltext = "test_server_helper016b.html";
						break;
					}
					case DARK_MAGE:
					{
						htmltext = "test_server_helper017.html";
						break;
					}
					case DARK_WIZARD:
					{
						htmltext = "test_server_helper017a.html";
						break;
					}
					case SHILLIEN_ORACLE:
					{
						htmltext = "test_server_helper017b.html";
						break;
					}
					case ORC_FIGHTER:
					{
						htmltext = "test_server_helper018.html";
						break;
					}
					case ORC_RAIDER:
					{
						htmltext = "test_server_helper018a.html";
						break;
					}
					case ORC_MONK:
					{
						htmltext = "test_server_helper018b.html";
						break;
					}
					case ORC_MAGE:
					case ORC_SHAMAN:
					{
						htmltext = "test_server_helper019.html";
						break;
					}
					case DWARVEN_FIGHTER:
					{
						htmltext = "test_server_helper020.html";
						break;
					}
					case ARTISAN:
					{
						htmltext = "test_server_helper020b.html";
						break;
					}
					case SCAVENGER:
					{
						htmltext = "test_server_helper020a.html";
						break;
					}
					case MALE_SOLDIER:
					case TROOPER:
					{
						htmltext = "test_server_helper020c.html";
						break;
					}
					case FEMALE_SOLDIER:
					case WARDER:
					{
						htmltext = "test_server_helper020d.html";
						break;
					}
					case ERTHEIA_FIGHTER:
					{
						htmltext = "test_server_helper020e.html";
						break;
					}
					case ERTHEIA_WIZARD:
					{
						htmltext = "test_server_helper020f.html";
						break;
					}
				}
			}
		}
		else if (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))
		{
			htmltext = "test_server_helper010.html";
		}
		else if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))
		{
			htmltext = "test_server_helper011.html";
		}
		else if (player.isInCategory(CategoryType.SIXTH_CLASS_GROUP))
		{
			htmltext = "test_server_helper011a.html";
		}
		else
		{
			htmltext = "test_server_helper029.html";
		}
		return htmltext;
	}
	
}

 

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

    • 🔥 L2Pride Interlude by DVP is NOW LIVE! 🔥 📅 Opened on June 10, 2026 at 21:00 GMT+2 ⚔️ The server is currently in the Tier 1 stage, giving everyone a fair chance to gear up and compete. 🔓 Tier 2 Items will be unlocked on June 27, 2026! ✅ Active players ✅ Stable server ✅ Competitive PvP ✅ Growing community Whether you're a solo player, clan leader, or PvP enthusiast, now is the perfect time to join and prepare for the next stage of progression. See you in-game, warriors! ⚔️ WEB: www.l2pride.ddns.net DISCORD: https://discord.gg/JVdpESC5Ry
    • Stock updates constantly. Only top items are posted on the forum. For current availability and ordering, message us on Telegram.   G2G Business 🇪🇺 EU Fully verified seller's account.   Revolut Business 🇪🇺 EU | Multi-currency IBAN, Virtual & physical cards, Instant SEPA transfers, ₿ Crypto exchange & settlements.   SumUp Business 🇬🇧 GB | POS, 1 physical card, 2 virtual cards. Payouts time: 1 day even on weekends and bank holidays, Multi-user access.   Vivid Business | Merchant POS, DE IBAN, up to 50 IBANs, SEPA Instant, unlimited transfers, up to 25 virtual and 3 physical cards.
    • 🔎 Find us: 👉🏼 Website: L2Dexter.eu 👉🏼 Discord: discord.gg/dttX9FE23W 👉🏼 Facebook: facebook.com/L2Dexter
    • G Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • REAL PHOTOS ALWAYS «BREAK» ▪ Think a high-quality photo should be perfect? Think again. In real shots, something is almost always “off”: ▪ Noise in the shadows — especially noticeable in low light ▪ Local overexposures on highlights and glossy surfaces ▪ Loss of fine details in the brightest and darkest areas ▪ Overall “dirt” and unevenness that no editor can fully remove ▪  It’s exactly these imperfections that make the frame look alive. Algorithms already know well: a sterile clean image without these “flaws” is almost always a fake. Reality is never perfect. A fake tries to be.  Want photos that look genuinely “broken,” like they were taken on a real phone? Write to us — we’ll make even the flaws work in your favor. › TG: @mustang_service_ms ( https:// t.me/ mustang_service_ms ) › Channel: Mustang Service ( https:// t.me/ +JPpJCETg-xM1NjNl ) #documents #drawing #photoshop #verication #fake
  • 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..