Formal: HTML
Path:
gameserver\data\html-en\welcome.htm
gameserver\data\html-ru\welcome.htm
Options that can be used:
Language change, player name display
Language change example:
<button value="EN" action="bypass -h scripts_services.Welcome:change_lang en" width=40 height=20 back="sek.cbui94" fore="sek.cbui94">
<button value="RU" action="bypass -h scripts_services.Welcome:change_lang ru" width=40 height=20 back="sek.cbui94" fore="sek.cbui94">
An example of displaying a player's name:
%char_name%
Adequate applications are also accepted without the issuance of items and the like, who needs to add this - I am attaching the source code so that they would not pull me with their perversions. How to add your code hhttps://lucera2.com/threads/how-to-add-your-quests-or-subsystems-to-an-assembly.1406/
Path:
gameserver\data\html-en\welcome.htm
gameserver\data\html-ru\welcome.htm
Options that can be used:
Language change, player name display
Language change example:
<button value="EN" action="bypass -h scripts_services.Welcome:change_lang en" width=40 height=20 back="sek.cbui94" fore="sek.cbui94">
<button value="RU" action="bypass -h scripts_services.Welcome:change_lang ru" width=40 height=20 back="sek.cbui94" fore="sek.cbui94">
An example of displaying a player's name:
%char_name%
Adequate applications are also accepted without the issuance of items and the like, who needs to add this - I am attaching the source code so that they would not pull me with their perversions. How to add your code hhttps://lucera2.com/threads/how-to-add-your-quests-or-subsystems-to-an-assembly.1406/
Java:
package services;
import l2.gameserver.Config;
import l2.gameserver.listener.actor.player.OnPlayerEnterListener;
import l2.gameserver.model.Player;
import l2.gameserver.model.actor.listener.CharListenerList;
import l2.gameserver.network.l2.s2c.NpcHtmlMessage;
import l2.gameserver.scripts.Functions;
import l2.gameserver.scripts.ScriptFile;
public class Welcome extends Functions implements ScriptFile, OnPlayerEnterListener
{
public void change_lang(String[] var)
{
Player player = getSelf();
if(var[0].equalsIgnoreCase("en"))
{
player.setVar("lang@", "en", -1);
}
else if(var[0].equalsIgnoreCase("ru"))
{
player.setVar("lang@", "ru", -1);
}
NpcHtmlMessage msg = new NpcHtmlMessage(5).setFile("welcome.htm");
msg.replace("%char_name%", player.getName());
player.sendPacket(msg);
}
@Override
public void onPlayerEnter(Player activeChar)
{
if(Config.SHOW_HTML_WELCOME && (activeChar.getClan() == null || activeChar.getClan().getNotice() == null ||
activeChar.getClan().getNotice().isEmpty()))
{
NpcHtmlMessage msg = new NpcHtmlMessage(5).setFile("welcome.htm");
msg.replace("%char_name%", activeChar.getName());
activeChar.sendPacket(msg);
}
}
@Override
public void onLoad()
{
if(Config.SHOW_HTML_WELCOME)
{
CharListenerList.addGlobal(this);
}
}
@Override
public void onReload()
{
}
@Override
public void onShutdown()
{
}
}