ManagePledgePower.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.L2Clan;
  17. public class ManagePledgePower extends L2GameServerPacket
  18. {
  19. private static final String _S__30_MANAGEPLEDGEPOWER = "[S] 2a ManagePledgePower";
  20. private int _action;
  21. private L2Clan _clan;
  22. private int _rank;
  23. private int _privs;
  24. public ManagePledgePower(L2Clan clan, int action, int rank)
  25. {
  26. _clan = clan;
  27. _action = action;
  28. _rank = rank;
  29. }
  30. @Override
  31. protected final void writeImpl()
  32. {
  33. writeC(0x2a);
  34. if(_action == 1)
  35. {
  36. _privs = _clan.getRankPrivs(_rank);
  37. }
  38. else
  39. {
  40. return;
  41. /*
  42. if (L2World.getInstance().findObject(_clanId) == null)
  43. return;
  44. privs = ((L2PcInstance)L2World.getInstance().findObject(_clanId)).getClanPrivileges();
  45. */
  46. }
  47. writeD(0);
  48. writeD(0);
  49. writeD(_privs);
  50. }
  51. /* (non-Javadoc)
  52. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#getType()
  53. */
  54. @Override
  55. public String getType()
  56. {
  57. return _S__30_MANAGEPLEDGEPOWER;
  58. }
  59. }