Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: com/l2jfrozen/gameserver/handler/itemhandlers/LevelCoin.java;
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package com.l2jfrozen.gameserver.handler.itemhandlers;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.handler.IItemHandler;
- +import com.l2jfrozen.gameserver.model.L2Character;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
- +import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage;
- +/**
- + *
- + * @author Computer Sarada
- + *
- + */
- +public class LevelCoin implements IItemHandler
- +{
- + private static final int[] ITEM_IDS = { Config.COIN_ITEM_LEVEL };
- + @Override
- + public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
- + {
- + if (!(playable instanceof L2PcInstance))
- + return;
- +
- + final L2PcInstance activeChar = (L2PcInstance) playable;
- +
- + if (activeChar.isInOlympiadMode())
- + {
- + activeChar.sendMessage("You cant use this item in olympiad mode.");
- + return;
- + }
- + else if (!activeChar.isInsideZone(L2Character.ZONE_PEACE))
- + {
- + activeChar.sendMessage("You can only use this item in peace zone..");
- + return;
- + }
- +
- + activeChar.getStat().addExp(activeChar.getStat().getExpForLevel(Config.LEVEL_CHARACTER));
- + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
- + activeChar.sendPacket(new ExShowScreenMessage(Config.MESSAGE_LEVEL_CHARACTER, Config.MESSAGE_TIME_LEVEL));
- + }
- +
- + @Override
- + public int[] getItemIds()
- + {
- + return ITEM_IDS;
- + }
- +}
- Index: com/l2jfrozen/gameserver/handler/ItemHandler.java;
- import com.l2jfrozen.gameserver.GameServer;
- +import com.l2jfrozen.gameserver.handler.itemhandlers.LevelCoin;
- _datatable = new TreeMap<>();
- +registerItemHandler(new LevelCoin());
- Index: com/l2jfrozen/Config.java;
- public static boolean NEW_PLAYER_EFFECT;
- + public static int COIN_ITEM_LEVEL;
- + public static int LEVEL_CHARACTER;
- + public static String MESSAGE_LEVEL_CHARACTER;
- + public static int MESSAGE_TIME_LEVEL;
- GM_CRITANNOUNCER_NAME = Boolean.parseBoolean(otherSettings.getProperty("GMShowCritAnnouncerName", "False"));
- + COIN_ITEM_LEVEL = Integer.parseInt(item.getProperty("ItemLevelCoinID", "5557"));
- + LEVEL_CHARACTER = Integer.parseInt(item.getProperty("LevelCharacterReward", "5557"));
- + MESSAGE_LEVEL_CHARACTER = item.getProperty("ScreenLevelMessageText", "lv!");
- + MESSAGE_TIME_LEVEL = Integer.parseInt(item.getProperty("ScreenLevelMessageTime", "6")) * 1000;
- Index: gameserver\config\head\other.properties;
- GMShowCritAnnouncerName = False
- +#=============================================================
- +# Item Level Character
- +#=============================================================
- +#Item Coin Level
- +ItemLevelCoinID = 6392
- +#Item ganha experiencia do level, não quer dizer que vai ganhar duas fez lv 40
- +LevelCharacterReward = 81
- +
- +#Messenge for reward Level!
- +ScreenLevelMessageText = vc ganho experiencia de 80 levels!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement