SujinChild.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 SujinChild extends L2Transformation
  24. {
  25. private static final int[] SKILLS = new int[]
  26. {
  27. 619
  28. };
  29. public SujinChild()
  30. {
  31. // id, colRadius, colHeight
  32. super(20003, 10, 11.00);
  33. }
  34. @Override
  35. public void onTransform()
  36. {
  37. if ((getPlayer().getTransformationId() != 20003) || getPlayer().isCursedWeaponEquipped())
  38. {
  39. return;
  40. }
  41. transformedSkills();
  42. }
  43. @Override
  44. public void onUntransform()
  45. {
  46. removeSkills();
  47. }
  48. public void removeSkills()
  49. {
  50. // Transform Dispel
  51. getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);
  52. getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  53. }
  54. public void transformedSkills()
  55. {
  56. // Transform Dispel
  57. getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
  58. getPlayer().setTransformAllowedSkills(SKILLS);
  59. }
  60. public static void main(String[] args)
  61. {
  62. TransformationManager.getInstance().registerTransformation(new SujinChild());
  63. }
  64. }