EffectBluff.java 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.L2Effect;
  17. import com.l2jserver.gameserver.model.actor.L2Npc;
  18. import com.l2jserver.gameserver.model.actor.instance.L2NpcInstance;
  19. import com.l2jserver.gameserver.model.actor.instance.L2SiegeSummonInstance;
  20. import com.l2jserver.gameserver.network.serverpackets.StartRotation;
  21. import com.l2jserver.gameserver.network.serverpackets.StopRotation;
  22. import com.l2jserver.gameserver.skills.Env;
  23. import com.l2jserver.gameserver.templates.effects.EffectTemplate;
  24. import com.l2jserver.gameserver.templates.skills.L2EffectType;
  25. /**
  26. * @author decad
  27. *
  28. * Implementation of the Bluff Effect
  29. */
  30. public class EffectBluff extends L2Effect
  31. {
  32. public EffectBluff(Env env, EffectTemplate template)
  33. {
  34. super(env, template);
  35. }
  36. /**
  37. *
  38. * @see com.l2jserver.gameserver.model.L2Effect#getEffectType()
  39. */
  40. @Override
  41. public L2EffectType getEffectType()
  42. {
  43. return L2EffectType.BLUFF; // test for bluff effect
  44. }
  45. /**
  46. *
  47. * @see com.l2jserver.gameserver.model.L2Effect#onStart()
  48. */
  49. @Override
  50. public boolean onStart()
  51. {
  52. if (getEffected() instanceof L2NpcInstance)
  53. return false;
  54. if (getEffected() instanceof L2Npc && ((L2Npc) getEffected()).getNpcId() == 35062)
  55. return false;
  56. if (getEffected() instanceof L2SiegeSummonInstance)
  57. return false;
  58. getEffected().broadcastPacket(new StartRotation(getEffected().getObjectId(), getEffected().getHeading(), 1, 65535));
  59. getEffected().broadcastPacket(new StopRotation(getEffected().getObjectId(), getEffector().getHeading(), 65535));
  60. getEffected().setHeading(getEffector().getHeading());
  61. return true;
  62. }
  63. /**
  64. *
  65. * @see com.l2jserver.gameserver.model.L2Effect#onActionTime()
  66. */
  67. @Override
  68. public boolean onActionTime()
  69. {
  70. return false;
  71. }
  72. }