Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 84)
- +++ java/net/sf/l2j/Config.java (working copy)
- + public static int CANCEL_SECONDS;
- + CANCEL_SECONDS = players.getProperty("CancelSeconds", 5);
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/skillhandlers/Cancel.java (revision 0)
- +++ java/net/sf/l2j/gameserver/handler/skillhandlers/Cancel.java (working copy)
- @@ -0,0 +1,84 @@
- for (L2Effect effect : target.getAllEffects())
- {
- // Don't cancel null effects or toggles.
- if (effect == null || effect.getSkill().isToggle())
- continue;
- // Mage && Warrior Bane drop only particular stacktypes.
- switch (skill.getSkillType())
- {
- case MAGE_BANE:
- if ("casting_time_down".equalsIgnoreCase(effect.getStackType()))
- break;
- if ("ma_up".equalsIgnoreCase(effect.getStackType()))
- break;
- continue;
- case WARRIOR_BANE:
- if ("attack_time_down".equalsIgnoreCase(effect.getStackType()))
- break;
- if ("speed_up".equalsIgnoreCase(effect.getStackType()))
- break;
- continue;
- }
- // If that skill effect was already canceled, continue.
- if (effect.getSkill().getId() == lastCanceledSkillId)
- continue;
- // Calculate the success chance following previous variables.
- if (calcCancelSuccess(effect.getPeriod(), diffLevel, skillPower, skillVuln, minRate, maxRate))
- {
- // Stores the last canceled skill for further use.
- lastCanceledSkillId = effect.getSkill().getId();
- // Custom cancel
- if (!cancelledBuffs.contains(effect.getSkill()) && !((Player)activeChar).isInOlympiadMode())
- cancelledBuffs.add(effect.getSkill());
- // Exit the effect.
- effect.exit();
- }
- + if (cancelledBuffs.size() > 0)
- + ThreadPool.schedule(new CancelTaskManager((Player) target, cancelledBuffs), Config.CANCEL_SECONDS * 1000);
- // Remove 1 to the stack of buffs to remove.
- count--;
- // If the stack goes to 0, then break the loop.
- if (count == 0)
- break;
- }
- + #=============================================================
- + # Cancel / Segunds / Return Buffer
- + #=============================================================
- + # This setting back the buffs after the set time in Cancel in Seconds
- + CancelSeconds = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement