Przeglądaj źródła

Separating song/dance count from other buffs. It is configurable, check Characters.properties. Thanks GodKratos

DrHouse 16 lat temu
rodzic
commit
e2b2d11276

+ 5 - 2
L2_GameServer/java/config/Character.properties

@@ -119,9 +119,12 @@ AutoLearnSkills = False
 # Retail: false
 AutoLootHerbs = False
 
-# Maximum number of buffs (default = 20 + 4 with divine inspiration skill)
-# Retail: 20
+# Maximum number of buffs and songs/dances
+# Since Gracia, song and dance count is split from other buffs.
+# (default buffs = 20 + 4 with divine inspiration skill)
+# Retail: 20, 12
 maxbuffamount = 20
+maxdanceamount = 12
 
 # This option allows a player to automatically learn Divine Inspiration.
 # this is not included in AutoLearnSkills above.

+ 3 - 1
L2_GameServer/java/net/sf/l2j/Config.java

@@ -110,6 +110,7 @@ public final class Config
     public static boolean	AUTO_LEARN_SKILLS;
     public static boolean	AUTO_LOOT_HERBS;
     public static byte		BUFFS_MAX_AMOUNT;
+    public static byte		DANCES_MAX_AMOUNT;
     public static boolean	AUTO_LEARN_DIVINE_INSPIRATION;
     public static boolean	ALT_GAME_CANCEL_BOW;
     public static boolean	ALT_GAME_CANCEL_CAST;
@@ -1123,7 +1124,8 @@ public final class Config
                 
                 AUTO_LEARN_SKILLS					= Boolean.parseBoolean(Character.getProperty("AutoLearnSkills", "false"));
                 AUTO_LOOT_HERBS						= Boolean.parseBoolean(Character.getProperty("AutoLootHerbs", "true"));
-                BUFFS_MAX_AMOUNT					= Byte.parseByte(Character.getProperty("maxbuffamount","24"));
+                BUFFS_MAX_AMOUNT					= Byte.parseByte(Character.getProperty("maxbuffamount","20"));
+                DANCES_MAX_AMOUNT					= Byte.parseByte(Character.getProperty("maxdanceamount","12"));
                 AUTO_LEARN_DIVINE_INSPIRATION		= Boolean.parseBoolean(Character.getProperty("AutoLearnDivineInspiration", "false"));
                 ALT_GAME_CANCEL_BOW					= Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
                 ALT_GAME_CANCEL_CAST				= Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || Character.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");

+ 15 - 5
L2_GameServer/java/net/sf/l2j/gameserver/model/CharEffectList.java

@@ -294,8 +294,9 @@ public class CharEffectList
 	 * Removes the first buff of this list.
 	 *
 	 * @param preferSkill If != 0 the given skill Id will be removed instead of the first
+	 * @param danceBuff If true removes song/dance type buff only
 	 */
-	private void removeFirstBuff(int preferSkill)
+	private void removeFirstBuff(int preferSkill, boolean danceBuff)
 	{
 		L2Effect[] effects = getAllEffects();
 		L2Effect removeMe = null;
@@ -303,12 +304,14 @@ public class CharEffectList
 		for (L2Effect e : effects)
 		{
 			if ( e != null &&
-					(e.getSkill().getSkillType() == L2SkillType.BUFF ||
+					(danceBuff && e.getSkill().isDance()) ||
+					(!danceBuff && !e.getSkill().isDance() &&
+					 (e.getSkill().getSkillType() == L2SkillType.BUFF ||
 					 e.getSkill().getSkillType() == L2SkillType.DEBUFF ||
 					 e.getSkill().getSkillType() == L2SkillType.REFLECT ||
 					 e.getSkill().getSkillType() == L2SkillType.HEAL_PERCENT ||
 					 e.getSkill().getSkillType() == L2SkillType.MANAHEAL_PERCENT) &&
-					!(e.getSkill().getId() > 4360  && e.getSkill().getId() < 4367)) // Seven Signs buff
+					!(e.getSkill().getId() > 4360  && e.getSkill().getId() < 4367))) // Seven Signs buff
 			{
 				if (preferSkill == 0) { removeMe = e; break; }
 				else if (e.getSkill().getId() == preferSkill) { removeMe = e; break; }
@@ -445,7 +448,8 @@ public class CharEffectList
                 tempSkill.getSkillType() == L2SkillType.REFLECT ||
                 tempSkill.getSkillType() == L2SkillType.HEAL_PERCENT ||
                 tempSkill.getSkillType() == L2SkillType.MANAHEAL_PERCENT) &&
-                !tempSkill.isDebuff() &&  !(tempSkill.getId() > 4360 && tempSkill.getId() < 4367))
+                !tempSkill.isDebuff() &&  !tempSkill.isDance() &&
+                !(tempSkill.getId() > 4360 && tempSkill.getId() < 4367))
         	)
 			{
 				// if max buffs, no herb effects are used, even if they would replace one old
@@ -454,7 +458,13 @@ public class CharEffectList
 					newEffect.stopEffectTask(); 
 					return; 
 				}
-				removeFirstBuff(tempSkill.getId());
+				removeFirstBuff(tempSkill.getId(), false);
+			}
+
+			// Remove first Song/Dance if number of Song/Dances > getMaxDanceCount()
+			if (tempSkill.isDance() && getDanceCount() >= Config.DANCES_MAX_AMOUNT && !doesStack(tempSkill))
+			{
+				removeFirstBuff(tempSkill.getId(), true);
 			}
 
 			// Add the L2Effect to all effect in progress on the L2Character