Adjustments for Steal Divinity (1440).
Contributed by Vinter.
This commit is contained in:
parent
4d09ce2083
commit
1c913d8155
@ -64,7 +64,7 @@ public class DispelByCategory extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
final List<BuffInfo> canceled = Formulas.calcCancelStealEffects(info.getEffector(), info.getEffected(), info.getSkill(), _slot, _rate, _max);
|
||||
final List<BuffInfo> canceled = Formulas.calcCancelEffects(info.getEffector(), info.getEffected(), info.getSkill(), _slot, _rate, _max);
|
||||
for (BuffInfo can : canceled)
|
||||
{
|
||||
info.getEffected().getEffectList().stopSkillEffects(true, can.getSkill());
|
||||
|
@ -32,17 +32,12 @@ import org.l2jmobius.gameserver.model.stats.Formulas;
|
||||
*/
|
||||
public class StealAbnormal extends AbstractEffect
|
||||
{
|
||||
private final String _slot;
|
||||
private final int _rate;
|
||||
private final int _max;
|
||||
private final int _amount;
|
||||
|
||||
public StealAbnormal(Condition attachCond, Condition applyCond, StatSet set, StatSet params)
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
|
||||
_slot = params.getString("slot", null);
|
||||
_rate = params.getInt("rate", 0);
|
||||
_max = params.getInt("max", 0);
|
||||
_amount = params.getInt("amount", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -62,7 +57,7 @@ public class StealAbnormal extends AbstractEffect
|
||||
{
|
||||
if ((info.getEffected() != null) && info.getEffected().isPlayer() && (info.getEffector() != info.getEffected()))
|
||||
{
|
||||
final List<BuffInfo> toSteal = Formulas.calcCancelStealEffects(info.getEffector(), info.getEffected(), info.getSkill(), _slot, _rate, _max);
|
||||
final List<BuffInfo> toSteal = Formulas.calcStealEffects(info.getEffected(), _amount);
|
||||
if (toSteal.isEmpty())
|
||||
{
|
||||
return;
|
||||
|
@ -1369,7 +1369,7 @@
|
||||
<set name="targetType" val="ONE" />
|
||||
<for>
|
||||
<effect name="StealAbnormal">
|
||||
<param slot="buff" rate="25" max="#maxNegated" />
|
||||
<param amount="#maxNegated" />
|
||||
</effect>
|
||||
</for>
|
||||
</skill>
|
||||
|
@ -570,7 +570,7 @@
|
||||
<set name="targetType" val="ONE" />
|
||||
<for>
|
||||
<effect name="StealAbnormal">
|
||||
<param slot="buff" rate="25" max="3" />
|
||||
<param amount="3" />
|
||||
</effect>
|
||||
</for>
|
||||
</skill>
|
||||
|
1959
L2J_Mobius_CT_2.4_Epilogue/dist/game/data/xsd/skills.xsd
vendored
1959
L2J_Mobius_CT_2.4_Epilogue/dist/game/data/xsd/skills.xsd
vendored
File diff suppressed because it is too large
Load Diff
@ -1858,7 +1858,34 @@ public class Formulas
|
||||
return Rnd.get(100) < rate;
|
||||
}
|
||||
|
||||
public static List<BuffInfo> calcCancelStealEffects(Creature creature, Creature target, Skill skill, String slot, int rate, int max)
|
||||
public static List<BuffInfo> calcStealEffects(Creature target, int amount)
|
||||
{
|
||||
final List<BuffInfo> canceled = new ArrayList<>(amount);
|
||||
|
||||
// Prevent initialization.
|
||||
final List<BuffInfo> buffs = target.getEffectList().hasBuffs() ? new ArrayList<>(target.getEffectList().getBuffs()) : new ArrayList<>(1);
|
||||
if (target.getEffectList().hasTriggered())
|
||||
{
|
||||
buffs.addAll(target.getEffectList().getTriggered());
|
||||
}
|
||||
if (target.getEffectList().hasDances())
|
||||
{
|
||||
buffs.addAll(target.getEffectList().getDances());
|
||||
}
|
||||
|
||||
for (int i = buffs.size() - 1; i >= 0 && canceled.size() < amount; i--) // reverse order
|
||||
{
|
||||
final BuffInfo info = buffs.get(i);
|
||||
if (!info.getSkill().canBeStolen())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
canceled.add(info);
|
||||
}
|
||||
return canceled;
|
||||
}
|
||||
|
||||
public static List<BuffInfo> calcCancelEffects(Creature creature, Creature target, Skill skill, String slot, int rate, int max)
|
||||
{
|
||||
final List<BuffInfo> canceled = new ArrayList<>(max);
|
||||
switch (slot)
|
||||
|
Loading…
Reference in New Issue
Block a user