Jump to content

Question

Posted (edited)

Hello guys.

 

Need add this part code :

_dispelledCount++;
 			e.exit();
+			
+			if ((getEffected().getActingPlayer() != null) && !getEffected().getActingPlayer().getRemovedBuffs().contains(e) && (_returnTime > 0) && CancelEngineConfigs.ENABLE_CANCEL_SYSTEM)
+			{
+				getEffected().getActingPlayer().addRemovedBuff(e);
+			}
 		}
+		
+		if ((getEffected().getActingPlayer() != null) && (!getEffected().getActingPlayer().getRemovedBuffs().isEmpty()) && (_returnTime > 0) && CancelEngineConfigs.ENABLE_CANCEL_SYSTEM)
+		{
+			getEffected().getActingPlayer()._returnRemovedBuffsTask = ThreadPoolManager.getInstance().scheduleGeneral(new CanceledBuffsReturnTask(getEffected().getActingPlayer(), getEffected().getActingPlayer().getRemovedBuffs()), _returnTime * 1000);
+		}
+		
 		return true;
 	}
 }

In this file:

package handlers.effecthandlers;

import l2r.gameserver.model.actor.L2Character;
import l2r.gameserver.model.effects.EffectTemplate;
import l2r.gameserver.model.effects.L2Effect;
import l2r.gameserver.model.effects.L2EffectType;
import l2r.gameserver.model.stats.Env;

/**
 * @author vGodFather
 */
public class DispelOne extends L2Effect
{
    private final boolean _ordered;
    
    public DispelOne(Env env, EffectTemplate template)
    {
        super(env, template);
        
        _ordered = template.getParameters().getBoolean("ordered", false);
    }
    
    @Override
    public L2EffectType getEffectType()
    {
        return L2EffectType.DISPEL;
    }
    
    @Override
    public boolean isInstant()
    {
        return true;
    }
    
    @Override
    public boolean onStart()
    {
        L2Character target = getEffected();
        if ((target == null) || target.isDead())
        {
            return false;
        }
        
        if (_ordered)
        {
            L2Effect buff = null;
            for (L2Effect e : target.getAllEffects())
            {
                if ((e != null) && !e.getSkill().canBeDispeled() && e.getSkill().isDance())
                {
                    continue;
                }
                buff = e;
                break;
            }
            
            if (buff != null)
            {
                buff.exit();
                return true;
            }
            
            for (L2Effect e : target.getAllEffects())
            {
                if ((e != null) && !e.getSkill().canBeDispeled())
                {
                    continue;
                }
                buff = e;
                break;
            }
            
            if (buff != null)
            {
                buff.exit();
                return true;
            }
        }
        else
        {
            for (L2Effect e : target.getAllEffects())
            {
                if (!e.getSkill().canBeDispeled())
                {
                    continue;
                }
                e.exit();
                break;
            }
        }
        return true;
    }
}

I try to add this piece of code but the crusher insane does not return the buff .

e.exit();
							
							if ((getEffected().getActingPlayer() != null) && !getEffected().getActingPlayer().getRemovedBuffs().contains(e) && (_returnTime > 0) && CancelEngineConfigs.ENABLE_CANCEL_SYSTEM)
							{
								getEffected().getActingPlayer().addRemovedBuff(e);
							}
				break;
			}
						if ((getEffected().getActingPlayer() != null) && (!getEffected().getActingPlayer().getRemovedBuffs().isEmpty()) && (_returnTime > 0) && CancelEngineConfigs.ENABLE_CANCEL_SYSTEM)
						{
							getEffected().getActingPlayer()._returnRemovedBuffsTask = ThreadPoolManager.getInstance().scheduleGeneral(new CanceledBuffsReturnTask(getEffected().getActingPlayer(), getEffected().getActingPlayer().getRemovedBuffs()), _returnTime * 1000);
						}
						
			}
		
		return true;
	}
}

Where should I put that part of the code .

 

 

Thanks

Edited by MaKasTreRo

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...