ScrollRed.java 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. * 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
  21. * 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 -
  22. * 5849 - From L2Vault: "The squares gives drops of "bond" and "landmine
  23. * ". 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 ;) "
  24. * Shock - 5851 - Stun effect from 5849 More Info: http://l2vault.ign.com/wiki/index.php/Handy%E2%80%99s_Block_Checker
  25. */
  26. public class ScrollRed extends L2Transformation
  27. {
  28. private static final int[] SKILLS =
  29. {
  30. 5853, 5491, 619
  31. };
  32. public ScrollRed()
  33. {
  34. // id, colRadius, colHeight
  35. super(121, 9, 28.3);
  36. }
  37. @Override
  38. public void onTransform()
  39. {
  40. if ((getPlayer().getTransformationId() != 121) || getPlayer().isCursedWeaponEquipped())
  41. {
  42. return;
  43. }
  44. transformedSkills();
  45. }
  46. public void transformedSkills()
  47. {
  48. // Flip Block
  49. getPlayer().addSkill(SkillTable.getInstance().getInfo(5853, 1), false);
  50. // Decrease Bow/Crossbow Attack Speed
  51. getPlayer().addSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  52. // Transform Dispel
  53. // getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
  54. getPlayer().setTransformAllowedSkills(SKILLS);
  55. }
  56. @Override
  57. public void onUntransform()
  58. {
  59. removeSkills();
  60. }
  61. public void removeSkills()
  62. {
  63. // Flip Block
  64. getPlayer().removeSkill(SkillTable.getInstance().getInfo(5853, 1), false);
  65. // Decrease Bow/Crossbow Attack Speed
  66. getPlayer().removeSkill(SkillTable.getInstance().getInfo(5491, 1), false);
  67. // Transform Dispel
  68. // getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);
  69. getPlayer().setTransformAllowedSkills(EMPTY_ARRAY);
  70. }
  71. public static void main(String[] args)
  72. {
  73. TransformationManager.getInstance().registerTransformation(new ScrollRed());
  74. }
  75. }