DragonMasterLee.java 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. /**
  20. * @author Tan
  21. */
  22. public class DragonMasterLee extends L2Transformation
  23. {
  24. private static final int[] SKILLS =
  25. {
  26. 5491, 619, 20002, 20004, 20005
  27. };
  28. public DragonMasterLee()
  29. {
  30. // id, colRadius, colHeight
  31. super(20005, 8, 19.3);
  32. }
  33. @Override
  34. public void onTransform()
  35. {
  36. if ((getPlayer().getTransformationId() != 20005) || getPlayer().isCursedWeaponEquipped())
  37. {
  38. return;
  39. }
  40. transformedSkills();
  41. }
  42. public void transformedSkills()
  43. {
  44. // Decrease Bow/Crossbow Attack Speed
  45. getPlayer().addSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  46. // Transform Dispel
  47. getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
  48. // Dragon Slash
  49. getPlayer().addSkill(SkillTable.getInstance().getInfo(20002, 1), false);
  50. // Dragon Dash
  51. getPlayer().addSkill(SkillTable.getInstance().getInfo(20004, 1), false);
  52. // Dragon Aura
  53. getPlayer().addSkill(SkillTable.getInstance().getInfo(20005, 1), false);
  54. getPlayer().setTransformAllowedSkills(SKILLS);
  55. }
  56. @Override
  57. public void onUntransform()
  58. {
  59. removeSkills();
  60. }
  61. public void removeSkills()
  62. {
  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. // Dragon Slash
  68. getPlayer().removeSkill(SkillTable.getInstance().getInfo(20002, 1), false);
  69. // Dragon Dash
  70. getPlayer().removeSkill(SkillTable.getInstance().getInfo(20004, 1), false);
  71. // Dragon Aura
  72. getPlayer().removeSkill(SkillTable.getInstance().getInfo(20005, 1), false);
  73. getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  74. }
  75. public static void main(String[] args)
  76. {
  77. TransformationManager.getInstance().registerTransformation(new DragonMasterLee());
  78. }
  79. }