Jump to content

Recommended Posts

Posted

You got twice the same section of code, using both L2J old version and aCis version. Delete

 

			if (activeChar.isAttackingNow())
			{
				ThreadPoolManager.getInstance().scheduleGeneral(new WeaponEquipTask(item, activeChar), (activeChar.getAttackEndTime() - GameTimeController.getGameTicks()) * GameTimeController.MILLIS_IN_TICK);
				return;
}

and the associated class.

Posted
1 hour ago, Tryskell said:

You got twice the same section of code, using both L2J old version and aCis version. Delete

 


			if (activeChar.isAttackingNow())
			{
				ThreadPoolManager.getInstance().scheduleGeneral(new WeaponEquipTask(item, activeChar), (activeChar.getAttackEndTime() - GameTimeController.getGameTicks()) * GameTimeController.MILLIS_IN_TICK);
				return;
}

and the associated class.

 

Thanks, later I will setup a test server and test this bug again.

  • 2 weeks later...
Posted (edited)
On 2/10/2019 at 2:05 PM, Tryskell said:

You got twice the same section of code, using both L2J old version and aCis version. Delete

 


			if (activeChar.isAttackingNow())
			{
				ThreadPoolManager.getInstance().scheduleGeneral(new WeaponEquipTask(item, activeChar), (activeChar.getAttackEndTime() - GameTimeController.getGameTicks()) * GameTimeController.MILLIS_IN_TICK);
				return;
}

and the associated class.


The fix worked!

For anyone else struggling, here's what I did on my older aCis rev:
 

 

diff --git a/UseItem.java b/UseItem.java
index de97950..9bec237 100644
--- a/UseItem.java
+++ b/UseItem.java
@@ -46,32 +46,6 @@
 	private boolean _ctrlPressed;
 	private int _itemId;
 	
-	/** Weapon Equip Task */
-	public static class WeaponEquipTask implements Runnable
-	{
-		L2ItemInstance item;
-		L2PcInstance activeChar;
-		
-		public WeaponEquipTask(L2ItemInstance it, L2PcInstance character)
-		{
-			item = it;
-			activeChar = character;
-		}
-		
-		@Override
-		public void run()
-		{
-			// If character is still engaged in strike we should not change weapon
-			if (activeChar.isAttackingNow())
-			{
-				return;
-			}
-			
-			// Equip or unEquip
-			activeChar.useEquippableItem(item, false);
-		}
-	}
-	
 	@Override
 	protected void readImpl()
 	{
@@ -318,13 +292,7 @@ protected void runImpl()
 			// Don't allow Hero items equipment if not a hero
 			if (!activeChar.isHero() && (((item.getItemId() >= 6611) && (item.getItemId() <= 6621)) || (item.getItemId() == 6842)) && !activeChar.isGM())
 				return;
-			
-			if (activeChar.isAttackingNow())
-			{
-				ThreadPoolManager.getInstance().scheduleGeneral(new WeaponEquipTask(item, activeChar), (activeChar.getAttackEndTime() - GameTimeController.getGameTicks()) * GameTimeController.MILLIS_IN_TICK);
-				return;
-			}
-			
+	
 			if (!GameProperties.ALLOW_DAGGERS_WEAR_HEAVY)
 			{
 				if ((activeChar.getClassId().getId() == 93) || (activeChar.getClassId().getId() == 108) || (activeChar.getClassId().getId() == 101) || (activeChar.getClassId().getId() == 8) || (activeChar.getClassId().getId() == 23) || (activeChar.getClassId().getId() == 36))
@@ -358,7 +326,15 @@ protected void runImpl()
 				}
 			}
 			
-			// Equip or unEquip
+		    if (activeChar.isAttackingNow())
+			ThreadPoolManager.getInstance().scheduleGeneral(() -> {
+			    final L2ItemInstance itemToTest = activeChar.getInventory().getItemByObjectId(_objectId);
+			    if(itemToTest == null)
+				return;
+
+			    activeChar.useEquippableItem(itemToTest, false);
+			}, activeChar.getAttackEndTime() - System.currentTimeMillis());
+		    else
 			activeChar.useEquippableItem(item, true);
 		}
 		else

 

Edited by zemaitis
  • 1 year later...
Posted
10 hours ago, heladito said:

hi! how can i add into Frozen?

 

If L2JFrozen got the related task, then simply make it manually following the diff patch. + means it's added, - removed.

 

You would probably be interested by my other exploit fix, regarding Enterworld and ENTERING implementation.

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...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock