Ability to use NpcString localisations for quest links.
This commit is contained in:
		| @@ -1,5 +1,10 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/localisations.xsd"> | ||||
| 	<!-- Q10320 --> | ||||
| 	<localisation id="532001" text="|Επ. 1 - 20| Ας πάμε στην κεντρική πλατεία" /> | ||||
| 	<localisation id="532002" text="|Επ. 1 - 20| Ας πάμε στην κεντρική πλατεία (Σε εξέλιξη)" /> | ||||
| 	<localisation id="532003" text="|Επ. 1 - 20| Ας πάμε στην κεντρική πλατεία (Ολοκληρώθηκε)" /> | ||||
| 	<!-- Plains of Dion --> | ||||
| 	<localisation id="99702" text="Τι κοιτάς;" /> | ||||
| 	<localisation id="1000288" text="$s1! Πώς τολμάς να διακόπτεις τον αγώνα μας! Βοήθεια παιδιά!" /> | ||||
| 	<localisation id="1000388" text="$s1! Έ! Έχουμε μια μονομαχία εδώ!" /> | ||||
|   | ||||
| @@ -17,6 +17,7 @@ | ||||
| package handlers.bypasshandlers; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.Collections; | ||||
| import java.util.Map; | ||||
| import java.util.Set; | ||||
| import java.util.TreeMap; | ||||
| @@ -32,6 +33,8 @@ import org.l2jmobius.gameserver.model.events.EventType; | ||||
| import org.l2jmobius.gameserver.model.events.listeners.AbstractEventListener; | ||||
| import org.l2jmobius.gameserver.model.quest.Quest; | ||||
| import org.l2jmobius.gameserver.model.quest.QuestState; | ||||
| import org.l2jmobius.gameserver.network.NpcStringId; | ||||
| import org.l2jmobius.gameserver.network.NpcStringId.NSLocalisation; | ||||
| import org.l2jmobius.gameserver.network.SystemMessageId; | ||||
| import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; | ||||
| import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; | ||||
| @@ -121,14 +124,40 @@ public class QuestLink implements IBypassHandler | ||||
| 				{ | ||||
| 					sbCanStart.append("<font color=\"bbaa88\">"); | ||||
| 					sbCanStart.append("<button icon=\"quest\" align=\"left\" action=\"bypass -h npc_" + npc.getObjectId() + "_Quest " + quest.getName() + "\">"); | ||||
| 					sbCanStart.append(quest.isCustomQuest() ? quest.getPath() : "<fstring>" + quest.getNpcStringId() + "01</fstring>"); | ||||
| 					String localisation = quest.isCustomQuest() ? quest.getPath() : "<fstring>" + quest.getNpcStringId() + "01</fstring>"; | ||||
| 					if (Config.MULTILANG_ENABLE) | ||||
| 					{ | ||||
| 						final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "01")); | ||||
| 						if (ns != null) | ||||
| 						{ | ||||
| 							final NSLocalisation nsl = ns.getLocalisation(player.getLang()); | ||||
| 							if (nsl != null) | ||||
| 							{ | ||||
| 								localisation = nsl.getLocalisation(Collections.EMPTY_LIST); | ||||
| 							} | ||||
| 						} | ||||
| 					} | ||||
| 					sbCanStart.append(localisation); | ||||
| 					sbCanStart.append("</button></font>"); | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					sbCantStart.append("<font color=\"a62f31\">"); | ||||
| 					sbCantStart.append("<button icon=\"quest\" align=\"left\" action=\"bypass -h npc_" + npc.getObjectId() + "_Quest " + quest.getName() + "\">"); | ||||
| 					sbCantStart.append(quest.isCustomQuest() ? quest.getPath() : "<fstring>" + quest.getNpcStringId() + "01</fstring>"); | ||||
| 					String localisation = quest.isCustomQuest() ? quest.getPath() : "<fstring>" + quest.getNpcStringId() + "01</fstring>"; | ||||
| 					if (Config.MULTILANG_ENABLE) | ||||
| 					{ | ||||
| 						final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "01")); | ||||
| 						if (ns != null) | ||||
| 						{ | ||||
| 							final NSLocalisation nsl = ns.getLocalisation(player.getLang()); | ||||
| 							if (nsl != null) | ||||
| 							{ | ||||
| 								localisation = nsl.getLocalisation(Collections.EMPTY_LIST); | ||||
| 							} | ||||
| 						} | ||||
| 					} | ||||
| 					sbCantStart.append(localisation); | ||||
| 					sbCantStart.append("</button></font>"); | ||||
| 				} | ||||
| 			} | ||||
| @@ -140,14 +169,40 @@ public class QuestLink implements IBypassHandler | ||||
| 			{ | ||||
| 				sbStarted.append("<font color=\"ffdd66\">"); | ||||
| 				sbStarted.append("<button icon=\"quest\" align=\"left\" action=\"bypass -h npc_" + npc.getObjectId() + "_Quest " + quest.getName() + "\">"); | ||||
| 				sbStarted.append(quest.isCustomQuest() ? quest.getPath() + " (In Progress)" : "<fstring>" + quest.getNpcStringId() + "02</fstring>"); | ||||
| 				String localisation = quest.isCustomQuest() ? quest.getPath() + " (In Progress)" : "<fstring>" + quest.getNpcStringId() + "02</fstring>"; | ||||
| 				if (Config.MULTILANG_ENABLE) | ||||
| 				{ | ||||
| 					final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "02")); | ||||
| 					if (ns != null) | ||||
| 					{ | ||||
| 						final NSLocalisation nsl = ns.getLocalisation(player.getLang()); | ||||
| 						if (nsl != null) | ||||
| 						{ | ||||
| 							localisation = nsl.getLocalisation(Collections.EMPTY_LIST); | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| 				sbStarted.append(localisation); | ||||
| 				sbStarted.append("</button></font>"); | ||||
| 			} | ||||
| 			else if (qs.isCompleted()) | ||||
| 			{ | ||||
| 				sbCompleted.append("<font color=\"787878\">"); | ||||
| 				sbCompleted.append("<button icon=\"quest\" align=\"left\" action=\"bypass -h npc_" + npc.getObjectId() + "_Quest " + quest.getName() + "\">"); | ||||
| 				sbCompleted.append(quest.isCustomQuest() ? quest.getPath() + " (Done) " : "<fstring>" + quest.getNpcStringId() + "03</fstring>"); | ||||
| 				String localisation = quest.isCustomQuest() ? quest.getPath() + " (Done) " : "<fstring>" + quest.getNpcStringId() + "03</fstring>"; | ||||
| 				if (Config.MULTILANG_ENABLE) | ||||
| 				{ | ||||
| 					final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "03")); | ||||
| 					if (ns != null) | ||||
| 					{ | ||||
| 						final NSLocalisation nsl = ns.getLocalisation(player.getLang()); | ||||
| 						if (nsl != null) | ||||
| 						{ | ||||
| 							localisation = nsl.getLocalisation(Collections.EMPTY_LIST); | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| 				sbCompleted.append(localisation); | ||||
| 				sbCompleted.append("</button></font>"); | ||||
| 			} | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment