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. public void transformedSkills()
  51. {
  52. // Divine Enchanter Water Spirit
  53. getPlayer().addSkill(SkillTable.getInstance().getInfo(704, 1), false);
  54. // Divine Enchanter Fire Spirit
  55. getPlayer().addSkill(SkillTable.getInstance().getInfo(705, 1), false);
  56. // Divine Enchanter Wind Spirit
  57. getPlayer().addSkill(SkillTable.getInstance().getInfo(706, 1), false);
  58. // Divine Enchanter Hero Spirit
  59. getPlayer().addSkill(SkillTable.getInstance().getInfo(707, 1), false);
  60. // Divine Enchanter Mass Binding
  61. getPlayer().addSkill(SkillTable.getInstance().getInfo(708, 1), false);
  62. // Sacrifice Enchanter
  63. getPlayer().addSkill(SkillTable.getInstance().getInfo(709, 1), false);
  64. // Decrease Bow/Crossbow Attack Speed
  65. getPlayer().addSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  66. // Transform Dispel
  67. getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
  68. getPlayer().setTransformAllowedSkills(SKILLS);
  69. }
  70. @Override
  71. public void onUntransform()
  72. {
  73. removeSkills();
  74. }
  75. public void removeSkills()
  76. {
  77. // Divine Enchanter Water Spirit
  78. getPlayer().removeSkill(SkillTable.getInstance().getInfo(704, 1), false, false);
  79. // Divine Enchanter Fire Spirit
  80. getPlayer().removeSkill(SkillTable.getInstance().getInfo(705, 1), false, false);
  81. // Divine Enchanter Wind Spirit
  82. getPlayer().removeSkill(SkillTable.getInstance().getInfo(706, 1), false, false);
  83. // Divine Enchanter Hero Spirit
  84. getPlayer().removeSkill(SkillTable.getInstance().getInfo(707, 1), false, false);
  85. // Divine Enchanter Mass Binding
  86. getPlayer().removeSkill(SkillTable.getInstance().getInfo(708, 1), false, false);
  87. // Sacrifice Enchanter
  88. getPlayer().removeSkill(SkillTable.getInstance().getInfo(709, 1), false, false);
  89. // Decrease Bow/Crossbow Attack Speed
  90. getPlayer().removeSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  91. // Transform Dispel
  92. getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);
  93. getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  94. }
  95. public static void main(String[] args)
  96. {
  97. TransformationManager.getInstance().registerTransformation(new DivineEnchanter());
  98. }
  99. }