EtcStatusUpdate.java 2.4 KB

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