Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: net.sf.l2j.gameserver.handler.itemhandlers;NobleItem.java
- ===================================================================
- --- net.sf.l2j.gameserver.handler.itemhandlers;NobleItem.java (revision 84)
- +++ net.sf.l2j.gameserver.handler.itemhandlers;NobleItem.java (working copy)
- + package net.sf.l2j.gameserver.handler.itemhandlers;
- +
- + import net.sf.l2j.gameserver.handler.IItemHandler;
- + import net.sf.l2j.gameserver.model.actor.Playable;
- + import net.sf.l2j.gameserver.model.actor.instance.Player;
- + import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
- + import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
- +
- + public class NobleItem implements IItemHandler
- + {
- + @Override
- + public void useItem(Playable playable, ItemInstance item, boolean forceUse)
- + {
- + if (!(playable instanceof Player))
- + return;
- +
- + Player activeChar = (Player) playable;
- + if (activeChar.isNoble())
- + {
- + activeChar.sendMessage("You Are Already A Noblesse!");
- + return;
- + }
- +
- + activeChar.broadcastPacket(new SocialAction(activeChar, 16));
- + activeChar.setNoble(true, true);
- + activeChar.sendMessage("You Are Now a Noble! Check your skills.");
- + activeChar.broadcastUserInfo();
- + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
- + }
- + }
- +
- Index: net.sf.l2j.gameserver.handler;ItemHandler.java
- ===================================================================
- --- net.sf.l2j.gameserver.handler;ItemHandler.java (revision 84)
- +++ net.sf.l2j.gameserver.handler;ItemHandler.java (working copy)
- + import net.sf.l2j.gameserver.handler.itemhandlers.NobleItem;
- + registerItemHandler(new NobleItem());
- Index: data/xml/ItemClan.xml
- ===================================================================
- --- data/xml/ItemClan.xml (revision 84)
- +++ data/xml/ItemClan.xml (working copy)
- + <?xml version="1.0" encoding="UTF-8"?>
- + <list>
- + <item id="9506" type="EtcItem" name="Clan Full">
- + <set name="material" val="STEEL" />
- + <set name="is_destroyable" val="false" />
- + <set name="is_dropable" val="false" />
- + <set name="is_sellable" val="false" />
- + <set name="is_stackable" val="true" />
- + <set name="handler" val="NobleItem" />
- + </item>
- + </list>
Add Comment
Please, Sign In to add comment