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

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.

  • 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

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.

  • 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

    • 🔥 Launch was a success! Over 500 players joined L2Elixir on opening day, and we are holding a steady 420–450 online! We faced extortion attempts and heavy DDoS attacks, but our protections held strong — even if the cost was far higher than expected. What matters is we fought back and kept the server online for you. ⚔️ 💙 Our priority is simple: Deliver a stable, fair, and growing server that will evolve for years to come. We continue to invest in protections, advertising, and development — and we won’t stop. All we ask from YOU is one thing: 👉 Keep playing. The more active the community is, the faster the server grows. 💠 Important Note: We have no paid clans or CPs, no “boosted” groups, no unfair benefits. Everyone has an equal chance to progress and compete. Thank you to everyone who joined, supported, and believed in this project. Let’s make L2Elixir great again — even in 2025–2026! 🚀   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs   @Atom Can you please move to Private Servers? Thanks!
    • https://jumpshare.com/share/kIdeKALOhgtMKpBKqxpg Test Equip Armors-> FullPlate, Gloves, Legs, Chest , Boots
    • 黑色星期五 — 为您的流量提供高级福利 仅在11月28日,我们的特别促销码可为您提供13%的商店折扣。 促销码: BLACKFRIDAY (13% 折扣) 您可以通过我们的网站或 Telegram 机器人在商店购物! 有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram Messenger 方便访问商店。 其他服务: 虚拟号码服务: 前往 用于购买 Telegram Stars 的机器人: 前往 – 快速且优惠地在 Telegram 中购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们向您呈现当前的 促销和特惠活动 列表,用于购买我们服务的产品和服务: 1. 您可以在首次购买时使用促销码:SOCNET(15% 折扣) 2. 获取 $1 商店余额或 10–20% 折扣 — 只需在我们网站注册后发送您的用户名,格式如下:“SEND ME BONUS, MY USERNAME IS...” — 您需要在我们的论坛帖子中写下这句话! 3. SMM 面板首次试用可获得 $1:只需在我们的网站(支持)提交主题为“Get Trial Bonus”的工单。 4. 我们的 Telegram 频道和 Stars 购买机器人每周都会举办 Telegram Stars 抽奖活动! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ 邮箱: solomonbog@socnet.store
    • BLACK FRIDAY — PREMIUM BENEFITS FOR YOUR TRAFFIC Only on November 28 our special promo code gives you a 13% discount in the store. PROMO CODE: BLACKFRIDAY (13% Discount) Shop in our store on the website or via the Telegram bot! Active links: Digital goods store (Website): Go Store Telegram bot: Go – convenient access to the store via Telegram messenger. Other services: Virtual numbers service: Go Telegram bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We want to present you the current list of promotions and special offers for purchasing our service's products and services: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 to your store balance or a 10–20% discount — just send your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to write this in our forum thread! 3. Get $1 for the first trial start of the SMM Panel: just open a ticket with the subject "Get Trial Bonus" on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock