فهرست منبع

Another two little custom things for easy server setup:
DisableRaidCurse (default false) and UseDeepBlueDropRulesRaid (default true).
Now you can kill 20lvl RB with 85lvl char without petrification or silence (DisableRaidCurse)
and even get drop (UseDeepBlueDropRulesRaid).
For PvP and enterntainment servers.

_DS_ 16 سال پیش
والد
کامیت
ced02d780b

+ 12 - 1
L2_GameServer/java/config/NPC.properties

@@ -37,6 +37,12 @@ MaxDriftRange = 300
 # Default: True
 UseDeepBlueDropRules = True
 
+# If True, the following deep blue raid bosses drop penalties will be applied:
+#	- When player's level is 9 or greater than raid's level, drops got divided by 3.
+#	- After 9 levels of difference between player and raid, drop chance is lowered by 9% each level that difference increases. (9lvls diff = -9%; 10lvls diff = -18%;)
+# Default: True
+UseDeepBlueDropRulesRaid = True
+
 # Default: False 
 ShowNpcLevel = False
 
@@ -94,4 +100,9 @@ RaidMaxRespawnMultiplier = 1.0
 # Configure the interval at which raid boss minions will re-spawn.
 # This time is in milliseconds, 1 minute is 60000 milliseconds.
 # Default: 300000
-RaidMinionRespawnTime = 300000
+RaidMinionRespawnTime = 300000
+
+# Disable Raid Curse if raid more than 8 levels lower.
+# Caution: drop will be reduced or even absent if DeepBlue drop rules enabled.  
+# Default: False
+DisableRaidCurse = False

+ 4 - 0
L2_GameServer/java/net/sf/l2j/Config.java

@@ -588,6 +588,7 @@ public final class Config
 	public static boolean ALT_GAME_VIEWNPC;
 	public static int MAX_DRIFT_RANGE;
 	public static boolean DEEPBLUE_DROP_RULES;
+	public static boolean DEEPBLUE_DROP_RULES_RAID;
 	public static boolean SHOW_NPC_LVL;
 	public static boolean GUARD_ATTACK_AGGRO_MOB;
 	public static boolean ALLOW_WYVERN_UPGRADER;
@@ -600,6 +601,7 @@ public final class Config
 	public static double RAID_MINION_RESPAWN_TIMER;
 	public static float RAID_MIN_RESPAWN_MULTIPLIER;
 	public static float RAID_MAX_RESPAWN_MULTIPLIER;
+	public static boolean RAID_DISABLE_CURSE;
 	public static int INVENTORY_MAXIMUM_PET;
 
 
@@ -1553,6 +1555,7 @@ public final class Config
 					ALT_GAME_VIEWNPC = Boolean.parseBoolean(NPC.getProperty("AltGameViewNpc", "False"));
 					MAX_DRIFT_RANGE = Integer.parseInt(NPC.getProperty("MaxDriftRange", "300"));
 					DEEPBLUE_DROP_RULES = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRules", "True"));
+					DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRulesRaid", "True"));
 					SHOW_NPC_LVL = Boolean.parseBoolean(NPC.getProperty("ShowNpcLevel", "False"));
 					GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
 					ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
@@ -1569,6 +1572,7 @@ public final class Config
 					RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMinRespawnMultiplier", "1.0"));
 					RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMaxRespawnMultiplier", "1.0"));
 					RAID_MINION_RESPAWN_TIMER = Integer.parseInt(NPC.getProperty("RaidMinionRespawnTime", "300000"));
+					RAID_DISABLE_CURSE = Boolean.parseBoolean(NPC.getProperty("DisableRaidCurse", "False"));
 					INVENTORY_MAXIMUM_PET = Integer.parseInt(NPC.getProperty("MaximumSlotsForPet", "12"));
 				}
 				catch (Exception e)

+ 10 - 5
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/L2Attackable.java

@@ -1043,7 +1043,8 @@ public class L2Attackable extends L2Npc
 
 		int deepBlueDrop = 1;
 
-		if (Config.DEEPBLUE_DROP_RULES)
+		if ((!isRaid() && Config.DEEPBLUE_DROP_RULES)
+				|| (isRaid() && Config.DEEPBLUE_DROP_RULES_RAID))
 		{
 			if (levelModifier > 0)
 			{
@@ -1060,7 +1061,8 @@ public class L2Attackable extends L2Npc
 			deepBlueDrop = 1;
 
 		// Check if we should apply our maths so deep blue mobs will not drop that easy
-		if (Config.DEEPBLUE_DROP_RULES)
+		if ((!isRaid() && Config.DEEPBLUE_DROP_RULES)
+				|| (isRaid() && Config.DEEPBLUE_DROP_RULES_RAID))
 			dropChance = ((drop.getChance() - ((drop.getChance() * levelModifier)/100)) / deepBlueDrop);
 
 		// Applies Drop rates
@@ -1149,7 +1151,8 @@ public class L2Attackable extends L2Npc
 
 		int deepBlueDrop = 1;
 
-		if (Config.DEEPBLUE_DROP_RULES)
+		if ((!isRaid() && Config.DEEPBLUE_DROP_RULES)
+				|| (isRaid() && Config.DEEPBLUE_DROP_RULES_RAID))
 		{
 			// We should multiply by the server's drop rate, so we always get a low chance of drop for deep blue mobs.
 			// NOTE: This is valid only for adena drops! Others drops will still obey server's rate
@@ -1162,7 +1165,8 @@ public class L2Attackable extends L2Npc
 			deepBlueDrop = 1;
 
 		// Check if we should apply our maths so deep blue mobs will not drop that easy
-		if (Config.DEEPBLUE_DROP_RULES)
+		if ((!isRaid() && Config.DEEPBLUE_DROP_RULES)
+				|| (isRaid() && Config.DEEPBLUE_DROP_RULES_RAID))
 			categoryDropChance = ((categoryDropChance - ((categoryDropChance * levelModifier)/100)) / deepBlueDrop);
 
 		// Applies Drop rates
@@ -1273,7 +1277,8 @@ public class L2Attackable extends L2Npc
 	 */
 	private int calculateLevelModifierForDrop(L2PcInstance lastAttacker)
 	{
-		if (Config.DEEPBLUE_DROP_RULES)
+		if ((!isRaid() && Config.DEEPBLUE_DROP_RULES)
+				|| (isRaid() && Config.DEEPBLUE_DROP_RULES_RAID))
 		{
 			int highestLevel = lastAttacker.getLevel();
 

+ 5 - 9
L2_GameServer/java/net/sf/l2j/gameserver/model/actor/L2Character.java

@@ -5160,13 +5160,9 @@ public abstract class L2Character extends L2Object
 			// Check Raidboss attack
 			// Character will be petrified if attacking a raid that's more
 			// than 8 levels lower
-			if (target.isRaid())
+			if (target.isRaid() && !Config.RAID_DISABLE_CURSE && getActingPlayer() != null)
 			{
-				int level = 0;
-				if (this instanceof L2PcInstance)
-					level = getLevel();
-				else if (this instanceof L2Summon)
-					level = ((L2Summon)this).getOwner().getLevel();
+				int level = getActingPlayer().getLevel();
 
 				if (level > target.getLevel() + 8)
 				{
@@ -6379,8 +6375,8 @@ public abstract class L2Character extends L2Object
 						targetsAttackTarget = target.getAI().getAttackTarget();
 						targetsCastTarget = target.getAI().getCastTarget();
 					}
-					if (
-							(target.isRaid() && getLevel() > target.getLevel() + 8)
+					if (!Config.RAID_DISABLE_CURSE
+							&& ((target.isRaid() && getLevel() > target.getLevel() + 8)
 							||
 							(!skill.isOffensive() && targetsAttackTarget != null && targetsAttackTarget.isRaid() 
 									&& targetsAttackTarget.getAttackByList().contains(target) // has attacked raid
@@ -6388,7 +6384,7 @@ public abstract class L2Character extends L2Object
 							||
 							(!skill.isOffensive() && targetsCastTarget != null && targetsCastTarget.isRaid() 
 									&& targetsCastTarget.getAttackByList().contains(target) // has attacked raid
-									&& getLevel() > targetsCastTarget.getLevel() + 8)
+									&& getLevel() > targetsCastTarget.getLevel() + 8))
 					)
 					{
 						if (skill.isMagic())