Jump to content

Recommended Posts

Posted

 

PTBR: Já que o Alt+G não tem como visualizar o WH do Clan

Resolvi criar esse código //whc, espero que gostem, é bem útil

ainda sou iniciante no java caso o código tenha algo errado

Rev: Frozen (fácil adaptação para outras)

 

Google Translator:  Since Alt+G has no way to view the Clan's WH

I decided to create this code //whc, I hope you like it, it's very useful

I'm still a java beginner in case the code has something wrong

Rev: Frozen (easy adaptation to others)

 

---------------------------------------------------------------
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;
+	}
+}

 

Credits: me
Créditos: eu

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..