diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/EffectMasterHandler.java index 796a80c6cba4d02af8f0461b8a41e8fe322e0f59..834405c883f77ed4699abfade3717d093fd1ced2 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -93,6 +93,7 @@ public final class EffectMasterHandler FocusMaxEnergy.class, FocusSouls.class, GetAgro.class, + GiveRecommendation.class, GiveSp.class, Grow.class, Harvesting.class, diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/MasterHandler.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/MasterHandler.java index 9e1ca066cf227dbaed845da8c60ad7ea2f727b1d..b3aac2096f15186e9a700f5df7eb87959497666f 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/MasterHandler.java @@ -210,7 +210,6 @@ import handlers.skillhandlers.Dummy; import handlers.skillhandlers.Fishing; import handlers.skillhandlers.FishingSkill; import handlers.skillhandlers.GetPlayer; -import handlers.skillhandlers.GiveReco; import handlers.skillhandlers.NornilsPower; import handlers.skillhandlers.Sow; import handlers.skillhandlers.TakeFort; @@ -503,7 +502,6 @@ public class MasterHandler Fishing.class, FishingSkill.class, GetPlayer.class, - GiveReco.class, NornilsPower.class, Sow.class, TakeFort.class, diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/GiveRecommendation.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/GiveRecommendation.java new file mode 100644 index 0000000000000000000000000000000000000000..56040eed403e5c67a586be264cfef7e59a094a0f --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/GiveRecommendation.java @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2004-2013 L2J DataPack + * + * This file is part of L2J DataPack. + * + * L2J DataPack 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. + * + * L2J DataPack 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.effecthandlers; + +import com.l2jserver.gameserver.model.StatsSet; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; +import com.l2jserver.gameserver.model.conditions.Condition; +import com.l2jserver.gameserver.model.effects.AbstractEffect; +import com.l2jserver.gameserver.model.skills.BuffInfo; +import com.l2jserver.gameserver.network.SystemMessageId; +import com.l2jserver.gameserver.network.serverpackets.ExVoteSystemInfo; +import com.l2jserver.gameserver.network.serverpackets.SystemMessage; +import com.l2jserver.gameserver.network.serverpackets.UserInfo; + +/** + * @author Nos + */ +public class GiveRecommendation extends AbstractEffect +{ + private final int _amount; + + public GiveRecommendation(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params) + { + super(attachCond, applyCond, set, params); + _amount = params.getInt("amount", 0); + if (_amount == 0) + { + _log.warning(getClass().getSimpleName() + ": amount parameter is missing or set to 0. id:" + set.getInt("id", -1)); + } + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void onStart(BuffInfo info) + { + L2PcInstance target = info.getEffected() instanceof L2PcInstance ? (L2PcInstance) info.getEffected() : null; + if (target != null) + { + int recommendationsGiven = _amount; + + if ((target.getRecomHave() + _amount) >= 255) + { + recommendationsGiven = 255 - target.getRecomHave(); + } + + if (recommendationsGiven > 0) + { + target.setRecomHave(target.getRecomHave() + recommendationsGiven); + + SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_OBTAINED_S1_RECOMMENDATIONS); + sm.addNumber(recommendationsGiven); + target.sendPacket(sm); + target.sendPacket(new UserInfo(target)); + target.sendPacket(new ExVoteSystemInfo(target)); + } + else + { + L2PcInstance player = info.getEffector() instanceof L2PcInstance ? (L2PcInstance) info.getEffector() : null; + if (player != null) + { + player.sendPacket(SystemMessageId.NOTHING_HAPPENED); + } + } + } + } +} diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/GiveReco.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/GiveReco.java deleted file mode 100644 index fc97e2eefac0a70ef8402628f0e8aabc88d6256f..0000000000000000000000000000000000000000 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/skillhandlers/GiveReco.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2004-2013 L2J DataPack - * - * This file is part of L2J DataPack. - * - * L2J DataPack 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. - * - * L2J DataPack 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.skillhandlers; - -import com.l2jserver.gameserver.handler.ISkillHandler; -import com.l2jserver.gameserver.model.L2Object; -import com.l2jserver.gameserver.model.actor.L2Character; -import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; -import com.l2jserver.gameserver.model.skills.L2Skill; -import com.l2jserver.gameserver.model.skills.L2SkillType; -import com.l2jserver.gameserver.network.SystemMessageId; -import com.l2jserver.gameserver.network.serverpackets.ExVoteSystemInfo; -import com.l2jserver.gameserver.network.serverpackets.SystemMessage; -import com.l2jserver.gameserver.network.serverpackets.UserInfo; - -/** - * @author Gnacik - */ -public class GiveReco implements ISkillHandler -{ - private static final L2SkillType[] SKILL_IDS = - { - L2SkillType.GIVE_RECO - }; - - @Override - public void useSkill(L2Character activeChar, L2Skill skill, L2Object[] targets) - { - for (L2Object obj : targets) - { - if (obj.isPlayer()) - { - L2PcInstance target = obj.getActingPlayer(); - int power = (int) skill.getPower(); - int reco = target.getRecomHave(); - - if ((reco + power) >= 255) - { - power = 255 - reco; - } - - if (power > 0) - { - target.setRecomHave(reco + power); - - SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_OBTAINED_S1_RECOMMENDATIONS); - sm.addNumber(power); - target.sendPacket(sm); - target.sendPacket(new UserInfo(target)); - target.sendPacket(new ExVoteSystemInfo(target)); - } - else - { - target.sendPacket(SystemMessageId.NOTHING_HAPPENED); - } - } - } - } - - @Override - public L2SkillType[] getSkillIds() - { - return SKILL_IDS; - } -} \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/stats/skills/09100-09199.xml b/L2J_DataPack_BETA/dist/game/data/stats/skills/09100-09199.xml index 8f252e712c0ffc95e6d2b8ec4d44307b57e9e39d..100738eead9b56e715d3c25ec7b8c49884f715b8 100644 --- a/L2J_DataPack_BETA/dist/game/data/stats/skills/09100-09199.xml +++ b/L2J_DataPack_BETA/dist/game/data/stats/skills/09100-09199.xml @@ -305,10 +305,13 @@ <set name="itemConsumeCount" val="1" /> <set name="magicLvl" val="1" /> <set name="operateType" val="A1" /> - <set name="power" val="10" /> <set name="reuseDelay" val="2000" /> - <set name="skillType" val="GIVE_RECO" /> <set name="targetType" val="SELF" /> + <for> + <effect name="GiveRecommendation"> + <param amount="10" /> + </effect> + </for> </skill> <skill id="9115" levels="1" name="Nevit's Hourglass - 1 hour"> <!-- Increases Nevit's blessing by 1 hour. -->