ExFishingStart.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.network.serverpackets;
  16. import com.l2jserver.gameserver.model.actor.L2Character;
  17. /**
  18. * Format (ch)ddddd
  19. * @author -Wooden-
  20. *
  21. */
  22. public class ExFishingStart extends L2GameServerPacket
  23. {
  24. private static final String _S__FE_13_EXFISHINGSTART = "[S] FE:1e ExFishingStart";
  25. private L2Character _activeChar;
  26. private int _x,_y,_z, _fishType;
  27. @SuppressWarnings("unused")
  28. private boolean _isNightLure;
  29. public ExFishingStart(L2Character character, int fishType, int x, int y,int z, boolean isNightLure)
  30. {
  31. _activeChar = character;
  32. _fishType = fishType;
  33. _x = x;
  34. _y = y;
  35. _z = z;
  36. _isNightLure = isNightLure;
  37. }
  38. /* (non-Javadoc)
  39. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#writeImpl()
  40. */
  41. @Override
  42. protected void writeImpl()
  43. {
  44. writeC(0xfe);
  45. writeH(0x1e);
  46. writeD(_activeChar.getObjectId());
  47. writeD(_fishType); // fish type
  48. writeD(_x); // x poisson
  49. writeD(_y); // y poisson
  50. writeD(_z); // z poisson
  51. writeC(0x00); // night lure
  52. writeC(0x00); //??
  53. writeC((_fishType >= 7 && _fishType <= 9) ? 0x01 : 0x00); // 0 = day lure 1 = night lure
  54. writeC(0x00);
  55. }
  56. /* (non-Javadoc)
  57. * @see com.l2jserver.gameserver.BasePacket#getType()
  58. */
  59. @Override
  60. public String getType()
  61. {
  62. return _S__FE_13_EXFISHINGSTART;
  63. }
  64. }