You'll probably have to adapt them to your source, because it's an outdated diff, but I hope it serves as a guide.
### Eclipse Workspace Patch 1.0
#P L2J_Mobius_CT_0_Interlude
Index: java/org/l2jmobius/gameserver/model/EffectList.java
===================================================================
--- java/org/l2jmobius/gameserver/model/EffectList.java (revision )
+++ java/org/l2jmobius/gameserver/model/EffectList.java (working copy)
@@ -23,6 +23,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumSet;
+import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -1381,9 +1382,12 @@
final int maxTotalBuffs = _owner.getStat().getMaxBuffCount();
final int maxDances = PlayerConfig.DANCES_MAX_AMOUNT;
final int currentDances = getDanceCount();
- if (((totalBuffs >= maxTotalBuffs) && !skill.isHealingPotionSkill()) || (skill.isDance() && (currentDances >= maxDances)))
+
+ final boolean overBuffCap = (totalBuffs >= maxTotalBuffs) && !skill.isHealingPotionSkill();
+ final boolean overDanceCap = skill.isDance() && (currentDances >= maxDances);
+
+ if (overBuffCap || overDanceCap)
{
- // New list counting buff and dances/song all together.
final List<BuffInfo> allEffects = new ArrayList<>();
allEffects.addAll(_buffs);
allEffects.addAll(_dances);
@@ -1391,18 +1395,16 @@
BuffInfo toRemove = null;
for (BuffInfo buffInfo : allEffects)
{
- if (!buffInfo.isInUse())
+ if ((buffInfo == null) || !buffInfo.isInUse())
{
continue;
}
- // Check if limit of dance/song is exceeded.
- if (skill.isDance() && (currentDances >= maxDances) && !buffInfo.getSkill().isDance())
+ if (overDanceCap && !buffInfo.getSkill().isDance())
{
continue;
}
- // Check the oldest buff to be removed.
if ((toRemove == null) || (buffInfo.getPeriodStartTicks() < toRemove.getPeriodStartTicks()))
{
toRemove = buffInfo;
@@ -1482,29 +1484,112 @@
ps = new PartySpelled(_owner);
}
- // Buffs.
- if (hasBuffs())
+ // Fifo System Buffs
+ final Iterator<BuffInfo> buffIt = hasBuffs() ? _buffs.iterator() : null;
+ final Iterator<BuffInfo> danceIt = hasDances() ? _dances.iterator() : null;
+
+ BuffInfo nextBuff = null;
+ BuffInfo nextDance = null;
+
+ // Has Buff
+ if (buffIt != null)
{
- for (BuffInfo info : _buffs)
+ while (buffIt.hasNext())
{
+ final BuffInfo info = buffIt.next();
+ if ((info == null) || !info.isInUse())
+ {
+ continue;
+ }
+
if (info.getSkill().isHealingPotionSkill())
{
shortBuffStatusUpdate(info);
+ continue;
}
- else
+
+ nextBuff = info;
+ break;
+ }
+ }
+
+ // Has Dance
+ if (danceIt != null)
+ {
+ while (danceIt.hasNext())
+ {
+ final BuffInfo info = danceIt.next();
+ if ((info == null) || !info.isInUse())
{
- addIcon(info, asu, ps, os, isSummon);
+ continue;
}
+
+ nextDance = info;
+ break;
}
}
- // Songs and dances.
- if (hasDances())
+ while ((nextBuff != null) || (nextDance != null))
{
- for (BuffInfo info : _dances)
+ final boolean useBuff;
+ if (nextDance == null)
{
- addIcon(info, asu, ps, os, isSummon);
+ useBuff = true;
}
+ else if (nextBuff == null)
+ {
+ useBuff = false;
+ }
+ else
+ {
+ useBuff = nextBuff.getPeriodStartTicks() <= nextDance.getPeriodStartTicks();
+ }
+
+ final BuffInfo current = useBuff ? nextBuff : nextDance;
+ addIcon(current, asu, ps, os, isSummon);
+
+ if (useBuff)
+ {
+ nextBuff = null;
+ if (buffIt != null)
+ {
+ while (buffIt.hasNext())
+ {
+ final BuffInfo info = buffIt.next();
+ if ((info == null) || !info.isInUse())
+ {
+ continue;
+ }
+
+ if (info.getSkill().isHealingPotionSkill())
+ {
+ shortBuffStatusUpdate(info);
+ continue;
+ }
+
+ nextBuff = info;
+ break;
+ }
+ }
+ }
+ else
+ {
+ nextDance = null;
+ if (danceIt != null)
+ {
+ while (danceIt.hasNext())
+ {
+ final BuffInfo info = danceIt.next();
+ if ((info == null) || !info.isInUse())
+ {
+ continue;
+ }
+
+ nextDance = info;
+ break;
+ }
+ }
+ }
}
// Toggles.
Maybe that will help you, check it out if it works for you
or
### Eclipse Workspace Patch 1.0
#P L2J_Mobius_CT_0_Interlude
Index: dist/game/config/Player.ini
===================================================================
--- dist/game/config/Player.ini (revision 19136)
+++ dist/game/config/Player.ini (working copy)
@@ -106,9 +106,10 @@
# Maximum number of buffs and songs/dances.
# Remember that Divine Inspiration will give players 4 additional buff slots on top of the number specified in "maxbuffamount".
# Default: 20, 12
-MaxBuffAmount = 20
-MaxDanceAmount = 12
+# MaxDanceAmount = 12
+MaxBuffAmount = 32
+
# Allow players to cancel dances/songs via Alt+click on buff icon
# Default: False
DanceCancelBuff = False
Index: java/org/l2jmobius/gameserver/model/actor/instance/SchemeBuffer.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/instance/SchemeBuffer.java (revision 19136)
+++ java/org/l2jmobius/gameserver/model/actor/instance/SchemeBuffer.java (working copy)
@@ -154,9 +154,9 @@
{
player.sendMessage("This scheme has reached the maximum amount of buffs.");
}
- else if (isDanceOrSong && (currentDanceSongCount >= PlayerConfig.DANCES_MAX_AMOUNT))
+ else if (isDanceOrSong && (currentDanceSongCount >= PlayerConfig.BUFFS_MAX_AMOUNT))
{
- player.sendMessage("You cannot add more than " + PlayerConfig.DANCES_MAX_AMOUNT + " songs/dances to this scheme.");
+ player.sendMessage("You cannot add more than " + PlayerConfig.BUFFS_MAX_AMOUNT + " songs/dances to this scheme.");
}
else
{
Index: java/org/l2jmobius/gameserver/config/PlayerConfig.java
===================================================================
--- java/org/l2jmobius/gameserver/config/PlayerConfig.java (revision 19136)
+++ java/org/l2jmobius/gameserver/config/PlayerConfig.java (working copy)
@@ -65,7 +65,7 @@
public static boolean SHOW_EFFECT_MESSAGES_ON_LOGIN;
public static boolean AUTO_LOOT_HERBS;
public static byte BUFFS_MAX_AMOUNT;
- public static byte DANCES_MAX_AMOUNT;
+ // public static byte DANCES_MAX_AMOUNT;
public static boolean DANCE_CANCEL_BUFF;
public static boolean DANCE_CONSUME_ADDITIONAL_MP;
public static boolean ALT_STORE_DANCES;
@@ -305,7 +305,7 @@
SHOW_EFFECT_MESSAGES_ON_LOGIN = config.getBoolean("ShowEffectMessagesOnLogin", false);
AUTO_LOOT_HERBS = config.getBoolean("AutoLootHerbs", false);
BUFFS_MAX_AMOUNT = config.getByte("MaxBuffAmount", (byte) 20);
- DANCES_MAX_AMOUNT = config.getByte("MaxDanceAmount", (byte) 12);
+ // DANCES_MAX_AMOUNT = config.getByte("MaxDanceAmount", (byte) 12);
DANCE_CANCEL_BUFF = config.getBoolean("DanceCancelBuff", false);
DANCE_CONSUME_ADDITIONAL_MP = config.getBoolean("DanceConsumeAdditionalMP", true);
ALT_STORE_DANCES = config.getBoolean("AltStoreDances", false);
Index: java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java (revision 19136)
+++ java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java (working copy)
@@ -324,6 +324,25 @@
}
@Override
+ public int getMaxBuffCount()
+ {
+ int max = PlayerConfig.BUFFS_MAX_AMOUNT;
+
+ final Player player = getActiveChar();
+ if (player != null)
+ {
+ final int diLevel = player.getSkillLevel(1405);
+
+ if (diLevel > 0)
+ {
+ // 1 slot extra por nivel, máximo 4.
+ max += Math.min(diLevel, 4);
+ }
+ }
+ return max;
+ }
+
+ @Override
public long getExp()
{
final Player player = getActiveChar();
Index: java/org/l2jmobius/gameserver/model/EffectList.java
===================================================================
--- java/org/l2jmobius/gameserver/model/EffectList.java (revision )
+++ java/org/l2jmobius/gameserver/model/EffectList.java (working copy)
@@ -23,6 +23,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumSet;
+import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -37,7 +38,6 @@
import java.util.logging.Logger;
import org.l2jmobius.commons.threads.ThreadPool;
-import org.l2jmobius.gameserver.config.PlayerConfig;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
@@ -1379,11 +1379,9 @@
{
final int totalBuffs = getBuffCount() + getDanceCount();
final int maxTotalBuffs = _owner.getStat().getMaxBuffCount();
- final int maxDances = PlayerConfig.DANCES_MAX_AMOUNT;
- final int currentDances = getDanceCount();
- if (((totalBuffs >= maxTotalBuffs) && !skill.isHealingPotionSkill()) || (skill.isDance() && (currentDances >= maxDances)))
+
+ if ((totalBuffs >= maxTotalBuffs) && !skill.isHealingPotionSkill())
{
- // New list counting buff and dances/song all together.
final List<BuffInfo> allEffects = new ArrayList<>();
allEffects.addAll(_buffs);
allEffects.addAll(_dances);
@@ -1391,18 +1389,11 @@
BuffInfo toRemove = null;
for (BuffInfo buffInfo : allEffects)
{
- if (!buffInfo.isInUse())
+ if ((buffInfo == null) || !buffInfo.isInUse())
{
continue;
}
- // Check if limit of dance/song is exceeded.
- if (skill.isDance() && (currentDances >= maxDances) && !buffInfo.getSkill().isDance())
- {
- continue;
- }
-
- // Check the oldest buff to be removed.
if ((toRemove == null) || (buffInfo.getPeriodStartTicks() < toRemove.getPeriodStartTicks()))
{
toRemove = buffInfo;
@@ -1482,29 +1473,109 @@
ps = new PartySpelled(_owner);
}
- // Buffs.
- if (hasBuffs())
+ final Iterator<BuffInfo> buffIt = hasBuffs() ? _buffs.iterator() : null;
+ final Iterator<BuffInfo> danceIt = hasDances() ? _dances.iterator() : null;
+
+ BuffInfo nextBuff = null;
+ BuffInfo nextDance = null;
+
+ if (buffIt != null)
{
- for (BuffInfo info : _buffs)
+ while (buffIt.hasNext())
{
+ final BuffInfo info = buffIt.next();
+ if ((info == null) || !info.isInUse())
+ {
+ continue;
+ }
+
if (info.getSkill().isHealingPotionSkill())
{
shortBuffStatusUpdate(info);
+ continue;
}
- else
+
+ nextBuff = info;
+ break;
+ }
+ }
+
+ if (danceIt != null)
+ {
+ while (danceIt.hasNext())
+ {
+ final BuffInfo info = danceIt.next();
+ if ((info == null) || !info.isInUse())
{
- addIcon(info, asu, ps, os, isSummon);
+ continue;
}
+
+ nextDance = info;
+ break;
}
}
- // Songs and dances.
- if (hasDances())
+ while ((nextBuff != null) || (nextDance != null))
{
- for (BuffInfo info : _dances)
+ final boolean useBuff;
+ if (nextDance == null)
{
- addIcon(info, asu, ps, os, isSummon);
+ useBuff = true;
}
+ else if (nextBuff == null)
+ {
+ useBuff = false;
+ }
+ else
+ {
+ useBuff = nextBuff.getPeriodStartTicks() <= nextDance.getPeriodStartTicks();
+ }
+
+ final BuffInfo current = useBuff ? nextBuff : nextDance;
+ addIcon(current, asu, ps, os, isSummon);
+
+ if (useBuff)
+ {
+ nextBuff = null;
+ if (buffIt != null)
+ {
+ while (buffIt.hasNext())
+ {
+ final BuffInfo info = buffIt.next();
+ if ((info == null) || !info.isInUse())
+ {
+ continue;
+ }
+
+ if (info.getSkill().isHealingPotionSkill())
+ {
+ shortBuffStatusUpdate(info);
+ continue;
+ }
+
+ nextBuff = info;
+ break;
+ }
+ }
+ }
+ else
+ {
+ nextDance = null;
+ if (danceIt != null)
+ {
+ while (danceIt.hasNext())
+ {
+ final BuffInfo info = danceIt.next();
+ if ((info == null) || !info.isInUse())
+ {
+ continue;
+ }
+
+ nextDance = info;
+ break;
+ }
+ }
+ }
}
// Toggles.