Sarada-L2

Item Click Sexy L2jFrozen Yo: Sarada

Dec 16th, 2020 (edited)
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.92 KB | None | 0 0
  1. Index: head-src/com/l2jfrozen/gameserver/handler/ItemHandler/ChangeSexItem.java
  2.  
  3. +/*
  4. + * This program is free software: you can redistribute it and/or modify it under
  5. + * the terms of the GNU General Public License as published by the Free Software
  6. + * Foundation, either version 3 of the License, or (at your option) any later
  7. + * version.
  8. + *
  9. + * This program is distributed in the hope that it will be useful, but WITHOUT
  10. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  12. + * details.
  13. + *
  14. + * You should have received a copy of the GNU General Public License along with
  15. + * this program. If not, see <http://www.gnu.org/licenses/>.
  16. + */
  17. +package com.l2jfrozen.gameserver.handler.itemhandlers;
  18. +
  19. +import com.l2jfrozen.Config;
  20. +import com.l2jfrozen.gameserver.handler.IItemHandler;
  21. +import com.l2jfrozen.gameserver.model.L2Character;
  22. +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
  23. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  24. +import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
  25. +import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage;
  26. +import com.l2jfrozen.gameserver.network.serverpackets.InventoryUpdate;
  27. +import com.l2jfrozen.gameserver.network.serverpackets.SocialAction;
  28. +import com.l2jfrozen.gameserver.network.serverpackets.StatusUpdate;
  29. +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
  30. +
  31. +public class ChangeSexItem implements IItemHandler
  32. +{
  33. +
  34. + private static final int[] ITEM_IDS = { Config.CHANGESEX_COIN_ID };
  35. +
  36. + @Override
  37. + public void useItem(L2PlayableInstance playable, final L2ItemInstance item)
  38. + {
  39. +
  40. + if (!(playable instanceof L2PcInstance))
  41. + {
  42. + return;
  43. + }
  44. + final L2PcInstance activeChar = (L2PcInstance)playable;
  45. + if (activeChar.isInOlympiadMode())
  46. + {
  47. + activeChar.sendMessage("This Item Cannot Be Used On Olympiad Games.");
  48. + }
  49. + else if (!activeChar.isInsideZone(L2Character.ZONE_PEACE)){
  50. + activeChar.sendMessage("You can only use this item in peace zone..");
  51. + return;
  52. + }
  53. +
  54. + activeChar.getInventory().destroyItemByItemId(null, Config.CHANGESEX_COIN_ID, 1, activeChar, activeChar.getTarget());
  55. + activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 16));
  56. + activeChar.getAppearance().setSex(!activeChar.getAppearance().getSex());
  57. + L2PcInstance.setSexDB(activeChar, 1);
  58. + activeChar.sendMessage("Congratulations your sex has changed !!! ");
  59. + activeChar.sendPacket(new ExShowScreenMessage("Congratulations. Your sex has been changed.", 6000));
  60. + activeChar.sendMessage("Please do restart");
  61. + activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());
  62. + activeChar.sendPacket(new InventoryUpdate());
  63. + activeChar.sendPacket(new StatusUpdate(activeChar));
  64. + activeChar.sendMessage("Your gender has been changed,You will Be Disconected in 6 Seconds!");
  65. + activeChar.broadcastUserInfo();
  66. + activeChar.decayMe();
  67. + activeChar.spawnMe();
  68. + ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
  69. + {
  70. + @Override
  71. + public void run()
  72. + {
  73. + activeChar.logout(true);
  74. + }
  75. + }, 6000);
  76. + return;
  77. + }
  78. +
  79. + @Override
  80. + public int[] getItemIds()
  81. + {
  82. + return ITEM_IDS;
  83. + }
  84. +}
  85.  
  86. Config.java
  87. +
  88. ++public static int CHANGESEX_COIN_ID;
  89. +CHANGESEX_COIN_ID = Integer.parseInt(item.getProperty("ItemSexyCoinID", "5557"));
  90.  
  91.  
  92. Index: head-src/com/l2jfrozen/gameserver/handler/itemhandlers/ItemHandler.java
  93. _datatable = new TreeMap<>();
  94. +registerItemHandler(new ChangeSexItem());
  95.  
  96. Propriedade voces escolhem onde botar
  97.  
  98. +#=============================================================
  99. +# Item Troca de Sexy
  100. +#=============================================================
  101. +#Item Coin Sexy
  102. +ItemSexyCoinID = 6392
Add Comment
Please, Sign In to add comment