Jump to content

[Share] Admin award all players


Recommended Posts

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

 

 

Link to comment
Share on other sites

its not your work ...

its shared by down !

 

Please give me a link or something so i can know if i'll lock this topic or not.

Link to comment
Share on other sites

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);

}

}

 

 

 

 

Fail

Link to comment
Share on other sites

Well, are you stupid or something ? Lighto helped a guy in this topic and he just shared the full code here so anyone can use it! he didn't say, WHOA IT IS UNIQUE, YOU CAN'T FIND IT ANYWHERE!

 

 

Here is the link with the guy he helped http://www.maxcheaters.com/forum/index.php?topic=126391.0"

 

You people seriously are soo dumb. Before you post something, think. It isn't difficult nor painfull. Really :)

Link to comment
Share on other sites

Please give me a link or something so i can know if i'll lock this topic or not.

 

http://www.maxcheaters.com/forum/index.php?topic=126391.0;msg=884695

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Hello everyone, as the title says, I want to remove the skill toggle effect when it is active in the skill bar. I did it a few years ago but now I don't remember how, I'm not sure but I think it's in the Skillgrp.dat file but I don't remember what value I should change.     First, thanks to whoever can help me clearly and not pass me by. Greetings and good day
    • L2Focus - Lineage 2 Interlude.   Rates Experience: (EXP) x1000 Skill Points: (SP) x1000 Adena: x1000 VIP: x2 Basic information Armor: TT/DK/DY (Same Stats) Weapon: EPIC/DY/IC (Same Stats) Jewels Boss: ( GM SHOP ) Tattoos: Fight | Mage Acessories: +100 | +300 Server Commands: .menu ( all options included ) Buff Slot: 32 + 4 (Divine Inspiration Free) Npc Buffer: Full + Scheme Buffs Siege: 7 Days Olympiad Hero: 7 Days Nobless: Last Hit in Barakiel Clan / Ally System Clan Info: Max Players: 50 Alliance Info: 1 Clans per ally Royal and Knights: Desactived. AntiZerg Zones: 18 players (2PT's). Enchant Safe Enchant: +5 Max. Enchant: +25 Normal Scroll: 100% chance, Max +5 Blessed Scroll: 80% chance, Max +20 Golden Scroll: +21 45%, +22 35%, +23 25%, +24 15%, +25 5% Golden Fail? - Only Loses scroll Crystal Scroll: 100% chance, Max +25 Augment Skills: Active / Passive 5% chance Augment Stats: STR/ INT / CON 5% chance Events Party Zone: 10:00 | 14:00 | 19:00 | 22:00 | 02:00 (Duration: 60 minutes) Tournament: 11:15 | 16:15 | 20:15 | 23:15 (Duration: 60 minutes) Kill The Boss: 09:00 | 15:00 | 20:00 | 23:00 (Duration: 15 minutes) Pvp Event: 13:10 | 15:10 | 20:10 | 21:10 (Duration: 45 minutes) Team vs Team: Every 1hour 24h/per day Olympiad Olympiad Time: 18:00 ~ 00:00 GMT-3 Min: 9 Matches to be a hero. Olympiad Box: 1 client windows running (PC) Olympiad Items: No Custom Olympiad Enchant: +5 Protection WarGuard: Protect for bots/hwid/phx/cheats Farm: 1 client per (PC). Box Limit: 2 client windows running (PC). Chaotic Zone: 18 players (2PT's). All configurations and features that are not reported here are standard, that is, equal to the official Lineage II or were considered irrelevant.   JOIN NOW www.L2Focus.com
    • that would be much appreciated mate 
  • Topics

×
×
  • Create New...