Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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.datatables.SkillTable;
- import com.l2jfrozen.gameserver.model.L2Skill;
- import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
- import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
- public class XpGiver implements IItemHandler
- {
- private static final int[] ITEM_IDS =
- {
- 1111
- };
- public void useItem(L2PlayableInstance playable, L2ItemInstance item)
- {
- if (!(playable instanceof L2PcInstance))
- return;
- L2PcInstance activeChar = (L2PcInstance)playable;
- if(activeChar.isInOlympiadMode())
- {
- activeChar.sendMessage("You can't you this in Olympiad!");
- }
- else
- {
- activeChar.addLevel(1);
- playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
- activeChar.broadcastUserInfo();
- activeChar.sendSkillList();
- }
- }
- public int[] getItemIds()
- {
- return ITEM_IDS;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment