Code style changes.
This commit is contained in:
@@ -42,7 +42,7 @@ public final class ChameleonRest extends AbstractEffect
|
||||
@Override
|
||||
public int getEffectFlags()
|
||||
{
|
||||
return (EffectFlag.SILENT_MOVE.getMask() | EffectFlag.RELAXING.getMask());
|
||||
return EffectFlag.SILENT_MOVE.getMask() | EffectFlag.RELAXING.getMask();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -36,7 +36,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
public class ClassChange extends AbstractEffect
|
||||
{
|
||||
private final int _index;
|
||||
private final static int IDENTITY_CRISIS_SKILL_ID = 1570;
|
||||
private static final int IDENTITY_CRISIS_SKILL_ID = 1570;
|
||||
|
||||
public ClassChange(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
|
@@ -56,7 +56,7 @@ public final class CpHealPercent extends AbstractEffect
|
||||
|
||||
double amount = 0;
|
||||
final double power = _power;
|
||||
final boolean full = (power == 100.0);
|
||||
final boolean full = power == 100.0;
|
||||
|
||||
amount = full ? target.getMaxCp() : (target.getMaxCp() * power) / 100.0;
|
||||
// Prevents overheal and negative amount
|
||||
|
@@ -87,7 +87,7 @@ public final class DispelBySlot extends AbstractEffect
|
||||
for (Entry<AbnormalType, Short> entry : _dispelAbnormals.entrySet())
|
||||
{
|
||||
// Dispel transformations (buff and by GM)
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM) && (effected.isTransformed() || (effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0))))
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM) && (effected.isTransformed() || effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0)))
|
||||
{
|
||||
info.getEffected().stopTransformation(true);
|
||||
continue;
|
||||
|
@@ -89,10 +89,10 @@ public final class DispelBySlotProbability extends AbstractEffect
|
||||
// Operation of O(n) for the amount of slots to dispel (which is usually small) and O(1) to get the buff.
|
||||
for (Entry<AbnormalType, Short> entry : _dispelAbnormals.entrySet())
|
||||
{
|
||||
if ((Rnd.get(100) < _rate))
|
||||
if (Rnd.get(100) < _rate)
|
||||
{
|
||||
// Dispel transformations (buff and by GM)
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM) && (effected.isTransformed() || (effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0))))
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM) && (effected.isTransformed() || effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0)))
|
||||
{
|
||||
info.getEffected().stopTransformation(true);
|
||||
}
|
||||
|
@@ -144,7 +144,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
attacker.decreaseCharges(3);
|
||||
}
|
||||
|
||||
final double addPower = (attacker.getStat().calcStat(Stats.MOMENTUM_SKILL_POWER, 1, null, null));
|
||||
final double addPower = attacker.getStat().calcStat(Stats.MOMENTUM_SKILL_POWER, 1, null, null);
|
||||
|
||||
attack += _power;
|
||||
attack *= addPower;
|
||||
@@ -171,7 +171,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
final double maxDamage = target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null);
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
|
@@ -101,7 +101,7 @@ public final class FatalBlow extends AbstractEffect
|
||||
}
|
||||
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
final double maxDamage = target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null);
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
|
@@ -31,15 +31,15 @@ import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
*/
|
||||
public class FeohStance extends AbstractEffect
|
||||
{
|
||||
private final static int FIRE_STANCE = 11007;
|
||||
private final static int WATER_STANCE = 11008;
|
||||
private final static int WIND_STANCE = 11009;
|
||||
private final static int EARTH_STANCE = 11010;
|
||||
private final static int ELEMENTAL_SPIKE = 11011;
|
||||
private final static int ELEMENTAL_CRASH = 11017;
|
||||
private final static int ELEMENTAL_DESTRUCTION = 11023;
|
||||
private final static int ELEMENTAL_BLAST = 11034;
|
||||
private final static int ELEMENTAL_STORM = 11040;
|
||||
private static final int FIRE_STANCE = 11007;
|
||||
private static final int WATER_STANCE = 11008;
|
||||
private static final int WIND_STANCE = 11009;
|
||||
private static final int EARTH_STANCE = 11010;
|
||||
private static final int ELEMENTAL_SPIKE = 11011;
|
||||
private static final int ELEMENTAL_CRASH = 11017;
|
||||
private static final int ELEMENTAL_DESTRUCTION = 11023;
|
||||
private static final int ELEMENTAL_BLAST = 11034;
|
||||
private static final int ELEMENTAL_STORM = 11040;
|
||||
private final HashSet<Skill> _skillList = new HashSet<>();
|
||||
private int _stanceId;
|
||||
|
||||
|
@@ -100,7 +100,7 @@ public final class Fishing extends AbstractEffect
|
||||
|
||||
// check for equiped fishing rod
|
||||
final L2Weapon equipedWeapon = player.getActiveWeaponItem();
|
||||
if (((equipedWeapon == null) || (equipedWeapon.getItemType() != WeaponType.FISHINGROD)))
|
||||
if ((equipedWeapon == null) || (equipedWeapon.getItemType() != WeaponType.FISHINGROD))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_A_FISHING_POLE_EQUIPPED);
|
||||
return;
|
||||
@@ -230,12 +230,12 @@ public final class Fishing extends AbstractEffect
|
||||
*/
|
||||
private static int computeBaitZ(L2PcInstance player, int baitX, int baitY, L2FishingZone fishingZone, L2WaterZone waterZone)
|
||||
{
|
||||
if ((fishingZone == null))
|
||||
if (fishingZone == null)
|
||||
{
|
||||
return Integer.MIN_VALUE;
|
||||
}
|
||||
|
||||
if ((waterZone == null))
|
||||
if (waterZone == null)
|
||||
{
|
||||
return Integer.MIN_VALUE;
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ public final class FocusMaxEnergy extends AbstractEffect
|
||||
final int maxCharge = (sonicMastery != null) ? sonicMastery.getLevel() : (focusMastery != null) ? focusMastery.getLevel() : (maximumForceMastery != null) ? 15 : 0;
|
||||
if (maxCharge != 0)
|
||||
{
|
||||
info.getEffected().getActingPlayer().increaseCharges((maxCharge - info.getEffected().getActingPlayer().getCharges()), maxCharge);
|
||||
info.getEffected().getActingPlayer().increaseCharges(maxCharge - info.getEffected().getActingPlayer().getCharges(), maxCharge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ public final class FocusSouls extends AbstractEffect
|
||||
final int maxSouls = (int) target.calcStat(Stats.MAX_SOULS, 0, null, null);
|
||||
if (maxSouls > 0)
|
||||
{
|
||||
if ((target.getChargedSouls() < maxSouls))
|
||||
if (target.getChargedSouls() < maxSouls)
|
||||
{
|
||||
target.increaseSouls(((target.getChargedSouls() + _charge) <= maxSouls) ? _charge : (maxSouls - target.getChargedSouls()));
|
||||
}
|
||||
|
@@ -118,7 +118,7 @@ public final class Harvesting extends AbstractEffect
|
||||
final int levelPlayer = activeChar.getLevel();
|
||||
final int levelTarget = target.getLevel();
|
||||
|
||||
int diff = (levelPlayer - levelTarget);
|
||||
int diff = levelPlayer - levelTarget;
|
||||
if (diff < 0)
|
||||
{
|
||||
diff = -diff;
|
||||
|
@@ -74,7 +74,7 @@ public final class Heal extends AbstractEffect
|
||||
final boolean sps = info.getSkill().isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
final boolean bss = info.getSkill().isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
|
||||
if (((sps || bss) && (activeChar.isPlayer() && activeChar.getActingPlayer().isMageClass())) || activeChar.isSummon())
|
||||
if (((sps || bss) && activeChar.isPlayer() && activeChar.getActingPlayer().isMageClass()) || activeChar.isSummon())
|
||||
{
|
||||
staticShotBonus = info.getSkill().getMpConsume(); // static bonus for spiritshots
|
||||
mAtkMul = bss ? 4 : 2;
|
||||
@@ -128,21 +128,18 @@ public final class Heal extends AbstractEffect
|
||||
{
|
||||
target.sendPacket(SystemMessageId.REJUVENATING_HP);
|
||||
}
|
||||
else if (activeChar.isPlayer() && (activeChar != target))
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1);
|
||||
sm.addString(activeChar.getName());
|
||||
sm.addInt((int) amount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (activeChar.isPlayer() && (activeChar != target))
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1);
|
||||
sm.addString(activeChar.getName());
|
||||
sm.addInt((int) amount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
else
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED);
|
||||
sm.addInt((int) amount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED);
|
||||
sm.addInt((int) amount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ public final class HealPercent extends AbstractEffect
|
||||
|
||||
double amount = 0;
|
||||
final double power = _power;
|
||||
final boolean full = (power == 100.0);
|
||||
final boolean full = power == 100.0;
|
||||
|
||||
amount = full ? target.getMaxHp() : (target.getMaxHp() * power) / 100.0;
|
||||
// Prevents overheal and negative amount
|
||||
|
@@ -61,7 +61,7 @@ public final class HpByLevel extends AbstractEffect
|
||||
|
||||
// Calculation
|
||||
final double abs = _power;
|
||||
final double absorb = ((info.getEffector().getCurrentHp() + abs) > info.getEffector().getMaxHp() ? info.getEffector().getMaxHp() : (info.getEffector().getCurrentHp() + abs));
|
||||
final double absorb = (info.getEffector().getCurrentHp() + abs) > info.getEffector().getMaxHp() ? info.getEffector().getMaxHp() : (info.getEffector().getCurrentHp() + abs);
|
||||
final int restored = (int) (absorb - info.getEffector().getCurrentHp());
|
||||
info.getEffector().setCurrentHp(absorb);
|
||||
// System message
|
||||
|
@@ -74,7 +74,7 @@ public final class HpCpHeal extends AbstractEffect
|
||||
final boolean sps = info.getSkill().isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
final boolean bss = info.getSkill().isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
|
||||
if (((sps || bss) && (activeChar.isPlayer() && activeChar.getActingPlayer().isMageClass())) || activeChar.isSummon())
|
||||
if (((sps || bss) && activeChar.isPlayer() && activeChar.getActingPlayer().isMageClass()) || activeChar.isSummon())
|
||||
{
|
||||
staticShotBonus = info.getSkill().getMpConsume(); // static bonus for spiritshots
|
||||
mAtkMul = bss ? 4 : 2;
|
||||
@@ -151,19 +151,18 @@ public final class HpCpHeal extends AbstractEffect
|
||||
{
|
||||
target.setCurrentCp(amount + target.getCurrentCp());
|
||||
|
||||
final SystemMessage sm;
|
||||
if (activeChar.isPlayer() && (activeChar != target))
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_CP_HAS_BEEN_RESTORED_BY_C1);
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.S2_CP_HAS_BEEN_RESTORED_BY_C1);
|
||||
sm.addString(activeChar.getName());
|
||||
sm.addInt((int) amount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
else
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CP_HAS_BEEN_RESTORED);
|
||||
sm.addInt((int) amount);
|
||||
target.sendPacket(sm);
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CP_HAS_BEEN_RESTORED);
|
||||
}
|
||||
sm.addInt((int) amount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -87,8 +87,8 @@ public final class HpDrain extends AbstractEffect
|
||||
drain = damage;
|
||||
}
|
||||
|
||||
final double hpAdd = (_power * drain);
|
||||
final double hpFinal = ((activeChar.getCurrentHp() + hpAdd) > activeChar.getMaxHp() ? activeChar.getMaxHp() : (activeChar.getCurrentHp() + hpAdd));
|
||||
final double hpAdd = _power * drain;
|
||||
final double hpFinal = (activeChar.getCurrentHp() + hpAdd) > activeChar.getMaxHp() ? activeChar.getMaxHp() : (activeChar.getCurrentHp() + hpAdd);
|
||||
activeChar.setCurrentHp(hpFinal);
|
||||
|
||||
if (damage > 0)
|
||||
|
@@ -79,7 +79,7 @@ public final class MagicalAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
final double maxDamage = target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null);
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
|
@@ -73,12 +73,12 @@ public final class MagicalAttackByAbnormal extends AbstractEffect
|
||||
int damage = (int) Formulas.calcMagicDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
|
||||
// each buff increase +30%
|
||||
damage *= (((target.getBuffCount() * 0.3) + 1.3) / 4);
|
||||
damage *= ((target.getBuffCount() * 0.3) + 1.3) / 4;
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
final double maxDamage = target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null);
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
|
@@ -91,7 +91,7 @@ public final class MagicalAttackMp extends AbstractEffect
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
final boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, info.getSkill()));
|
||||
final double damage = Formulas.calcManaDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
final double mp = (damage > target.getCurrentMp() ? target.getCurrentMp() : damage);
|
||||
final double mp = damage > target.getCurrentMp() ? target.getCurrentMp() : damage;
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
|
@@ -80,7 +80,7 @@ public final class MagicalSoulAttack extends AbstractEffect
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
final double maxDamage = target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null);
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
|
@@ -63,7 +63,7 @@ public final class ManaHealPercent extends AbstractEffect
|
||||
|
||||
double amount = 0;
|
||||
final double power = _power;
|
||||
final boolean full = (power == 100.0);
|
||||
final boolean full = power == 100.0;
|
||||
|
||||
amount = full ? target.getMaxMp() : (target.getMaxMp() * power) / 100.0;
|
||||
// Prevents overheal and negative amount
|
||||
|
@@ -81,7 +81,7 @@ public final class MarkRetriever extends AbstractEffect
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (effected.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
final double maxDamage = effected.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null);
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = maxDamage;
|
||||
|
@@ -80,7 +80,7 @@ public final class MaxCp extends AbstractEffect
|
||||
charStat.getActiveChar().addStatFunc(new FuncAdd(Stats.MAX_CP, 1, this, _power, null));
|
||||
if (_heal)
|
||||
{
|
||||
effected.setCurrentCp((currentCp + _power));
|
||||
effected.setCurrentCp(currentCp + _power);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -80,7 +80,7 @@ public final class MaxHp extends AbstractEffect
|
||||
charStat.getActiveChar().addStatFunc(new FuncAdd(Stats.MAX_HP, 1, this, _power, null));
|
||||
if (_heal)
|
||||
{
|
||||
effected.setCurrentHp((currentHp + _power));
|
||||
effected.setCurrentHp(currentHp + _power);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -135,7 +135,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
final double maxDamage = target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null);
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
|
@@ -88,7 +88,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
final double maxDamage = target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null);
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
|
@@ -103,7 +103,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
final double maxDamage = target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null);
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
|
@@ -73,7 +73,7 @@ public final class RebalanceHP extends AbstractEffect
|
||||
}
|
||||
|
||||
final L2Summon summon = member.getPet();
|
||||
if ((summon != null) && (!summon.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, summon, true)))
|
||||
if ((summon != null) && !summon.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, summon, true))
|
||||
{
|
||||
fullHP += summon.getMaxHp();
|
||||
currentHPs += summon.getCurrentHp();
|
||||
@@ -106,7 +106,7 @@ public final class RebalanceHP extends AbstractEffect
|
||||
member.setCurrentHp(newHP);
|
||||
}
|
||||
final L2Summon summon = member.getPet();
|
||||
if ((summon != null) && (!summon.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, summon, true)))
|
||||
if ((summon != null) && !summon.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, summon, true))
|
||||
{
|
||||
double newHP = (summon.getMaxHp() * currentHPs) / fullHP;
|
||||
if (newHP > summon.getCurrentHp()) // The target gets healed
|
||||
|
@@ -58,7 +58,7 @@ public final class Sow extends AbstractEffect
|
||||
final L2PcInstance player = info.getEffector().getActingPlayer();
|
||||
final L2MonsterInstance target = (L2MonsterInstance) info.getEffected();
|
||||
|
||||
if (target.isDead() || (!target.getTemplate().canBeSown()) || target.isSeeded() || (target.getSeederId() != player.getObjectId()))
|
||||
if (target.isDead() || !target.getTemplate().canBeSown() || target.isSeeded() || (target.getSeederId() != player.getObjectId()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public final class Sow extends AbstractEffect
|
||||
|
||||
// 5% decrease in chance if player level
|
||||
// is more than +/- 5 levels to _target's_ level
|
||||
int diff = (levelPlayer - levelTarget);
|
||||
int diff = levelPlayer - levelTarget;
|
||||
if (diff < 0)
|
||||
{
|
||||
diff = -diff;
|
||||
|
@@ -52,7 +52,7 @@ public final class StaticDamage extends AbstractEffect
|
||||
}
|
||||
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (info.getEffected().getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
final double maxDamage = info.getEffected().getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null);
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
_power = (int) maxDamage;
|
||||
|
@@ -155,8 +155,8 @@ public final class SummonNpc extends AbstractEffect
|
||||
int y = player.getY();
|
||||
if (_randomOffset)
|
||||
{
|
||||
x += (Rnd.nextBoolean() ? Rnd.get(20, 50) : Rnd.get(-50, -20));
|
||||
y += (Rnd.nextBoolean() ? Rnd.get(20, 50) : Rnd.get(-50, -20));
|
||||
x += Rnd.nextBoolean() ? Rnd.get(20, 50) : Rnd.get(-50, -20);
|
||||
y += Rnd.nextBoolean() ? Rnd.get(20, 50) : Rnd.get(-50, -20);
|
||||
}
|
||||
|
||||
spawn.setX(x);
|
||||
|
@@ -79,7 +79,7 @@ public final class ThrowHorizontal extends AbstractEffect
|
||||
final int z = info.getEffected().getZ();
|
||||
|
||||
// Prevent using skill with this effect on NPC that not monster
|
||||
if (!(info.getEffected().isMonster() || info.getEffected().isRaidMinion() || info.getEffected().isMinion() || info.getEffected().isSummon() || info.getEffected().isPlayer()))
|
||||
if (!info.getEffected().isMonster() && !info.getEffected().isRaidMinion() && !info.getEffected().isMinion() && !info.getEffected().isSummon() && !info.getEffected().isPlayer())
|
||||
{
|
||||
final L2PcInstance effector = (L2PcInstance) info.getEffector();
|
||||
effector.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||
|
@@ -67,7 +67,7 @@ public final class TransferHate extends AbstractEffect
|
||||
continue;
|
||||
}
|
||||
|
||||
final L2Attackable hater = ((L2Attackable) obj);
|
||||
final L2Attackable hater = (L2Attackable) obj;
|
||||
final int hate = hater.getHating(info.getEffector());
|
||||
if (hate <= 0)
|
||||
{
|
||||
|
@@ -114,10 +114,10 @@ public final class TriggerForce extends AbstractEffect
|
||||
// apply offensive aura to enemies
|
||||
if ((_skill.getSkillId() == RAGE_AURA) || (_skill.getSkillId() == ROLLING_THUNDER))
|
||||
{
|
||||
final boolean srcInArena = (effector.isInsideZone(ZoneId.PVP) && (!effector.isInsideZone(ZoneId.SIEGE)));
|
||||
final boolean srcInArena = effector.isInsideZone(ZoneId.PVP) && !effector.isInsideZone(ZoneId.SIEGE);
|
||||
for (L2Character obj : effector.getKnownList().getKnownCharactersInRadius(200))
|
||||
{
|
||||
if (((obj.isAttackable() || obj.isPlayable()) && !obj.isDoor()) && Skill.checkForAreaOffensiveSkills(effector, obj, _skill.getSkill(), srcInArena) && !_affectedObjects.contains(obj))
|
||||
if ((obj.isAttackable() || obj.isPlayable()) && !obj.isDoor() && Skill.checkForAreaOffensiveSkills(effector, obj, _skill.getSkill(), srcInArena) && !_affectedObjects.contains(obj))
|
||||
{
|
||||
_affectedObjects.add(obj);
|
||||
_skill.getSkill().applyEffects(effector, obj);
|
||||
@@ -159,7 +159,7 @@ public final class TriggerForce extends AbstractEffect
|
||||
}
|
||||
if (!member.getEffectList().isAffectedBySkill(_skill.getSkillId()) && (member.calculateDistance(effector, true, false) < 900) && (_skill.getSkillId() != RAGE_AURA) && (_skill.getSkillId() != ROLLING_THUNDER))
|
||||
{
|
||||
if ((member != effector))
|
||||
if (member != effector)
|
||||
{
|
||||
_skill.getSkill().applyEffects(effector, member);
|
||||
}
|
||||
@@ -234,13 +234,13 @@ public final class TriggerForce extends AbstractEffect
|
||||
activeForces++;
|
||||
}
|
||||
|
||||
if (((activeForces < 4) || ((member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) == null) || (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) == null))) && (member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY) != null))
|
||||
if (((activeForces < 4) || (member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) == null) || (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) == null)) && (member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY) != null))
|
||||
{
|
||||
member.getEffectList().remove(true, member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY));
|
||||
}
|
||||
if ((activeForces >= 4) && (member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) != null) && (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) != null) && (!member.getEffectList().isAffectedBySkill(PARTY_SOLIDARITY) || (member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY).getSkill().getLevel() != Math.min((activeForces - 3), 3))))
|
||||
if ((activeForces >= 4) && (member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) != null) && (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) != null) && (!member.getEffectList().isAffectedBySkill(PARTY_SOLIDARITY) || (member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY).getSkill().getLevel() != Math.min(activeForces - 3, 3))))
|
||||
{
|
||||
member.makeTriggerCast(SkillData.getInstance().getSkill(PARTY_SOLIDARITY, Math.min((activeForces - 3), 3)), member);
|
||||
member.makeTriggerCast(SkillData.getInstance().getSkill(PARTY_SOLIDARITY, Math.min(activeForces - 3, 3)), member);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ public final class TriggerSkillByAttack extends AbstractEffect
|
||||
|
||||
public void onAttackEvent(OnCreatureDamageDealt event)
|
||||
{
|
||||
if (event.isDamageOverTime() || (_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLvl() == 0)))
|
||||
if (event.isDamageOverTime() || (_chance == 0) || (_skill.getSkillId() == 0) || (_skill.getSkillLvl() == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public final class TriggerSkillByAttack extends AbstractEffect
|
||||
}
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getAttacker().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
event.getAttacker().makeTriggerCast(triggerSkill, (L2Character) triggerTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ public final class TriggerSkillByAvoid extends AbstractEffect
|
||||
|
||||
public void onAvoidEvent(OnCreatureAttackAvoid event)
|
||||
{
|
||||
if (event.isDamageOverTime() || (_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLvl() == 0)))
|
||||
if (event.isDamageOverTime() || (_chance == 0) || (_skill.getSkillId() == 0) || (_skill.getSkillLvl() == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public final class TriggerSkillByAvoid extends AbstractEffect
|
||||
}
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getTarget().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
event.getTarget().makeTriggerCast(triggerSkill, (L2Character) triggerTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -98,7 +98,7 @@ public final class TriggerSkillByDamage extends AbstractEffect
|
||||
}
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getTarget().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
event.getTarget().makeTriggerCast(triggerSkill, (L2Character) triggerTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -62,7 +62,7 @@ public final class TriggerSkillBySkill extends AbstractEffect
|
||||
|
||||
public void onSkillUseEvent(OnCreatureSkillUse event)
|
||||
{
|
||||
if ((_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLvl() == 0) || ((_castSkillId == 0) && (_skill.getSkillId() != AQUAMARINE))))
|
||||
if ((_chance == 0) || (_skill.getSkillId() == 0) || (_skill.getSkillLvl() == 0) || ((_castSkillId == 0) && (_skill.getSkillId() != AQUAMARINE)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public final class TriggerSkillBySkill extends AbstractEffect
|
||||
}
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getCaster().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
event.getCaster().makeTriggerCast(triggerSkill, (L2Character) triggerTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -45,11 +45,7 @@ public final class Unsummon extends AbstractEffect
|
||||
public boolean calcSuccess(BuffInfo info)
|
||||
{
|
||||
final int magicLevel = info.getSkill().getMagicLevel();
|
||||
if (((magicLevel <= 0) || ((info.getEffected().getLevel() - 9) <= magicLevel)) && ((_chance * Formulas.calcAttributeBonus(info.getEffector(), info.getEffected(), info.getSkill()) * Formulas.calcGeneralTraitBonus(info.getEffector(), info.getEffected(), info.getSkill().getTraitType(), false)) > (Rnd.nextDouble() * 100)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return ((magicLevel <= 0) || ((info.getEffected().getLevel() - 9) <= magicLevel)) && ((_chance * Formulas.calcAttributeBonus(info.getEffector(), info.getEffected(), info.getSkill()) * Formulas.calcGeneralTraitBonus(info.getEffector(), info.getEffected(), info.getSkill().getTraitType(), false)) > (Rnd.nextDouble() * 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user