ScrollRed.java 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. /**
  24. * TODO: Buffs disappear once you get transformed, but reappear after the transformed state wears off. Skills involved in the minigame but are not assigned directly to players: Flip Nearby Blocks - 5847 - For Flip Block, there are two skills, one for each side (makes sense). For this, there is only
  25. * one skill. Thus it is probably not assigned to the transformation. Block Trigger Slow - 5848 - This may be assigned to players, unsure. Decrease Speed - 5849 - This is possibly assigned to all players to set all players to the same running speed for the duration of the game. Block Trigger Stun -
  26. * 5849 - From L2Vault: "The squares gives drops of "bond" and "landmine
  27. * ". I wasn't able to figure out what the bond did as it wasn't anything that seemed to go into your inventory. However, Landmine did appear in your inventory which allows you to use it before flipping a square which will give the other team a state of stun when they attempt to flip the same square (from what I can gather, it all happens so quickly ;) "
  28. * Shock - 5851 - Stun effect from 5849 More Info: http://l2vault.ign.com/wiki/index.php/Handy%E2%80%99s_Block_Checker
  29. */
  30. public class ScrollRed extends L2Transformation
  31. {
  32. private static final int[] SKILLS =
  33. {
  34. 5853,
  35. 5491,
  36. 619
  37. };
  38. public ScrollRed()
  39. {
  40. // id, colRadius, colHeight
  41. super(121, 9, 28.3);
  42. }
  43. @Override
  44. public void onTransform()
  45. {
  46. if ((getPlayer().getTransformationId() != 121) || getPlayer().isCursedWeaponEquipped())
  47. {
  48. return;
  49. }
  50. transformedSkills();
  51. }
  52. @Override
  53. public void onUntransform()
  54. {
  55. removeSkills();
  56. }
  57. public void removeSkills()
  58. {
  59. // Flip Block
  60. getPlayer().removeSkill(SkillTable.getInstance().getInfo(5853, 1), false);
  61. // Decrease Bow/Crossbow Attack Speed
  62. getPlayer().removeSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  63. // Transform Dispel
  64. // getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);
  65. getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  66. }
  67. public void transformedSkills()
  68. {
  69. // Flip Block
  70. getPlayer().addSkill(SkillTable.getInstance().getInfo(5853, 1), false);
  71. // Decrease Bow/Crossbow Attack Speed
  72. getPlayer().addSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  73. // Transform Dispel
  74. // getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
  75. getPlayer().setTransformAllowedSkills(SKILLS);
  76. }
  77. public static void main(String[] args)
  78. {
  79. TransformationManager.getInstance().registerTransformation(new ScrollRed());
  80. }
  81. }