Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### 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)
- @@ -27,6 +27,7 @@
- ('admin_set_menu','1'), -- Not Implemented
- ('admin_set_mod','3'),
- ('admin_saveolymp','2'),
- +('admin_olympiad_stat', '2'),
- ('admin_manualhero','2'),
- -- Section: Announcements
- #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)
- @@ -69,6 +69,7 @@
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminMobGroup;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminMonsterRace;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminNoble;
- +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminOlympiadStat;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminPForge;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminPetition;
- import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminPledge;
- @@ -186,6 +187,7 @@
- registerAdminCommandHandler(new AdminAio());
- registerAdminCommandHandler(new AdminCharSupervision());
- registerAdminCommandHandler(new AdminWho()); // L2OFF command
- + registerAdminCommandHandler(new AdminOlympiadStat());
- // 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/AdminOlympiadStat.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminOlympiadStat.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/handler/admincommandhandlers/AdminOlympiadStat.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.L2Object;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
- +
- +/**
- + * @author RedHoT
- + */
- +public class AdminOlympiadStat implements IAdminCommandHandler
- +{
- + private static String[] ADMIN_COMMANDS =
- + {
- + "admin_olympiad_stat"
- + };
- +
- + @Override
- + public boolean useAdminCommand(String command, L2PcInstance activeChar)
- + {
- + if (command.startsWith("admin_olympiad_stat"))
- + {
- + L2Object target = activeChar.getTarget();
- +
- + if (target instanceof L2PcInstance)
- + {
- + L2PcInstance player = (L2PcInstance) target;
- +
- + if (!player.isNoble())
- + {
- + activeChar.sendMessage("Oops! Your target is not a Noble!");
- + return false;
- + }
- + activeChar.sendMessage("Match(s): " + Olympiad.getInstance().getCompetitionDone(player.getObjectId()));
- + activeChar.sendMessage("Points: " + Olympiad.getInstance().getNoblePoints(player.getObjectId()));
- + return true;
- + }
- + activeChar.sendMessage("Usage: //olympiad_stat <target>");
- + return false;
- + }
- + return true;
- + }
- +
- + @Override
- + public String[] getAdminCommandList()
- + {
- + return ADMIN_COMMANDS;
- + }
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement