Share [Share] Remove All Buffs and Effects When Switching Subclasses — No Skill XML Editing

bysouza

Heir
Customer

Lucera2 Classic – Clear All Effects on Subclass Change​

Hello everyone,

I am sharing a custom solution for Lucera2 Classic that removes all active and saved effects whenever a player changes their active subclass.

The Problem​

Lucera2 stores effects separately for each class, similar to how effects are saved during logout.

Because of this, when a player switches back to a previously used class, the server restores the effects that were previously saved for that class.

Using the following option is valid when you only want to prevent a specific skill from being saved:

&lt;set name="isSaveable" val="false"/&gt;<br>
However, this is not practical when the goal is to remove all effects during every subclass change.

It would require editing every skill manually, and it would also affect the skill's normal persistence behavior after logout.

The Solution​

This package uses an independent .ext.jar extension.

It does not replace or modify:

  • server.jar
  • scripts.jar
  • Existing datapack files
The extension listens to Lucera2's native subclass event through:

OnSetActiveSubClassListener<br>
After the native subclass process finishes restoring the effects of the selected class, the extension performs the following actions:

  • Removes all active effects from the character.
  • Deletes saved effects associated with the character's classes.
  • Prevents old effects from returning when switching back to another subclass.
  • Refreshes effect icons and character statistics.
  • Prevents Interface AutoBuff from automatically restoring the previous buff list, when applicable.
  • Preserves saved summon effects.
  • Runs only when an actual active-class change occurs.

Effects Removed​

The cleanup includes:

  • Buffs and debuffs
  • Songs and dances
  • Toggle effects
  • Transformations
  • Skin effects
  • Other effects registered in the character's active effect list
After changing subclass, players can apply new buffs and effects normally.

Configuration​

The entire system can be enabled or disabled through the properties file:

RemoveBuffsOnSubclassChange = true<br>
A short secondary cleanup pass is also available to improve compatibility with other subclass listeners:

PostSwitchCleanupDelayMs = 250<br>
This is not continuous polling.

Only one short delayed cleanup action is created when a subclass change occurs.

Installation​

  1. Stop the GameServer.
  2. Copy the .ext.jar file to the GameServer root directory.
  3. Copy the properties file to:
gameserver/config/custom/<br>
  1. Start the GameServer.
  2. Check the console for the following startup messages:
[SUBCLASS EFFECT CLEAR]<br>
No database installation or schema modification is required.

Important Compatibility Note​

The provided binary was compiled and validated for a specific Lucera2 Classic Protocol 166 / Java 17 revision.

Internal classes, methods, and signatures may differ between Lucera2 revisions.

Before using this extension on another build:

  • Compile the included source against your own server.jar.
  • Validate the listener and referenced methods.
  • Always test the extension on a development server before using it in production.
I hope this helps administrators who need a global subclass effect cleanup solution without manually editing every skill XML.
 

Attachments

If you're giving buffs to the players, what is the reason for removing the buffs when they switch subclasses?
 
If you're giving buffs to the players, what is the reason for removing the buffs when they switch subclasses?
If there weren't a reason for it, so many people wouldn't be looking for something similar; if you're wondering who is looking, just search the forum.
 
If there weren't a reason for it, so many people wouldn't be looking for something similar; if you're wondering who is looking, just search the forum.
I'm asking *you*—the one who shared it. If I had wanted to look it up myself, I would have; I just asked you for the reason.
 
I'm asking *you*—the one who shared it. If I had wanted to look it up myself, I would have; I just asked you for the reason.
Personally, I prefer it working this way; I could list a few reasons why, but that’s beside the point.
 
I'm asking *you*—the one who shared it. If I had wanted to look it up myself, I would have; I just asked you for the reason.
For higher-rate servers, removing all buffs when switching subclasses can provide a cleaner and more balanced experience. Since buffs are usually easy to obtain again through an NPC Buffer or other services, losing them does not create a major inconvenience.
This prevents players from storing different buff combinations on multiple subclasses, avoids old transformations, toggles or skin effects being restored, and ensures that every class change starts from a clean state. It can also encourage players to prepare the correct buff setup for each class, increase the usefulness of buffer services and reduce visual or abnormal-effect synchronization issues.
For low-rate servers, preserving buffs may be more convenient because they can be expensive or difficult to obtain. However, for higher-rate and custom servers, completely clearing effects during a subclass change can be a more predictable and appropriate rule.
 
the idea could actually be meaningful only on a custom server where certain buffs on the buffer NPC are offered for premium tokens and coins aka force the donation to the player if someone ever had this kind of system in his server that offers some "gigamaxed super buffs". But on a retail, i don't think so, i haven't checked it out at all - thanks for the share though
 
Back
Top