EffectProtectionBlessing.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* This program is free software; you can redistribute it and/or modify
  2. * it under the terms of the GNU General Public License as published by
  3. * the Free Software Foundation; either version 2, or (at your option)
  4. * any later version.
  5. *
  6. * This program is distributed in the hope that it will be useful,
  7. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. * GNU General Public License for more details.
  10. *
  11. * You should have received a copy of the GNU General Public License
  12. * along with this program; if not, write to the Free Software
  13. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  14. * 02111-1307, USA.
  15. *
  16. * http://www.gnu.org/copyleft/gpl.html
  17. */
  18. package net.sf.l2j.gameserver.skills.effects;
  19. import net.sf.l2j.gameserver.model.L2Effect;
  20. import net.sf.l2j.gameserver.model.actor.L2Playable;
  21. import net.sf.l2j.gameserver.skills.Env;
  22. import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
  23. import net.sf.l2j.gameserver.templates.skills.L2EffectType;
  24. /**
  25. * @author kerberos_20
  26. *
  27. */
  28. public class EffectProtectionBlessing extends L2Effect
  29. {
  30. public EffectProtectionBlessing(Env env, EffectTemplate template)
  31. {
  32. super(env, template);
  33. }
  34. @Override
  35. public L2EffectType getEffectType()
  36. {
  37. return L2EffectType.PROTECTION_BLESSING;
  38. }
  39. /** Notify started */
  40. @Override
  41. public boolean onStart()
  42. {
  43. if (getEffected() instanceof L2Playable)
  44. {
  45. ((L2Playable) getEffected()).startProtectionBlessing();
  46. return true;
  47. }
  48. return false;
  49. }
  50. /** Notify exited */
  51. @Override
  52. public void onExit()
  53. {
  54. ((L2Playable) getEffected()).stopProtectionBlessing(this);
  55. }
  56. @Override
  57. public boolean onActionTime()
  58. {
  59. // just stop this effect
  60. return false;
  61. }
  62. }