Treykan.java 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 Treykan extends L2Transformation
  24. {
  25. private static final int[] SKILLS = new int[]
  26. {
  27. 619,
  28. 967,
  29. 968,
  30. 969,
  31. 5437
  32. };
  33. public Treykan()
  34. {
  35. // id, colRadius, colHeight
  36. super(126, 25, 27.00);
  37. }
  38. @Override
  39. public void onTransform()
  40. {
  41. if ((getPlayer().getTransformationId() != 126) || getPlayer().isCursedWeaponEquipped())
  42. {
  43. return;
  44. }
  45. transformedSkills();
  46. }
  47. @Override
  48. public void onUntransform()
  49. {
  50. removeSkills();
  51. }
  52. public void removeSkills()
  53. {
  54. // Transform Dispel
  55. getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);
  56. // Cursed Body
  57. getPlayer().removeSkill(SkillTable.getInstance().getInfo(967, 1), false);
  58. // Treykan Claw
  59. getPlayer().removeSkill(SkillTable.getInstance().getInfo(968, 1), false);
  60. // Treykan Dash
  61. getPlayer().removeSkill(SkillTable.getInstance().getInfo(969, 1), false);
  62. // Dissonance
  63. getPlayer().removeSkill(SkillTable.getInstance().getInfo(5437, 1), false);
  64. getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  65. }
  66. public void transformedSkills()
  67. {
  68. // Transform Dispel
  69. getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
  70. // Cursed Body
  71. getPlayer().addSkill(SkillTable.getInstance().getInfo(967, 1), false);
  72. // Treykan Claw
  73. getPlayer().addSkill(SkillTable.getInstance().getInfo(968, 1), false);
  74. // Treykan Dash
  75. getPlayer().addSkill(SkillTable.getInstance().getInfo(969, 1), false);
  76. // Dissonance
  77. getPlayer().addSkill(SkillTable.getInstance().getInfo(5437, 1), false);
  78. getPlayer().setTransformAllowedSkills(SKILLS);
  79. }
  80. public static void main(String[] args)
  81. {
  82. TransformationManager.getInstance().registerTransformation(new Treykan());
  83. }
  84. }