DoomWraith.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 DoomWraith extends L2Transformation
  24. {
  25. private static final int[] SKILLS =
  26. {
  27. 586,
  28. 587,
  29. 588,
  30. 589,
  31. 5491,
  32. 619
  33. };
  34. public DoomWraith()
  35. {
  36. // id, colRadius, colHeight
  37. super(2, 13, 25);
  38. }
  39. @Override
  40. public void onTransform()
  41. {
  42. if ((getPlayer().getTransformationId() != 2) || getPlayer().isCursedWeaponEquipped())
  43. {
  44. return;
  45. }
  46. transformedSkills();
  47. }
  48. @Override
  49. public void onUntransform()
  50. {
  51. removeSkills();
  52. }
  53. public void removeSkills()
  54. {
  55. // Rolling Attack (up to 2 levels)
  56. getPlayer().removeSkill(SkillTable.getInstance().getInfo(586, 2), false);
  57. // Earth Storm (up to 2 levels)
  58. getPlayer().removeSkill(SkillTable.getInstance().getInfo(587, 2), false);
  59. // Curse of Darkness (up to 2 levels)
  60. getPlayer().removeSkill(SkillTable.getInstance().getInfo(588, 2), false);
  61. // Darkness Energy Drain (up to 2 levels)
  62. getPlayer().removeSkill(SkillTable.getInstance().getInfo(589, 2), false);
  63. // Decrease Bow/Crossbow Attack Speed
  64. getPlayer().removeSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  65. // Transform Dispel
  66. getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);
  67. getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  68. }
  69. public void transformedSkills()
  70. {
  71. // Rolling Attack (up to 2 levels)
  72. getPlayer().addSkill(SkillTable.getInstance().getInfo(586, 2), false);
  73. // Earth Storm (up to 2 levels)
  74. getPlayer().addSkill(SkillTable.getInstance().getInfo(587, 2), false);
  75. // Curse of Darkness (up to 2 levels)
  76. getPlayer().addSkill(SkillTable.getInstance().getInfo(588, 2), false);
  77. // Darkness Energy Drain (up to 2 levels)
  78. getPlayer().addSkill(SkillTable.getInstance().getInfo(589, 2), false);
  79. // Decrease Bow/Crossbow Attack Speed
  80. getPlayer().addSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  81. // Transform Dispel
  82. getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
  83. getPlayer().setTransformAllowedSkills(SKILLS);
  84. }
  85. public static void main(String[] args)
  86. {
  87. TransformationManager.getInstance().registerTransformation(new DoomWraith());
  88. }
  89. }