Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.sf.l2j.gameserver.handler.itemhandlers;
- import net.sf.l2j.gameserver.handler.IItemHandler;
- import net.sf.l2j.gameserver.model.L2ItemInstance;
- import net.sf.l2j.gameserver.model.actor.L2Playable;
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- public class CustomCoins implements IItemHandler
- {
- private static final int[] ITEM_IDS = { id1, id2 };
- @Override
- public void useItem(L2Playable playable, L2ItemInstance item)
- {
- L2PcInstance activeChar = (L2PcInstance) playable;
- int itemId = item.getItemId();
- if (itemId == ITEM_IDS[0]) {
- if (activeChar.isHero()) {
- activeChar.sendMessage("You are already a hero!");
- return;
- }
- activeChar.setHero(true);
- activeChar.sendMessage("You have hero status, util you log out!");
- activeChar.destroyItem("Consume", 3487, 1, activeChar, true);
- }
- else if (itemId == ITEM_IDS[1]) {
- if (activeChar.isNoble()) {
- activeChar.sendMessage("You are already noble!");
- return;
- }
- activeChar.setNoble(true);
- activeChar.sendMessage("You have noble status!");
- activeChar.destroyItem("Consume", 3496, 1, activeChar, true);
- }
- }
- public int[] getItemIds()
- {
- return ITEM_IDS;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement