浏览代码

BETA/STABLE: NotTalkingNPCs DP script moved to CORE, and now is customizable trough config, thanks jurchiks.

MELERIX 14 年之前
父节点
当前提交
e714bdc5f5

+ 17 - 0
L2J_Server_BETA/java/com/l2jserver/Config.java

@@ -761,6 +761,7 @@ public final class Config
 	public static int INVENTORY_MAXIMUM_PET;
 	public static double PET_HP_REGEN_MULTIPLIER;
 	public static double PET_MP_REGEN_MULTIPLIER;
+	public static TIntArrayList NON_TALKING_NPCS;
 	
 	
 	//--------------------------------------------------
@@ -2043,6 +2044,22 @@ public final class Config
 					INVENTORY_MAXIMUM_PET = Integer.parseInt(NPC.getProperty("MaximumSlotsForPet", "12"));
 					PET_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetHpRegenMultiplier", "100")) /100;
 					PET_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetMpRegenMultiplier", "100")) /100;
+					split = NPC.getProperty("NonTalkingNpcs", "18684,18685,18686,18687,18688,18689,18690,19691,18692,31557,31606,31671,31672,31673,31674,32026,32030,32031,32032,32306,32619,32620,32621").split(",");
+					NON_TALKING_NPCS = new TIntArrayList(split.length);
+					for (String npcId : split)
+					{
+						try
+						{
+							NON_TALKING_NPCS.add(Integer.parseInt(npcId));
+						}
+						catch (NumberFormatException nfe)
+						{
+							if (!npcId.isEmpty())
+							{
+								_log.warning("Could not parse " + npcId + " id for NonTalkingNpcs. Please check that all values are digits and coma separated.");
+							}
+						}
+					}
 				}
 				catch (Exception e)
 				{

+ 5 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Npc.java

@@ -1145,6 +1145,11 @@ public class L2Npc extends L2Character
 	 */
 	public void showChatWindow(L2PcInstance player, int val)
 	{
+		if (Config.NON_TALKING_NPCS.contains(getNpcId()))
+		{
+			player.sendPacket(ActionFailed.STATIC_PACKET);
+			return;
+		}
 		if (player.isCursedWeaponEquipped() && (!(player.getTarget() instanceof L2ClanHallManagerInstance) || !(player.getTarget() instanceof L2DoormenInstance)))
 		{
 			player.setTarget(player);

+ 5 - 1
L2J_Server_BETA/java/config/NPC.properties

@@ -166,4 +166,8 @@ DisableRaidCurse = False
 # Default: 10,10,10
 RaidChaosTime = 10
 GrandChaosTime = 10
-MinionChaosTime = 10
+MinionChaosTime = 10
+
+# A comma separated list of all NPCs who have no dialog, i.e. double-clicking on them doesn't open a chat window
+# Default: 18684,18685,18686,18687,18688,18689,18690,19691,18692,31557,31606,31671,31672,31673,31674,32026,32030,32031,32032,32306,32619,32620,32621
+NonTalkingNpcs = 18684,18685,18686,18687,18688,18689,18690,19691,18692,31557,31606,31671,31672,31673,31674,32026,32030,32031,32032,32306,32619,32620,32621