Bluff.java 2.2 KB

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