L2JMobius

Public Development => General Discussion => Topic started by: dramaa on September 16, 2024, 09:23:32 PM

Title: buff order
Post by: dramaa on September 16, 2024, 09:23:32 PM
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.
Title: Re: buff order
Post by: BazookaRpm on September 17, 2024, 02:40:02 AM
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
Title: Re: buff order
Post by: Mobius on September 17, 2024, 03:03:40 AM
Use //debug packets
to see the related packet for updating the icons when they change.
Title: Re: buff order
Post by: dramaa on September 17, 2024, 09:19:34 AM
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
Title: Re: buff order
Post by: Mobius on September 17, 2024, 10:35:03 AM
to see the related packet for updating the icons when they change.
Title: Re: buff order
Post by: dramaa on September 17, 2024, 12:34:28 PM

at least tell me what's and [c]?
Title: Re: buff order
Post by: Mobius on September 17, 2024, 01:23:43 PM
Code: [Select]
[s] server packet
[c] client packet
Title: Re: buff order
Post by: dramaa on September 28, 2024, 06:53:56 PM
i really need help, if anyone know where i can fix it :/
Title: Re: buff order
Post by: notorionn on September 28, 2024, 09:16:25 PM
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 (https://l2jmobius.org/forum/index.php?topic=8136.msg34971#msg34971)
Title: Re: buff order
Post by: dramaa on September 29, 2024, 01:07:05 PM
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 (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
Title: Re: buff order
Post by: klz on February 11, 2025, 02:48:27 PM
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
Title: Re: buff order
Post by: klz on February 11, 2025, 07:24:02 PM
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)

Title: Re: buff order
Post by: Mobius on February 11, 2025, 07:38:31 PM
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.
Title: Re: buff order
Post by: dramaa on February 12, 2025, 09:11:48 AM
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
Title: Re: buff order
Post by: Naker on February 13, 2025, 01:34:19 PM
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
Title: Re: buff order
Post by: klz on February 14, 2025, 04:14:47 AM
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.

Just checked it, will go with that approach since it seems to be way safer than mine. Thank you!
Title: Re: buff order
Post by: lineage2noobwars on February 15, 2025, 05:55:55 PM
i am tring make buff and song be 20+4 but all i found is on effelist but when i eddit it always have error
Title: Re: buff order
Post by: dramaa on February 20, 2025, 07:09:35 AM
i am tring make buff and song be 20+4 but all i found is on effelist but when i eddit it always have error
game\config\Character.ini
# 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 = 4
Title: Re: buff order
Post by: Naker on February 20, 2025, 09:36:59 PM
game\config\Character.ini
# 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 = 4
20+4 not mean 20 buff 4 dance, song .... lol
Title: Re: buff order
Post by: BazookaRpm on February 20, 2025, 10:52:37 PM
Buff : 20 default +4 adicional ( only Divine inspiración)
Song/dance : 12 default.


if you place 20 buff + 4 dances/song. You can only use 4 dances and songs at most. It will only bring you problems if you don't follow the default settings.