Tryskell Posted February 10, 2019 Author Posted February 10, 2019 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. Quote
zemaitis Posted February 10, 2019 Posted February 10, 2019 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. Quote
zemaitis Posted February 23, 2019 Posted February 23, 2019 (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 February 23, 2019 by zemaitis Quote
Trance Posted March 1, 2019 Posted March 1, 2019 (edited) MonkaS Edited March 1, 2019 by Trance Quote
Tryskell Posted August 13, 2020 Author Posted August 13, 2020 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. Quote
Recommended Posts
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.