Focus/Raise Shield changes plus unable to use during final ultimate defense.

Contributed by Ofelin.
This commit is contained in:
MobiusDev
2018-09-17 10:09:12 +00:00
parent 182ba200c9
commit 3eeaf944ce
10 changed files with 514 additions and 172 deletions

View File

@@ -121,6 +121,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("DeleteTopAgro", DeleteTopAgro::new);
EffectHandler.getInstance().registerHandler("DetectHiddenObjects", DetectHiddenObjects::new);
EffectHandler.getInstance().registerHandler("Detection", Detection::new);
EffectHandler.getInstance().registerHandler("DisableSkill", DisableSkill::new);
EffectHandler.getInstance().registerHandler("DisableTargeting", DisableTargeting::new);
EffectHandler.getInstance().registerHandler("Disarm", Disarm::new);
EffectHandler.getInstance().registerHandler("Disarmor", Disarmor::new);
@@ -129,6 +130,7 @@ public final class EffectMasterHandler
EffectHandler.getInstance().registerHandler("DispelBySlot", DispelBySlot::new);
EffectHandler.getInstance().registerHandler("DispelBySlotMyself", DispelBySlotMyself::new);
EffectHandler.getInstance().registerHandler("DispelBySlotProbability", DispelBySlotProbability::new);
EffectHandler.getInstance().registerHandler("DispelCaster", DispelCaster::new);
EffectHandler.getInstance().registerHandler("DoubleCast", DoubleCast::new);
EffectHandler.getInstance().registerHandler("DuelistFury", DuelistFury::new);
EffectHandler.getInstance().registerHandler("EnableCloak", EnableCloak::new);

View File

@@ -0,0 +1,80 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
package handlers.effecthandlers;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Ofelin
*/
public class DisableSkill extends AbstractEffect
{
private final Set<Integer> disableSkills;
private Skill knownSKill;
public DisableSkill(StatsSet params)
{
String disable = params.getString("disable");
if ((disable != null) && !disable.isEmpty())
{
disableSkills = new HashSet<>();
for (String slot : disable.split(";"))
{
disableSkills.add(Integer.parseInt(slot));
}
}
else
{
disableSkills = Collections.<Integer> emptySet();
}
}
@Override
public void onStart(L2Character effector, L2Character effected, Skill skill)
{
for (int disableSkillId : disableSkills)
{
knownSKill = effected.getKnownSkill(disableSkillId);
if (knownSKill != null)
{
effected.disableSkill(knownSKill, 0);
}
effected.disableSkill(skill, 0);
}
}
@Override
public void onExit(L2Character effector, L2Character effected, Skill skill)
{
for (int enableSkillId : disableSkills)
{
knownSKill = effected.getKnownSkill(enableSkillId);
if (knownSKill != null)
{
effected.enableSkill(knownSKill);
}
}
}
}

View File

@@ -0,0 +1,78 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
package handlers.effecthandlers;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.effects.L2EffectType;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.AbnormalType;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* @author Gnacik, Zoey76, Adry_85
*/
public class DispelCaster extends AbstractEffect
{
private final Set<AbnormalType> _dispelAbnormals;
public DispelCaster(StatsSet params)
{
String dispel = params.getString("dispel");
if ((dispel != null) && !dispel.isEmpty())
{
_dispelAbnormals = new HashSet<>();
for (String slot : dispel.split(";"))
{
_dispelAbnormals.add(AbnormalType.getAbnormalType(slot));
}
}
else
{
_dispelAbnormals = Collections.<AbnormalType> emptySet();
}
}
@Override
public L2EffectType getEffectType()
{
return L2EffectType.DISPEL_BY_SLOT;
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_dispelAbnormals.isEmpty())
{
return;
}
// The effectlist should already check if it has buff with this abnormal type or not.
effector.getEffectList().stopEffects(info -> !info.getSkill().isIrreplacableBuff() && _dispelAbnormals.contains(info.getSkill().getAbnormalType()), true, true);
}
}