Advertisement
Sarada-L2

Coin Level Click L2jFrozen Yo: Sarada

Dec 6th, 2020
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. Index: com/l2jfrozen/gameserver/handler/itemhandlers/LevelCoin.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. +/**
  27. + *
  28. + * @author Computer Sarada
  29. + *
  30. + */
  31. +public class LevelCoin implements IItemHandler
  32. +{
  33. + private static final int[] ITEM_IDS = { Config.COIN_ITEM_LEVEL };
  34. + @Override
  35. + public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
  36. + {
  37. + if (!(playable instanceof L2PcInstance))
  38. + return;
  39. +
  40. + final L2PcInstance activeChar = (L2PcInstance) playable;
  41. +
  42. + if (activeChar.isInOlympiadMode())
  43. + {
  44. + activeChar.sendMessage("You cant use this item in olympiad mode.");
  45. + return;
  46. + }
  47. + else if (!activeChar.isInsideZone(L2Character.ZONE_PEACE))
  48. + {
  49. + activeChar.sendMessage("You can only use this item in peace zone..");
  50. + return;
  51. + }
  52. +
  53. + activeChar.getStat().addExp(activeChar.getStat().getExpForLevel(Config.LEVEL_CHARACTER));
  54. + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
  55. + activeChar.sendPacket(new ExShowScreenMessage(Config.MESSAGE_LEVEL_CHARACTER, Config.MESSAGE_TIME_LEVEL));
  56. + }
  57. +
  58. + @Override
  59. + public int[] getItemIds()
  60. + {
  61. + return ITEM_IDS;
  62. + }
  63. +}
  64.  
  65. Index: com/l2jfrozen/gameserver/handler/ItemHandler.java;
  66.  
  67. import com.l2jfrozen.gameserver.GameServer;
  68. +import com.l2jfrozen.gameserver.handler.itemhandlers.LevelCoin;
  69.  
  70.  
  71. _datatable = new TreeMap<>();
  72. +registerItemHandler(new LevelCoin());
  73.  
  74. Index: com/l2jfrozen/Config.java;
  75.  
  76. public static boolean NEW_PLAYER_EFFECT;
  77. + public static int COIN_ITEM_LEVEL;
  78. + public static int LEVEL_CHARACTER;
  79. + public static String MESSAGE_LEVEL_CHARACTER;
  80. + public static int MESSAGE_TIME_LEVEL;
  81.  
  82.  
  83. GM_CRITANNOUNCER_NAME = Boolean.parseBoolean(otherSettings.getProperty("GMShowCritAnnouncerName", "False"));
  84. + COIN_ITEM_LEVEL = Integer.parseInt(item.getProperty("ItemLevelCoinID", "5557"));
  85. + LEVEL_CHARACTER = Integer.parseInt(item.getProperty("LevelCharacterReward", "5557"));
  86. + MESSAGE_LEVEL_CHARACTER = item.getProperty("ScreenLevelMessageText", "lv!");
  87. + MESSAGE_TIME_LEVEL = Integer.parseInt(item.getProperty("ScreenLevelMessageTime", "6")) * 1000;
  88.  
  89. Index: gameserver\config\head\other.properties;
  90.  
  91. GMShowCritAnnouncerName = False
  92. +#=============================================================
  93. +# Item Level Character
  94. +#=============================================================
  95. +#Item Coin Level
  96. +ItemLevelCoinID = 6392
  97. +#Item ganha experiencia do level, não quer dizer que vai ganhar duas fez lv 40
  98. +LevelCharacterReward = 81
  99. +
  100. +#Messenge for reward Level!
  101. +ScreenLevelMessageText = vc ganho experiencia de 80 levels!
  102.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement