Jump to content

Custom Second Windows Html (like NPCdialog)


Recommended Posts

Hello

Has anyone ever managed to create a 2nd html window like NPCdialog

I was thinking of duplicating the NPCDialoghtm of the XDAT with another name and I don't really know how to add it in the interface.u and on the Server Core side I don't really know how to succeed in calling it and that it doesn't close the official NPCdialog page and have both pages at the same time. Has anyone ever managed to do something like this?

 

I m in Gracia Final Part (L2JFree)
THX

Edited by Vision
Link to comment
Share on other sites

1 hour ago, sacrifice said:

so it's impossible to have 2 windows at the same time? Where and how are we redirected?

It's not impossible, as xdem pointed out you just need to redirect the html string from a window to another, since you can't add server packets to your client. Otherwise yo can re-utilize the html viewer from TutorialViewerWnd


https://docs.unrealengine.com/udk/Two/UnrealScriptReference.html
https://docs.unrealengine.com/udk/Two/CoreUnrealScriptObjects.html

https://docs.unrealengine.com/udk/Two/UnrealScriptStartupCodeFlow.html

Link to comment
Share on other sites

For example side core

 

package com.l2jfree.gameserver.network.packets.server;

import com.l2jfree.gameserver.network.packets.L2ServerPacket;

public class TutorialShowHtml extends L2ServerPacket
{
	private static final String _S__A6_TUTORIALSHOWHTML = "[S] a6 TutorialShowHtml";
	private final String _html;
	
	public TutorialShowHtml(String html)
	{
		_html = html;
	}
	
	/* (non-Javadoc)
	 * @see com.l2jfree.gameserver.serverpackets.ServerBasePacket#writeImpl()
	 */
	@Override
	protected void writeImpl()
	{
		writeC(0xa6);
		writeS(_html);
	}
	
	/* (non-Javadoc)
	 * @see com.l2jfree.gameserver.BasePacket#getType()
	 */
	@Override
	public String getType()
	{
		return _S__A6_TUTORIALSHOWHTML;
	}
}

 

interface.u side:

TutorialBtnWnd.uc

TutorialViewerWnd.uc

SystemTutorialWnd.uc

.....

If create new  uc for new window I dont know how to link for open

I would like a small example of code to guide me to succeed in doing this with the tutorial window for example

Edited by sacrifice
Link to comment
Share on other sites

me too but how can use tutorial windows for  open with my custom html?

 

 

spacer.png

I dont find where is  original html of this windows "This is Sedrick's......"

 

Edited by sacrifice
Link to comment
Share on other sites

yes A6 is in Tutorialshowhtml.java

 

private static final String _S__A6_TUTORIALSHOWHTML = "[S] a6 TutorialShowHtml";

 

But How call this page in code java

 

                sb.append("</html>");
                html.setHtml(sb.toString());
                player.sendPacket(html);
                break;

 

 

Link to comment
Share on other sites

package com.l2jfree.gameserver.network.packets.client;

import com.l2jfree.gameserver.gameobjects.L2Player;
import com.l2jfree.gameserver.model.quest.QuestState;
import com.l2jfree.gameserver.network.packets.L2ClientPacket;

public class RequestTutorialPassCmdToServer extends L2ClientPacket
{
	private String _bypass = null;
	
	@Override
	protected void readImpl()
	{
		_bypass = readS();
	}
	
	@Override
	protected void runImpl()
	{
		L2Player player = getClient().getActiveChar();
		if (player == null)
			return;
		
		QuestState qs = player.getQuestState("255_Tutorial");
		if (qs != null)
			qs.getQuest().notifyEvent(_bypass, null, player);
		
		sendAF();
	}
	
	@Override
	public String getType()
	{
		return "[C] 86 RequestTutorialPassCmdToServer";
	}
}

 

package com.l2jfree.gameserver.network.packets.client;

import com.l2jfree.gameserver.gameobjects.L2Player;
import com.l2jfree.gameserver.gameobjects.instance.L2ClassMasterInstance;
import com.l2jfree.gameserver.model.quest.QuestState;
import com.l2jfree.gameserver.network.packets.L2ClientPacket;

/**
 * 7B 74 00 75 00 74 00 6F 00 72 00 69 00 61 00 6C
 * 00 5F 00 63 00 6C 00 6F 00 73 00 65 00 5F 00 32
 * 00 00 00
 * 
 * Format: (c) S
 * 
 * @author  DaDummy
 */
public class RequestTutorialLinkHtml extends L2ClientPacket
{
	private static final String _C__7B_REQUESTTUTORIALLINKHTML = "[C] 7B equestTutorialLinkHtml";
	
	private String _link;
	
	@Override
	protected void readImpl()
	{
		_link = readS(); // link
	}
	
	@Override
	protected void runImpl()
	{
		L2Player player = getClient().getActiveChar();
		if (player == null)
			return;
		
		L2ClassMasterInstance.onTutorialLink(player, _link);
		
		player.onTutorialLink(_link);
		
		QuestState qs = player.getQuestState("255_Tutorial");
		if (qs != null)
			qs.getQuest().notifyEvent(_link, null, player);
		
		sendAF();
	}
	
	@Override
	public String getType()
	{
		return _C__7B_REQUESTTUTORIALLINKHTML;
	}
}

 

Link to comment
Share on other sites

protected void runImpl()
	{
		L2Player player = getClient().getActiveChar();
		if (player == null)
			return;
	+if (_link.startsWith("bp_close")) {
              +  player.sendPacket(TutorialCloseHtml.STATIC_PACKET);
            + }	

		L2ClassMasterInstance.onTutorialLink(player, _link);
		
		player.onTutorialLink(_link);
		
		QuestState qs = player.getQuestState("255_Tutorial");
		if (qs != null)
			qs.getQuest().notifyEvent(_link, null, player);
		
		sendAF();
	}

make button on html file with bypas bp_close , it should close tutorial htm window... if not works you should register your bypass somewhere i don't remember right now search for bypass handlers .. try it and reply

Edited by arm4729
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

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