Jump to content
  • 0

[Help]//Sethero prob


Question

Posted

Pedia Xrisimopiw L2jserver rev 4299 kai to command //sethero den douleui Pite mou Pws na to Fix na to dikom AdminAdmin.java

 

/*

* 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.

*

* http://www.gnu.org/copyleft/gpl.html

*/

package net.sf.l2j.gameserver.handler.admincommandhandlers;

 

import java.util.StringTokenizer;

 

import net.sf.l2j.Config;

import net.sf.l2j.gameserver.GmListTable;

import net.sf.l2j.gameserver.Olympiad;

import net.sf.l2j.gameserver.cache.HtmCache;

import net.sf.l2j.gameserver.datatables.ItemTable;

import net.sf.l2j.gameserver.datatables.NpcTable;

import net.sf.l2j.gameserver.datatables.NpcWalkerRoutesTable;

import net.sf.l2j.gameserver.datatables.SkillTable;

import net.sf.l2j.gameserver.datatables.TeleportLocationTable;

import net.sf.l2j.gameserver.handler.IAdminCommandHandler;

import net.sf.l2j.gameserver.instancemanager.Manager;

import net.sf.l2j.gameserver.model.GMAudit;

import net.sf.l2j.gameserver.model.L2Multisell;

import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

import net.sf.l2j.gameserver.network.SystemMessageId;

import net.sf.l2j.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

: " + 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");

}

}

Recommended Posts

  • 0
Posted

kserw java :) .. 0ok tha to dokimaso kai tha sou pw

 

@krinos gia na kanw compile l2jfree xriazete maven E?

y einai to monadiko pou den ginete me eclipse alla me maven.... gl :P

Guest
This topic is now closed to further replies.


  • Posts

    • Hello community, I’d like to share an improved version of the L2smr editor for StaticMeshes, focused on solving some workflow issues I found in the original tool. CreditsThis project is based on the original acmi/L2smr repository https://github.com/acmi/L2smr , created by acmi, and I updated it to Java 17 with some additional features. Issues in the original L2smr Too many windows: each StaticMesh opened in a new one → cluttered desktop. No search: navigating through hundreds of StaticMeshActors was slow and tedious. Added improvements Flexible views Single Window Mode: reuse one window instead of opening new ones. Multiple Window Mode: still available for those who prefer having several views open simultaneously. Real-time Search Field Instant filtering as you type. Case-insensitive search. “Reset” button to quickly clear the search.     Installation and Execution: Clone the repository: git clone https://github.com/Jeep12/l2smr.git cd l2smr        2.Build the project:   ./gradlew build        3. Run the application:     ./run.bat      Or simply double-click on run.bat.     The run.bat script automatically extracts JavaFX from the included javafx-17.0.2.zip file in the javafx/ directory, sets up the required libraries, and launches the application. You don’t    need to install JavaFX separately.      Repository: https://github.com/Jeep12/l2smr     Maybe these features already existed in another version or fork, and they might not be very big changes, but since I didn’t know about them and found them necessary, I decided to          implement them myself and wanted to share them.      
    • no....Mobius L2Clientdat and L2FileEditor can do that...but still cant works with TaiWanese Grand Crusade ,especially Armorgrp.dat and Armorgrp-Classic.dat
    • L2GOLD - Halcyon x45 Project Classic Interlude   C6 - Classic Interlude: Protocol 110     Is a complete copy of L2Gold in Classic [110 Protocol] with L2OFF files.   Fully L2Gold Features - Daily Quest - Daily Mining Quest - Ancient Weapons -Refine System  -Rebirth System -Fully configurable everything you want -Gold stats/Gold skills/Gold items working 100% -Zones 100% alike  -Unique donations system (npc or voicedcommand .donate) - On Enchant success announcement ( if +16 for weapon, 8 for armor , 7 for jewel) - Announce of Castle Lord - Announce of Hero  - Olympiad Max A grade - Olympiad Buffs on matches changed to Gold Alike - Working fully Dreadbane   - AI Mods: Static Time for RB   Automated Events: Squash Watermelon RB Event High rate  (those are fully automated)   Server is running a Test Server: Online to anyone can test it.   Game Client: https://www.mediafire.com/file/1d8xe18rvgi04lx/L2_Classic_Interlude_Client_V2.rar/file   Game Patch: https://www.mediafire.com/file/3z4b8ezy93h2z1g/L2Halcyon+Gold+Patch.rar/file   GM Accounts: ID: root pass root [ accounts go from  root1 until root20 ]   Regular Accounts Registrations: http://84.247.164.27/?page=register   Some Screenshots: https://imgur.com/a/o7TxzTN   Contact me here via PM (only serious buyers).    Price of the product: Fully Server Pack + Source ( 250 Euros )
    • ✨ A Service with Vibes  Vibe SMS ✨   Vibe SMS is not just a platform for working with numbers. We’ve built it to be simple, convenient, and stress-free, so your tasks get done without hassle. We value real communication: we listen to your ideas, provide support, and make sure everyone feels calm and confident. With us, you’re not just a client  you’re part of a space built on trust, support, and a human touch. Vibe SMS is a place where people matter and where we create an atmosphere you’ll want to stay in.   Website link — https://vibe-sms.net/ Our Telegram channel — https://t.me/vibe_sms
  • 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