Removed stream usage from BlockActions effect.
This commit is contained in:
parent
8226d405fc
commit
003a68a7e1
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5574,12 +5574,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5574,12 +5574,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5574,12 +5574,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5574,12 +5574,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5583,12 +5583,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5583,12 +5583,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5583,12 +5583,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5582,12 +5582,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5582,12 +5582,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5582,12 +5582,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5592,12 +5592,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5592,12 +5592,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5562,12 +5562,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5562,12 +5562,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5562,12 +5562,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5562,12 +5562,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5571,12 +5571,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5596,12 +5596,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5596,12 +5596,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5596,12 +5596,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5595,12 +5595,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5562,12 +5562,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5608,12 +5608,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5627,12 +5627,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5647,12 +5647,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
@ -16,9 +16,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
@ -37,12 +36,17 @@ import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
*/
|
||||
public class BlockActions extends AbstractEffect
|
||||
{
|
||||
private final Set<Integer> _allowedSkills;
|
||||
private final Set<Integer> _allowedSkills = new HashSet<>();
|
||||
|
||||
public BlockActions(StatSet params)
|
||||
{
|
||||
final String[] allowedSkills = params.getString("allowedSkills", "").split(";");
|
||||
_allowedSkills = Arrays.stream(allowedSkills).filter(s -> !s.isEmpty()).map(Integer::parseInt).collect(Collectors.toSet());
|
||||
for (String skill : params.getString("allowedSkills", "").split(";"))
|
||||
{
|
||||
if (!skill.isEmpty())
|
||||
{
|
||||
_allowedSkills.add(Integer.parseInt(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -65,8 +69,13 @@ public class BlockActions extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
_allowedSkills.stream().forEach(effected::addBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.addBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
effected.startParalyze();
|
||||
|
||||
// Cancel running skill casters.
|
||||
effected.abortAllSkillCasters();
|
||||
}
|
||||
@ -74,7 +83,11 @@ public class BlockActions extends AbstractEffect
|
||||
@Override
|
||||
public void onExit(Creature effector, Creature effected, Skill skill)
|
||||
{
|
||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||
for (Integer skillId : _allowedSkills)
|
||||
{
|
||||
effected.removeBlockActionsAllowedSkill(skillId);
|
||||
}
|
||||
|
||||
if (effected.isPlayable())
|
||||
{
|
||||
if (effected.isSummon())
|
||||
|
@ -5647,12 +5647,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
public void addBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfAbsent(skillId, k -> new AtomicInteger()).incrementAndGet();
|
||||
}
|
||||
|
||||
public void removeBlockActionsAllowedSkill(int skillId)
|
||||
public void removeBlockActionsAllowedSkill(Integer skillId)
|
||||
{
|
||||
_blockActionsAllowedSkills.computeIfPresent(skillId, (k, v) -> v.decrementAndGet() != 0 ? v : null);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user