### Eclipse Workspace Patch 1.0 #P L2jFrozen_DataPack Index: sql/admin_command_access_rights.sql =================================================================== --- sql/admin_command_access_rights.sql (revision 986) +++ sql/admin_command_access_rights.sql (working copy) @@ -28,6 +28,7 @@ ('admin_set_mod','3'), ('admin_saveolymp','2'), ('admin_manualhero','2'), +('admin_masshero', '2'), -- Section: Announcements ('admin_list_announcements','3'), #P L2jFrozen_GameServer Index: head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java =================================================================== --- head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (revision 986) +++ head-src/com/l2jfrozen/gameserver/handler/AdminCommandHandler.java (working copy) @@ -64,6 +64,7 @@ import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminMammon; import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminManor; import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminMassControl; +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminMassHero; import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminMassRecall; import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminMenu; import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminMobGroup; @@ -186,6 +187,7 @@ registerAdminCommandHandler(new AdminAio()); registerAdminCommandHandler(new AdminCharSupervision()); registerAdminCommandHandler(new AdminWho()); // L2OFF command + registerAdminCommandHandler(new AdminMassHero()); // ATTENTION: adding new command handlers, you have to change the // sql file containing the access levels rights Index: head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminMassHero.java =================================================================== --- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminMassHero.java (revision 0) +++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminMassHero.java (working copy) @@ -0,0 +1,67 @@ +/* + * 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 com.l2jfrozen.gameserver.handler.admincommandhandlers; + +import com.l2jfrozen.gameserver.handler.IAdminCommandHandler; +import com.l2jfrozen.gameserver.model.L2World; +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.network.serverpackets.SocialAction; + +/** + * @author RedHoT + */ +public class AdminMassHero implements IAdminCommandHandler +{ + private static String[] ADMIN_COMMANDS = + { + "admin_masshero" + }; + @Override + public boolean useAdminCommand(String command, L2PcInstance activeChar) + { + if (activeChar == null) + return false; + + if (command.startsWith("admin_masshero")) + { + for (L2PcInstance player : L2World.getInstance().getAllPlayers()) + { + if (player == null) + return false; + + /* Check to see if the player already is Hero and if aren't in Olympiad Mode */ + if (!player.isHero() || !player.isInOlympiadMode()) + { + player.setHero(true); + player.sendMessage("Admin is rewarding all online players with Hero Status."); + player.broadcastPacket(new SocialAction(player.getObjectId(), 16)); + player.broadcastUserInfo(); + } + player = null; + } + } + return true; + } + + @Override + public String[] getAdminCommandList() + { + return ADMIN_COMMANDS; + } +} \ No newline at end of file