Advertisement
VANPER

Sistema que permite os buffs retornarem após um cancel.

Feb 8th, 2020
1,250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.36 KB | None | 0 0
  1. Index: java/net/sf/l2j/Config.java
  2. ===================================================================
  3. --- java/net/sf/l2j/Config.java (revision 84)
  4. +++ java/net/sf/l2j/Config.java (working copy)
  5.  
  6. +   public static int CANCEL_SECONDS;
  7.  
  8. +   CANCEL_SECONDS = players.getProperty("CancelSeconds", 5);
  9.  
  10. ===================================================================
  11. --- java/net/sf/l2j/gameserver/handler/skillhandlers/Cancel.java    (revision 0)
  12. +++ java/net/sf/l2j/gameserver/handler/skillhandlers/Cancel.java    (working copy)
  13. @@ -0,0 +1,84 @@
  14.  
  15. for (L2Effect effect : target.getAllEffects())
  16. {
  17.     // Don't cancel null effects or toggles.
  18.     if (effect == null || effect.getSkill().isToggle())
  19.         continue;
  20.    
  21.     // Mage && Warrior Bane drop only particular stacktypes.
  22.     switch (skill.getSkillType())
  23.     {
  24.         case MAGE_BANE:
  25.             if ("casting_time_down".equalsIgnoreCase(effect.getStackType()))
  26.                 break;
  27.            
  28.             if ("ma_up".equalsIgnoreCase(effect.getStackType()))
  29.                 break;
  30.            
  31.             continue;
  32.        
  33.         case WARRIOR_BANE:
  34.             if ("attack_time_down".equalsIgnoreCase(effect.getStackType()))
  35.                 break;
  36.            
  37.             if ("speed_up".equalsIgnoreCase(effect.getStackType()))
  38.                 break;
  39.            
  40.             continue;
  41.     }
  42.    
  43.     // If that skill effect was already canceled, continue.
  44.     if (effect.getSkill().getId() == lastCanceledSkillId)
  45.         continue;
  46.    
  47.     // Calculate the success chance following previous variables.
  48.     if (calcCancelSuccess(effect.getPeriod(), diffLevel, skillPower, skillVuln, minRate, maxRate))
  49.     {
  50.         // Stores the last canceled skill for further use.
  51.         lastCanceledSkillId = effect.getSkill().getId();
  52.  
  53.         // Custom cancel
  54.         if (!cancelledBuffs.contains(effect.getSkill()) && !((Player)activeChar).isInOlympiadMode())                        
  55.             cancelledBuffs.add(effect.getSkill());
  56.        
  57.         // Exit the effect.
  58.         effect.exit();
  59.     }
  60.  
  61. +   if (cancelledBuffs.size() > 0)
  62. +       ThreadPool.schedule(new CancelTaskManager((Player) target, cancelledBuffs), Config.CANCEL_SECONDS * 1000);
  63.    
  64.     // Remove 1 to the stack of buffs to remove.
  65.     count--;
  66.    
  67.     // If the stack goes to 0, then break the loop.
  68.     if (count == 0)
  69.         break;
  70. }
  71. +   #=============================================================
  72. +   #            Cancel / Segunds / Return Buffer
  73. +   #=============================================================
  74. +   # This setting back the buffs after the set time in Cancel in Seconds
  75. +   CancelSeconds = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement