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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..