GameManager.java 1.9 KB

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