L2JMobius

Interlude buff order

dramaa · 20 · 5435

Online dramaa

  • Baron
  • *****
    • Posts: 267
    • L2Equinox
can you please tell me where to find buff order? songs and dances are always last in buffs list, i want to have it simple order, last use stays last.


Online BazookaRpm

  • Count
  • *****
    • Posts: 444
  • Lineage II - lover - Heirophant
Hello colleague, I see that you are working on the CT0 interlude version, I am also working on that version, I don't know if we can exchange information or help, I think you may know things that maybe I don't know or vice versa, greetings
Atte BazooKa.RPM

Lineage II Lovers


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19656
Use //debug packets
to see the related packet for updating the icons when they change.


Online dramaa

  • Baron
  • *****
    • Posts: 267
    • L2Equinox
Use //debug packets
to see the related packet for updating the icons when they change.

i am getting such msgs in console, what to get from this ?
Code: [Select]
[17/09 10:15:18] [C] MoveBackwardToLocation
[17/09 10:15:19] [C] Action
[17/09 10:15:19] [S] MoveToPawn
[17/09 10:15:19] [S] CreatureSay
[17/09 10:15:19] [S] NpcHtmlMessage
[17/09 10:15:19] [S] ActionFailed
[17/09 10:15:19] [S] ActionFailed
[17/09 10:15:20] [C] MoveBackwardToLocation
[17/09 10:15:21] [C] Action
[17/09 10:15:21] [S] MoveToPawn
[17/09 10:15:21] [S] CreatureSay
[17/09 10:15:21] [S] NpcHtmlMessage
[17/09 10:15:21] [S] ActionFailed
[17/09 10:15:21] [S] ActionFailed
[17/09 10:15:25] [C] MoveBackwardToLocation
[17/09 10:15:28] [C] SendBypassBuildCmd
[17/09 10:15:28] [S] CreatureSay
[17/09 10:15:28] [S] NpcHtmlMessage
[17/09 10:15:29] [C] RequestBypassToServer
[17/09 10:15:29] [S] TargetUnselected
[17/09 10:15:29] [S] CreatureSay


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19656


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19656

Online dramaa

  • Baron
  • *****
    • Posts: 267
    • L2Equinox
i really need help, if anyone know where i can fix it :/


Offline notorionn

  • Elder
  • ****
    • Posts: 153

Online dramaa

  • Baron
  • *****
    • Posts: 267
    • L2Equinox
Is it an old post here from the forum similar to what you want to solve?
https://l2jmobius.org/forum/index.php?topic=8136.msg34971#msg34971
not :/ i want to make sure, everyone have same buff sorting in ct0 right? dances and songs are always last in list, no matter when you use them


Offline klz

  • Heir
  • **
    • Posts: 19
not :/ i want to make sure, everyone have same buff sorting in ct0 right? dances and songs are always last in list, no matter when you use them

have you been able to fix this? I'm struggling with the same


Offline klz

  • Heir
  • **
    • Posts: 19
Trying to share something here, looking for advice. I somehow managed to get buffs / dances in stacking order, this is my EffectList.java diff.

The main thing i did was to remove the BuffInfo Queue for _dances and instead treat them as _buffs.

Do you all think this will do the trick or maybe i'm breaking something critical?

Sorry for the code style, i'm particularly noob to java :(

Code: [Select]
diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/EffectList.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/EffectList.java
index c609b64648..47b85572eb 100644
--- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/EffectList.java
+++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/model/EffectList.java
@@ -31,7 +31,6 @@ import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.logging.Logger;
 
-import org.l2jmobius.Config;
 import org.l2jmobius.commons.threads.ThreadPool;
 import org.l2jmobius.gameserver.enums.SkillFinishType;
 import org.l2jmobius.gameserver.model.actor.Creature;
@@ -62,8 +61,6 @@ public class EffectList
  private static final Logger LOGGER = Logger.getLogger(EffectList.class.getName());
  /** Queue containing all effects from buffs for this effect list. */
  private final Queue<BuffInfo> _buffs = new ConcurrentLinkedQueue<>();
- /** Queue containing all dances/songs for this effect list. */
- private final Queue<BuffInfo> _dances = new ConcurrentLinkedQueue<>();
  /** Queue containing all toggle for this effect list. */
  private final Queue<BuffInfo> _toggles = new ConcurrentLinkedQueue<>();
  /** Queue containing all debuffs for this effect list. */
@@ -92,6 +89,7 @@ public class EffectList
  private final AtomicInteger _hiddenBuffs = new AtomicInteger();
  /** Delay task **/
  private ScheduledFuture<?> _updateEffectIconTask;
+ private Queue<BuffInfo> dances;
 
  /**
  * Constructor for effect list.
@@ -117,7 +115,15 @@ public class EffectList
  */
  public Queue<BuffInfo> getDances()
  {
- return _dances;
+ dances = null;
+ _buffs.forEach(_buff ->
+ {
+ if (_buff.getSkill().isDance())
+ {
+ dances.add(_buff);
+ }
+ });
+ return dances;
  }
 
  /**
@@ -164,11 +170,6 @@ public class EffectList
  buffs.addAll(_buffs);
  }
 
- if (hasDances())
- {
- buffs.addAll(_dances);
- }
-
  if (hasToggles())
  {
  buffs.addAll(_toggles);
@@ -203,10 +204,6 @@ public class EffectList
  {
  effects = _debuffs;
  }
- else if (skill.isDance())
- {
- effects = _dances;
- }
  else if (skill.isToggle())
  {
  effects = _toggles;
@@ -244,23 +241,6 @@ public class EffectList
  }
  }
 
- if (hasDances())
- {
- for (BuffInfo info : _dances)
- {
- if (info != null)
- {
- for (AbstractEffect effect : info.getEffects())
- {
- if ((effect != null) && (effect.getEffectType() == type))
- {
- return info;
- }
- }
- }
- }
- }
-
  if (hasToggles())
  {
  for (BuffInfo info : _toggles)
@@ -330,18 +310,6 @@ public class EffectList
  }
  }
 
- if (hasDances() && (info == null))
- {
- for (BuffInfo b : _dances)
- {
- if (b.getSkill().getId() == skillId)
- {
- info = b;
- break;
- }
- }
- }
-
  if (hasToggles() && (info == null))
  {
  for (BuffInfo b : _toggles)
@@ -490,7 +458,15 @@ public class EffectList
  */
  public int getDanceCount()
  {
- return hasDances() ? _dances.size() : 0;
+ int danceCount = 0;
+ for (BuffInfo _buff : _buffs)
+ {
+ if (_buff.getSkill().isDance())
+ {
+ danceCount++;
+ }
+ }
+ return danceCount;
  }
 
  /**
@@ -628,18 +604,6 @@ public class EffectList
  update = true;
  }
 
- if (hasDances())
- {
- for (BuffInfo info : _dances)
- {
- if (!info.getSkill().isStayAfterDeath())
- {
- stopAndRemove(true, info, _dances);
- }
- }
- update = true;
- }
-
  if (hasToggles())
  {
  for (BuffInfo info : _toggles)
@@ -668,10 +632,6 @@ public class EffectList
  {
  stopAndRemove(broadcast, info, _buffs);
  }
- for (BuffInfo info : _dances)
- {
- stopAndRemove(broadcast, info, _dances);
- }
  for (BuffInfo info : _toggles)
  {
  stopAndRemove(broadcast, info, _toggles);
@@ -722,18 +682,6 @@ public class EffectList
  update = true;
  }
 
- if (hasDances())
- {
- for (BuffInfo info : _dances)
- {
- if (!info.getSkill().isStayOnSubclassChange())
- {
- stopAndRemove(true, info, _dances);
- }
- }
- update = true;
- }
-
  if (hasToggles())
  {
  for (BuffInfo info : _toggles)
@@ -799,7 +747,6 @@ public class EffectList
  {
  return;
  }
- _dances.forEach(b -> stopAndRemove(update, b, _dances));
  // Update effect flags and icons.
  updateEffectList(update);
  }
@@ -850,18 +797,6 @@ public class EffectList
  update = true;
  }
 
- if (hasDances())
- {
- for (BuffInfo info : _dances)
- {
- if (info != null)
- {
- action.accept(info);
- }
- }
- update = true;
- }
-
  if (hasToggles())
  {
  for (BuffInfo info : _toggles)
@@ -978,18 +913,6 @@ public class EffectList
  update = true;
  }
 
- if (hasDances())
- {
- for (BuffInfo info : _dances)
- {
- if (info.getSkill().isRemovedOnAnyActionExceptMove())
- {
- stopAndRemove(true, info, _dances);
- }
- }
- update = true;
- }
-
  if (hasToggles())
  {
  for (BuffInfo info : _toggles)
@@ -1028,18 +951,6 @@ public class EffectList
  update = true;
  }
 
- if (hasDances())
- {
- for (BuffInfo info : _dances)
- {
- if ((info != null) && info.getSkill().isRemovedOnDamage())
- {
- stopAndRemove(true, info, _dances);
- }
- }
- update = true;
- }
-
  if (hasToggles())
  {
  for (BuffInfo info : _toggles)
@@ -1109,7 +1020,15 @@ public class EffectList
  */
  public boolean hasDances()
  {
- return !_dances.isEmpty();
+ int danceCount = 0;
+ for (BuffInfo _buff : _buffs)
+ {
+ if (_buff.getSkill().isDance())
+ {
+ danceCount++;
+ }
+ }
+ return !(danceCount == 0);
  }
 
  /**
@@ -1159,14 +1078,6 @@ public class EffectList
  }
  }
 
- if (dances && hasDances())
- {
- for (BuffInfo info : _dances)
- {
- update |= function.apply(info);
- }
- }
-
  if (hasToggles())
  {
  for (BuffInfo info : _toggles)
@@ -1323,11 +1234,9 @@ public class EffectList
  if (!skill.isDebuff() && !skill.isToggle() && !skill.is7Signs() && !doesStack(skill))
  {
  int buffsToRemove = -1;
- if (skill.isDance())
- {
- buffsToRemove = getDanceCount() - Config.DANCES_MAX_AMOUNT;
- }
- else if (!skill.isHealingPotionSkill())
+ /*
+ * if (skill.isDance()) { buffsToRemove = getDanceCount() - Config.DANCES_MAX_AMOUNT; } else
+ */ if (!skill.isHealingPotionSkill())
  {
  buffsToRemove = getBuffCount() - _owner.getStat().getMaxBuffCount();
  }
@@ -1431,15 +1340,6 @@ public class EffectList
  }
  }
 
- // Songs and dances.
- if (hasDances())
- {
- for (BuffInfo info : _dances)
- {
- addIcon(info, asu, ps, psSummon, os, isSummon);
- }
- }
-
  // Toggles.
  if (hasToggles())
  {
@@ -1645,20 +1545,6 @@ public class EffectList
  }
  }
 
- if (hasDances())
- {
- for (BuffInfo info : _dances)
- {
- if (info != null)
- {
- for (AbstractEffect e : info.getEffects())
- {
- flags |= e.getEffectFlags();
- }
- }
- }
- }
-
  if (hasToggles())
  {
  for (BuffInfo info : _toggles)



Online Mobius

  • Distinguished King
  • *****
    • Posts: 19656
I would not touch effect list.
As said above I would check the packets related with showing the icons.

We have done something like that on the C4 branch.


Online dramaa

  • Baron
  • *****
    • Posts: 267
    • L2Equinox
it's kind a old topic, i did fix it without touching java, it has types inside skills, since i dont care this option
buffs - 20
dance/songs - +4
i just simply deleted types inside skills, so they are all random now and order depends which skill you use last


Online Naker

  • Count
  • *****
    • Posts: 450
  • Coding Dreams
it's kind a old topic, i did fix it without touching java, it has types inside skills, since i dont care this option
buffs - 20
dance/songs - +4
i just simply deleted types inside skills, so they are all random now and order depends which skill you use last
But dance and song have special conditions related to the mp consum with this all the logic is missing