DragonMasterLee.java 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. /**
  24. * @author Tan
  25. */
  26. public class DragonMasterLee extends L2Transformation
  27. {
  28. private static final int[] SKILLS =
  29. {
  30. 5491,
  31. 619,
  32. 20002,
  33. 20004,
  34. 20005
  35. };
  36. public DragonMasterLee()
  37. {
  38. // id, colRadius, colHeight
  39. super(20005, 8, 19.3);
  40. }
  41. @Override
  42. public void onTransform()
  43. {
  44. if ((getPlayer().getTransformationId() != 20005) || 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. // Decrease Bow/Crossbow Attack Speed
  58. getPlayer().removeSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  59. // Transform Dispel
  60. getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);
  61. // Dragon Slash
  62. getPlayer().removeSkill(SkillTable.getInstance().getInfo(20002, 1), false);
  63. // Dragon Dash
  64. getPlayer().removeSkill(SkillTable.getInstance().getInfo(20004, 1), false);
  65. // Dragon Aura
  66. getPlayer().removeSkill(SkillTable.getInstance().getInfo(20005, 1), false);
  67. getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  68. }
  69. public void transformedSkills()
  70. {
  71. // Decrease Bow/Crossbow Attack Speed
  72. getPlayer().addSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  73. // Transform Dispel
  74. getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
  75. // Dragon Slash
  76. getPlayer().addSkill(SkillTable.getInstance().getInfo(20002, 1), false);
  77. // Dragon Dash
  78. getPlayer().addSkill(SkillTable.getInstance().getInfo(20004, 1), false);
  79. // Dragon Aura
  80. getPlayer().addSkill(SkillTable.getInstance().getInfo(20005, 1), false);
  81. getPlayer().setTransformAllowedSkills(SKILLS);
  82. }
  83. public static void main(String[] args)
  84. {
  85. TransformationManager.getInstance().registerTransformation(new DragonMasterLee());
  86. }
  87. }