Advertisement
LIONN

Disable AIO Outside PZ

May 18th, 2013
1,242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.76 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2jFrozen_GameServer
  3. Index: head-src/com/l2jfrozen/Config.java
  4. ===================================================================
  5. --- head-src/com/l2jfrozen/Config.java  (revision 1004)
  6. +++ head-src/com/l2jfrozen/Config.java  (working copy)
  7. @@ -570,6 +570,7 @@
  8.     public static int AIO_TCOLOR;
  9.     public static boolean ALLOW_AIO_USE_GK;
  10.     public static boolean ALLOW_AIO_USE_CM;
  11. +   public static boolean CAN_USE_SKILL_OUTSIDE_PZ;
  12.     public static boolean ANNOUNCE_CASTLE_LORDS;
  13.    
  14.     /** Configuration to allow custom items to be given on character creation */
  15. @@ -674,6 +675,7 @@
  16.             AIO_TCOLOR = Integer.decode("0x" + otherSettings.getProperty("AioTitleColor", "88AA88"));
  17.             ALLOW_AIO_USE_GK = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseGk", "False"));
  18.             ALLOW_AIO_USE_CM = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseClassMaster", "False"));
  19. +           CAN_USE_SKILL_OUTSIDE_PZ = Boolean.parseBoolean(otherSettings.getProperty("CanUseSkillOutsidePeacezone", "False"));
  20.             ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(otherSettings.getProperty("AnnounceCastleLords", "False"));
  21.             if(ENABLE_AIO_SYSTEM) //create map if system is enabled
  22.             {
  23. Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
  24. ===================================================================
  25. --- head-src/com/l2jfrozen/gameserver/model/L2Character.java    (revision 1004)
  26. +++ head-src/com/l2jfrozen/gameserver/model/L2Character.java    (working copy)
  27. @@ -1173,6 +1173,26 @@
  28.         if(isAttackingDisabled())
  29.             return;
  30.  
  31. +       if ((this instanceof L2PcInstance) && !Config.CAN_USE_SKILL_OUTSIDE_PZ)
  32. +       {
  33. +           if (((L2PcInstance) this).isAio() && (!isInsideZone(L2Character.ZONE_PEACE) || !target.isInsideZone(L2Character.ZONE_PEACE)))
  34. +           {
  35. +               sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
  36. +               sendPacket(ActionFailed.STATIC_PACKET);
  37. +               return;
  38. +           }
  39. +          
  40. +           if (target instanceof L2PcInstance)
  41. +           {
  42. +               if (((L2PcInstance) target).isAio() && !isInsideZone(L2Character.ZONE_PEACE))
  43. +               {
  44. +                   sendPacket(new SystemMessage(SystemMessageId.INCORRECT_TARGET));
  45. +                   sendPacket(ActionFailed.STATIC_PACKET);
  46. +                   return;
  47. +               }
  48. +           }
  49. +       }
  50. +      
  51.         if(this instanceof L2PcInstance)
  52.         {
  53.             if(((L2PcInstance) this).inObserverMode())
  54. @@ -1812,6 +1832,29 @@
  55.             return;
  56.         }
  57.        
  58. +       if (getTarget() != null)
  59. +       {
  60. +           if ((this instanceof L2PcInstance) && !Config.CAN_USE_SKILL_OUTSIDE_PZ)
  61. +           {
  62. +               if (((L2PcInstance) this).isAio() && (!isInsideZone(L2Character.ZONE_PEACE) || !((L2PcInstance) getTarget()).isInsideZone(L2Character.ZONE_PEACE)))
  63. +               {
  64. +                   sendPacket(new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED).addSkillName(skill.getId()));
  65. +                   sendPacket(ActionFailed.STATIC_PACKET);
  66. +                   return;
  67. +               }
  68. +              
  69. +               if (getTarget() instanceof L2PcInstance)
  70. +               {
  71. +                   if (((L2PcInstance) getTarget()).isAio() && !isInsideZone(L2Character.ZONE_PEACE))
  72. +                   {
  73. +                       sendPacket(new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED).addSkillName(skill.getId()));
  74. +                       sendPacket(ActionFailed.STATIC_PACKET);
  75. +                       return;
  76. +                   }
  77. +               }
  78. +           }
  79. +       }
  80. +
  81.         if(isSkillDisabled(skill.getId()))
  82.         {
  83.             if(activeChar instanceof L2PcInstance && !(skill.getId() == 2166))
  84. Index: config/head/other.properties
  85. ===================================================================
  86. --- config/head/other.properties    (revision 1004)
  87. +++ config/head/other.properties    (working copy)
  88. @@ -229,6 +229,9 @@
  89.  # Aio Buffers can speak to Class Master?
  90.  AllowAioUseClassMaster = False
  91.  
  92. +# Enable/disable ability to use AIO skills outside peacezone
  93. +CanUseSkillOutsidePeacezone = False
  94. +
  95.  # Announce castle lords on enter game. default = false
  96.  AnnounceCastleLords = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement