Hey, since the explosion effect is one of the nicest things in game and we barely have it triggered, please consider implementing the SD break effect directly on the server instead of relying on the client to detect when SD reaches 0 from the damage packet.
The behavior should be based on detecting the exact transition:
Old SD > 0 → New SD = 0
The important part is to detect this before subtracting the SD damage.
Suggested logic:
int oldSD = victim->SD;
int sdDamage = CalculateSDDamage(...);
bool shieldBroken =
oldSD > 0 &&
sdDamage >= oldSD;
if (sdDamage > oldSD) { sdDamage = oldSD; }
if (shieldBroken && !IsChaosCastle(victim))
{
SendEffect(victim, 17);
}
victim->SD -= sdDamage;
Then continue sending the normal damage packet with the resulting HP/SD values.
So the client receives two separate things:
Effect 17 = SD has just been broken SD = 0 = normal updated shield state
Important requirements:
Check oldSD > 0 && sdDamage >= oldSD before modifying SD.
Use >= / <= logic so an exact 100 SD - 100 damage = 0 also triggers.
Explicitly send MU effect 17 when the shield breaks.
Do not keep a permanent shieldBroken flag.
Once SD regenerates above 0, the effect automatically becomes eligible to trigger again on the next break.
Prefer sending the effect to both the victim and players in its viewport, matching the normal MU effect packet behavior.
Exclude Chaos Castle from effect 17.
Expected behavior:
500 → 300 SD no effect 300 → 120 SD no effect 120 → 0 SD Effect 17 0 → 0 SD no effect SD regenerates to 100 100 → 40 SD no effect 40 → 0 SD Effect 17 again
The main goal is to make SD breaking an explicit server event, instead of expecting the client to infer the animation/effect only because the damage packet reports SD = 0.
Edited by johnnyssk

Recommended Comments