L2JMobius

Public Development => General Discussion => Topic started by: lineage2noobwars on February 15, 2025, 07:59:29 PM

Title: Buff limitation
Post by: lineage2noobwars on February 15, 2025, 07:59:29 PM
i am tring have a llimitition for buff be 20 with song and dances i found that i need change the effelist.java but when i change it  event a bit and try to build it agian i get errors there any other way without edit a source to make buff and song have same limit?
Title: Re: Buff limitation
Post by: BazookaRpm on February 15, 2025, 08:33:15 PM
The aforementioned topic talks about the same thing, in fact it is almost a duplicate post.

https://l2jmobius.org/forum/index.php?topic=12932.0

Title: Re: Buff limitation
Post by: lineage2noobwars on February 15, 2025, 09:30:43 PM
The aforementioned topic talks about the same thing, in fact it is almost a duplicate post.

https://l2jmobius.org/forum/index.php?topic=12932.0
i tried it but i cant compilete it alway keep say errors
Title: Re: Buff limitation
Post by: Mobius on February 15, 2025, 10:38:19 PM
Try this.
Code: (diff) [Select]
Index: java/org/l2jmobius/gameserver/network/serverpackets/PartySpelled.java
===================================================================
--- java/org/l2jmobius/gameserver/network/serverpackets/PartySpelled.java (revision 17216)
+++ java/org/l2jmobius/gameserver/network/serverpackets/PartySpelled.java (working copy)
@@ -50,9 +50,22 @@
  ServerPackets.PARTY_SPELLED.writeId(this, buffer);
  buffer.writeInt(_creature.isServitor() ? 2 : _creature.isPet() ? 1 : 0);
  buffer.writeInt(_creature.getObjectId());
- buffer.writeInt(_effects.size());
- for (BuffInfo info : _effects)
+ // C4 does not support more than 20 effects in party window, so limiting them makes no difference.
+ // This check ignores first effects, so there is space for last effects to be viewable by party members.
+ // It may also help healers be aware of cursed members.
+ int size = 0;
+ if (_effects.size() > 20)
  {
+ buffer.writeInt(20);
+ size = _effects.size() - 20;
+ }
+ else
+ {
+ buffer.writeInt(_effects.size());
+ }
+ for (; size < _effects.size(); size++)
+ {
+ final BuffInfo info = _effects.get(size);
  if ((info != null) && info.isInUse())
  {
  buffer.writeInt(info.getSkill().getDisplayId());
Title: Re: Buff limitation
Post by: lineage2noobwars on February 15, 2025, 11:51:22 PM
ok ty mobius
Title: Re: Buff limitation
Post by: lineage2noobwars on February 16, 2025, 12:59:41 AM
Try this.
Code: (diff) [Select]
Index: java/org/l2jmobius/gameserver/network/serverpackets/PartySpelled.java
===================================================================
--- java/org/l2jmobius/gameserver/network/serverpackets/PartySpelled.java (revision 17216)
+++ java/org/l2jmobius/gameserver/network/serverpackets/PartySpelled.java (working copy)
@@ -50,9 +50,22 @@
  ServerPackets.PARTY_SPELLED.writeId(this, buffer);
  buffer.writeInt(_creature.isServitor() ? 2 : _creature.isPet() ? 1 : 0);
  buffer.writeInt(_creature.getObjectId());
- buffer.writeInt(_effects.size());
- for (BuffInfo info : _effects)
+ // C4 does not support more than 20 effects in party window, so limiting them makes no difference.
+ // This check ignores first effects, so there is space for last effects to be viewable by party members.
+ // It may also help healers be aware of cursed members.
+ int size = 0;
+ if (_effects.size() > 20)
  {
+ buffer.writeInt(20);
+ size = _effects.size() - 20;
+ }
+ else
+ {
+ buffer.writeInt(_effects.size());
+ }
+ for (; size < _effects.size(); size++)
+ {
+ final BuffInfo info = _effects.get(size);
  if ((info != null) && info.isInUse())
  {
  buffer.writeInt(info.getSkill().getDisplayId());
i get this from copy this  [javac] C:\Users\dimos\git\l2j_mobius\L2J_Mobius_CT_0_Interlude\java\org\l2jmobius\gameserver\network\serverpackets\PartySpelled.java:51: error: variable declaration not allowed here
    [javac]          int size = 0;
Title: Re: Buff limitation
Post by: Mobius on February 16, 2025, 03:02:35 AM
Works fine for me...
No warnings...
Title: Re: Buff limitation
Post by: lineage2noobwars on February 16, 2025, 12:07:10 PM
Works fine for me...
No warnings...
i copy paste it and give me that warning its jrd 21 i check the eclipese
Title: Re: Buff limitation
Post by: Mobius on February 16, 2025, 12:29:54 PM
How to create and apply DIFF patches.
https://l2jmobius.org/forum/index.php?topic=896.0
Title: Re: Buff limitation
Post by: lineage2noobwars on February 16, 2025, 12:55:04 PM
How to create and apply DIFF patches.
https://l2jmobius.org/forum/index.php?topic=896.0
i did that
Title: Re: Buff limitation
Post by: lineage2noobwars on February 16, 2025, 02:32:09 PM
Code: [Select]
package org.l2jmobius.gameserver.network.serverpackets;

import java.util.ArrayList;
import java.util.List;

import org.l2jmobius.commons.network.WritableBuffer;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.skill.BuffInfo;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.ServerPackets;

public class PartySpelled extends ServerPacket
{
private final List<BuffInfo> _effects = new ArrayList<>();
private final Creature _creature;

public PartySpelled(Creature creature)
{
_creature = creature;
}

public void addSkill(BuffInfo info)
{
_effects.add(info);
}

[member=79]override[/member]
public void writeImpl(GameClient client, WritableBuffer buffer)
{
ServerPackets.PARTY_SPELLED.writeId(this, buffer);
buffer.writeInt(_creature.isServitor() ? 2 : _creature.isPet() ? 1 : 0);
buffer.writeInt(_creature.getObjectId());
buffer.writeInt(_effects.size());
for (BuffInfo info : _effects)
int size = 0;
if (_effects.size() > 20)
{
buffer.writeInt(20);
size = _effects.size() - 20;
}
else
{
buffer.writeInt(_effects.size());
}
for (; size < _effects.size(); size++)

{
final BuffInfo info = _effects.get(size);
if ((info != null) && info.isInUse())
{
buffer.writeInt(info.getSkill().getDisplayId());
buffer.writeShort(info.getSkill().getDisplayLevel());
buffer.writeInt(info.getTime());
}
}
}
}
51: error: variable declaration not allowed here
    [javac]       int size = 0;