Advertisement
Giardev

View Ware Clan

Nov 15th, 2022
946
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---------------------------------------------------------------
  2. com.l2jfrozen.gameserver.handler.AdminCommandHandler.java
  3.  
  4. @97
  5. import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminVip;
  6. +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminWHC;
  7. import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminWho;
  8.  
  9. @200
  10.  
  11.         registerAdminCommandHandler(new AdminVip());
  12.         +registerAdminCommandHandler(new AdminWHC());
  13.         registerAdminCommandHandler(new AdminWho());
  14.        
  15. ---------------------------------------------------------------
  16. com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminWHC.java
  17.  
  18. +package com.l2jfrozen.gameserver.handler.admincommandhandlers;
  19. +
  20. +import com.l2jfrozen.gameserver.datatables.sql.ClanTable;
  21. +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
  22. +import com.l2jfrozen.gameserver.model.L2Clan;
  23. +import com.l2jfrozen.gameserver.model.L2World;
  24. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  25. +import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;
  26. +import com.l2jfrozen.gameserver.network.serverpackets.WareHouseWithdrawalList;
  27. +
  28. +/**
  29. + * Codigo de visualização de Warehouse Clan. Esse codigo permite o adm visualizar o wh de qualquer player que tenha clan. O codigo é //whc clicado em um target com clan -
  30. + * Google Translator: Warehouse Clan preview code. This code allows the admin to view what any player who has a clan. The code is //whc clicked on a target with clan
  31. + * @author yycarvalho
  32. + */
  33. +public class AdminWHC implements IAdminCommandHandler
  34. +{
  35. +   private static final String[] ADMIN_COMMANDS =
  36. +   {
  37. +       "admin_whc",
  38. +   };
  39. +  
  40. +   @Override
  41. +   public boolean useAdminCommand(String command, L2PcInstance activeChar)
  42. +   {
  43. +       L2PcInstance Player = L2World.getInstance().getPlayer(activeChar.getTargetId());
  44. +       if (command.equals("admin_whc") && activeChar.getTarget() != null && Player.getClan() != null)
  45. +       {
  46. +           L2Clan Clan = ClanTable.getInstance().getClan(Player.getClanId());
  47. +           int LeaderId = Clan.getLeaderId();
  48. +           L2PcInstance PlayerLeader = L2PcInstance.load(LeaderId);
  49. +           PlayerLeader.setActiveWarehouse(PlayerLeader.getClan().getWarehouse());
  50. +           activeChar.sendPacket(new WareHouseWithdrawalList(PlayerLeader, WareHouseWithdrawalList.CLAN));
  51. +       }
  52. +       else
  53. +       {
  54. +           activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(), 0, activeChar.getName(), "Incorrect target"));
  55. +       }
  56. +      
  57. +       return false;
  58. +   }
  59. +  
  60. +   @Override
  61. +   public String[] getAdminCommandList()
  62. +   {
  63. +       return ADMIN_COMMANDS;
  64. +   }
  65. +}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement