2
0

ExFishingHpRegen.java 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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)dddcccd
  19. * d: cahacter oid
  20. * d: time left
  21. * d: fish hp
  22. * c:
  23. * c:
  24. * c: 00 if fish gets damage 02 if fish regens
  25. * d:
  26. * @author -Wooden-
  27. *
  28. */
  29. public class ExFishingHpRegen extends L2GameServerPacket
  30. {
  31. private static final String _S__FE_16_EXFISHINGHPREGEN = "[S] FE:28 ExFishingHPRegen";
  32. private L2Character _activeChar;
  33. private int _time, _fishHP, _hpMode, _anim, _goodUse, _penalty, _hpBarColor;
  34. public ExFishingHpRegen(L2Character character, int time, int fishHP, int HPmode, int GoodUse, int anim, int penalty, int hpBarColor)
  35. {
  36. _activeChar = character;
  37. _time = time;
  38. _fishHP = fishHP;
  39. _hpMode = HPmode;
  40. _goodUse = GoodUse;
  41. _anim = anim;
  42. _penalty = penalty;
  43. _hpBarColor = hpBarColor;
  44. }
  45. /* (non-Javadoc)
  46. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#writeImpl()
  47. */
  48. @Override
  49. protected void writeImpl()
  50. {
  51. writeC(0xfe);
  52. writeH(0x28);
  53. writeD(_activeChar.getObjectId());
  54. writeD(_time);
  55. writeD(_fishHP);
  56. writeC(_hpMode); // 0 = HP stop, 1 = HP raise
  57. writeC(_goodUse); // 0 = none, 1 = success, 2 = failed
  58. writeC(_anim); // Anim: 0 = none, 1 = reeling, 2 = pumping
  59. writeD(_penalty); // Penalty
  60. writeC(_hpBarColor); // 0 = normal hp bar, 1 = purple hp bar
  61. }
  62. /* (non-Javadoc)
  63. * @see com.l2jserver.gameserver.BasePacket#getType()
  64. */
  65. @Override
  66. public String getType()
  67. {
  68. return _S__FE_16_EXFISHINGHPREGEN;
  69. }
  70. }