Advertisement
VANPER

Sistema Ant Heal em PVP

Feb 8th, 2020
978
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.38 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 boolean PROTECTION_HEAL;
  7. +   public static double PROTECTION_HEAL_PVP;
  8.    
  9. +   PROTECTION_HEAL = server.getProperty("HealProtection", false);
  10. +   PROTECTION_HEAL_PVP = server.getProperty("HealCurrent", 1.);
  11.        
  12.        
  13. ===================================================================
  14. --- java/net/sf/l2j/gameserver/handler/skillhandlers/Heal.java  (revision 0)
  15. +++ java/net/sf/l2j/gameserver/handler/skillhandlers/Heal.java  (working copy)
  16. @@ -0,0 +1,84 @@
  17.  
  18.     switch (skill.getSkillType())
  19.     {
  20.         case HEAL_PERCENT:
  21.             hp = target.getMaxHp() * power / 100.0;
  22.             break;
  23.         default:
  24.             hp = power;
  25.             hp *= target.calcStat(Stats.HEAL_EFFECTIVNESS, 100, null, null) / 100;
  26.    
  27. +       if (Config.PROTECTION_HEAL)
  28. +       {
  29. +       if (activeChar instanceof Player && ((Player) activeChar).getPvpFlag() != 0 || activeChar instanceof Player && ((Player) activeChar).getKarma() != 0)
  30. +       hp *= Config.PROTECTION_HEAL_PVP;
  31. +       }
  32.    
  33.     }
  34.  
  35. # =================================================================
  36. #                 PvP Flag HealCurrent
  37. # =================================================================
  38. # To cure a percentage in pvp and pk.
  39. HealProtection = False
  40. # Default = 0.5
  41. HealCurrent = 0.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement