From 36a041716e22db527750dc2843dc31c40340fd6e Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 29 Oct 2022 21:45:50 +0000 Subject: [PATCH] Addition of HeroBook Item handler. Contributed by Fakee. --- .../data/scripts/handlers/MasterHandler.java | 2 + .../handlers/itemhandlers/HeroBook.java | 42 ++++++++++++++++ .../game/data/stats/items/82300-82399.xml | 50 +++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/itemhandlers/HeroBook.java diff --git a/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/MasterHandler.java index 653877d6ca..0c9ba7ed3c 100644 --- a/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/MasterHandler.java @@ -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, diff --git a/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/itemhandlers/HeroBook.java b/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/itemhandlers/HeroBook.java new file mode 100644 index 0000000000..4d83a6456e --- /dev/null +++ b/L2J_Mobius_10.3_MasterClass/dist/game/data/scripts/handlers/itemhandlers/HeroBook.java @@ -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 . + */ +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; + } +} \ No newline at end of file diff --git a/L2J_Mobius_10.3_MasterClass/dist/game/data/stats/items/82300-82399.xml b/L2J_Mobius_10.3_MasterClass/dist/game/data/stats/items/82300-82399.xml index 735dcbae1f..104beb8ff3 100644 --- a/L2J_Mobius_10.3_MasterClass/dist/game/data/stats/items/82300-82399.xml +++ b/L2J_Mobius_10.3_MasterClass/dist/game/data/stats/items/82300-82399.xml @@ -29,4 +29,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +