Advertisement
Guest User

ClanFullCrystal.java

a guest
Nov 18th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package net.sf.l2j.gameserver.handler.itemhandlers;
  16.  
  17. import net.sf.l2j.gameserver.data.SkillTable;
  18. import net.sf.l2j.gameserver.handler.IItemHandler;
  19. import net.sf.l2j.gameserver.model.actor.Playable;
  20. import net.sf.l2j.gameserver.model.actor.Player;
  21. import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  22. import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
  23.  
  24.  
  25. public class ClanFullCrystal implements IItemHandler {
  26.  
  27. @Override
  28. public void useItem(Playable playable, ItemInstance item, boolean forceUse) {
  29. if (!(playable instanceof Player))
  30. return;
  31.  
  32. final Player player = (Player) playable;
  33.  
  34. if (player.isClanLeader()) {
  35. for (int i = 370; i <= 391; i++) {
  36. player.getClan().addNewSkill(SkillTable.getInstance().getInfo(i, SkillTable.getInstance().getMaxLevel(i)));
  37. }
  38. player.sendPacket(new ExShowScreenMessage("Now your clan is Full Skill!", 10000, 0x02, true));
  39. player.destroyItem("", item.getObjectId(), 1, null, true);
  40. } else
  41. player.sendMessage("Only leaders of the clans can use this item!");
  42.  
  43.  
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement