Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
- */
- package net.sf.l2j.gameserver.handler.admincommandhandlers;
- import net.sf.l2j.gameserver.datatables.ClanTable;
- import net.sf.l2j.gameserver.datatables.SkillTable;
- import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
- import net.sf.l2j.gameserver.model.L2Clan;
- import net.sf.l2j.gameserver.model.L2Skill;
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- import net.sf.l2j.gameserver.network.SystemMessageId;
- /**
- * @author Bluur
- *
- */
- public class AdminClanFullByName implements IAdminCommandHandler
- {
- private static final String[] commands = {"admin_clanfull"};
- private static final int reputation = 30000000;
- private static final byte level = 8;
- //id skills
- private static final int[] clanSkills =
- {
- 370,
- 371,
- 372,
- 373,
- 374,
- 375,
- 376,
- 377,
- 378,
- 379,
- 380,
- 381,
- 382,
- 383,
- 384,
- 385,
- 386,
- 387,
- 388,
- 389,
- 390,
- 391
- };
- @Override
- public boolean useAdminCommand(String command, L2PcInstance activeChar)
- {
- if (command.startsWith("admin_clanfull"))
- makeClan(command, activeChar);
- return true;
- }
- private void makeClan(String command, L2PcInstance activeChar)
- {
- try
- {
- String clanName = command.substring(15);
- L2Clan clan = ClanTable.getInstance().getClanByName(clanName);
- if (clan == null)
- {
- activeChar.sendMessage("Clan nao existe ou nome esta incorreto!");
- return;
- }
- for (int s : clanSkills)
- {
- L2Skill clanSkill = SkillTable.getInstance().getInfo(s, SkillTable.getInstance().getMaxLevel(s));
- clan.addNewSkill(clanSkill);
- }
- clan.addReputationScore(reputation);
- clan.changeLevel(level);
- clan.updateClanInDB();
- activeChar.sendMessage("O Clan " + clan.getName() +" esta clanfull agora!");
- }
- catch (IndexOutOfBoundsException e)
- {
- activeChar.sendPacket(SystemMessageId.INCORRECT_NAME_TRY_AGAIN);
- }
- }
- @Override
- public String[] getAdminCommandList()
- {
- return commands;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment