EffectParalyze.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 com.l2jserver.gameserver.skills.effects;
  16. import com.l2jserver.gameserver.model.CharEffectList;
  17. import com.l2jserver.gameserver.model.L2Effect;
  18. import com.l2jserver.gameserver.skills.AbnormalEffect;
  19. import com.l2jserver.gameserver.skills.Env;
  20. import com.l2jserver.gameserver.templates.effects.EffectTemplate;
  21. import com.l2jserver.gameserver.templates.skills.L2EffectType;
  22. public class EffectParalyze extends L2Effect
  23. {
  24. public EffectParalyze(Env env, EffectTemplate template)
  25. {
  26. super(env, template);
  27. }
  28. // Special constructor to steal this effect
  29. public EffectParalyze(Env env, L2Effect effect)
  30. {
  31. super(env, effect);
  32. }
  33. /**
  34. *
  35. * @see com.l2jserver.gameserver.model.L2Effect#effectCanBeStolen()
  36. */
  37. @Override
  38. protected boolean effectCanBeStolen()
  39. {
  40. return true;
  41. }
  42. /**
  43. *
  44. * @see com.l2jserver.gameserver.model.L2Effect#getEffectType()
  45. */
  46. @Override
  47. public L2EffectType getEffectType()
  48. {
  49. return L2EffectType.PARALYZE;
  50. }
  51. /**
  52. *
  53. * @see com.l2jserver.gameserver.model.L2Effect#onStart()
  54. */
  55. @Override
  56. public boolean onStart()
  57. {
  58. getEffected().startAbnormalEffect(AbnormalEffect.HOLD_1);
  59. getEffected().startParalyze();
  60. return super.onStart();
  61. }
  62. /**
  63. *
  64. * @see com.l2jserver.gameserver.model.L2Effect#onExit()
  65. */
  66. @Override
  67. public void onExit()
  68. {
  69. getEffected().stopAbnormalEffect(AbnormalEffect.HOLD_1);
  70. getEffected().stopParalyze(false);
  71. super.onExit();
  72. }
  73. /**
  74. *
  75. * @see com.l2jserver.gameserver.model.L2Effect#onActionTime()
  76. */
  77. @Override
  78. public boolean onActionTime()
  79. {
  80. return false;
  81. }
  82. /* (non-Javadoc)
  83. * @see com.l2jserver.gameserver.model.L2Effect#getEffectFlags()
  84. */
  85. @Override
  86. public int getEffectFlags()
  87. {
  88. return CharEffectList.EFFECT_FLAG_PARALYZED;
  89. }
  90. }