L2JMobius

order of buffs

Ezio · 12 · 226

Offline Ezio

  • Heir
  • **
    • Posts: 28
Good evening, I would like to ask how I can fix the problem with the order of buffs because songs/dances always go to the end.


Online BazookaRpm

  • Count
  • *****
    • Posts: 443
  • Lineage II - lover - Heirophant
You need to edit the source code for what you want, for example, buffs and dances/songs under the FiFo system; that's very easy.

maybe, playerStats,effectList, playerconfig,player.ini

I have some patches you could use as a guide.
Atte BazooKa.RPM

Lineage II Lovers


Offline Ezio

  • Heir
  • **
    • Posts: 28

Online Naker

  • Count
  • *****
    • Posts: 450
  • Coding Dreams
what version? Cuz most sure they are not going to the end just they use other tab so is not a single tab like old times is using separet tab thats way look like going to the end when is not



Online mastermind007

  • Heir
  • **
    • Posts: 20
My guess is to check out the EffectList.Java specifically the

Code: [Select]
private void updateEffectIcons()

From there you can follow the trail.
If it ain't broke, you're not trying hard enough.


Offline dramaa

  • Baron
  • *****
    • Posts: 267
    • L2Equinox
Good evening, I would like to ask how I can fix the problem with the order of buffs because songs/dances always go to the end.

go thru songs/dance and remove those <operateType>A2</operateType>, i dont rememember if normal buffs have this too, if have just remove it from everywhere


Online BazookaRpm

  • Count
  • *****
    • Posts: 443
  • Lineage II - lover - Heirophant
You'll probably have to adapt them to your source, because it's an outdated diff, but I hope it serves as a guide.

Code: [Select]
### 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

Code: [Select]
### 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.
Atte BazooKa.RPM

Lineage II Lovers


Offline dramaa

  • Baron
  • *****
    • Posts: 267
    • L2Equinox
You'll probably have to adapt them to your source, because it's an outdated diff, but I hope it serves as a guide.

Code: [Select]
### 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

Code: [Select]
### 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.

he means something else, buffs are by order, songs/dances are always last or first i don't remember correctly, i had same problem, its jsut operate type things, no need to touch code for that, just my opinion


Online Naker

  • Count
  • *****
    • Posts: 450
  • Coding Dreams
I say on my message and I will say again... You see at the end cuz is going to other bar. 1 bar buff 1 bar song and dance same as debuff have his bar and toogles is not like is going to the end are not on same bar so order is not according to the aplication.


Online BazookaRpm

  • Count
  • *****
    • Posts: 443
  • Lineage II - lover - Heirophant
The good thing is that he can find the best method to get the result he wants, and if it's satisfactory, he'll share it.

:)
Atte BazooKa.RPM

Lineage II Lovers


Offline Ezio

  • Heir
  • **
    • Posts: 28
Thx guys I fix it I change I change XML song/dances  to is magic=1 and work