Advertisement
Sarada-L2

Bloquear Skill Aio Fora da City L2jFrozen yo: Sarada

Dec 18th, 2020
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. L2PcInstance.java
  2.  
  3.  
  4. public void useMagic(final L2Skill skill, final boolean forceUse, final boolean dontMove)
  5. {
  6. if (isDead())
  7. {
  8. abortCast();
  9. sendPacket(ActionFailed.STATIC_PACKET);
  10. return;
  11. }
  12.  
  13. + if (isAio() && !isGM() && !isInsideZone(L2Character.ZONE_PEACE))
  14. + {
  15. + sendPacket(ActionFailed.STATIC_PACKET);
  16. + return;
  17. + }
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24. public void sendSkillList(final L2PcInstance player)
  25. {
  26. + boolean isDisabled = false;
  27. SkillList sl = new SkillList();
  28. if (player != null)
  29. {
  30. for (final L2Skill s : player.getAllSkills())
  31. {
  32. if (s == null)
  33. {
  34. continue;
  35. }
  36.  
  37. if (s.getId() > 9000)
  38. {
  39. continue; // Fake skills to change base stats
  40. }
  41.  
  42. if (s.bestowed())
  43. {
  44. continue;
  45. }
  46. + if (isAio() && !isGM() && !isInsideZone(L2Character.ZONE_PEACE))
  47. + isDisabled = true;
  48. if (s.isChance())
  49. {
  50. - sl.addSkill(s.getId(), s.getLevel(), s.isChance());
  51. + sl.addSkill(s.getId(), s.getLevel(), s.isChance(), isDisabled);
  52. }
  53. else
  54. {
  55. - sl.addSkill(s.getId(), s.getLevel(), s.isPassive());
  56. + sl.addSkill(s.getId(), s.getLevel(), s.isPassive(), isDisabled);
  57. }
  58. }
  59. }
  60. sendPacket(sl);
  61. sl = null;
  62. }
  63.  
  64.  
  65. SkillList.java
  66.  
  67.  
  68.  
  69. - public void addSkill(final int id, final int level, final boolean passive)
  70. + public void addSkill(final int id, final int level, final boolean passive, boolean isDisabled)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement