Advertisement
Nik

Skills ignoreSkillMute support

Nik
Oct 18th, 2011
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 10.00 KB | None | 0 0
  1. Index: java/com/l2jserver/gameserver/ai/L2AttackableAI.java
  2. ===================================================================
  3. --- java/com/l2jserver/gameserver/ai/L2AttackableAI.java    (revision 5011)
  4. +++ java/com/l2jserver/gameserver/ai/L2AttackableAI.java    (working copy)
  5. @@ -924,7 +924,7 @@
  6.                         {
  7.                             if (sk.getTargetType() == L2TargetType.TARGET_SELF)
  8.                                 continue;
  9. -                           if ((sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.isMagic() && npc.isMuted()) || (!sk.isMagic() && npc.isPhysicalMuted())))
  10. +                           if ((sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.isMagic() && npc.isMuted() && !sk.ignoreSkillMute()) || (!sk.isMagic() && npc.isPhysicalMuted() && !sk.ignoreSkillMute())))
  11.                             {
  12.                                 continue;
  13.                             }
  14. @@ -946,7 +946,7 @@
  15.                 if (Rnd.get(100) < (100 - percentage) / 3)
  16.                     for (L2Skill sk : _skillrender._healskills)
  17.                     {
  18. -                       if ((sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.isMagic() && npc.isMuted())) || (!sk.isMagic() && npc.isPhysicalMuted()))
  19. +                       if ((sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.isMagic() && npc.isMuted() && !sk.ignoreSkillMute())) || (!sk.isMagic() && npc.isPhysicalMuted() && !sk.ignoreSkillMute()))
  20.                         {
  21.                             continue;
  22.                         }
  23. @@ -957,7 +957,7 @@
  24.                     }
  25.                 for (L2Skill sk : _skillrender._healskills)
  26.                 {
  27. -                   if ((sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.isMagic() && npc.isMuted())) || (!sk.isMagic() && npc.isPhysicalMuted()))
  28. +                   if ((sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.isMagic() && npc.isMuted() && !sk.ignoreSkillMute())) || (!sk.isMagic() && npc.isPhysicalMuted() && !sk.ignoreSkillMute()))
  29.                     {
  30.                         continue;
  31.                     }
  32. @@ -1002,7 +1002,7 @@
  33.                         {
  34.                             if (sk.getTargetType() == L2TargetType.TARGET_SELF)
  35.                                 continue;
  36. -                           if ((sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.isMagic() && npc.isMuted()) || (!sk.isMagic() && npc.isPhysicalMuted())))
  37. +                           if ((sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.isMagic() && npc.isMuted() && !sk.ignoreSkillMute()) || (!sk.isMagic() && npc.isPhysicalMuted() && !sk.ignoreSkillMute())))
  38.                             {
  39.                                 continue;
  40.                             }
  41. @@ -1022,7 +1022,7 @@
  42.                 }
  43.                 for (L2Skill sk : _skillrender._resskills)
  44.                 {
  45. -                   if ((sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.isMagic() && npc.isMuted())) || (!sk.isMagic() && npc.isPhysicalMuted()))
  46. +                   if ((sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.isMagic() && npc.isMuted() && !sk.ignoreSkillMute())) || (!sk.isMagic() && npc.isPhysicalMuted() && !sk.ignoreSkillMute()))
  47.                     {
  48.                         continue;
  49.                     }
  50. @@ -1221,7 +1221,7 @@
  51.         if (caster.isCastingNow() && !sk.isSimultaneousCast())
  52.             return false;
  53.        
  54. -       if (sk.getMpConsume() >= caster.getCurrentMp() || caster.isSkillDisabled(sk) || (sk.isMagic() && caster.isMuted()) || (!sk.isMagic() && caster.isPhysicalMuted()))
  55. +       if (sk.getMpConsume() >= caster.getCurrentMp() || caster.isSkillDisabled(sk) || (sk.isMagic() && caster.isMuted() && !sk.ignoreSkillMute()) || (!sk.isMagic() && caster.isPhysicalMuted() && !sk.ignoreSkillMute()))
  56.             return false;
  57.         if (getAttackTarget() == null)
  58.             if (caster.getMostHated() != null)
  59. @@ -1757,7 +1757,7 @@
  60.                 {
  61.                     for (L2Skill sk : _skillrender._immobiliseskills)
  62.                     {
  63. -                       if (sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.getCastRange() + npc.getTemplate().getCollisionRadius() + getAttackTarget().getTemplate().getCollisionRadius() <= dist2 && !canAura(sk)) || (sk.isMagic() && npc.isMuted()) || (!sk.isMagic() && npc.isPhysicalMuted()))
  64. +                       if (sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.getCastRange() + npc.getTemplate().getCollisionRadius() + getAttackTarget().getTemplate().getCollisionRadius() <= dist2 && !canAura(sk)) || (sk.isMagic() && npc.isMuted() && !sk.ignoreSkillMute()) || (!sk.isMagic() && npc.isPhysicalMuted() && !sk.ignoreSkillMute()))
  65.                         {
  66.                             continue;
  67.                         }
  68. @@ -1780,7 +1780,7 @@
  69.                 {
  70.                     for (L2Skill sk : _skillrender._cotskills)
  71.                     {
  72. -                       if (sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.getCastRange() + npc.getTemplate().getCollisionRadius() + getAttackTarget().getTemplate().getCollisionRadius() <= dist2 && !canAura(sk)) || (sk.isMagic() && npc.isMuted()) || (!sk.isMagic() && npc.isPhysicalMuted()))
  73. +                       if (sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.getCastRange() + npc.getTemplate().getCollisionRadius() + getAttackTarget().getTemplate().getCollisionRadius() <= dist2 && !canAura(sk)) || (sk.isMagic() && npc.isMuted() && !sk.ignoreSkillMute()) || (!sk.isMagic() && npc.isPhysicalMuted() && !sk.ignoreSkillMute()))
  74.                         {
  75.                             continue;
  76.                         }
  77. @@ -1802,7 +1802,7 @@
  78.                 {
  79.                     for (L2Skill sk : _skillrender._debuffskills)
  80.                     {
  81. -                       if (sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.getCastRange() + npc.getTemplate().getCollisionRadius() + getAttackTarget().getTemplate().getCollisionRadius() <= dist2 && !canAura(sk)) || (sk.isMagic() && npc.isMuted()) || (!sk.isMagic() && npc.isPhysicalMuted()))
  82. +                       if (sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.getCastRange() + npc.getTemplate().getCollisionRadius() + getAttackTarget().getTemplate().getCollisionRadius() <= dist2 && !canAura(sk)) || (sk.isMagic() && npc.isMuted() && !sk.ignoreSkillMute()) || (!sk.isMagic() && npc.isPhysicalMuted() && !sk.ignoreSkillMute()))
  83.                         {
  84.                             continue;
  85.                         }
  86. @@ -1825,7 +1825,7 @@
  87.                 {
  88.                     for (L2Skill sk : _skillrender._negativeskills)
  89.                     {
  90. -                       if (sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.getCastRange() + npc.getTemplate().getCollisionRadius() + getAttackTarget().getTemplate().getCollisionRadius() <= dist2 && !canAura(sk)) || (sk.isMagic() && npc.isMuted()) || (!sk.isMagic() && npc.isPhysicalMuted()))
  91. +                       if (sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.getCastRange() + npc.getTemplate().getCollisionRadius() + getAttackTarget().getTemplate().getCollisionRadius() <= dist2 && !canAura(sk)) || (sk.isMagic() && npc.isMuted() && !sk.ignoreSkillMute()) || (!sk.isMagic() && npc.isPhysicalMuted() && !sk.ignoreSkillMute()))
  92.                         {
  93.                             continue;
  94.                         }
  95. @@ -1849,7 +1849,7 @@
  96.                 {
  97.                     for (L2Skill sk : _skillrender._atkskills)
  98.                     {
  99. -                       if (sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.getCastRange() + npc.getTemplate().getCollisionRadius() + getAttackTarget().getTemplate().getCollisionRadius() <= dist2 && !canAura(sk)) || (sk.isMagic() && npc.isMuted()) || (!sk.isMagic() && npc.isPhysicalMuted()))
  100. +                       if (sk.getMpConsume() >= npc.getCurrentMp() || npc.isSkillDisabled(sk) || (sk.getCastRange() + npc.getTemplate().getCollisionRadius() + getAttackTarget().getTemplate().getCollisionRadius() <= dist2 && !canAura(sk)) || (sk.isMagic() && npc.isMuted() && !sk.ignoreSkillMute()) || (!sk.isMagic() && npc.isPhysicalMuted() && !sk.ignoreSkillMute()))
  101.                         {
  102.                             continue;
  103.                         }
  104. Index: java/com/l2jserver/gameserver/model/L2Skill.java
  105. ===================================================================
  106. --- java/com/l2jserver/gameserver/model/L2Skill.java    (revision 5011)
  107. +++ java/com/l2jserver/gameserver/model/L2Skill.java    (working copy)
  108. @@ -1,4 +1,5 @@
  109.  /*
  110. +
  111.   * This program is free software: you can redistribute it and/or modify it under
  112.   * the terms of the GNU General Public License as published by the Free Software
  113.   * Foundation, either version 3 of the License, or (at your option) any later
  114. @@ -266,9 +267,10 @@
  115.     private final String _attribute;
  116.    
  117.     private final boolean _ignoreShield;
  118. +   private final boolean _ignoreSkillMute;
  119. +  
  120.     private final boolean _isSuicideAttack;
  121.     private final boolean _canBeReflected;
  122. -  
  123.     private final boolean _canBeDispeled;
  124.    
  125.     private final boolean _isClanSkill;
  126. @@ -453,6 +455,7 @@
  127.         _maxChance = set.getInteger("maxChance", Config.MAX_DEBUFF_CHANCE);
  128.         _stat = set.getEnum("stat", Stats.class, null);
  129.         _ignoreShield = set.getBool("ignoreShld", false);
  130. +       _ignoreSkillMute = set.getBool("ignoreSkillMute", false);
  131.         _skillType = set.getEnum("skillType", L2SkillType.class);
  132.         _effectType = set.getEnum("effectType", L2SkillType.class, null);
  133.         _effectId = set.getInteger("effectId", 0);
  134. @@ -1985,6 +1988,11 @@
  135.         return _ignoreShield;
  136.     }
  137.    
  138. +   public boolean ignoreSkillMute()
  139. +   {
  140. +       return _ignoreShield;
  141. +   }
  142. +  
  143.     public boolean canBeReflected()
  144.     {
  145.         return _canBeReflected;
  146. Index: java/com/l2jserver/gameserver/model/actor/L2Attackable.java
  147. ===================================================================
  148. --- java/com/l2jserver/gameserver/model/actor/L2Attackable.java (revision 5011)
  149. +++ java/com/l2jserver/gameserver/model/actor/L2Attackable.java (working copy)
  150. @@ -408,16 +408,19 @@
  151.         if (getCurrentHp() <= skill.getHpConsume())
  152.             return;
  153.        
  154. -       if (skill.isMagic())
  155. +       if (!skill.ignoreSkillMute())
  156.         {
  157. -           if (isMuted())
  158. -               return;
  159. +           if (skill.isMagic())
  160. +           {
  161. +               if (isMuted())
  162. +                   return;
  163. +           }
  164. +           else
  165. +           {
  166. +               if (isPhysicalMuted())
  167. +                   return;
  168. +           }
  169.         }
  170. -       else
  171. -       {
  172. -           if (isPhysicalMuted())
  173. -               return;
  174. -       }
  175.        
  176.         L2Object target = skill.getFirstOfTargetList(this);
  177.         if (target == null)
  178. Index: java/com/l2jserver/gameserver/model/actor/L2Character.java
  179. ===================================================================
  180. --- java/com/l2jserver/gameserver/model/actor/L2Character.java  (revision 5011)
  181. +++ java/com/l2jserver/gameserver/model/actor/L2Character.java  (working copy)
  182. @@ -2078,7 +2078,7 @@
  183.             return false;
  184.         }
  185.        
  186. -       if (!skill.isPotion())
  187. +       if (!skill.isPotion() || !skill.ignoreSkillMute()) // Skill mute checks.
  188.         {
  189.             // Check if the skill is a magic spell and if the L2Character is not muted
  190.             if (skill.isMagic())
  191.  
  192.  
  193.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement