Jump to content
  • 0

Remote class manager aCis


Bouloche

Question

Posted (edited)

Hi. I'm beginner in l2j/java dev and i'm on aCis latest private sources.
I try to make a remote class manager for open possibles classes transfert window when the character get lvl 20,40,76.
I have made a condition in PlayerStatus.java like that :

@Override
	public final boolean addLevel(byte value)
	{
		if (getLevel() + value > PlayerLevelData.getInstance().getRealMaxLevel())
			return false;
		
		boolean levelIncreased = super.addLevel(value);
		
		if (getLevel() == 20)
		{
			NpcHtmlMessage html = new NpcHtmlMessage(0);
			html.setFile("data/html/mods/classmaster/50000-2.htm");
			_actor.sendPacket(html);
		}

But the result when player get lvl 20 is :
Capture_decran_2023-05-26_064135.png.0baa55609015bf1e85fe0ce79b08d102.png

 

I don't know how  get the available classes in my html. Or maybe i havent the good method. 
Maybe i must call the method in ClassMaster.java or run the command who open the class change window in class master (1stClass)
I'm a bit lost
Than you for your future help.

Edited by Bouloche
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

You cannot just push the HTML and hope it works. It might for static htmls, which are htmls that do not have a dynamic part that has to be replaced with something within the core, such as the %menu%. In this particular case, you would have to "create/request" a new instance of the ClassManager and call the proper method of the ClassManager instance to show the available classes. Worst-case scenario, you would have to change the logic in the ClassMaster a bit (build upon the existing logic) to make sure that it could work without a particular NPC (or in other words to work with NpcObjID = null) under certain conditions, such as an additional Config.MY_CUSTOM_CLASS_MASTER_ENABLED (just an example).


Here is what it might look like:

if (Config.ALLOW_CLASS_MASTERS && Config.MY_CUSTOM_CLASS_MASTER_ENABLED)
{
      // ADD_SOME_ADDITIONAL_CHECKS_FOR_CLASS_CHANGE_ELIGIBILITY_HERE
      new ClassMaster(_actor.getObjectId(), null).showChatWindow(_actor);
}
Edited by Bru7aLMike
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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