Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------
- com.l2jfrozen.gameserver.handler.AdminCommandHandler.java
- @97
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminVip;
- +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminWHC;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminWho;
- @200
- registerAdminCommandHandler(new AdminVip());
- +registerAdminCommandHandler(new AdminWHC());
- registerAdminCommandHandler(new AdminWho());
- ---------------------------------------------------------------
- com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminWHC.java
- +package com.l2jfrozen.gameserver.handler.admincommandhandlers;
- +
- +import com.l2jfrozen.gameserver.datatables.sql.ClanTable;
- +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
- +import com.l2jfrozen.gameserver.model.L2Clan;
- +import com.l2jfrozen.gameserver.model.L2World;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;
- +import com.l2jfrozen.gameserver.network.serverpackets.WareHouseWithdrawalList;
- +
- +/**
- + * 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 -
- + * 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
- + * @author yycarvalho
- + */
- +public class AdminWHC implements IAdminCommandHandler
- +{
- + private static final String[] ADMIN_COMMANDS =
- + {
- + "admin_whc",
- + };
- +
- + @Override
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + L2PcInstance Player = L2World.getInstance().getPlayer(activeChar.getTargetId());
- + if (command.equals("admin_whc") && activeChar.getTarget() != null && Player.getClan() != null)
- + {
- + L2Clan Clan = ClanTable.getInstance().getClan(Player.getClanId());
- + int LeaderId = Clan.getLeaderId();
- + L2PcInstance PlayerLeader = L2PcInstance.load(LeaderId);
- + PlayerLeader.setActiveWarehouse(PlayerLeader.getClan().getWarehouse());
- + activeChar.sendPacket(new WareHouseWithdrawalList(PlayerLeader, WareHouseWithdrawalList.CLAN));
- + }
- + else
- + {
- + activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(), 0, activeChar.getName(), "Incorrect target"));
- + }
- +
- + return false;
- + }
- +
- + @Override
- + public String[] getAdminCommandList()
- + {
- + return ADMIN_COMMANDS;
- + }
- +}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement