diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/MasterHandler.java index 1a8f5a9463..4529b05dc1 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/MasterHandler.java @@ -205,6 +205,7 @@ import handlers.itemhandlers.FishShots; import handlers.itemhandlers.Harvester; import handlers.itemhandlers.ItemSkills; import handlers.itemhandlers.ItemSkillsTemplate; +import handlers.itemhandlers.LimitedSayha; import handlers.itemhandlers.Maps; import handlers.itemhandlers.MercTicket; import handlers.itemhandlers.NicknameColor; @@ -553,6 +554,7 @@ public class MasterHandler Harvester.class, ItemSkills.class, ItemSkillsTemplate.class, + LimitedSayha.class, Maps.class, MercTicket.class, NicknameColor.class, diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/itemhandlers/LimitedSayha.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/itemhandlers/LimitedSayha.java new file mode 100644 index 0000000000..67fe228769 --- /dev/null +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/scripts/handlers/itemhandlers/LimitedSayha.java @@ -0,0 +1,75 @@ +/* + * 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.actor.instance.PlayerInstance; +import org.l2jmobius.gameserver.model.items.instance.ItemInstance; +import org.l2jmobius.gameserver.network.SystemMessageId; + +/** + * @author Mode + */ +public class LimitedSayha implements IItemHandler +{ + @Override + public boolean useItem(Playable playable, ItemInstance item, boolean forceUse) + { + if (!playable.isPlayer()) + { + playable.sendPacket(SystemMessageId.YOUR_PET_CANNOT_CARRY_THIS_ITEM); + return false; + } + + final PlayerInstance player = playable.getActingPlayer(); + long time = 0; + switch (item.getId()) + { + case 71899: + { + time = 86400000L * 30; + break; + } + case 71900: + { + time = 86400000L * 1; + break; + } + case 71901: + { + time = 86400000L * 7; + break; + } + default: + { + time = 0; + break; + } + } + if ((time > 0) && player.setLimitedSayhaGraceEndTime(System.currentTimeMillis() + time)) + { + player.destroyItem("LimitedSayha potion", item, 1, player, true); + } + else + { + player.sendMessage("Your Limited Sayha's Grace remaining time is greater than item's."); + return false; + } + return true; + } +} \ No newline at end of file diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71800-71899.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71800-71899.xml index fafc8bfe1f..f8502ce4c7 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71800-71899.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71800-71899.xml @@ -601,6 +601,6 @@ - + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71900-71999.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71900-71999.xml index 7d48e1505e..1c50999fe0 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71900-71999.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71900-71999.xml @@ -11,14 +11,7 @@ - - - - - - - - + @@ -31,7 +24,7 @@ - + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91700-91799.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91700-91799.xml index 7630315164..91ebff3e17 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91700-91799.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91700-91799.xml @@ -843,18 +843,18 @@ + - - + - +