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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock