Guest User

Skill

a guest
Aug 16th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.95 KB | None | 0 0
  1. Index: java/net/sf/l2j/gameserver/customskill/CustomItemSkill.java
  2. ===================================================================
  3. --- java/net/sf/l2j/gameserver/customskill/CustomItemSkill.java (revision 0)
  4. +++ java/net/sf/l2j/gameserver/customskill/CustomItemSkill.java (working copy)
  5. @@ -0,0 +1,44 @@
  6. +/*
  7. + * This program is free software: you can redistribute it and/or modify it under
  8. + * the terms of the GNU General Public License as published by the Free Software
  9. + * Foundation, either version 3 of the License, or (at your option) any later
  10. + * version.
  11. + *
  12. + * This program is distributed in the hope that it will be useful, but WITHOUT
  13. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  14. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  15. + * details.
  16. + *
  17. + * You should have received a copy of the GNU General Public License along with
  18. + * this program. If not, see <http://www.gnu.org/licenses/>.
  19. + */
  20. +package net.sf.l2j.gameserver.customskill;
  21. +
  22. +import net.sf.l2j.gameserver.datatables.SkillTable;
  23. +import net.sf.l2j.gameserver.model.L2Skill;
  24. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  25. +import net.sf.l2j.gameserver.network.SystemMessageId;
  26. +import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  27. +
  28. +/**
  29. + * @author Baggos
  30. + */
  31. +public class CustomItemSkill
  32. +{
  33. +  
  34. +   public void CustomItem(L2PcInstance player)
  35. +   {
  36. +       L2Skill skill = SkillTable.getInstance().getInfo(294, 1);
  37. +       final SystemMessage night = SystemMessage.getSystemMessage(SystemMessageId.NIGHT_EFFECT_APPLIES);
  38. +       final SystemMessage day = SystemMessage.getSystemMessage(SystemMessageId.DAY_EFFECT_DISAPPEARS);
  39. +      
  40. +       if (player.getInventory().getItemByItemId(9819) != null && skill != null)
  41. +       {
  42. +           player.addSkill(skill, true);
  43. +           player.sendPacket(night);
  44. +       }
  45. +       else
  46. +           player.removeSkill(skill, true);
  47. +       player.sendPacket(day);
  48. +   }
  49. +}
  50. \ No newline at end of file
Add Comment
Please, Sign In to add comment