Addition of localisations for NPC name and titles.

This commit is contained in:
MobiusDevelopment
2019-07-14 13:03:02 +00:00
parent 95ba581cf5
commit aa201e6cae
130 changed files with 3351 additions and 72 deletions

View File

@@ -38,6 +38,7 @@ import org.l2jmobius.gameserver.data.xml.impl.FishingData;
import org.l2jmobius.gameserver.data.xml.impl.ItemCrystallizationData;
import org.l2jmobius.gameserver.data.xml.impl.MultisellData;
import org.l2jmobius.gameserver.data.xml.impl.NpcData;
import org.l2jmobius.gameserver.data.xml.impl.NpcNameLocalisationData;
import org.l2jmobius.gameserver.data.xml.impl.OptionData;
import org.l2jmobius.gameserver.data.xml.impl.PrimeShopData;
import org.l2jmobius.gameserver.data.xml.impl.SayuneData;
@@ -340,6 +341,7 @@ public class AdminReload implements IAdminCommandHandler
SystemMessageId.loadLocalisations();
NpcStringId.loadLocalisations();
SendMessageLocalisationData.getInstance().load();
NpcNameLocalisationData.getInstance().load();
AdminData.getInstance().broadcastMessageToGMs(activeChar.getName() + ": Reloaded Localisation data.");
break;
}

View File

@@ -19,9 +19,16 @@ package handlers.voicedcommandhandlers;
import java.util.StringTokenizer;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.gameserver.data.xml.impl.NpcNameLocalisationData;
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.DeleteObject;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import org.l2jmobius.gameserver.network.serverpackets.NpcInfo;
public class Lang implements IVoicedCommandHandler
{
@@ -61,6 +68,18 @@ public class Lang implements IVoicedCommandHandler
{
msg.setFile(activeChar, "data/html/mods/Lang/Ok.htm");
activeChar.sendPacket(msg);
for (WorldObject obj : World.getInstance().getVisibleObjects())
{
if (obj.isNpc() && NpcNameLocalisationData.getInstance().hasLocalisation(obj.getId()))
{
activeChar.sendPacket(new DeleteObject(obj));
ThreadPool.schedule(() ->
{
activeChar.sendPacket(new NpcInfo((Npc) obj));
}, 1000);
}
}
activeChar.setTarget(null);
return true;
}
msg.setFile(activeChar, "data/html/mods/Lang/Error.htm");