Treykan.java 2.6 KB

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