GMViewPledgeInfo.java 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (C) 2004-2015 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.gameserver.network.serverpackets;
  20. import com.l2jserver.gameserver.model.L2Clan;
  21. import com.l2jserver.gameserver.model.L2ClanMember;
  22. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  23. public class GMViewPledgeInfo extends L2GameServerPacket
  24. {
  25. private final L2Clan _clan;
  26. private final L2PcInstance _activeChar;
  27. public GMViewPledgeInfo(L2Clan clan, L2PcInstance activeChar)
  28. {
  29. _clan = clan;
  30. _activeChar = activeChar;
  31. }
  32. @Override
  33. protected final void writeImpl()
  34. {
  35. writeC(0x96);
  36. writeS(_activeChar.getName());
  37. writeD(_clan.getId());
  38. writeD(0x00);
  39. writeS(_clan.getName());
  40. writeS(_clan.getLeaderName());
  41. writeD(_clan.getCrestId()); // -> no, it's no longer used (nuocnam) fix by game
  42. writeD(_clan.getLevel());
  43. writeD(_clan.getCastleId());
  44. writeD(_clan.getHideoutId());
  45. writeD(_clan.getFortId());
  46. writeD(_clan.getRank());
  47. writeD(_clan.getReputationScore());
  48. writeD(0x00);
  49. writeD(0x00);
  50. writeD(_clan.getAllyId()); // c2
  51. writeS(_clan.getAllyName()); // c2
  52. writeD(_clan.getAllyCrestId()); // c2
  53. writeD(_clan.isAtWar() ? 1 : 0); // c3
  54. writeD(0x00); // T3 Unknown
  55. writeD(_clan.getMembers().length);
  56. for (L2ClanMember member : _clan.getMembers())
  57. {
  58. if (member != null)
  59. {
  60. writeS(member.getName());
  61. writeD(member.getLevel());
  62. writeD(member.getClassId());
  63. writeD(member.getSex() ? 1 : 0);
  64. writeD(member.getRaceOrdinal());
  65. writeD(member.isOnline() ? member.getObjectId() : 0);
  66. writeD(member.getSponsor() != 0 ? 1 : 0);
  67. }
  68. }
  69. }
  70. }