Przeglądaj źródła

Some custom configs:
- Announce PvP/Pk
- Disable Tutorial (req Dp support)
- Disable Expertise penalty

JIV 15 lat temu
rodzic
commit
422a0c4406

+ 13 - 2
L2_GameServer/java/com/l2jserver/Config.java

@@ -191,7 +191,8 @@ public final class Config
 	public static String PARTY_XP_CUTOFF_METHOD;
 	public static double PARTY_XP_CUTOFF_PERCENT;
 	public static int PARTY_XP_CUTOFF_LEVEL;
-
+	public static boolean DISABLE_TUTORIAL;
+	public static boolean EXPERTISE_PENALTY;
 
 	//--------------------------------------------------
 	// ClanHall Settings
@@ -636,7 +637,10 @@ public final class Config
 	public static boolean L2JMOD_ANTIFEED_DUALBOX;
 	public static boolean L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX;
 	public static int L2JMOD_ANTIFEED_INTERVAL;
-
+	public static boolean ANNOUNCE_PK_PVP;
+	public static boolean ANNOUNCE_PK_PVP_NORMAL_MESSAGE;
+	public static String ANNOUNCE_PK_MSG;
+	public static String ANNOUNCE_PVP_MSG;
 
 	//--------------------------------------------------
 	// NPC Settings
@@ -1415,6 +1419,8 @@ public final class Config
 					PARTY_XP_CUTOFF_METHOD = Character.getProperty("PartyXpCutoffMethod", "auto");
 					PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(Character.getProperty("PartyXpCutoffPercent", "3."));
 					PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(Character.getProperty("PartyXpCutoffLevel", "30"));
+					DISABLE_TUTORIAL = Boolean.parseBoolean(Character.getProperty("DisableTutorial", "False"));
+					EXPERTISE_PENALTY = Boolean.parseBoolean(Character.getProperty("ExpertisePenalty", "True"));
 				}
 				catch (Exception e)
 				{
@@ -2103,6 +2109,11 @@ public final class Config
 					L2JMOD_ANTIFEED_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedDualbox", "true"));
 					L2JMOD_ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("AntiFeedDisconnectedAsDualbox", "true"));
 					L2JMOD_ANTIFEED_INTERVAL = 1000*Integer.parseInt(L2JModSettings.getProperty("AntiFeedInterval", "120"));
+					ANNOUNCE_PK_PVP = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncePkPvP", "False"));
+					ANNOUNCE_PK_PVP_NORMAL_MESSAGE = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncePkPvPNormalMessage", "True"));
+					ANNOUNCE_PK_MSG = L2JModSettings.getProperty("AnnouncePkMsg", "$killer has slaughtered $target");
+					ANNOUNCE_PVP_MSG = L2JModSettings.getProperty("AnnouncePvpMsg", "$killer has defeated $target");
+					
 				}
 				catch (Exception e)
 				{

+ 34 - 0
L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -36,6 +36,7 @@ import javolution.util.FastMap;
 
 import com.l2jserver.Config;
 import com.l2jserver.L2DatabaseFactory;
+import com.l2jserver.gameserver.Announcements;
 import com.l2jserver.gameserver.GameTimeController;
 import com.l2jserver.gameserver.GeoData;
 import com.l2jserver.gameserver.GmListTable;
@@ -2246,6 +2247,9 @@ public final class L2PcInstance extends L2Playable
 
 	public void refreshExpertisePenalty()
 	{
+		if (!Config.EXPERTISE_PENALTY)
+			return;
+		
 		int armorPenalty = 0;
 		int weaponPenalty = 0;
 		
@@ -5446,6 +5450,36 @@ public final class L2PcInstance extends L2Playable
 				pk.kills.add(getName());
 			}
 			
+			//announce pvp/pk
+			if (Config.ANNOUNCE_PK_PVP && pk != null && !pk.isGM())
+			{
+				String msg = "";
+				if (getPvpFlag() == 0)
+				{
+					msg = Config.ANNOUNCE_PK_MSG.replace("$killer", pk.getName()).replace("$target", getName());
+					if (Config.ANNOUNCE_PK_PVP_NORMAL_MESSAGE)
+					{
+						SystemMessage sm = new SystemMessage(SystemMessageId.S1);
+						sm.addString(msg);
+						Announcements.getInstance().announceToAll(sm);
+					}
+					else	
+						Announcements.getInstance().announceToAll(msg);
+				}
+				else if (getPvpFlag() != 0)
+				{
+					msg = Config.ANNOUNCE_PVP_MSG.replace("$killer", pk.getName()).replace("$target", getName());
+					if (Config.ANNOUNCE_PK_PVP_NORMAL_MESSAGE)
+					{
+						SystemMessage sm = new SystemMessage(SystemMessageId.S1);
+						sm.addString(msg);
+						Announcements.getInstance().announceToAll(sm);
+					}
+					else
+						Announcements.getInstance().announceToAll(msg);
+				}
+			}
+			
 			// Clear resurrect xp calculation
 			setExpBeforeDeath(0);
 			

+ 11 - 1
L2_GameServer/java/config/Character.properties

@@ -622,4 +622,14 @@ PartyXpCutoffPercent = 3.0
 
 # This option takes effect when "level" method is chosen. Don't use low values for this!
 # Default: 30
-PartyXpCutoffLevel = 30
+PartyXpCutoffLevel = 30
+
+# Disable tutorial on new player enter into Game
+# Please remember its sometimes important to novice players
+# Default: False
+DisableTutorial = False
+
+# Expertise penalty
+# If disabled, player will not recieve penalty for equip higher grade items
+# Default: True
+ExpertisePenalty = True

+ 19 - 1
L2_GameServer/java/config/l2jmods.properties

@@ -287,4 +287,22 @@ AntiFeedDisconnectedAsDualbox = True
 # and clan reputation will not be transferred.
 # Setting to 0 will disable this feature.
 # Default: 120 seconds.
-AntiFeedInterval = 120
+AntiFeedInterval = 120
+
+# ---------------------------------------------------------------------------
+# Pvp/pk Announce
+# ---------------------------------------------------------------------------
+# Default: False
+AnnouncePkPvP = False
+
+# Announce this as normal system message
+# Default: True
+AnnouncePkPvPNormalMessage = True
+
+# PK message template
+# variables: $killer, $target
+AnnouncePkMsg = $killer has slaughtered $target
+
+# Pvp message template
+# variables: $killer, $target
+AnnouncePvpMsg = $killer has defeated $target