DivineEnchanter.java 3.5 KB

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