DivineKnight.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package transformations;
  16. import com.l2jserver.gameserver.datatables.SkillTable;
  17. import com.l2jserver.gameserver.instancemanager.TransformationManager;
  18. import com.l2jserver.gameserver.model.L2Transformation;
  19. public class DivineKnight extends L2Transformation
  20. {
  21. private static final int[] SKILLS =
  22. {
  23. 680, 681, 682, 683, 684, 685, 795, 796, 5491, 619
  24. };
  25. public DivineKnight()
  26. {
  27. // id, colRadius, colHeight
  28. super(252, 16, 30);
  29. }
  30. @Override
  31. public void onTransform()
  32. {
  33. if ((getPlayer().getTransformationId() != 252) || getPlayer().isCursedWeaponEquipped())
  34. {
  35. return;
  36. }
  37. transformedSkills();
  38. }
  39. public void transformedSkills()
  40. {
  41. // Divine Knight Hate
  42. getPlayer().addSkill(SkillTable.getInstance().getInfo(680, 1), false);
  43. // Divine Knight Hate Aura
  44. getPlayer().addSkill(SkillTable.getInstance().getInfo(681, 1), false);
  45. // Divine Knight Stun Attack
  46. getPlayer().addSkill(SkillTable.getInstance().getInfo(682, 1), false);
  47. // Divine Knight Thunder Storm
  48. getPlayer().addSkill(SkillTable.getInstance().getInfo(683, 1), false);
  49. // Divine Knight Ultimate Defense
  50. getPlayer().addSkill(SkillTable.getInstance().getInfo(684, 1), false);
  51. // Sacrifice Knight
  52. getPlayer().addSkill(SkillTable.getInstance().getInfo(685, 1), false);
  53. // Divine Knight Brandish
  54. getPlayer().addSkill(SkillTable.getInstance().getInfo(795, 1), false);
  55. // Divine Knight Explosion
  56. getPlayer().addSkill(SkillTable.getInstance().getInfo(796, 1), false);
  57. // Decrease Bow/Crossbow Attack Speed
  58. getPlayer().addSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  59. // Transform Dispel
  60. getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
  61. getPlayer().setTransformAllowedSkills(SKILLS);
  62. }
  63. @Override
  64. public void onUntransform()
  65. {
  66. removeSkills();
  67. }
  68. public void removeSkills()
  69. {
  70. // Divine Knight Hate
  71. getPlayer().removeSkill(SkillTable.getInstance().getInfo(680, 1), false);
  72. // Divine Knight Hate Aura
  73. getPlayer().removeSkill(SkillTable.getInstance().getInfo(681, 1), false);
  74. // Divine Knight Stun Attack
  75. getPlayer().removeSkill(SkillTable.getInstance().getInfo(682, 1), false);
  76. // Divine Knight Thunder Storm
  77. getPlayer().removeSkill(SkillTable.getInstance().getInfo(683, 1), false);
  78. // Divine Knight Ultimate Defense
  79. getPlayer().removeSkill(SkillTable.getInstance().getInfo(684, 1), false, false);
  80. // Sacrifice Knight
  81. getPlayer().removeSkill(SkillTable.getInstance().getInfo(685, 1), false, false);
  82. // Divine Knight Brandish
  83. getPlayer().removeSkill(SkillTable.getInstance().getInfo(795, 1), false);
  84. // Divine Knight Explosion
  85. getPlayer().removeSkill(SkillTable.getInstance().getInfo(796, 1), false);
  86. // Decrease Bow/Crossbow Attack Speed
  87. getPlayer().removeSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  88. // Transform Dispel
  89. getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);
  90. getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  91. }
  92. public static void main(String[] args)
  93. {
  94. TransformationManager.getInstance().registerTransformation(new DivineKnight());
  95. }
  96. }