Jump to content
  • 0

Confusion errors+good implementation but 25353 errors (lf help+guide)


Question

Posted

I cant implement neither dressme, neither cancellation system ,implementing seems easy but, There are errors like these: (a guide or an explanation would help a lot ,best = guide+explanation xD) ,yep i know ,its kinda stupid and long question but not rly ,it could be helpful to many others not just me

 

Example 1:

First part of cancellation system

### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: java/com/l2jserver/gameserver/skills/effects/EffectCancel.java
===================================================================
--- java/com/l2jserver/gameserver/skills/effects/EffectCancel.java	(revision 5615)
+++ java/com/l2jserver/gameserver/skills/effects/EffectCancel.java	(working copy)
@@ -14,6 +14,7 @@
  */
package com.l2jserver.gameserver.skills.effects;

+import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;

 

+ suppose to be *new line* but the normal line doesnt exist either, this create first confusion

 

 

Example 2:

Second confusion, so i am implementing exactly how it shows there yet it shows error [Error: ScheduledFuture cannot be resolved to a type {public static ScheduledFuture<?> _CancelRegTask;}    Whats that suppose to mean? any explanation for newbies like me? xD

	protected static final Logger _log = Logger.getLogger(EffectCancel.class.getName());

public static L2Effect[] giveback;
public static L2PcInstance playah;
public static ScheduledFuture<?> _CancelRegTask;
public static long _cancelLasts = System.currentTimeMillis() + 15000;

	public EffectCancel(Env env, EffectTemplate template)
	{

 

Example 3:

The implementation is just fine but the errors keep showing ,now heres another kind of error:

The method addLastCancelledEffect(L2Effect) is undefined for the type L2Character Oh come on ,whats the problem ,even if i try and implement perfectly how it shows there ,these kind of errors will keep show anywhere ,what im doing wrong here?

 

if (negateAbnormalType.equalsIgnoreCase(eff.getAbnormalType()) && effect.getSkill().getNegateAbnormals().get(negateAbnormalType) >= eff.getAbnormalLvl())
				{
					if (calcCancelSuccess(eff, cancelLvl, (int)rate))
					{
													if(target instanceof L2PcInstance)
														target.addLastCancelledEffect(eff);
						 							eff.exit();
												}
				}
			}
		}
	}

 

Recommended Posts

  • 0
Posted

i know what - means but unfortunately is not like that

If u can wait till tomorrow I can probably make u a guide.

  • 0
Posted

Could you link me to the thread with that code?

 

As for your second error it's because you didn't add this line:

import java.util.concurrent.ScheduledFuture;

 

  • 0
Posted

If u can wait till tomorrow I can probably make u a guide.

 

i am not rushing and thanks :), dedicating time for free is something very few do, this cant be appreciated enough

 

 

Could you link me to the thread with that code?

 

As for your second error it's because you didn't add this line:

import java.util.concurrent.ScheduledFuture;

 

If they show what to implement and where,why they dont add the imports too? and where to add that kind of variables to make import works and etc? ,what am i missing ,i still dont know

  • 0
Posted

i am not rushing and thanks :)

 

 

If they show what to implement and where,why they dont add the imports too? and where to add that kind of variables to make import works and etc? ,what am i missing ,i still dont know

Do you have Teamviewer?

 

I may be able to explain some things to you from there and help you with that code.

  • 0
Posted

Do you have Teamviewer?

 

I may be able to explain some things to you from there and help you with that code.

 

not now cuz im going to sleep :3

BUT yes, that would be very great and helpfull ,tomorrow u can ?

  • 0
Posted

not now cuz im going to sleep :3

BUT yes, that would be very great and helpfull ,tomorrow u can ?

I don't know.

 

If you can wait till tomorrow Wyatt may make a guide so you won't need my help I guess.

 

Anyway, have a nice night.

  • 0
Posted

For example 3, it means what it means, you miss the method declaration. Either the pack the diff has been made had already the method, either it has be renamed on your pack, or w/e. As you can see, you implement a USE of the method. It needs to be declared SOMEWHERE. In that case in L2Character.

 

For example 2, it means, in that case, you miss the import. As it's a basic Java feature, you don't need to make anything but save the file (ctrl+S). It will fix all missing imports. If it was a missing class with a L2 name, either it has been renamed, or you simply miss it.

 

For 1, see 2. You don't need to care about imports at all, saving the file will make the imports. In few cases, it can possibly import the bad one, or you will have to choose between 2 same-looking classes.

 

About your 25351 other errors, gl. If it's in a single file, you probably failed the implementation (missing bracket, etc). If it's in the whole pack, you miss an important library.

 

In case you use basic L2J IL, which by default got 10k+ warning, stop to use it, and use a decent pack.

  • 0
Posted

I am using freya not interlude  :)

 

so ur saying that it auto implements imports? how? ,doesnt seem to auto implement for me

 

EDIT: I wasnt saying about that pack have 2324245 errors but it was a joke number ,i was telling about implementation that shows many errors

  • 0
Posted

apply patch when you need to create new java *dressme  VisualArmor.java  for example right? :)

 

and imports with variable ,ive got that part too now finnaly!

 

now 1 problem left!

Ive come across to error like syntax error but the implementation seems fine ,thats becuz it needs adaption or is bad code? *uhuh im close now*

 

ok ,now im going to try implement cancellation system ,il tell u how it works

  • 0
Posted

I did it at 8am, sleepy mode, but I hope u can get at least 2 or 3 points.

Watch it with HD btw.

 

 

Wyatt ,i am close to understanding ,now tell me something

 

I AM STUCK at half of the implementation ;p ,

 

This is full code

### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: java/com/l2jserver/gameserver/skills/effects/EffectCancel.java
===================================================================
--- java/com/l2jserver/gameserver/skills/effects/EffectCancel.java	(revision 5615)
+++ java/com/l2jserver/gameserver/skills/effects/EffectCancel.java	(working copy)
@@ -14,6 +14,7 @@
  */
package com.l2jserver.gameserver.skills.effects;

+import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;

import com.l2jserver.Config;
@@ -36,6 +37,11 @@
{
	protected static final Logger _log = Logger.getLogger(EffectCancel.class.getName());

+	public static L2Effect[] giveback;
+	public static L2PcInstance playah;
+	public static ScheduledFuture<?> _CancelRegTask;
+	public static long _cancelLasts = System.currentTimeMillis() + 15000;
+	
	public EffectCancel(Env env, EffectTemplate template)
	{
		super(env, template);
@@ -71,14 +77,15 @@
		return false;
	}

-	private static boolean cancel(L2Character caster, L2Character target, L2Effect effect)
+	private static boolean cancel(L2Character caster, final L2Character target, L2Effect effect)
	{
		if (!(target instanceof L2PcInstance)|| target.isDead())
			return false;

+		playah = (L2PcInstance) target;
		final int cancelLvl = effect.getSkill().getMagicLevel();
		int count = effect.getSkill().getMaxNegatedEffects();
-
+		
		double rate = effect.getEffectPower();
		final double vulnModifier = Formulas.calcSkillTypeVulnerability(0, target, effect.getSkillType());
		final double profModifier = Formulas.calcSkillTypeProficiency(0, caster, target, effect.getSkillType());
@@ -118,6 +125,11 @@

		final L2Effect[] effects = target.getAllEffects();

+		if(effects != null)
+		{
+			giveback = effects;
+		}
+		
		if (effect.getSkill().getNegateAbnormals() != null) // Cancel for abnormals
		{
			for (L2Effect eff : effects)
@@ -130,7 +142,11 @@
					if (negateAbnormalType.equalsIgnoreCase(eff.getAbnormalType()) && effect.getSkill().getNegateAbnormals().get(negateAbnormalType) >= eff.getAbnormalLvl())
					{
						if (calcCancelSuccess(eff, cancelLvl, (int)rate))
+						{
+							if(target instanceof L2PcInstance)
+								target.addLastCancelledEffect(eff);
							eff.exit();
+						}
					}
				}
			}
@@ -168,6 +184,8 @@
				lastCanceledSkillId = eff.getSkill().getId();

				eff.exit();
+				if(target instanceof L2PcInstance)
+					target.addLastCancelledEffect(eff);
				count--;

				if (count == 0)
@@ -198,6 +216,8 @@

					lastCanceledSkillId = eff.getSkill().getId();
					eff.exit();
+					if(target instanceof L2PcInstance)
+						target.addLastCancelledEffect(eff);
					count--;

					if (count == 0)
@@ -206,6 +226,7 @@
			}
		}

+		target.recoverLastCancelledEffects();
		return true;
	}

Index: java/com/l2jserver/gameserver/skills/effects/EffectDeflectBuff.java
===================================================================
--- java/com/l2jserver/gameserver/skills/effects/EffectDeflectBuff.java	(revision 0)
+++ java/com/l2jserver/gameserver/skills/effects/EffectDeflectBuff.java	(working copy)
@@ -0,0 +1,97 @@
+/*
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jserver.gameserver.skills.effects;
+
+import com.l2jserver.gameserver.model.L2Effect;
+import com.l2jserver.gameserver.network.SystemMessageId;
+import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
+import com.l2jserver.gameserver.skills.Env;
+import com.l2jserver.gameserver.templates.effects.EffectTemplate;
+import com.l2jserver.gameserver.templates.skills.L2EffectType;
+import com.l2jserver.gameserver.templates.skills.L2SkillType;
+
+/**
+ * @author Lambda
+ *
+ */
+public final class EffectDeflectBuff extends L2Effect
+{
+	/**
+	 * @param env
+	 * @param template
+	 */
+	public EffectDeflectBuff(Env env, EffectTemplate template)
+	{
+		super(env, template);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see com.l2jserver.gameserver.model.L2Effect#getEffectType()
+	 */
+	@Override
+	public L2EffectType getEffectType()
+	{
+		return L2EffectType.PREVENT_BUFF;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see com.l2jserver.gameserver.model.L2Effect#onActionTime()
+	 */
+	@Override
+	public boolean onActionTime()
+	{
+		// Only cont skills shouldn't end
+		if(getSkill().getSkillType() != L2SkillType.CONT)
+			return false;
+		
+		double manaDam = calc();
+		
+		if(manaDam > getEffected().getCurrentMp())
+		{
+			SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP);
+			getEffected().sendPacket(sm);
+			return false;
+		}
+		
+		getEffected().reduceCurrentMp(manaDam);
+		return true;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see com.l2jserver.gameserver.model.L2Effect#onStart()
+	 */
+	@Override
+	public boolean onStart()
+	{
+		getEffected().setIsBuffProtected(true);
+		return true;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see com.l2jserver.gameserver.model.L2Effect#onExit()
+	 */
+	@Override
+	public void onExit()
+	{
+		getEffected().setIsBuffProtected(false);
+	}
+}
Index: java/com/l2jserver/gameserver/model/actor/L2Character.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/L2Character.java	(revision 5615)
+++ java/com/l2jserver/gameserver/model/actor/L2Character.java	(working copy)
@@ -23,6 +23,7 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Future;
+import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import java.util.logging.Logger;

@@ -69,12 +70,14 @@
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance.SkillDat;
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
import com.l2jserver.gameserver.model.actor.instance.L2RiftInvaderInstance;
+import com.l2jserver.gameserver.model.actor.instance.L2VillageMasterInstance;
import com.l2jserver.gameserver.model.actor.knownlist.CharKnownList;
import com.l2jserver.gameserver.model.actor.position.CharPosition;
import com.l2jserver.gameserver.model.actor.stat.CharStat;
import com.l2jserver.gameserver.model.actor.status.CharStatus;
import com.l2jserver.gameserver.model.entity.Instance;
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
+import com.l2jserver.gameserver.model.olympiad.OlympiadManager;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.AbstractNpcInfo;
@@ -82,6 +85,7 @@
import com.l2jserver.gameserver.network.serverpackets.Attack;
import com.l2jserver.gameserver.network.serverpackets.ChangeMoveType;
import com.l2jserver.gameserver.network.serverpackets.ChangeWaitType;
+import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jserver.gameserver.network.serverpackets.FlyToLocation;
import com.l2jserver.gameserver.network.serverpackets.FlyToLocation.FlyType;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
@@ -100,6 +104,7 @@
import com.l2jserver.gameserver.pathfinding.PathFinding;
import com.l2jserver.gameserver.skills.AbnormalEffect;
import com.l2jserver.gameserver.skills.Calculator;
+import com.l2jserver.gameserver.skills.Env;
import com.l2jserver.gameserver.skills.Formulas;
import com.l2jserver.gameserver.skills.Stats;
import com.l2jserver.gameserver.skills.effects.EffectChanceSkillTrigger;
@@ -150,6 +155,7 @@
	private L2Skill _lastSkillCast;
	private L2Skill _lastSimultaneousSkillCast;

+	private boolean _isBuffProtected = false;
	private boolean _isDead									= false;
	private boolean _isImmobilized							= false;
	private boolean _isOverloaded							= false; // the char is carrying too much
@@ -209,6 +215,11 @@
	private final byte[] _zones = new byte[22];
	protected byte _zoneValidateCounter = 4;

+	//Holds cancelled buffs
+	private List<L2Effect> _lastCancelledEffects = new FastList<L2Effect>();
+	//Task to give back cancelled buffs
+	private ScheduledFuture<?> _lastCancelledEffectsTask;
+	
	private L2Character _debugger = null;

	/**
@@ -219,6 +230,75 @@
		return _debugger != null;
	}

+	public void addLastCancelledEffect(L2Effect e)
+	{
+		if(!_lastCancelledEffects.contains(e))
+			_lastCancelledEffects.add(e);
+	}
+	
+	public void recoverLastCancelledEffects()
+	{
+		if(_lastCancelledEffects.isEmpty() || (_lastCancelledEffectsTask != null && !_lastCancelledEffectsTask.isDone()))
+			return;
+		
+		final L2Character target = this;
+		
+		_lastCancelledEffectsTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
+		{
+			@Override
+			public void run()
+			{
+				Collection<L2Character> knowns  = target.getKnownList().getKnownCharactersInRadius(300);
+				for (L2Object grm : knowns)
+				{
+					if (grm instanceof L2VillageMasterInstance)
+					{
+						return;
+					}
+				}
+				
+				if(target.isDead())
+					return;
+				
+				if (OlympiadManager.getInstance().isRegistered((L2PcInstance) target))
+					return;
+				
+				Env env;
+				L2Effect effect;
+				for(L2Effect e : _lastCancelledEffects)
+				{
+					env = new Env();
+					env.target = target;
+					env.skill = e.getSkill();
+					
+					try
+					{
+						effect = e.getEffectTemplate().getEffect(env);
+						if (effect != null)
+						{
+							effect.scheduleEffect();
+							if (effect.getShowIcon() && target instanceof L2PcInstance)
+							{
+								SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
+								sm.addSkillName(effect);
+								target.sendPacket(sm);
+							}
+						}
+						e.exit();
+					}
+					catch (RuntimeException ex)
+					{
+						_log.log(Level.WARNING, "Cannot return effect: " + e + "to owner: " + target, ex);
+					}
+				}
+				
+				sendPacket(new ExShowScreenMessage("Your cancelled buffs has been given back.", 2000));
+				
+				_lastCancelledEffects.clear();
+			}
+		}, 15000);
+	}
+	
	/**
	 * Sets L2Character instance, to which debug packets will be send
	 * @param d
@@ -6998,4 +7078,14 @@
	{
		return _effects.isAffected(flag);
	}
+	
+	public final void setIsBuffProtected(boolean value)
+	{
+		_isBuffProtected = value;
+	}
+	
+	public boolean isBuffProtected()
+	{
+		return _isBuffProtected;
+	}
}
Index: java/com/l2jserver/gameserver/templates/skills/L2EffectType.java
===================================================================
--- java/com/l2jserver/gameserver/templates/skills/L2EffectType.java	(revision 5615)
+++ java/com/l2jserver/gameserver/templates/skills/L2EffectType.java	(working copy)
@@ -76,5 +76,6 @@
	HIDE,
	ABORT_CAST,
	INCREASE_CHARGES,
-	BLOCK_RESURRECTION
+	BLOCK_RESURRECTION,
+	PREVENT_BUFF
}
\ No newline at end of file
Index: java/com/l2jserver/gameserver/skills/effects/EffectCancelDebuff.java
===================================================================
--- java/com/l2jserver/gameserver/skills/effects/EffectCancelDebuff.java	(revision 5615)
+++ java/com/l2jserver/gameserver/skills/effects/EffectCancelDebuff.java	(working copy)
@@ -103,6 +103,8 @@
            
             lastCanceledSkillId = effect.getSkill().getId();
             effect.exit();
+            if(target instanceof L2PcInstance)
+            	target.addLastCancelledEffect(effect);
             count--;
            
             if (count == 0)
@@ -135,12 +137,16 @@
                
                 lastCanceledSkillId = effect.getSkill().getId();
                 effect.exit();
+                if(target instanceof L2PcInstance)
+                	target.addLastCancelledEffect(effect);
                 count--;
                
                 if (count == 0)
                     break;
             }
         }
+        
+        target.recoverLastCancelledEffects();
         return true;
     }
    
Index: java/com/l2jserver/gameserver/model/L2Effect.java
===================================================================
--- java/com/l2jserver/gameserver/model/L2Effect.java	(revision 5615)
+++ java/com/l2jserver/gameserver/model/L2Effect.java	(working copy)
@@ -112,6 +112,8 @@

	public boolean preventExitUpdate;

+	private long _cancelLasts = System.currentTimeMillis() + 15000;
+	
	private final class EffectTask implements Runnable
	{
		public void run()
@@ -663,4 +665,20 @@
	{
		return false;
	}
+	
+	/**
+	 * @return the _cancelLasts
+	 */
+	public long getcancelLasts()
+	{
+		return _cancelLasts;
+	}
+	
+	/**
+	 * @param _cancelLasts the _cancelLasts to set
+	 */
+	public void setcancelLasts(long _cancelLasts)
+	{
+		this._cancelLasts = _cancelLasts;
+	}
}
\ No newline at end of file
Index: java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java	(revision 5615)
+++ java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java	(working copy)
@@ -46,6 +46,7 @@
import com.l2jserver.gameserver.model.L2Clan;
import com.l2jserver.gameserver.model.L2ItemInstance;
import com.l2jserver.gameserver.model.L2Object;
+import com.l2jserver.gameserver.model.L2Skill;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2ClassMasterInstance;
@@ -331,6 +332,9 @@
		if (Config.PLAYER_SPAWN_PROTECTION > 0)
			activeChar.setProtection(true);

+		L2Skill skill2 = SkillTable.getInstance().getInfo(26074, 1);
+		activeChar.addSkill(skill2);
+		
		activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());

		if (L2Event.active && L2Event.connectionLossData.containsKey(activeChar.getName()) && L2Event.isOnEvent(activeChar))

 

This is where im stuck:

Index: java/com/l2jserver/gameserver/model/actor/L2Character.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/L2Character.java	(revision 5615)
+++ java/com/l2jserver/gameserver/model/actor/L2Character.java	(working copy)
@@ -23,6 +23,7 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Future;
+import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import java.util.logging.Logger;

@@ -69,12 +70,14 @@
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance.SkillDat;
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
import com.l2jserver.gameserver.model.actor.instance.L2RiftInvaderInstance;
+import com.l2jserver.gameserver.model.actor.instance.L2VillageMasterInstance;
import com.l2jserver.gameserver.model.actor.knownlist.CharKnownList;
import com.l2jserver.gameserver.model.actor.position.CharPosition;
import com.l2jserver.gameserver.model.actor.stat.CharStat;
import com.l2jserver.gameserver.model.actor.status.CharStatus;
import com.l2jserver.gameserver.model.entity.Instance;
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
+import com.l2jserver.gameserver.model.olympiad.OlympiadManager;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.AbstractNpcInfo;
@@ -82,6 +85,7 @@
import com.l2jserver.gameserver.network.serverpackets.Attack;
import com.l2jserver.gameserver.network.serverpackets.ChangeMoveType;
import com.l2jserver.gameserver.network.serverpackets.ChangeWaitType;
+import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jserver.gameserver.network.serverpackets.FlyToLocation;
import com.l2jserver.gameserver.network.serverpackets.FlyToLocation.FlyType;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
@@ -100,6 +104,7 @@
import com.l2jserver.gameserver.pathfinding.PathFinding;
import com.l2jserver.gameserver.skills.AbnormalEffect;
import com.l2jserver.gameserver.skills.Calculator;
+import com.l2jserver.gameserver.skills.Env;
import com.l2jserver.gameserver.skills.Formulas;
import com.l2jserver.gameserver.skills.Stats;
import com.l2jserver.gameserver.skills.effects.EffectChanceSkillTrigger;
@@ -150,6 +155,7 @@
	private L2Skill _lastSkillCast;
	private L2Skill _lastSimultaneousSkillCast;

+	private boolean _isBuffProtected = false;
	private boolean _isDead									= false;
	private boolean _isImmobilized							= false;
	private boolean _isOverloaded							= false; // the char is carrying too much
@@ -209,6 +215,11 @@
	private final byte[] _zones = new byte[22];
	protected byte _zoneValidateCounter = 4;

+	//Holds cancelled buffs
+	private List<L2Effect> _lastCancelledEffects = new FastList<L2Effect>();
+	//Task to give back cancelled buffs
+	private ScheduledFuture<?> _lastCancelledEffectsTask;
+	
	private L2Character _debugger = null;

	/**
@@ -219,6 +230,75 @@
		return _debugger != null;
	}

+	public void addLastCancelledEffect(L2Effect e)
+	{
+		if(!_lastCancelledEffects.contains(e))
+			_lastCancelledEffects.add(e);
+	}
+	
+	public void recoverLastCancelledEffects()
+	{
+		if(_lastCancelledEffects.isEmpty() || (_lastCancelledEffectsTask != null && !_lastCancelledEffectsTask.isDone()))
+			return;
+		
+		final L2Character target = this;
+		
+		_lastCancelledEffectsTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
+		{
+			@Override
+			public void run()
+			{
+				Collection<L2Character> knowns  = target.getKnownList().getKnownCharactersInRadius(300);
+				for (L2Object grm : knowns)
+				{
+					if (grm instanceof L2VillageMasterInstance)
+					{
+						return;
+					}
+				}
+				
+				if(target.isDead())
+					return;
+				
+				if (OlympiadManager.getInstance().isRegistered((L2PcInstance) target))
+					return;
+				
+				Env env;
+				L2Effect effect;
+				for(L2Effect e : _lastCancelledEffects)
+				{
+					env = new Env();
+					env.target = target;
+					env.skill = e.getSkill();
+					
+					try
+					{
+						effect = e.getEffectTemplate().getEffect(env);
+						if (effect != null)
+						{
+							effect.scheduleEffect();
+							if (effect.getShowIcon() && target instanceof L2PcInstance)
+							{
+								SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
+								sm.addSkillName(effect);
+								target.sendPacket(sm);
+							}
+						}
+						e.exit();
+					}
+					catch (RuntimeException ex)
+					{
+						_log.log(Level.WARNING, "Cannot return effect: " + e + "to owner: " + target, ex);
+					}
+				}
+				
+				sendPacket(new ExShowScreenMessage("Your cancelled buffs has been given back.", 2000));
+				
+				_lastCancelledEffects.clear();
+			}
+		}, 15000);
+	}
+	
	/**
	 * Sets L2Character instance, to which debug packets will be send
	 * @param d
@@ -6998,4 +7078,14 @@
	{
		return _effects.isAffected(flag);
	}
+	
+	public final void setIsBuffProtected(boolean value)
+	{
+		_isBuffProtected = value;
+	}
+	
+	public boolean isBuffProtected()
+	{
+		return _isBuffProtected;
+	}
}

 

This part!

	private L2Skill _lastSkillCast;
	private L2Skill _lastSimultaneousSkillCast;

+	private boolean _isBuffProtected = false;
	private boolean _isDead									= false;
	private boolean _isImmobilized							= false;
	private boolean _isOverloaded	

 

The problem is that when i search for private L2Skill _lastSkillCast; ,it doesnt find anything ,SO THAT MEAN ,i have to apply patch (and delete the current l2 character? OR!)?

 

 

 

  • 0
Posted

As I say in the video, if u don't find the line, u can take a look on the lines of the patch

@@ -150,6 +155,7 @@

and take a look downstairs of eclipse, when u change ur cursor position the line and row number changes, find a that line number and add it near.

  • 0
Posted

As I say in the video, if u don't find the line, u can take a look on the lines of the patch and take a look downstairs of eclipse, when u change ur cursor position the line and row number changes, find a that line number and add it near.

 

well this was fail reply from me ,the reason i didnt found it is because my cursor was above teh line i think xD

 

k, im going to continue now

 

 

Guest
This topic is now closed to further replies.


×
×
  • Create New...