Advertisement
Sarada-L2

Click Nobles RusAcis

Oct 1st, 2021
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. diff --git a/java/net/sf/l2j/gameserver/handler/ItemHandler.java b/java/net/sf/l2j/gameserver/handler/ItemHandler.java
  2. index 772663d..1136f0a 100644
  3. --- a/java/net/sf/l2j/gameserver/handler/ItemHandler.java
  4. +++ b/java/net/sf/l2j/gameserver/handler/ItemHandler.java
  5. @@ -18,6 +18,7 @@
  6. import net.sf.l2j.gameserver.handler.itemhandlers.Keys;
  7. import net.sf.l2j.gameserver.handler.itemhandlers.Maps;
  8. import net.sf.l2j.gameserver.handler.itemhandlers.MercenaryTickets;
  9. +import net.sf.l2j.gameserver.handler.itemhandlers.NobleCustomItem;
  10. import net.sf.l2j.gameserver.handler.itemhandlers.PaganKeys;
  11. import net.sf.l2j.gameserver.handler.itemhandlers.PetFoods;
  12. import net.sf.l2j.gameserver.handler.itemhandlers.Recipes;
  13. @@ -38,6 +39,7 @@
  14.  
  15. protected ItemHandler()
  16. {
  17. + registerHandler(new NobleCustomItem());
  18. registerHandler(new BeastSoulShots());
  19. registerHandler(new BeastSpices());
  20. registerHandler(new BeastSpiritShots());
  21. diff --git a/java/net/sf/l2j/gameserver/handler/itemhandlers/NobleCustomItem.java b/java/net/sf/l2j/gameserver/handler/itemhandlers/NobleCustomItem.java
  22. new file mode 100644
  23. index 0000000..6593922
  24. --- /dev/null
  25. +++ b/java/net/sf/l2j/gameserver/handler/itemhandlers/NobleCustomItem.java
  26. @@ -0,0 +1,34 @@
  27. +package net.sf.l2j.gameserver.handler.itemhandlers;
  28. +
  29. +import net.sf.l2j.gameserver.handler.IItemHandler;
  30. +import net.sf.l2j.gameserver.model.actor.Playable;
  31. +import net.sf.l2j.gameserver.model.actor.Player;
  32. +import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  33. +import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
  34. +
  35. +/**
  36. + * @author Sarada
  37. + *
  38. + */
  39. +public class NobleCustomItem implements IItemHandler
  40. +{
  41. + @Override
  42. + public void useItem(Playable playable, ItemInstance item, boolean forceUse)
  43. + {
  44. + if(!(playable instanceof Player))
  45. + return;
  46. + Player activeChar = (Player)playable;
  47. + if(activeChar.isNoble())
  48. + {
  49. + activeChar.sendMessage("You Are Already A Noblesse!.");
  50. + } else
  51. + {
  52. + activeChar.broadcastPacket(new SocialAction(activeChar, 16));
  53. + activeChar.setNoble(true,true);
  54. + activeChar.sendMessage("You Are Now a Noble,You Are Granted With Noblesse Status , And Noblesse Skills.");
  55. + activeChar.broadcastUserInfo();
  56. + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
  57. + }
  58. + }
  59. +
  60. +}
  61.  
  62.  
  63. XML
  64. <item id="6392" type="EtcItem" name="Event - Medal">
  65. <set name="material" val="STEEL" />
  66. <set name="is_stackable" val="true" />
  67. +<set name="handler" val="NobleCustomItem" />
  68. </item>
  69.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement