Łighto™
Members-
Posts
263 -
Credits
0 -
Joined
-
Last visited
Never -
Feedback
0%
About Łighto™
Profile Information
-
Gender
Male
-
Location
Greece
-
Interests
Discipline
Łighto™'s Achievements
Newbie (1/16)
0
Reputation
-
Hello people. Since i helped a guy here "http://www.maxcheaters.com/forum/index.php?topic=126391.0" with the same issue, i decided to share the admin command //mass_create. How it works? You type //mass_create itemID amount (e.g //mass_create 57 1 -> This will add 1 adena to every online player) Tested in L2J Interlude and works fine. package net.sf.l2j.gameserver.handler.admincommandhandlers; import java.util.StringTokenizer; import net.sf.l2j.Config; import net.sf.l2j.gameserver.datatables.ItemTable; import net.sf.l2j.gameserver.handler.IAdminCommandHandler; import net.sf.l2j.gameserver.model.GMAudit; import net.sf.l2j.gameserver.model.L2World; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.serverpackets.ItemList; import net.sf.l2j.gameserver.templates.L2Item; public class AdminMassCreate implements IAdminCommandHandler { private static final String[] ADMIN_COMMANDS = { "admin_mass_create" }; private static final int REQUIRED_LEVEL = Config.GM_CREATE_ITEM; // you need the same access level as create_item. 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_mass_create")) { try { String val = command.substring(17); StringTokenizer st = new StringTokenizer(val); if (st.countTokens() == 2) { String id = st.nextToken(); int idval = Integer.parseInt(id); String num = st.nextToken(); int numval = Integer.parseInt(num); massCreate(activeChar, idval, numval); } else if (st.countTokens() == 1) { String id = st.nextToken(); int idval = Integer.parseInt(id); massCreate(activeChar, idval, 1); } } catch (StringIndexOutOfBoundsException e) { activeChar.sendMessage("Usage: //itemcreate <itemId> [amount]"); } catch (NumberFormatException nfe) { activeChar.sendMessage("Specify a valid number."); } } return true; } private void massCreate(L2PcInstance activeChar, int idval, int numval) { for (L2PcInstance _players : L2World.getInstance().getAllPlayers()) { if (_players == activeChar) continue; _players.getInventory().addItem("Admin", idval, numval, _players, null); ItemList il = new ItemList(_players, true); _players.sendPacket(il); _players.sendMessage("Admin award you " + numval + " item(s) number " + idval); activeChar.sendMessage("You have spawned " + numval + " item(s) number " + idval + " in all chars inventory."); } } public String[] getAdminCommandList() { return ADMIN_COMMANDS; } private boolean checkLevel(int level) { return (level >= REQUIRED_LEVEL); } }
-
Give items to all players
Łighto™ replied to Gxz's question in Request Server Development Help [L2J]
No problem try ItemList il = new ItemList(_players, true); _players.sendPacket(il); _players.sendMessage("Admin spawned " + numval + " item(s) number " + idval + " in your inventory"); -
Give items to all players
Łighto™ replied to Gxz's question in Request Server Development Help [L2J]
Here you are /* * 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.datatables.ItemTable; import net.sf.l2j.gameserver.handler.IAdminCommandHandler; import net.sf.l2j.gameserver.model.GMAudit; import net.sf.l2j.gameserver.model.L2World; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.serverpackets.ItemList; import net.sf.l2j.gameserver.templates.L2Item; /** * This class handles following admin commands: * - itemcreate = show menu * - create_item <id> [num] = creates num items with respective id, if num is not specified, assumes 1. * * @version $Revision: 1.2.2.2.2.3 $ $Date: 2005/04/11 10:06:06 $ */ public class AdminCreateItem implements IAdminCommandHandler { private static final String[] ADMIN_COMMANDS = { "admin_itemcreate", "admin_create_item", "admin_mass_create" }; private static final int REQUIRED_LEVEL = Config.GM_CREATE_ITEM; 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.equals("admin_itemcreate")) { AdminHelpPage.showHelpPage(activeChar, "itemcreation.htm"); } else if (command.startsWith("admin_create_item")) { try { String val = command.substring(17); StringTokenizer st = new StringTokenizer(val); if (st.countTokens()== 2) { String id = st.nextToken(); int idval = Integer.parseInt(id); String num = st.nextToken(); int numval = Integer.parseInt(num); createItem(activeChar,idval,numval); } else if (st.countTokens()== 1) { String id = st.nextToken(); int idval = Integer.parseInt(id); createItem(activeChar,idval,1); } } catch (StringIndexOutOfBoundsException e) { activeChar.sendMessage("Usage: //itemcreate <itemId> [amount]"); } catch (NumberFormatException nfe) { activeChar.sendMessage("Specify a valid number."); } AdminHelpPage.showHelpPage(activeChar, "itemcreation.htm"); } else if (command.startsWith("admin_mass_create")) { try { String val = command.substring(17); StringTokenizer st = new StringTokenizer(val); if (st.countTokens()== 2) { String id = st.nextToken(); int idval = Integer.parseInt(id); String num = st.nextToken(); int numval = Integer.parseInt(num); massCreate(activeChar,idval,numval); } else if (st.countTokens()== 1) { String id = st.nextToken(); int idval = Integer.parseInt(id); massCreate(activeChar,idval,1); } } catch (StringIndexOutOfBoundsException e) { activeChar.sendMessage("Usage: //itemcreate <itemId> [amount]"); } catch (NumberFormatException nfe) { activeChar.sendMessage("Specify a valid number."); } } return true; } /** * @param activeChar * @param idval * @param numval */ private void massCreate(L2PcInstance activeChar, int idval, int numval) { for (L2PcInstance _players : L2World.getInstance().getAllPlayers()) { if (_players == activeChar) continue; _players.getInventory().addItem("Admin", idval, numval, _players, null); ItemList il = new ItemList(_players, true); _players.sendPacket(il); activeChar.sendMessage("You have spawned " + numval + " item(s) number " + idval + " in all chars inventory."); } } public String[] getAdminCommandList() { return ADMIN_COMMANDS; } private boolean checkLevel(int level) { return (level >= REQUIRED_LEVEL); } private void createItem(L2PcInstance activeChar, int id, int num) { if (num > 20) { L2Item template = ItemTable.getInstance().getTemplate(id); if (!template.isStackable()) { activeChar.sendMessage("This item does not stack - Creation aborted."); return; } } activeChar.getInventory().addItem("Admin", id, num, activeChar, null); ItemList il = new ItemList(activeChar, true); activeChar.sendPacket(il); activeChar.sendMessage("You have spawned " + num + " item(s) number " + id + " in your inventory."); } } Just tested in l2j interlude. It works great. -
[question]how to change the subclass lvl?
Łighto™ replied to jossoo's question in Request Server Development Help [L2J]
gameserver/model/base/SubClass.java private PlayerClass _class; private long _exp = Experience.LEVEL[40]; private int _sp = 0; private byte _level = 40; private int _classIndex = 1; Allakse ekei p leei 40, me oti 8es.. Dn xreiazete n kaneis config gia ka8e ti.. -
Allazoun suxna ta agapimena mou tragoudia.. Anyway aftin tin periodo m'aresei afto http://www.youtube.com/watch?v=SbQMXe0GfdY M aresoun poli oi stoixoi tou...simenoun polla..
-
The problem is that monsters aren't dropping items/adena etc on ground? OR they do not drop nothing at all!?
-
The idea for a new server has been born.
Łighto™ replied to MasterDisaster's topic in General Discussion [English]
Firstly good luck with your project. I Wish you the best. Secondly, do not even thinking of opening a server in order only to make money from the donates. The server will die in max 2-3 months. Also make sure you have the money in order to keep it alive for at least ~3,4 months. About the donations, just give some gifts to players.. accessories etc. Not custom armors, enchants & shits. Also remember -> Unique events, make the server unique. Try to not make another server, like alll the others because it will fail. :) -
To Empire Total War einai poli kalo.. An 8es dl link pes mou to na sto steilw se pm :)
-
Do something with the website. We can't understand it :/. Make it in english. Anyway let's hope, this time the project will stay alive.
-
[GR]Otan xwrizeis apo tin kopela sou Ti kaneis????
Łighto™ replied to CrazyManiac's topic in Spam Topics
xaxaxaxaxaxaxaxa eleoooooooooooos. ti eipe i kopelia....x0ax0ax0a0x0a0xa0 -
to prwto einai : 5epistoles- dust rhymes. to allo dn kcerw.
-
Yeah. Not only one or two times. I have also tried other (not free of course) companies and i can say that securesignup.net is one of the best!
-
Roy The Cat Problem..
Łighto™ replied to XxXKainXxX's question in Request Server Development Help [Greek]
Aftos den itan logos na kaneis 2 thread. Anyway koita edw http://www.maxcheaters.com/forum/index.php?topic=125668.0