Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/java/net/sf/l2j/gameserver/handler/ItemHandler.java b/java/net/sf/l2j/gameserver/handler/ItemHandler.java
- index 772663d..1136f0a 100644
- --- a/java/net/sf/l2j/gameserver/handler/ItemHandler.java
- +++ b/java/net/sf/l2j/gameserver/handler/ItemHandler.java
- @@ -18,6 +18,7 @@
- import net.sf.l2j.gameserver.handler.itemhandlers.Keys;
- import net.sf.l2j.gameserver.handler.itemhandlers.Maps;
- import net.sf.l2j.gameserver.handler.itemhandlers.MercenaryTickets;
- +import net.sf.l2j.gameserver.handler.itemhandlers.NobleCustomItem;
- import net.sf.l2j.gameserver.handler.itemhandlers.PaganKeys;
- import net.sf.l2j.gameserver.handler.itemhandlers.PetFoods;
- import net.sf.l2j.gameserver.handler.itemhandlers.Recipes;
- @@ -38,6 +39,7 @@
- protected ItemHandler()
- {
- + registerHandler(new NobleCustomItem());
- registerHandler(new BeastSoulShots());
- registerHandler(new BeastSpices());
- registerHandler(new BeastSpiritShots());
- diff --git a/java/net/sf/l2j/gameserver/handler/itemhandlers/NobleCustomItem.java b/java/net/sf/l2j/gameserver/handler/itemhandlers/NobleCustomItem.java
- new file mode 100644
- index 0000000..6593922
- --- /dev/null
- +++ b/java/net/sf/l2j/gameserver/handler/itemhandlers/NobleCustomItem.java
- @@ -0,0 +1,34 @@
- +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.Player;
- +import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
- +import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
- +
- +/**
- + * @author Sarada
- + *
- + */
- +public class NobleCustomItem 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!.");
- + } else
- + {
- + activeChar.broadcastPacket(new SocialAction(activeChar, 16));
- + activeChar.setNoble(true,true);
- + activeChar.sendMessage("You Are Now a Noble,You Are Granted With Noblesse Status , And Noblesse Skills.");
- + activeChar.broadcastUserInfo();
- + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
- + }
- + }
- +
- +}
- XML
- <item id="6392" type="EtcItem" name="Event - Medal">
- <set name="material" val="STEEL" />
- <set name="is_stackable" val="true" />
- +<set name="handler" val="NobleCustomItem" />
- </item>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement