EtcStatusUpdate.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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.instance.L2PcInstance;
  17. /* Packet format: F3 XX000000 YY000000 ZZ000000 */
  18. /**
  19. *
  20. * @author Luca Baldi
  21. */
  22. public class EtcStatusUpdate extends L2GameServerPacket
  23. {
  24. private static final String _S__F3_ETCSTATUSUPDATE = "[S] f9 EtcStatusUpdate";
  25. private L2PcInstance _activeChar;
  26. public EtcStatusUpdate(L2PcInstance activeChar)
  27. {
  28. _activeChar = activeChar;
  29. }
  30. /**
  31. * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#writeImpl()
  32. */
  33. @Override
  34. protected void writeImpl()
  35. {
  36. writeC(0xf9); // several icons to a separate line (0 = disabled)
  37. writeD(_activeChar.getCharges()); // 1-7 increase force, lvl
  38. writeD(_activeChar.getWeightPenalty()); // 1-4 weight penalty, lvl (1=50%, 2=66.6%, 3=80%, 4=100%)
  39. writeD((_activeChar.getMessageRefusal() || _activeChar.isChatBanned() || _activeChar.isSilenceMode()) ? 1 : 0); // 1 = block all chat
  40. writeD(0x00); // 1 = danger area
  41. writeD(_activeChar.getExpertiseWeaponPenalty()); // 1 = grade penalty - weapon penalty [1-4]
  42. writeD(_activeChar.getExpertiseArmorPenalty()); // Armor Grade Penalty, need to implement it. [1-4]
  43. writeD(_activeChar.getCharmOfCourage() ? 1 : 0); // 1 = charm of courage (allows resurrection on the same spot upon death on the siege battlefield)
  44. writeD(_activeChar.getDeathPenaltyBuffLevel()); // 1-15 death penalty, lvl (combat ability decreased due to death)
  45. writeD(_activeChar.getSouls());
  46. }
  47. /**
  48. * @see com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket#getType()
  49. */
  50. @Override
  51. public String getType()
  52. {
  53. return _S__F3_ETCSTATUSUPDATE;
  54. }
  55. }