DivineSummoner.java 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 DivineSummoner extends L2Transformation
  24. {
  25. private static final int[] SKILLS =
  26. {
  27. 710,
  28. 711,
  29. 712,
  30. 713,
  31. 714,
  32. 5779,
  33. 619
  34. };
  35. public DivineSummoner()
  36. {
  37. // id, colRadius, colHeight
  38. super(258, 10, 25);
  39. }
  40. @Override
  41. public void onTransform()
  42. {
  43. if ((getPlayer().getTransformationId() != 258) || getPlayer().isCursedWeaponEquipped())
  44. {
  45. return;
  46. }
  47. if (getPlayer().hasSummon())
  48. {
  49. getPlayer().getSummon().unSummon(getPlayer());
  50. }
  51. transformedSkills();
  52. }
  53. @Override
  54. public void onUntransform()
  55. {
  56. if (getPlayer().hasSummon())
  57. {
  58. getPlayer().getSummon().unSummon(getPlayer());
  59. }
  60. removeSkills();
  61. }
  62. public void removeSkills()
  63. {
  64. // Divine Summoner Summon Divine Beast
  65. getPlayer().removeSkill(SkillTable.getInstance().getInfo(710, 1), false);
  66. // Divine Summoner Transfer Pain
  67. getPlayer().removeSkill(SkillTable.getInstance().getInfo(711, 1), false);
  68. // Divine Summoner Final Servitor
  69. getPlayer().removeSkill(SkillTable.getInstance().getInfo(712, 1), false);
  70. // Divine Summoner Servitor Hill
  71. getPlayer().removeSkill(SkillTable.getInstance().getInfo(713, 1), false);
  72. // Sacrifice Summoner
  73. getPlayer().removeSkill(SkillTable.getInstance().getInfo(714, 1), false, false);
  74. // Decrease Bow/Crossbow Attack Speed
  75. getPlayer().removeSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  76. // Transform Dispel
  77. getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);
  78. getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  79. }
  80. public void transformedSkills()
  81. {
  82. // Divine Summoner Summon Divine Beast
  83. getPlayer().addSkill(SkillTable.getInstance().getInfo(710, 1), false);
  84. // Divine Summoner Transfer Pain
  85. getPlayer().addSkill(SkillTable.getInstance().getInfo(711, 1), false);
  86. // Divine Summoner Final Servitor
  87. getPlayer().addSkill(SkillTable.getInstance().getInfo(712, 1), false);
  88. // Divine Summoner Servitor Hill
  89. getPlayer().addSkill(SkillTable.getInstance().getInfo(713, 1), false);
  90. // Sacrifice Summoner
  91. getPlayer().addSkill(SkillTable.getInstance().getInfo(714, 1), false);
  92. // Decrease Bow/Crossbow Attack Speed
  93. getPlayer().addSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  94. // Transform Dispel
  95. getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
  96. getPlayer().setTransformAllowedSkills(SKILLS);
  97. }
  98. public static void main(String[] args)
  99. {
  100. TransformationManager.getInstance().registerTransformation(new DivineSummoner());
  101. }
  102. }