EffectCharmOfCourage.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 2, or (at your option) any later version.
  5. *
  6. * This program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  9. * details.
  10. *
  11. * You should have received a copy of the GNU General Public License along with
  12. * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  13. * Place - Suite 330, Boston, MA 02111-1307, USA.
  14. *
  15. * http://www.gnu.org/copyleft/gpl.html
  16. */
  17. package net.sf.l2j.gameserver.skills.effects;
  18. import net.sf.l2j.gameserver.model.L2Effect;
  19. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  20. import net.sf.l2j.gameserver.skills.Env;
  21. import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
  22. import net.sf.l2j.gameserver.templates.skills.L2EffectType;
  23. /**
  24. *
  25. * @author nBd
  26. */
  27. public class EffectCharmOfCourage extends L2Effect
  28. {
  29. public EffectCharmOfCourage(Env env, EffectTemplate template)
  30. {
  31. super(env, template);
  32. }
  33. /**
  34. * @see net.sf.l2j.gameserver.model.L2Effect#getEffectType()
  35. */
  36. @Override
  37. public L2EffectType getEffectType()
  38. {
  39. return L2EffectType.CHARMOFCOURAGE;
  40. }
  41. /**
  42. *
  43. * @see net.sf.l2j.gameserver.model.L2Effect#onStart()
  44. */
  45. @Override
  46. public boolean onStart()
  47. {
  48. if (getEffected() instanceof L2PcInstance)
  49. {
  50. ((L2PcInstance) getEffected()).setCharmOfCourage(true);
  51. return true;
  52. }
  53. return false;
  54. }
  55. /**
  56. *
  57. * @see net.sf.l2j.gameserver.model.L2Effect#onExit()
  58. */
  59. @Override
  60. public void onExit()
  61. {
  62. ((L2PcInstance) getEffected()).setCharmOfCourage(false);
  63. }
  64. /**
  65. * @see net.sf.l2j.gameserver.model.L2Effect#onActionTime()
  66. */
  67. @Override
  68. public boolean onActionTime()
  69. {
  70. return false;
  71. }
  72. }