Jump to content
  • 0

{HELP}//SETHERO


ellinak0s

Question

15 answers to this question

Recommended Posts

  • 0

pio pack ekanes compile?

com.l2jserver.gameserver.handler.admincommandhandlers anoixe to Arxeio AdminAdmin.java kai psaxe gia to sethero.
Link to comment
Share on other sites

  • 0

*

 This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* [url=http://www.gnu.org/copyleft/gpl.html]http://www.gnu.org/copyleft/gpl.html[/url]
*/
package lt.equal.gameserver.handler.admincommandhandlers;

import java.util.StringTokenizer;

import lt.equal.Config;
import lt.equal.gameserver.GmListTable;
import lt.equal.gameserver.Olympiad;
import lt.equal.gameserver.cache.HtmCache;
import lt.equal.gameserver.datatables.ItemTable;
import lt.equal.gameserver.datatables.NpcTable;
import lt.equal.gameserver.datatables.NpcWalkerRoutesTable;
import lt.equal.gameserver.datatables.SkillTable;
import lt.equal.gameserver.datatables.TeleportLocationTable;
import lt.equal.gameserver.handler.IAdminCommandHandler;
import lt.equal.gameserver.instancemanager.Manager;
import lt.equal.gameserver.model.GMAudit;
import lt.equal.gameserver.model.L2Multisell;
import lt.equal.gameserver.model.actor.instance.L2PcInstance;
import lt.equal.gameserver.network.SystemMessageId;
import lt.equal.gameserver.serverpackets.SystemMessage;

/**
* This class handles following admin commands:
* - admin|admin1/admin2/admin3/admin4/admin5 = slots for the 5 starting admin menus
* - gmliston/gmlistoff = includes/excludes active character from /gmlist results
* - silence = toggles private messages acceptance mode
* - diet = toggles weight penalty mode
* - tradeoff = toggles trade acceptance mode
* - reload = reloads specified component from multisell|skill|npc|htm|item|instancemanager
* - set/set_menu/set_mod = alters specified server setting
* - saveolymp = saves olympiad state manually
* - manualhero = cycles olympiad and calculate new heroes.
* @version $Revision: 1.3.2.1.2.4 $ $Date: 2007/07/28 10:06:06 $
*/
public class AdminAdmin implements IAdminCommandHandler {

private static final String[] ADMIN_COMMANDS = {"admin_admin", "admin_admin1", "admin_admin2", "admin_admin3", "admin_admin4", "admin_admin5",
	"admin_gmliston", "admin_gmlistoff", "admin_silence", "admin_diet", "admin_tradeoff", "admin_reload", "admin_set", "admin_set_menu", "admin_set_mod",
	"admin_saveolymp", "admin_manualhero"};

private static final int REQUIRED_LEVEL = Config.GM_MENU;

public boolean useAdminCommand(String command, L2PcInstance activeChar) {

	if (!Config.ALT_PRIVILEGES_ADMIN)
		if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM()))
			return false;

	GMAudit.auditGMAction(activeChar.getName(), command, (activeChar.getTarget() != null?activeChar.getTarget().getName():"no-target"), "");

	if (command.startsWith("admin_admin"))
	{
		showMainPage(activeChar,command);
	}
	else if(command.startsWith("admin_gmliston"))
	{
		GmListTable.getInstance().showGm(activeChar);
		activeChar.sendMessage("Registerd into gm list");
	}
	else if(command.startsWith("admin_gmlistoff"))
	{
		GmListTable.getInstance().hideGm(activeChar);
		activeChar.sendMessage("Removed from gm list");
	}
	else if(command.startsWith("admin_silence"))
	{
		if (activeChar.getMessageRefusal()) // already in message refusal mode
		{
			activeChar.setMessageRefusal(false);
			activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_ACCEPTANCE_MODE));
		}
		else
		{
			activeChar.setMessageRefusal(true);
			activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_REFUSAL_MODE));
		}
	}
	else if(command.startsWith("admin_saveolymp"))
	{
		try
		{
			Olympiad.getInstance().save();
		}
		catch(Exception e){e.printStackTrace();}
		activeChar.sendMessage("olympiad stuff saved!!");
	}
	else if(command.startsWith("admin_manualhero"))
	{
		try
		{
			Olympiad.getInstance().manualSelectHeroes();
		}
		catch(Exception e){e.printStackTrace();}
		activeChar.sendMessage("Heroes formed");
	}
	else if(command.startsWith("admin_diet"))
	{
		try
		{
			StringTokenizer st = new StringTokenizer(command);
			st.nextToken();
			if(st.nextToken().equalsIgnoreCase("on"))
			{
				activeChar.setDietMode(true);
				activeChar.sendMessage("Diet mode on");
			}
			else if(st.nextToken().equalsIgnoreCase("off"))
			{
				activeChar.setDietMode(false);
				activeChar.sendMessage("Diet mode off");
			}
		}
		catch(Exception ex)
		{
			if(activeChar.getDietMode())
			{
				activeChar.setDietMode(false);
				activeChar.sendMessage("Diet mode off");
			}
			else
			{
				activeChar.setDietMode(true);
				activeChar.sendMessage("Diet mode on");
			}
		}
		finally
		{
			activeChar.refreshOverloaded();
		}
	}
	else if(command.startsWith("admin_tradeoff"))
	{
		try
		{
			String mode = command.substring(15);
			if (mode.equalsIgnoreCase("on"))
			{
				activeChar.setTradeRefusal(true);
				activeChar.sendMessage("Trade refusal enabled");
			}
			else if (mode.equalsIgnoreCase("off"))
			{
				activeChar.setTradeRefusal(false);
				activeChar.sendMessage("Trade refusal disabled");
			}
		}
		catch(Exception ex)
		{
			if(activeChar.getTradeRefusal())
			{
				activeChar.setTradeRefusal(false);
				activeChar.sendMessage("Trade refusal disabled");
			}
			else
			{
				activeChar.setTradeRefusal(true);
				activeChar.sendMessage("Trade refusal enabled");
			}
		}
	}
	else if(command.startsWith("admin_reload"))
	{
		StringTokenizer st = new StringTokenizer(command);
		st.nextToken();
		try
		{
			String type = st.nextToken();
			if(type.equals("multisell"))
			{
				L2Multisell.getInstance().reload();
				activeChar.sendMessage("multisell reloaded");
			}
			else if(type.startsWith("teleport"))
			{
				TeleportLocationTable.getInstance().reloadAll();
				activeChar.sendMessage("teleport location table reloaded");
			}
			else if(type.startsWith("skill"))
			{
				SkillTable.getInstance().reload();
				activeChar.sendMessage("skills reloaded");
			}
			else if(type.equals("npc"))
			{
				NpcTable.getInstance().reloadAllNpc();
				activeChar.sendMessage("npcs reloaded");
			}
			else if(type.startsWith("htm"))
			{
				HtmCache.getInstance().reload();
				activeChar.sendMessage("Cache[html]: " + HtmCache.getInstance().getMemoryUsage()  + " megabytes on " + HtmCache.getInstance().getLoadedFiles() + " files loaded");
			}
			else if(type.startsWith("item"))
			{
				ItemTable.getInstance().reload();
				activeChar.sendMessage("Item templates reloaded");
			}
			else if(type.startsWith("instancemanager"))
			{
				Manager.reloadAll();
				activeChar.sendMessage("All instance manager has been reloaded");
			}
			else if(type.startsWith("npcwalkers"))
			{
				NpcWalkerRoutesTable.getInstance().load();
				activeChar.sendMessage("All NPC walker routes have been reloaded");

			}

		}
		catch(Exception e)
		{
			activeChar.sendMessage("Usage:  //reload <multisell|skill|npc|htm|item|instancemanager>");
		}
	}

	else if(command.startsWith("admin_set"))
	{
		StringTokenizer st = new StringTokenizer(command);
		String[] cmd=st.nextToken().split("_");
		try
		{
			String[] parameter = st.nextToken().split("=");
			String pName = parameter[0].trim();
			String pValue = parameter[1].trim();
			if (Config.setParameterValue(pName, pValue))
				activeChar.sendMessage("parameter "+pName+" succesfully set to "+pValue);
			else
				activeChar.sendMessage("Invalid parameter!");
		}
		catch(Exception e)
		{
			if (cmd.length==2)
				activeChar.sendMessage("Usage: //set parameter=vaue");
		}
		finally
		{
			if (cmd.length==3)
			{
				if (cmd[2].equalsIgnoreCase("menu"))
					AdminHelpPage.showHelpPage(activeChar, "settings.htm");
				else if (cmd[2].equalsIgnoreCase("mod"))
					AdminHelpPage.showHelpPage(activeChar, "mods_menu.htm");
			}
		}
	}
	return true;
}

public String[] getAdminCommandList()
{
	return ADMIN_COMMANDS;
}

private boolean checkLevel(int level)
{
	return (level >= REQUIRED_LEVEL);
}

private void showMainPage(L2PcInstance activeChar, String command)
{
	int mode = 0;
	String filename=null;
	try
	{
		mode = Integer.parseInt(command.substring(11));
	}
	catch (Exception e) {}
	switch (mode)
	{
	case 1:
		filename="main";
		break;
	case 2:
		filename="game";
		break;
	case 3:
		filename="effects";
		break;
	case 4:
		filename="server";
		break;
	case 5:
		filename="mods";
		break;
	default:
		if (Config.GM_ADMIN_MENU_STYLE.equals("modern"))
			filename="main";
		else
			filename="classic";
	break;
	}
	AdminHelpPage.showHelpPage(activeChar, filename+"_menu.htm");
}
}

Link to comment
Share on other sites

  • 0

dokimase auto

 This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* [url=http://www.gnu.org/copyleft/gpl.html]http://www.gnu.org/copyleft/gpl.html[/url]
*/
package lt.equal.gameserver.handler.admincommandhandlers;

import java.util.StringTokenizer;

import lt.equal.Config;
import lt.equal.gameserver.GmListTable;
import lt.equal.gameserver.Olympiad;
import lt.equal.gameserver.cache.HtmCache;
import lt.equal.gameserver.datatables.ItemTable;
import lt.equal.gameserver.datatables.NpcTable;
import lt.equal.gameserver.datatables.NpcWalkerRoutesTable;
import lt.equal.gameserver.datatables.SkillTable;
import lt.equal.gameserver.datatables.TeleportLocationTable;
import lt.equal.gameserver.handler.IAdminCommandHandler;
import lt.equal.gameserver.instancemanager.Manager;
import lt.equal.gameserver.model.GMAudit;
import lt.equal.gameserver.model.L2Multisell;
import lt.equal.gameserver.model.actor.instance.L2PcInstance;
import lt.equal.gameserver.network.SystemMessageId;
import lt.equal.gameserver.serverpackets.SystemMessage;

/**
* This class handles following admin commands:
* - admin|admin1/admin2/admin3/admin4/admin5 = slots for the 5 starting admin menus
* - gmliston/gmlistoff = includes/excludes active character from /gmlist results
* - silence = toggles private messages acceptance mode
* - diet = toggles weight penalty mode
* - tradeoff = toggles trade acceptance mode
* - reload = reloads specified component from multisell|skill|npc|htm|item|instancemanager
* - set/set_menu/set_mod = alters specified server setting
* - saveolymp = saves olympiad state manually
* - manualhero = cycles olympiad and calculate new heroes.
* @version $Revision: 1.3.2.1.2.4 $ $Date: 2007/07/28 10:06:06 $
*/
public class AdminAdmin implements IAdminCommandHandler {

private static final String[] ADMIN_COMMANDS = {"admin_admin", "admin_admin1", "admin_admin2", "admin_admin3", "admin_admin4", "admin_admin5",
	"admin_gmliston", "admin_gmlistoff", "admin_silence", "admin_diet", "admin_tradeoff", "admin_reload", "admin_set", "admin_set_menu", "admin_set_mod",
	"admin_saveolymp", "admin_manualhero", "admin_sethero"};

private static final int REQUIRED_LEVEL = Config.GM_MENU;

public boolean useAdminCommand(String command, L2PcInstance activeChar) {

	if (!Config.ALT_PRIVILEGES_ADMIN)
		if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM()))
			return false;

	GMAudit.auditGMAction(activeChar.getName(), command, (activeChar.getTarget() != null?activeChar.getTarget().getName():"no-target"), "");

	if (command.startsWith("admin_admin"))
	{
		showMainPage(activeChar,command);
	}
	else if(command.startsWith("admin_gmliston"))
	{
		GmListTable.getInstance().showGm(activeChar);
		activeChar.sendMessage("Registerd into gm list");
	}
	else if(command.startsWith("admin_gmlistoff"))
	{
		GmListTable.getInstance().hideGm(activeChar);
		activeChar.sendMessage("Removed from gm list");
	}
	else if(command.startsWith("admin_silence"))
	{
		if (activeChar.getMessageRefusal()) // already in message refusal mode
		{
			activeChar.setMessageRefusal(false);
			activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_ACCEPTANCE_MODE));
		}
		else
		{
			activeChar.setMessageRefusal(true);
			activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_REFUSAL_MODE));
		}
	}
	else if(command.startsWith("admin_saveolymp"))
	{
		try
		{
			Olympiad.getInstance().save();
		}
		catch(Exception e){e.printStackTrace();}
		activeChar.sendMessage("olympiad stuff saved!!");
	}
               else if (command.startsWith("admin_sethero"))
	{
		L2PcInstance target = null;

		if (activeChar.getTarget() instanceof L2PcInstance)
		{
			target = (L2PcInstance) activeChar.getTarget();
			target.setHero(target.isHero() ? false : true);
		}
		else
		{
			target = activeChar;
			target.setHero(target.isHero() ? false : true);
		}
		target.broadcastUserInfo();
	}
	else if(command.startsWith("admin_manualhero"))
	{
		try
		{
			Olympiad.getInstance().manualSelectHeroes();
		}
		catch(Exception e){e.printStackTrace();}
		activeChar.sendMessage("Heroes formed");
	}
	else if(command.startsWith("admin_diet"))
	{
		try
		{
			StringTokenizer st = new StringTokenizer(command);
			st.nextToken();
			if(st.nextToken().equalsIgnoreCase("on"))
			{
				activeChar.setDietMode(true);
				activeChar.sendMessage("Diet mode on");
			}
			else if(st.nextToken().equalsIgnoreCase("off"))
			{
				activeChar.setDietMode(false);
				activeChar.sendMessage("Diet mode off");
			}
		}
		catch(Exception ex)
		{
			if(activeChar.getDietMode())
			{
				activeChar.setDietMode(false);
				activeChar.sendMessage("Diet mode off");
			}
			else
			{
				activeChar.setDietMode(true);
				activeChar.sendMessage("Diet mode on");
			}
		}
		finally
		{
			activeChar.refreshOverloaded();
		}
	}
	else if(command.startsWith("admin_tradeoff"))
	{
		try
		{
			String mode = command.substring(15);
			if (mode.equalsIgnoreCase("on"))
			{
				activeChar.setTradeRefusal(true);
				activeChar.sendMessage("Trade refusal enabled");
			}
			else if (mode.equalsIgnoreCase("off"))
			{
				activeChar.setTradeRefusal(false);
				activeChar.sendMessage("Trade refusal disabled");
			}
		}
		catch(Exception ex)
		{
			if(activeChar.getTradeRefusal())
			{
				activeChar.setTradeRefusal(false);
				activeChar.sendMessage("Trade refusal disabled");
			}
			else
			{
				activeChar.setTradeRefusal(true);
				activeChar.sendMessage("Trade refusal enabled");
			}
		}
	}
	else if(command.startsWith("admin_reload"))
	{
		StringTokenizer st = new StringTokenizer(command);
		st.nextToken();
		try
		{
			String type = st.nextToken();
			if(type.equals("multisell"))
			{
				L2Multisell.getInstance().reload();
				activeChar.sendMessage("multisell reloaded");
			}
			else if(type.startsWith("teleport"))
			{
				TeleportLocationTable.getInstance().reloadAll();
				activeChar.sendMessage("teleport location table reloaded");
			}
			else if(type.startsWith("skill"))
			{
				SkillTable.getInstance().reload();
				activeChar.sendMessage("skills reloaded");
			}
			else if(type.equals("npc"))
			{
				NpcTable.getInstance().reloadAllNpc();
				activeChar.sendMessage("npcs reloaded");
			}
			else if(type.startsWith("htm"))
			{
				HtmCache.getInstance().reload();
				activeChar.sendMessage("Cache[html]: " + HtmCache.getInstance().getMemoryUsage()  + " megabytes on " + HtmCache.getInstance().getLoadedFiles() + " files loaded");
			}
			else if(type.startsWith("item"))
			{
				ItemTable.getInstance().reload();
				activeChar.sendMessage("Item templates reloaded");
			}
			else if(type.startsWith("instancemanager"))
			{
				Manager.reloadAll();
				activeChar.sendMessage("All instance manager has been reloaded");
			}
			else if(type.startsWith("npcwalkers"))
			{
				NpcWalkerRoutesTable.getInstance().load();
				activeChar.sendMessage("All NPC walker routes have been reloaded");

			}

		}
		catch(Exception e)
		{
			activeChar.sendMessage("Usage:  //reload <multisell|skill|npc|htm|item|instancemanager>");
		}
	}

	else if(command.startsWith("admin_set"))
	{
		StringTokenizer st = new StringTokenizer(command);
		String[] cmd=st.nextToken().split("_");
		try
		{
			String[] parameter = st.nextToken().split("=");
			String pName = parameter[0].trim();
			String pValue = parameter[1].trim();
			if (Config.setParameterValue(pName, pValue))
				activeChar.sendMessage("parameter "+pName+" succesfully set to "+pValue);
			else
				activeChar.sendMessage("Invalid parameter!");
		}
		catch(Exception e)
		{
			if (cmd.length==2)
				activeChar.sendMessage("Usage: //set parameter=vaue");
		}
		finally
		{
			if (cmd.length==3)
			{
				if (cmd[2].equalsIgnoreCase("menu"))
					AdminHelpPage.showHelpPage(activeChar, "settings.htm");
				else if (cmd[2].equalsIgnoreCase("mod"))
					AdminHelpPage.showHelpPage(activeChar, "mods_menu.htm");
			}
		}
	}
	return true;
}

public String[] getAdminCommandList()
{
	return ADMIN_COMMANDS;
}

private boolean checkLevel(int level)
{
	return (level >= REQUIRED_LEVEL);
}

private void showMainPage(L2PcInstance activeChar, String command)
{
	int mode = 0;
	String filename=null;
	try
	{
		mode = Integer.parseInt(command.substring(11));
	}
	catch (Exception e) {}
	switch (mode)
	{
	case 1:
		filename="main";
		break;
	case 2:
		filename="game";
		break;
	case 3:
		filename="effects";
		break;
	case 4:
		filename="server";
		break;
	case 5:
		filename="mods";
		break;
	default:
		if (Config.GM_ADMIN_MENU_STYLE.equals("modern"))
			filename="main";
		else
			filename="classic";
	break;
	}
	AdminHelpPage.showHelpPage(activeChar, filename+"_menu.htm");
}
}

Link to comment
Share on other sites

  • 0

dokimase auto

 This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* [url=http://www.gnu.org/copyleft/gpl.html]http://www.gnu.org/copyleft/gpl.html[/url]
*/
package lt.equal.gameserver.handler.admincommandhandlers;

import java.util.StringTokenizer;

import lt.equal.Config;
import lt.equal.gameserver.GmListTable;
import lt.equal.gameserver.Olympiad;
import lt.equal.gameserver.cache.HtmCache;
import lt.equal.gameserver.datatables.ItemTable;
import lt.equal.gameserver.datatables.NpcTable;
import lt.equal.gameserver.datatables.NpcWalkerRoutesTable;
import lt.equal.gameserver.datatables.SkillTable;
import lt.equal.gameserver.datatables.TeleportLocationTable;
import lt.equal.gameserver.handler.IAdminCommandHandler;
import lt.equal.gameserver.instancemanager.Manager;
import lt.equal.gameserver.model.GMAudit;
import lt.equal.gameserver.model.L2Multisell;
import lt.equal.gameserver.model.actor.instance.L2PcInstance;
import lt.equal.gameserver.network.SystemMessageId;
import lt.equal.gameserver.serverpackets.SystemMessage;

/**
* This class handles following admin commands:
* - admin|admin1/admin2/admin3/admin4/admin5 = slots for the 5 starting admin menus
* - gmliston/gmlistoff = includes/excludes active character from /gmlist results
* - silence = toggles private messages acceptance mode
* - diet = toggles weight penalty mode
* - tradeoff = toggles trade acceptance mode
* - reload = reloads specified component from multisell|skill|npc|htm|item|instancemanager
* - set/set_menu/set_mod = alters specified server setting
* - saveolymp = saves olympiad state manually
* - manualhero = cycles olympiad and calculate new heroes.
* @version $Revision: 1.3.2.1.2.4 $ $Date: 2007/07/28 10:06:06 $
*/
public class AdminAdmin implements IAdminCommandHandler {

private static final String[] ADMIN_COMMANDS = {"admin_admin", "admin_admin1", "admin_admin2", "admin_admin3", "admin_admin4", "admin_admin5",
	"admin_gmliston", "admin_gmlistoff", "admin_silence", "admin_diet", "admin_tradeoff", "admin_reload", "admin_set", "admin_set_menu", "admin_set_mod",
	"admin_saveolymp", "admin_manualhero", "admin_sethero"};

private static final int REQUIRED_LEVEL = Config.GM_MENU;

public boolean useAdminCommand(String command, L2PcInstance activeChar) {

	if (!Config.ALT_PRIVILEGES_ADMIN)
		if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM()))
			return false;

	GMAudit.auditGMAction(activeChar.getName(), command, (activeChar.getTarget() != null?activeChar.getTarget().getName():"no-target"), "");

	if (command.startsWith("admin_admin"))
	{
		showMainPage(activeChar,command);
	}
	else if(command.startsWith("admin_gmliston"))
	{
		GmListTable.getInstance().showGm(activeChar);
		activeChar.sendMessage("Registerd into gm list");
	}
	else if(command.startsWith("admin_gmlistoff"))
	{
		GmListTable.getInstance().hideGm(activeChar);
		activeChar.sendMessage("Removed from gm list");
	}
	else if(command.startsWith("admin_silence"))
	{
		if (activeChar.getMessageRefusal()) // already in message refusal mode
		{
			activeChar.setMessageRefusal(false);
			activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_ACCEPTANCE_MODE));
		}
		else
		{
			activeChar.setMessageRefusal(true);
			activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_REFUSAL_MODE));
		}
	}
	else if(command.startsWith("admin_saveolymp"))
	{
		try
		{
			Olympiad.getInstance().save();
		}
		catch(Exception e){e.printStackTrace();}
		activeChar.sendMessage("olympiad stuff saved!!");
	}
                else if (command.startsWith("admin_sethero"))
	{
		L2PcInstance target = null;

		if (activeChar.getTarget() instanceof L2PcInstance)
		{
			target = (L2PcInstance) activeChar.getTarget();
			target.setHero(target.isHero() ? false : true);
		}
		else
		{
			target = activeChar;
			target.setHero(target.isHero() ? false : true);
		}
		target.broadcastUserInfo();
	}
	else if(command.startsWith("admin_manualhero"))
	{
		try
		{
			Olympiad.getInstance().manualSelectHeroes();
		}
		catch(Exception e){e.printStackTrace();}
		activeChar.sendMessage("Heroes formed");
	}
	else if(command.startsWith("admin_diet"))
	{
		try
		{
			StringTokenizer st = new StringTokenizer(command);
			st.nextToken();
			if(st.nextToken().equalsIgnoreCase("on"))
			{
				activeChar.setDietMode(true);
				activeChar.sendMessage("Diet mode on");
			}
			else if(st.nextToken().equalsIgnoreCase("off"))
			{
				activeChar.setDietMode(false);
				activeChar.sendMessage("Diet mode off");
			}
		}
		catch(Exception ex)
		{
			if(activeChar.getDietMode())
			{
				activeChar.setDietMode(false);
				activeChar.sendMessage("Diet mode off");
			}
			else
			{
				activeChar.setDietMode(true);
				activeChar.sendMessage("Diet mode on");
			}
		}
		finally
		{
			activeChar.refreshOverloaded();
		}
	}
	else if(command.startsWith("admin_tradeoff"))
	{
		try
		{
			String mode = command.substring(15);
			if (mode.equalsIgnoreCase("on"))
			{
				activeChar.setTradeRefusal(true);
				activeChar.sendMessage("Trade refusal enabled");
			}
			else if (mode.equalsIgnoreCase("off"))
			{
				activeChar.setTradeRefusal(false);
				activeChar.sendMessage("Trade refusal disabled");
			}
		}
		catch(Exception ex)
		{
			if(activeChar.getTradeRefusal())
			{
				activeChar.setTradeRefusal(false);
				activeChar.sendMessage("Trade refusal disabled");
			}
			else
			{
				activeChar.setTradeRefusal(true);
				activeChar.sendMessage("Trade refusal enabled");
			}
		}
	}
	else if(command.startsWith("admin_reload"))
	{
		StringTokenizer st = new StringTokenizer(command);
		st.nextToken();
		try
		{
			String type = st.nextToken();
			if(type.equals("multisell"))
			{
				L2Multisell.getInstance().reload();
				activeChar.sendMessage("multisell reloaded");
			}
			else if(type.startsWith("teleport"))
			{
				TeleportLocationTable.getInstance().reloadAll();
				activeChar.sendMessage("teleport location table reloaded");
			}
			else if(type.startsWith("skill"))
			{
				SkillTable.getInstance().reload();
				activeChar.sendMessage("skills reloaded");
			}
			else if(type.equals("npc"))
			{
				NpcTable.getInstance().reloadAllNpc();
				activeChar.sendMessage("npcs reloaded");
			}
			else if(type.startsWith("htm"))
			{
				HtmCache.getInstance().reload();
				activeChar.sendMessage("Cache[html]: " + HtmCache.getInstance().getMemoryUsage()  + " megabytes on " + HtmCache.getInstance().getLoadedFiles() + " files loaded");
			}
			else if(type.startsWith("item"))
			{
				ItemTable.getInstance().reload();
				activeChar.sendMessage("Item templates reloaded");
			}
			else if(type.startsWith("instancemanager"))
			{
				Manager.reloadAll();
				activeChar.sendMessage("All instance manager has been reloaded");
			}
			else if(type.startsWith("npcwalkers"))
			{
				NpcWalkerRoutesTable.getInstance().load();
				activeChar.sendMessage("All NPC walker routes have been reloaded");

			}

		}
		catch(Exception e)
		{
			activeChar.sendMessage("Usage:  //reload <multisell|skill|npc|htm|item|instancemanager>");
		}
	}

	else if(command.startsWith("admin_set"))
	{
		StringTokenizer st = new StringTokenizer(command);
		String[] cmd=st.nextToken().split("_");
		try
		{
			String[] parameter = st.nextToken().split("=");
			String pName = parameter[0].trim();
			String pValue = parameter[1].trim();
			if (Config.setParameterValue(pName, pValue))
				activeChar.sendMessage("parameter "+pName+" succesfully set to "+pValue);
			else
				activeChar.sendMessage("Invalid parameter!");
		}
		catch(Exception e)
		{
			if (cmd.length==2)
				activeChar.sendMessage("Usage: //set parameter=vaue");
		}
		finally
		{
			if (cmd.length==3)
			{
				if (cmd[2].equalsIgnoreCase("menu"))
					AdminHelpPage.showHelpPage(activeChar, "settings.htm");
				else if (cmd[2].equalsIgnoreCase("mod"))
					AdminHelpPage.showHelpPage(activeChar, "mods_menu.htm");
			}
		}
	}
	return true;
}

public String[] getAdminCommandList()
{
	return ADMIN_COMMANDS;
}

private boolean checkLevel(int level)
{
	return (level >= REQUIRED_LEVEL);
}

private void showMainPage(L2PcInstance activeChar, String command)
{
	int mode = 0;
	String filename=null;
	try
	{
		mode = Integer.parseInt(command.substring(11));
	}
	catch (Exception e) {}
	switch (mode)
	{
	case 1:
		filename="main";
		break;
	case 2:
		filename="game";
		break;
	case 3:
		filename="effects";
		break;
	case 4:
		filename="server";
		break;
	case 5:
		filename="mods";
		break;
	default:
		if (Config.GM_ADMIN_MENU_STYLE.equals("modern"))
			filename="main";
		else
			filename="classic";
	break;
	}
	AdminHelpPage.showHelpPage(activeChar, filename+"_menu.htm");
}
}

na to antigrapsw kai meta build?
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • 2 Factor Authentication Code for 100% secure login. Account provided with full information (email, password, dob, gender, etc).
    • ready server for sale, also available for testing with ready and beautiful npc zone pvp with custom 2 epic core orfen lvl2 with all maps ready all quests work at 100% ready comm  board with buffer teleport gm shop service anyone interested send me a pm many more that I forget  Exp/Sp : x30 (Premium: x40)    Adena : x7 (Premium: x10)   Drop : x7 (Premium: 10)   Spoil : x7 (Premium: 10)   Seal Stones : x7 (Premium: 10)   Raid Boss EXP/SP : x10   Raid Boss Drop : x3 (Premium: x5)   Epic Boss Drop : x1 Enchants   Safe Enchant : +3   Max Enchant : +16   Normal Scroll of Enchant Chance : 55%   Blessed Scroll of Enchant Chance : 60% Game Features   GMShop (Max. B-Grade)   Mana Potions (1000 MP, 10 sec Cooldown)   NPC Buffer (Include all buffs, 2h duration)   Auto-learn skills (Except Divine Inspiration)   Global Gatekeeper   Skill Escape: 15 seconds or /unstuck   1st Class Transfer (Free)   2nd Class Transfer (Free)   3rd Class Transfer (700 halisha mark)   Subclass (Items required from Cabrio / Hallate / Kernon / Golkonda + Top B Weapon + 984 Cry B)   Subclass 5 Subclasses + Main (Previous subclasses to level 75 to add new one)   Noblesse (Full Retail Quest)   Buff Slots: 24 (28 with Divine Inspiration LVL 4)   Skill Sweeper Festival added (Scavenger level 36)   Skill Block Buff added   Maximum delevel to keep Skills: 10 Levels   Shift + Click to see Droplist   Global Shout & Trade Chat   Retail Geodata and Pathnodes   Seven Signs Retail   Merchant and Blacksmith of Mammon at towns   Dimensional Rift (Min. 3 people in party to enter - Instance)   Tyrannosaurus drop Top LS with fixed 50% chance   Fast Augmentation System (Using Life Stones from Inventory)   Chance of getting skills (Normal 1%, Mid 3%, High 5%, Top 10%)   Wedding System with 30 seconds teleport to husband/wife Olympiad & Siege   Olympiad circle 14 days. (Maximum Enchant +6)   Olympiads time 18:00 - 00:00 (GMT +3)   Non-class 5 minimum participants to begin   Class based disabled   Siege every week.   To gain the reward you need to keep the Castle 2 times. Clans, Alliances & Limits   Max Clients/PC: 2   Max Clan Members: 36   Alliances allowed (Max 1 Clans)   24H Clan Penalties   Alliance penalty reset at daily restart (3-5 AM)   To bid for a Clan Hall required Clan Level 6 Quests x3   Alliance with the Ketra Orcs   Alliance with the Varka Silenos   War with Ketra Orcs   War with the Varka Silenos   The Finest Food   A Powerful Primeval Creature   Legacy of Insolence   Exploration of Giants Cave Part 1   Exploration of Giants Cave Part 2   Seekers of the Holy Grail   Guardians of the Holy Grail   Hunt of the Golden Ram Mercenary Force   The Zero Hour   Delicious Top Choice Meat   Heart in Search of Power   Rise and Fall of the Elroki Tribe   Yoke of the Past     Renegade Boss (Monday to Friday 20:00)   All Raid Boss 18+1 hours random respawn   Core (Jewel +1 STR +1 DEX) Monday, Wednesday and Friday 20:00 - 21:00 (Maximum level allowed to enter Cruma Tower: 80)   Orfen (Jewel +1 INT +1 WIT) Monday to Friday, 20:00 - 21:00 (Maximum level allowed to enter Sea of Spores: 80)   Ant Queen Monday and Friday 21:00 - 22:00 (Maximum level allowed to enter Ant Nest: 80)   Zaken Monday,Wednesday,Friday 22:00 - 23:00 (Maximum level allowed to enter Devil's Isle: 80)   Frintezza Tuesday, Thursday and Sunday 22:00 – 23:00 (Need CC of 4 party and 7 people in each party min to join the lair, max is 8 party of 9 people each)   Baium (lvl80) Saturday 22:00 – 23:00   Antharas Every 2 Saturdays 22:00 - 23:00 Every 2 Sundays (alternating with Valakas) 22:00 – 23:00   Valakas Every 2 Saturdays 22:00 - 23:00 Every 2 Sundays (alternating with Antharas) 22:00 – 23:00   Subclass Raids (Cabrio, Kernon, Hallate, Golkonda) 18hours + 1 random   Noblesse Raid (Barakiel) 6 hours + 15min random   Varka’s Hero Shadith 8 hours + 30 mins random (4th lvl of alliance with Ketra)   Ketra’s Hero Hekaton 8 hours + 30 mins random (4th lvl of alliance with Varka)   Varka’s Commander Mos 8 hours + 30 mins random (5th lvl of alliance with Ketra)   Ketra’s Commander Tayr 8 hours + 30 mins random (5th lvl of alliance with Varka)
    • Have a great day! Unfortunately, we can not give you the codes at the moment, but they will be distributed as soon as trial is back online, thanks for understanding! Other users also can reply there for codes, we will send them out some time after.
    • Ok mates i would like to play a pridestyle server (interluide, gracie w/ever) Is there any such server online and worth playing?
  • Topics

×
×
  • 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