Addition of HeroBook Item handler.

Contributed by Fakee.
This commit is contained in:
MobiusDevelopment
2022-10-29 21:45:50 +00:00
parent b3a11a1920
commit 36a041716e
3 changed files with 94 additions and 0 deletions

View File

@@ -200,6 +200,7 @@ import handlers.itemhandlers.ExtractableItems;
import handlers.itemhandlers.FatedSupportBox;
import handlers.itemhandlers.FishShots;
import handlers.itemhandlers.Harvester;
import handlers.itemhandlers.HeroBook;
import handlers.itemhandlers.ItemSkills;
import handlers.itemhandlers.ItemSkillsTemplate;
import handlers.itemhandlers.Maps;
@@ -550,6 +551,7 @@ public class MasterHandler
FatedSupportBox.class,
FishShots.class,
Harvester.class,
HeroBook.class,
ItemSkills.class,
ItemSkillsTemplate.class,
Maps.class,

View File

@@ -0,0 +1,42 @@
/*
* This file is part of the L2J Mobius project.
*
* 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 handlers.itemhandlers;
import org.l2jmobius.gameserver.handler.IItemHandler;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.herobook.ExHeroBookShowUI;
/**
* @author Fakee
*/
public class HeroBook implements IItemHandler
{
@Override
public boolean useItem(Playable playable, Item item, boolean forceUse)
{
if (!playable.isPlayer())
{
playable.sendPacket(SystemMessageId.YOUR_PET_CANNOT_CARRY_THIS_ITEM);
return false;
}
playable.sendPacket(new ExHeroBookShowUI());
return true;
}
}