diff --git a/dist/game/data/scripts/handlers/EffectMasterHandler.java b/dist/game/data/scripts/handlers/EffectMasterHandler.java index 6b53803aebba43202ad2d3c9f8fee865e03763ce..6c6b0ca52e4f37bdecb2d59cc34f936e52aa0456 100644 --- a/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -93,6 +93,7 @@ public final class EffectMasterHandler FocusEnergy.class, FocusMaxEnergy.class, FocusSouls.class, + FoodForPet.class, GetAgro.class, GiveRecommendation.class, GiveSp.class, diff --git a/dist/game/data/scripts/handlers/effecthandlers/FoodForPet.java b/dist/game/data/scripts/handlers/effecthandlers/FoodForPet.java new file mode 100644 index 0000000000000000000000000000000000000000..6fbc6e69083cc5f3f6cea692128bb29148bf556d --- /dev/null +++ b/dist/game/data/scripts/handlers/effecthandlers/FoodForPet.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2004-2018 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.Config; +import com.l2jserver.gameserver.enums.MountType; +import com.l2jserver.gameserver.model.StatsSet; +import com.l2jserver.gameserver.model.actor.L2Character; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; +import com.l2jserver.gameserver.model.actor.instance.L2PetInstance; +import com.l2jserver.gameserver.model.conditions.Condition; +import com.l2jserver.gameserver.model.effects.AbstractEffect; +import com.l2jserver.gameserver.model.skills.BuffInfo; + +/** + * Food For Pet effect implementation. + * @author Adry_85 + * @since 2.6.0.0 + */ +public final class FoodForPet extends AbstractEffect +{ + private final int _normal; + private final int _ride; + private final int _wyvern; + + public FoodForPet(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params) + { + super(attachCond, applyCond, set, params); + + _normal = params.getInt("normal", 0); + _ride = params.getInt("ride", 0); + _wyvern = params.getInt("wyvern", 0); + } + + @Override + public boolean isInstant() + { + return true; + } + + @Override + public void onStart(BuffInfo info) + { + final L2Character activeChar = info.getEffector(); + + if (activeChar.isPet()) + { + final L2PetInstance pet = (L2PetInstance) activeChar; + pet.setCurrentFed(pet.getCurrentFed() + (_normal * Config.PET_FOOD_RATE)); + } + else if (activeChar.isPlayer()) + { + final L2PcInstance player = activeChar.getActingPlayer(); + if (player.getMountType() == MountType.WYVERN) + { + player.setCurrentFeed(player.getCurrentFeed() + _wyvern); + } + else + { + player.setCurrentFeed(player.getCurrentFeed() + _ride); + } + } + } +} diff --git a/dist/game/data/scripts/handlers/itemhandlers/PetFood.java b/dist/game/data/scripts/handlers/itemhandlers/PetFood.java index 0d827d887310133cd5970b195e8d61163ddf6951..5b23f320a70a0d9253e07f8e45d59e0d26502614 100644 --- a/dist/game/data/scripts/handlers/itemhandlers/PetFood.java +++ b/dist/game/data/scripts/handlers/itemhandlers/PetFood.java @@ -20,7 +20,6 @@ package handlers.itemhandlers; import java.util.List; -import com.l2jserver.Config; import com.l2jserver.gameserver.data.xml.impl.PetDataTable; import com.l2jserver.gameserver.datatables.SkillData; import com.l2jserver.gameserver.handler.IItemHandler; @@ -70,7 +69,7 @@ public class PetFood implements IItemHandler if (pet.destroyItem("Consume", item.getObjectId(), 1, null, false)) { pet.broadcastPacket(new MagicSkillUse(pet, pet, skillId, skillLevel, 0, 0)); - pet.setCurrentFed(pet.getCurrentFed() + (skill.getFeed() * Config.PET_FOOD_RATE)); + skill.applyEffects(pet, pet); pet.broadcastStatusUpdate(); if (pet.isHungry()) { @@ -90,14 +89,13 @@ public class PetFood implements IItemHandler if (player.destroyItem("Consume", item.getObjectId(), 1, null, false)) { player.broadcastPacket(new MagicSkillUse(player, player, skillId, skillLevel, 0, 0)); - player.setCurrentFeed(player.getCurrentFeed() + skill.getFeed()); + skill.applyEffects(player, player); return true; } } } - final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CANNOT_BE_USED); - sm.addItemName(item); - player.sendPacket(sm); + + player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_CANNOT_BE_USED).addItemName(item)); } } return false; diff --git a/dist/game/data/stats/skills/02000-02099.xml b/dist/game/data/stats/skills/02000-02099.xml index e8bf1b1de88d575bb8ba669494d17ee4eb355342..8c3430f9830f5812258dd2423e7f937e5c942119 100644 --- a/dist/game/data/stats/skills/02000-02099.xml +++ b/dist/game/data/stats/skills/02000-02099.xml @@ -565,13 +565,19 @@ <set name="targetType" val="SELF" /> </skill> <skill id="2048" levels="1" name="Wolves' Food"> - <!-- Confirmed CT2.5 --> - <set name="feed" val="100" /> - <set name="isMagic" val="2" /> <!-- Static Skill --> + <!-- High Five Confirmed --> + <set name="affectScope" val="SINGLE" /> + <set name="isMagic" val="2" /> <set name="magicLvl" val="1" /> <set name="operateType" val="A1" /> <set name="rideState" val="NONE;STRIDER;WYVERN;WOLF" /> <set name="targetType" val="SELF" /> + <effects> + <effect name="FoodForPet"> + <param normal="100" /> + <param ride="100" /> + </effect> + </effects> </skill> <skill id="2049" levels="1" name="Blessed Scroll of Resurrection"> <set name="castRange" val="400" /> @@ -826,13 +832,19 @@ </effects> </skill> <skill id="2063" levels="1" name="Hatchling Food"> - <!-- Confirmed CT2.5 --> - <set name="feed" val="150" /> - <set name="isMagic" val="2" /> <!-- Static Skill --> + <!-- High Five Confirmed --> + <set name="affectScope" val="SINGLE" /> + <set name="isMagic" val="2" /> <set name="magicLvl" val="1" /> <set name="operateType" val="A1" /> <set name="rideState" val="NONE;STRIDER;WYVERN;WOLF" /> <set name="targetType" val="SELF" /> + <effects> + <effect name="FoodForPet"> + <param normal="150" /> + <param ride="150" /> + </effect> + </effects> </skill> <skill id="2064" levels="1" name="Scroll of Mana Regeneration"> <set name="abnormalLvl" val="4" /> diff --git a/dist/game/data/stats/skills/02100-02199.xml b/dist/game/data/stats/skills/02100-02199.xml index 8fda5df0db43fc31b0c6c6d4d7ba808735c024b1..6e4b17a41852014a6278c92c2f500a74710525b8 100644 --- a/dist/game/data/stats/skills/02100-02199.xml +++ b/dist/game/data/stats/skills/02100-02199.xml @@ -24,22 +24,34 @@ </effects> </skill> <skill id="2101" levels="1" name="Feed: General Strider"> - <!-- Confirmed CT2.5 --> - <set name="feed" val="200" /> - <set name="isMagic" val="2" /> <!-- Static Skill --> + <!-- High Five Confirmed --> + <set name="affectScope" val="SINGLE" /> + <set name="isMagic" val="2" /> <set name="magicLvl" val="1" /> <set name="operateType" val="A1" /> <set name="rideState" val="NONE;STRIDER;WYVERN;WOLF" /> <set name="targetType" val="SELF" /> + <effects> + <effect name="FoodForPet"> + <param normal="200" /> + <param ride="200" /> + </effect> + </effects> </skill> <skill id="2102" levels="1" name="Feed: Clan Hall Strider"> - <!-- Confirmed CT2.5 --> - <set name="feed" val="450" /> - <set name="isMagic" val="2" /> <!-- Static Skill --> + <!-- High Five Confirmed --> + <set name="affectScope" val="SINGLE" /> + <set name="isMagic" val="2" /> <set name="magicLvl" val="1" /> <set name="operateType" val="A1" /> <set name="rideState" val="NONE;STRIDER;WYVERN;WOLF" /> <set name="targetType" val="SELF" /> + <effects> + <effect name="FoodForPet"> + <param normal="200" /> + <param ride="450" /> + </effect> + </effects> </skill> <skill id="2103" levels="1" name="Mystery Potion"> <!-- Confirmed CT2.5 --> @@ -1174,14 +1186,22 @@ </effects> </skill> <skill id="2180" levels="1" name="Feed: Castle Strider"> - <!-- Confirmed CT2.5 --> - <set name="feed" val="450" /> - <set name="isMagic" val="2" /> <!-- Static Skill --> + <!-- High Five Confirmed --> + <set name="affectScope" val="SINGLE" /> + <set name="isMagic" val="2" /> <set name="magicLvl" val="1" /> <set name="operateType" val="A1" /> <set name="rideState" val="NONE;STRIDER;WYVERN;WOLF" /> <set name="targetType" val="SELF" /> + <effects> + <effect name="FoodForPet"> + <param normal="200" /> + <param ride="450" /> + <param wyvern="450" /> + </effect> + </effects> </skill> + <skill id="2181" levels="1" name="Item - Fishing Shot"> <set name="isMagic" val="2" /> <!-- Static Skill --> <set name="magicLvl" val="1" /> diff --git a/dist/game/data/stats/skills/02300-02399.xml b/dist/game/data/stats/skills/02300-02399.xml index a1064cb59f8e31a216b9fa132f534ec3c29ed327..a01c3c9a6f2d4fc20d647a2e5e7005da7caf370d 100644 --- a/dist/game/data/stats/skills/02300-02399.xml +++ b/dist/game/data/stats/skills/02300-02399.xml @@ -1157,13 +1157,19 @@ </cond> </skill> <skill id="2361" levels="1" name="Evolving Wolf's Food"> - <!-- Confirmed CT2.5 --> - <set name="feed" val="1100" /> - <set name="isMagic" val="2" /> <!-- Static Skill --> + <!-- High Five Confirmed --> + <set name="affectScope" val="SINGLE" /> + <set name="isMagic" val="2" /> <set name="magicLvl" val="1" /> <set name="operateType" val="A1" /> <set name="rideState" val="NONE;STRIDER;WYVERN;WOLF" /> <set name="targetType" val="SELF" /> + <effects> + <effect name="FoodForPet"> + <param normal="1100" /> + <param ride="1100" /> + </effect> + </effects> </skill> <skill id="2362" levels="1" name="Prison Gate Key"> <!-- Confirmed CT2.5 --> diff --git a/dist/game/data/stats/skills/02900-02999.xml b/dist/game/data/stats/skills/02900-02999.xml index 47642a0e6eebb2bd2de57f0c3ddb191b5a913eed..360ed71d7b565671d17903db9db67389c3232701 100644 --- a/dist/game/data/stats/skills/02900-02999.xml +++ b/dist/game/data/stats/skills/02900-02999.xml @@ -264,14 +264,19 @@ </effects> </skill> <skill id="2916" levels="1" name="Feed for Enriched Enhanced Pets"> - <!-- Confirmed CT2.5 --> - <set name="blockedInOlympiad" val="true" /> - <set name="feed" val="11000" /> - <set name="isMagic" val="2" /> <!-- Static Skill --> + <!-- High Five Confirmed --> + <set name="affectScope" val="SINGLE" /> + <set name="isMagic" val="2" /> <set name="magicLvl" val="1" /> <set name="operateType" val="A1" /> <set name="rideState" val="NONE;STRIDER;WYVERN;WOLF" /> <set name="targetType" val="SELF" /> + <effects> + <effect name="FoodForPet"> + <param normal="11000" /> + <param ride="11000" /> + </effect> + </effects> </skill> <skill id="2917" levels="1" name="Big Staccato Silk Cocoon"> <!-- Confirmed CT2.5 --> diff --git a/dist/game/data/xsd/skills.xsd b/dist/game/data/xsd/skills.xsd index 222dee616e0db12ff42d76f28d81ace9129b29cc..2ba21a4458113859c92b4c1b87d1cc53981e4aba 100644 --- a/dist/game/data/xsd/skills.xsd +++ b/dist/game/data/xsd/skills.xsd @@ -41,9 +41,7 @@ <xs:enumeration value="elementPower" /> <xs:enumeration value="excludedFromCheck" /> <xs:enumeration value="fanRange" /> - <xs:enumeration value="feed" /> <xs:enumeration value="flyType" /> - <xs:enumeration value="halfKillRate" /> <xs:enumeration value="hitTime" /> <xs:enumeration value="hpConsume" /> <xs:enumeration value="icon" /> @@ -239,6 +237,7 @@ <xs:attribute type="xs:string" name="chance" use="optional" /> <xs:attribute type="xs:string" name="power" use="optional" /> <xs:attribute type="operation" name="type" use="optional" /> + <xs:attribute type="operation" name="mode" use="optional" /> <xs:attribute type="xs:boolean" name="heal" use="optional" /> <xs:attribute type="xs:string" name="criticalChance" use="optional" /> <xs:attribute type="xs:byte" name="blowChance" use="optional" /> @@ -311,7 +310,7 @@ <xs:attribute type="xs:string" name="itemId" use="optional" /> <xs:attribute type="xs:string" name="itemCount" use="optional" /> <xs:attribute type="xs:short" name="id" use="optional" /> - <xs:attribute type="xs:short" name="amount" use="optional" /> + <xs:attribute type="xs:string" name="amount" use="optional" /> <xs:attribute type="xs:int" name="despawnDelay" use="optional" /> <xs:attribute type="xs:string" name="isSummonSpawn" use="optional" /> <xs:attribute type="xs:string" name="escapeType" use="optional" /> @@ -337,6 +336,9 @@ <xs:attribute type="xs:short" name="skillId3" use="optional" /> <xs:attribute type="xs:string" name="time" use="optional" /> <xs:attribute type="xs:string" name="flyRadius" use="optional" /> + <xs:attribute type="xs:string" name="normal" use="optional" /> + <xs:attribute type="xs:string" name="ride" use="optional" /> + <xs:attribute type="xs:string" name="wyvern" use="optional" /> </xs:extension> </xs:simpleContent> </xs:complexType> @@ -523,10 +525,8 @@ <xs:enumeration value="Confuse" /> <xs:enumeration value="ConsumeBody" /> <xs:enumeration value="ConvertItem" /> - <xs:enumeration value="CpDamPercent" /> - <xs:enumeration value="CpHeal" /> + <xs:enumeration value="Cp" /> <xs:enumeration value="CpHealOverTime" /> - <xs:enumeration value="CpHealPercent" /> <xs:enumeration value="CrystalGradeModify" /> <xs:enumeration value="CubicMastery" /> <xs:enumeration value="DamOverTime" /> @@ -555,6 +555,7 @@ <xs:enumeration value="FocusEnergy" /> <xs:enumeration value="FocusMaxEnergy" /> <xs:enumeration value="FocusSouls" /> + <xs:enumeration value="FoodForPet" /> <xs:enumeration value="GetAgro" /> <xs:enumeration value="GiveRecommendation" /> <xs:enumeration value="GiveSp" /> @@ -563,10 +564,11 @@ <xs:enumeration value="HeadquarterCreate" /> <xs:enumeration value="Heal" /> <xs:enumeration value="HealOverTime" /> - <xs:enumeration value="HealPercent" /> <xs:enumeration value="Hide" /> + <xs:enumeration value="Hp" /> <xs:enumeration value="HpByLevel" /> <xs:enumeration value="HpDrain" /> + <xs:enumeration value="HpPerMax" /> <xs:enumeration value="ImmobileBuff" /> <xs:enumeration value="ImmobilePetBuff" /> <xs:enumeration value="Lethal" /> @@ -576,13 +578,13 @@ <xs:enumeration value="MagicalAttackMp" /> <xs:enumeration value="MagicalSoulAttack" /> <xs:enumeration value="ManaDamOverTime" /> - <xs:enumeration value="ManaHeal" /> <xs:enumeration value="ManaHealByLevel" /> <xs:enumeration value="ManaHealOverTime" /> - <xs:enumeration value="ManaHealPercent" /> <xs:enumeration value="MaxCp" /> <xs:enumeration value="MaxHp" /> + <xs:enumeration value="Mp" /> <xs:enumeration value="MpConsumePerLevel" /> + <xs:enumeration value="MpPerMax" /> <xs:enumeration value="Mute" /> <xs:enumeration value="NoblesseBless" /> <xs:enumeration value="OpenChest" />