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 151033c68e7301061b0bd71811bdec8604ead177..6eb2123127832fdf12a8aa9a471b10bc429696d9 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -138,6 +138,7 @@ public final class EffectMasterHandler Recovery.class, RefuelAirship.class, Relax.class, + ResistSkill.class, Restoration.class, RestorationRandom.class, Resurrection.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 ff6aaa6648afd34992efbd202abea696c3fc0904..541492f359f860b3d69a1fda9bcb3fbee62f8593 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/MasterHandler.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/MasterHandler.java @@ -225,6 +225,7 @@ import handlers.targethandlers.BehindArea; import handlers.targethandlers.BehindAura; import handlers.targethandlers.Clan; import handlers.targethandlers.ClanMember; +import handlers.targethandlers.CommandChannel; import handlers.targethandlers.CorpseClan; import handlers.targethandlers.CorpseMob; import handlers.targethandlers.EnemySummon; @@ -553,6 +554,7 @@ public class MasterHandler BehindAura.class, Clan.class, ClanMember.class, + CommandChannel.class, CorpseClan.class, CorpseMob.class, EnemySummon.class, diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java index 63c44eb65d719674f560918419d1ff194cffb6b7..17c38caf959d89f3d12cb72d4d5bf16240615344 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java @@ -179,7 +179,7 @@ public class AdminBuffs implements IAdminCommandHandler return false; } } - else if (activeChar.getTarget().isPlayer()) + else if ((activeChar.getTarget() != null) && activeChar.getTarget().isPlayer()) { player = activeChar.getTarget().getActingPlayer(); } diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/ResistSkill.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/ResistSkill.java new file mode 100644 index 0000000000000000000000000000000000000000..88be1278e1a2666eddbe545522f3d49701cbcd3e --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/effecthandlers/ResistSkill.java @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2004-2014 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 java.util.ArrayList; +import java.util.List; + +import com.l2jserver.gameserver.model.StatsSet; +import com.l2jserver.gameserver.model.actor.L2Character; +import com.l2jserver.gameserver.model.conditions.Condition; +import com.l2jserver.gameserver.model.effects.AbstractEffect; +import com.l2jserver.gameserver.model.effects.L2EffectType; +import com.l2jserver.gameserver.model.holders.SkillHolder; +import com.l2jserver.gameserver.model.skills.BuffInfo; + +/** + * @author UnAfraid + */ +public class ResistSkill extends AbstractEffect +{ + private final List<SkillHolder> _skills = new ArrayList<>(); + + public ResistSkill(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params) + { + super(attachCond, applyCond, set, params); + if (params != null) + { + for (int i = 1;; i++) + { + int skillId = params.getInt("skillId" + i, 0); + int skillLvl = params.getInt("skillLvl" + i, 0); + if (skillId == 0) + { + break; + } + _skills.add(new SkillHolder(skillId, skillLvl)); + } + } + if (_skills.isEmpty()) + { + throw new IllegalArgumentException(getClass().getSimpleName() + ": Without parameters!"); + } + } + + @Override + public void onStart(BuffInfo info) + { + super.onStart(info); + final L2Character effected = info.getEffected(); + for (SkillHolder holder : _skills) + { + effected.addInvulAgainst(holder); + effected.sendDebugMessage("Applying invul against " + holder.getSkill()); + } + } + + @Override + public void onExit(BuffInfo info) + { + final L2Character effected = info.getEffected(); + for (SkillHolder holder : _skills) + { + info.getEffected().removeInvulAgainst(holder); + effected.sendDebugMessage("Removing invul against " + holder.getSkill()); + } + super.onExit(info); + } + + @Override + public L2EffectType getEffectType() + { + return L2EffectType.BUFF; + } +} diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/CommandChannel.java b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/CommandChannel.java new file mode 100644 index 0000000000000000000000000000000000000000..79e6f27eee379e024508f0f8cfc54d6aa387896b --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/handlers/targethandlers/CommandChannel.java @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2004-2014 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.targethandlers; + +import java.util.ArrayList; +import java.util.List; + +import com.l2jserver.gameserver.handler.ITargetTypeHandler; +import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.L2Party; +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.targets.L2TargetType; + +/** + * @author UnAfraid + */ +public class CommandChannel implements ITargetTypeHandler +{ + @Override + public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target) + { + final List<L2Character> targetList = new ArrayList<>(); + final L2PcInstance player = activeChar.getActingPlayer(); + if (player == null) + { + return EMPTY_TARGET_LIST; + } + + targetList.add(player); + + final int radius = skill.getAffectRange(); + final L2Party party = player.getParty(); + final boolean hasChannel = (party != null) && party.isInCommandChannel(); + + if (L2Skill.addSummon(activeChar, player, radius, false)) + { + targetList.add(player.getSummon()); + } + + // if player in not in party + if (party == null) + { + return targetList.toArray(new L2Character[targetList.size()]); + } + + // Get all visible objects in a spherical area near the L2Character + int maxTargets = skill.getAffectLimit(); + final List<L2PcInstance> members = hasChannel ? party.getCommandChannel().getMembers() : party.getMembers(); + + for (L2PcInstance member : members) + { + if (activeChar == member) + { + continue; + } + + if (L2Skill.addCharacter(activeChar, member, radius, false)) + { + targetList.add(member); + if (targetList.size() >= maxTargets) + { + break; + } + } + } + + return targetList.toArray(new L2Character[targetList.size()]); + } + + @Override + public Enum<L2TargetType> getTargetType() + { + return L2TargetType.COMMAND_CHANNEL; + } +} diff --git a/L2J_DataPack_BETA/dist/game/data/stats/skills/09000-09099.xml b/L2J_DataPack_BETA/dist/game/data/stats/skills/09000-09099.xml index f33c7c8814e008189c31d7b3ae0c52c9d59f65be..ffcd0d3759c2f0e0d72ece75669dbd3a642583e4 100644 --- a/L2J_DataPack_BETA/dist/game/data/stats/skills/09000-09099.xml +++ b/L2J_DataPack_BETA/dist/game/data/stats/skills/09000-09099.xml @@ -883,32 +883,48 @@ <set name="abnormalLvl" val="1" /> <set name="abnormalTime" val="10" /> <set name="abnormalType" val="SKILL_IGNORE" /> + <set name="abnormalRange" val="2000" /> <set name="icon" val="icon.skill1418" /> <set name="magicLvl" val="1" /> <set name="operateType" val="A2" /> <set name="reuseDelay" val="1200000" /> - <set name="skillType" val="NOTDONE" /> <set name="staticReuse" val="true" /> - <set name="targetType" val="NONE" /> + <set name="targetType" val="COMMAND_CHANNEL" /> <cond msgId="113" addName="1"> <player insideZoneId="90578" /> </cond> + <for> + <effect name="ResistSkill"> + <param skillId1="6662" /> + <param skillId2="6274" /> + <param skillId3="6275" /> + </effect> + </for> </skill> <skill id="9058" levels="1" name="Black Freezing Core"> <!-- Prevents user from being affected by Freya's Eternal Blizzard. --> <set name="abnormalLvl" val="1" /> <set name="abnormalTime" val="10" /> <set name="abnormalType" val="SKILL_IGNORE" /> + <set name="abnormalRange" val="2000" /> + <set name="itemConsumeId" val="15470" /> + <set name="itemConsumeCount" val="1" /> <set name="icon" val="icon.skill1418" /> <set name="magicLvl" val="1" /> <set name="operateType" val="A2" /> <set name="reuseDelay" val="1200000" /> - <set name="skillType" val="NOTDONE" /> <set name="staticReuse" val="true" /> - <set name="targetType" val="NONE" /> + <set name="targetType" val="COMMAND_CHANNEL" /> <cond msgId="113" addName="1"> <player insideZoneId="90578" /> </cond> + <for> + <effect name="ResistSkill"> + <param skillId1="6662" /> + <param skillId2="6274" /> + <param skillId3="6275" /> + </effect> + </for> </skill> <skill id="9059" levels="1" name="Torch Light"> <!-- Confirmed CT2.5 -->