Serious debuff issue.

Issue #24 open
Sahar Atias created an issue

There's a bug atm on l2jserver that if a player debuffs target multiple times that has traits (for example - tribunal) at some point onExit() would be called more than once, this results in traits becoming stronger and stronger the more it happens until the player actually becomes immune

I applied this temp fix which worked so far, but you should seriously consider reworking that crap, it can easly be tested logging traitsCount and traits values.

diff --git a/dist/game/data/scripts/handlers/effecthandlers/AttackTrait.java b/dist/game/data/scripts/handlers/effecthandlers/AttackTrait.java
index 9b11e47..e7c05ca 100644
--- a/dist/game/data/scripts/handlers/effecthandlers/AttackTrait.java
+++ b/dist/game/data/scripts/handlers/effecthandlers/AttackTrait.java
@@ -61,6 +61,11 @@
        {
            for (Entry<TraitType, Float> trait : _attackTraits.entrySet())
            {
+               if (charStat.getAttackTraitsCount()[trait.getKey().getId()] == 0)
+               {
+                   return;
+               }
+               
                charStat.getAttackTraits()[trait.getKey().getId()] /= trait.getValue();
                charStat.getAttackTraitsCount()[trait.getKey().getId()]--;
            }
diff --git a/dist/game/data/scripts/handlers/effecthandlers/DefenceTrait.java b/dist/game/data/scripts/handlers/effecthandlers/DefenceTrait.java
index 1ecf197..5b5443b 100644
--- a/dist/game/data/scripts/handlers/effecthandlers/DefenceTrait.java
+++ b/dist/game/data/scripts/handlers/effecthandlers/DefenceTrait.java
@@ -80,11 +80,21 @@
            {
                if (trait.getValue() < 2.0f)
                {
+                   if (charStat.getDefenceTraitsCount()[trait.getKey().getId()] == 0)
+                   {
+                       return;
+                   }
+                   
                    charStat.getDefenceTraits()[trait.getKey().getId()] /= trait.getValue();
                    charStat.getDefenceTraitsCount()[trait.getKey().getId()]--;
                }
                else
                {
+                   if (charStat.getTraitsInvul()[trait.getKey().getId()] == 0)
+                   {
+                       return;
+                   }
+                   
                    charStat.getTraitsInvul()[trait.getKey().getId()]--;
                }
            }

Comments (31)

  1. FinalDestination

    patch fix:

    @@ -1430,7 +1430,7 @@ public void add(BuffInfo info)
            // Where new buff should be placed
            if (skill.getAbnormalType().isNone())
            {
    -           stopSkillEffects(false, skill);
    +           stopSkillEffects(true, skill);
            }
            // Verify stacked skills.
            else
     @@ -1460,7 +1460,7 @@ public void add(BuffInfo info)
                        {
                            if (stackedInfo.getSkill().isAbnormalInstant())
                            {
    -                           stopSkillEffects(false, skill.getAbnormalType());
    +                           stopSkillEffects(true, skill.getAbnormalType());
                                stackedInfo = _stackedEffects.get(skill.getAbnormalType());
                            }
    
     @@ -1477,9 +1477,9 @@ public void add(BuffInfo info)
                        {
                            if (stackedInfo.getSkill().isAbnormalInstant())
                            {
    -                           stopSkillEffects(false, skill.getAbnormalType());
    +                           stopSkillEffects(true, skill.getAbnormalType());
                            }
    -                       stopSkillEffects(false, skill.getAbnormalType());
    +                       stopSkillEffects(true, skill.getAbnormalType());
                        }
                    }
    
  2. ShinichiYao

    Trigger skills triggered and disappear if you have lot of trigger skill triggered at same time especially using pole hitting mobs.

  3. Sahar Atias reporter

    Yup, you gave @FinalDestination to test one thing and then you commit a different thing. Tribunal isn't a passive skill and therefore i'm pretty sure this issue still exists.

  4. Maneco2

    Look this debuff poison in dragon valley center, more doubles and client crashes is not remove debuff fast...

  5. Log in to comment