Added missing final modifiers.
This commit is contained in:
@@ -66,11 +66,11 @@ public final class Backstab extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
Skill skill = info.getSkill();
|
||||
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
final Skill skill = info.getSkill();
|
||||
final boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
double damage = Formulas.calcBackstabDamage(activeChar, target, skill, shld, ss);
|
||||
|
||||
// Crit rate base crit rate for skill, modified with STR bonus
|
||||
@@ -91,7 +91,7 @@ public final class Backstab extends AbstractEffect
|
||||
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
final L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
activePlayer.sendDamageMessage(target, (int) damage, false, true, false);
|
||||
}
|
||||
|
||||
|
@@ -68,9 +68,9 @@ public final class Blink extends AbstractEffect
|
||||
final int x1 = (int) (Math.cos(Math.PI + radian + course) * radius);
|
||||
final int y1 = (int) (Math.sin(Math.PI + radian + course) * radius);
|
||||
|
||||
int x = effected.getX() + x1;
|
||||
int y = effected.getY() + y1;
|
||||
int z = effected.getZ();
|
||||
final int x = effected.getX() + x1;
|
||||
final int y = effected.getY() + y1;
|
||||
final int z = effected.getZ();
|
||||
|
||||
final Location destination = GeoData.getInstance().moveCheck(effected.getX(), effected.getY(), effected.getZ(), x, y, z, effected.getInstanceId());
|
||||
|
||||
|
@@ -40,7 +40,7 @@ public final class BlockBuffSlot extends AbstractEffect
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
|
||||
String blockBuffSlots = params.getString("slot", null);
|
||||
final String blockBuffSlots = params.getString("slot", null);
|
||||
if ((blockBuffSlots != null) && !blockBuffSlots.isEmpty())
|
||||
{
|
||||
_blockBuffSlots = new HashSet<>();
|
||||
|
@@ -65,21 +65,21 @@ public final class CallPc extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
L2PcInstance target = info.getEffected().getActingPlayer();
|
||||
L2PcInstance activeChar = info.getEffector().getActingPlayer();
|
||||
final L2PcInstance target = info.getEffected().getActingPlayer();
|
||||
final L2PcInstance activeChar = info.getEffector().getActingPlayer();
|
||||
if (checkSummonTargetStatus(target, activeChar))
|
||||
{
|
||||
if ((_itemId != 0) && (_itemCount != 0))
|
||||
{
|
||||
if (target.getInventory().getInventoryItemCount(_itemId, 0) < _itemCount)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_IS_REQUIRED_FOR_SUMMONING);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_IS_REQUIRED_FOR_SUMMONING);
|
||||
sm.addItemName(_itemId);
|
||||
target.sendPacket(sm);
|
||||
return;
|
||||
}
|
||||
target.getInventory().destroyItemByItemId("Consume", _itemId, _itemCount, activeChar, target);
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
||||
sm.addItemName(_itemId);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public final class CallPc extends AbstractEffect
|
||||
|
||||
if (target.isAlikeDead())
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_DEAD_AT_THE_MOMENT_AND_CANNOT_BE_SUMMONED_OR_TELEPORTED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_DEAD_AT_THE_MOMENT_AND_CANNOT_BE_SUMMONED_OR_TELEPORTED);
|
||||
sm.addPcName(target);
|
||||
activeChar.sendPacket(sm);
|
||||
return false;
|
||||
@@ -111,7 +111,7 @@ public final class CallPc extends AbstractEffect
|
||||
|
||||
if (target.isInStoreMode())
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_CURRENTLY_TRADING_OR_OPERATING_A_PRIVATE_STORE_AND_CANNOT_BE_SUMMONED_OR_TELEPORTED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_CURRENTLY_TRADING_OR_OPERATING_A_PRIVATE_STORE_AND_CANNOT_BE_SUMMONED_OR_TELEPORTED);
|
||||
sm.addPcName(target);
|
||||
activeChar.sendPacket(sm);
|
||||
return false;
|
||||
@@ -119,7 +119,7 @@ public final class CallPc extends AbstractEffect
|
||||
|
||||
if (target.isRooted() || target.isInCombat())
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_ENGAGED_IN_COMBAT_AND_CANNOT_BE_SUMMONED_OR_TELEPORTED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_ENGAGED_IN_COMBAT_AND_CANNOT_BE_SUMMONED_OR_TELEPORTED);
|
||||
sm.addPcName(target);
|
||||
activeChar.sendPacket(sm);
|
||||
return false;
|
||||
@@ -139,7 +139,7 @@ public final class CallPc extends AbstractEffect
|
||||
|
||||
if (target.inObserverMode())
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING_OR_TELEPORTING);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING_OR_TELEPORTING);
|
||||
sm.addCharName(target);
|
||||
activeChar.sendPacket(sm);
|
||||
return false;
|
||||
@@ -147,7 +147,7 @@ public final class CallPc extends AbstractEffect
|
||||
|
||||
if (target.isInsideZone(ZoneId.NO_SUMMON_FRIEND) || target.isInsideZone(ZoneId.JAIL))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING_OR_TELEPORTING);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING_OR_TELEPORTING);
|
||||
sm.addString(target.getName());
|
||||
activeChar.sendPacket(sm);
|
||||
return false;
|
||||
@@ -155,7 +155,7 @@ public final class CallPc extends AbstractEffect
|
||||
|
||||
if (activeChar.getInstanceId() > 0)
|
||||
{
|
||||
Instance summonerInstance = InstanceManager.getInstance().getInstance(activeChar.getInstanceId());
|
||||
final Instance summonerInstance = InstanceManager.getInstance().getInstance(activeChar.getInstanceId());
|
||||
if (!Config.ALLOW_SUMMON_IN_INSTANCE || !summonerInstance.isSummonAllowed())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_FROM_YOUR_CURRENT_LOCATION);
|
||||
|
@@ -69,7 +69,7 @@ public final class ChameleonRest extends AbstractEffect
|
||||
}
|
||||
}
|
||||
|
||||
double manaDam = _power * getTicksMultiplier();
|
||||
final double manaDam = _power * getTicksMultiplier();
|
||||
if (manaDam > info.getEffected().getCurrentMp())
|
||||
{
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
|
||||
|
@@ -45,7 +45,7 @@ public final class ClanGate extends AbstractEffect
|
||||
final L2Clan clan = info.getEffected().getActingPlayer().getClan();
|
||||
if (clan != null)
|
||||
{
|
||||
SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.COURT_WIZARD_THE_PORTAL_HAS_BEEN_CREATED);
|
||||
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.COURT_WIZARD_THE_PORTAL_HAS_BEEN_CREATED);
|
||||
clan.broadcastToOtherOnlineMembers(msg, info.getEffected().getActingPlayer());
|
||||
}
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ public final class CpDamPercent extends AbstractEffect
|
||||
info.getEffected().stopFakeDeath(true);
|
||||
}
|
||||
|
||||
int damage = (int) ((info.getEffected().getCurrentCp() * _power) / 100);
|
||||
final int damage = (int) ((info.getEffected().getCurrentCp() * _power) / 100);
|
||||
// Manage attack or cast break of the target (calculating rate, sending message)
|
||||
if (!info.getEffected().isRaid() && Formulas.calcAtkBreak(info.getEffected(), damage))
|
||||
{
|
||||
|
@@ -46,7 +46,7 @@ public final class CpHealOverTime extends AbstractEffect
|
||||
}
|
||||
|
||||
double cp = info.getEffected().getCurrentCp();
|
||||
double maxcp = info.getEffected().getMaxRecoverableCp();
|
||||
final double maxcp = info.getEffected().getMaxRecoverableCp();
|
||||
|
||||
// Not needed to set the CP and send update packet if player is already at max CP
|
||||
if (cp >= maxcp)
|
||||
|
@@ -57,8 +57,8 @@ public final class CpHealPercent extends AbstractEffect
|
||||
}
|
||||
|
||||
double amount = 0;
|
||||
double power = _power;
|
||||
boolean full = (power == 100.0);
|
||||
final double power = _power;
|
||||
final boolean full = (power == 100.0);
|
||||
|
||||
amount = full ? target.getMaxCp() : (target.getMaxCp() * power) / 100.0;
|
||||
// Prevents overheal and negative amount
|
||||
|
@@ -55,16 +55,16 @@ public final class DeathLink extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
final boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
final boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
|
||||
if (target.isPlayer() && target.getActingPlayer().isFakeDeath())
|
||||
{
|
||||
@@ -73,7 +73,7 @@ public final class DeathLink extends AbstractEffect
|
||||
|
||||
final boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, info.getSkill()));
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
int damage = (int) Formulas.calcMagicDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
final int damage = (int) Formulas.calcMagicDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
|
@@ -68,7 +68,7 @@ public final class DeleteHate extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
L2Attackable target = (L2Attackable) info.getEffected();
|
||||
final L2Attackable target = (L2Attackable) info.getEffected();
|
||||
target.clearAggroList();
|
||||
target.setWalking();
|
||||
target.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
|
@@ -68,7 +68,7 @@ public final class DeleteHateOfMe extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
L2Attackable target = (L2Attackable) info.getEffected();
|
||||
final L2Attackable target = (L2Attackable) info.getEffected();
|
||||
target.stopHating(info.getEffector());
|
||||
target.setWalking();
|
||||
target.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||
|
@@ -51,7 +51,7 @@ public final class DispelBySlot extends AbstractEffect
|
||||
_dispelAbnormals = new EnumMap<>(AbnormalType.class);
|
||||
for (String ngtStack : _dispel.split(";"))
|
||||
{
|
||||
String[] ngt = ngtStack.split(",");
|
||||
final String[] ngt = ngtStack.split(",");
|
||||
_dispelAbnormals.put(AbnormalType.getAbnormalType(ngt[0]), Short.parseShort(ngt[1]));
|
||||
}
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ public final class DispelBySlotProbability extends AbstractEffect
|
||||
_dispelAbnormals = new EnumMap<>(AbnormalType.class);
|
||||
for (String ngtStack : _dispel.split(";"))
|
||||
{
|
||||
String[] ngt = ngtStack.split(",");
|
||||
final String[] ngt = ngtStack.split(",");
|
||||
_dispelAbnormals.put(AbnormalType.getAbnormalType(ngt[0]), (ngt.length > 1) ? Short.parseShort(ngt[1]) : Short.MAX_VALUE);
|
||||
}
|
||||
}
|
||||
|
@@ -41,15 +41,15 @@ public final class Duel extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2PcInstance effector = info.getEffector().getActingPlayer();
|
||||
L2PcInstance effected = info.getEffected().getActingPlayer();
|
||||
final L2PcInstance effector = info.getEffector().getActingPlayer();
|
||||
final L2PcInstance effected = info.getEffected().getActingPlayer();
|
||||
|
||||
if (effected.isDead() || (effector == null) || (effected.getPvpFlag() == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Skill skill = SkillData.getInstance().getSkill(10319, 1);
|
||||
final Skill skill = SkillData.getInstance().getSkill(10319, 1);
|
||||
skill.applyEffects(effector, effector);
|
||||
|
||||
effector.setIsInvul(true);
|
||||
|
@@ -58,10 +58,10 @@ public final class EnemyCharge extends AbstractEffect
|
||||
final int curZ = info.getEffector().getZ();
|
||||
|
||||
// Calculate distance (dx,dy) between current position and destination
|
||||
double dx = info.getEffected().getX() - curX;
|
||||
double dy = info.getEffected().getY() - curY;
|
||||
double dz = info.getEffected().getZ() - curZ;
|
||||
double distance = Math.sqrt((dx * dx) + (dy * dy));
|
||||
final double dx = info.getEffected().getX() - curX;
|
||||
final double dy = info.getEffected().getY() - curY;
|
||||
final double dz = info.getEffected().getZ() - curZ;
|
||||
final double distance = Math.sqrt((dx * dx) + (dy * dy));
|
||||
if (distance > 2000)
|
||||
{
|
||||
_log.info("EffectEnemyCharge was going to use invalid coordinates for characters, getEffector: " + curX + "," + curY + " and getEffected: " + info.getEffected().getX() + "," + info.getEffected().getY());
|
||||
@@ -85,13 +85,13 @@ public final class EnemyCharge extends AbstractEffect
|
||||
}
|
||||
|
||||
// Calculate movement angles needed
|
||||
double sin = dy / distance;
|
||||
double cos = dx / distance;
|
||||
final double sin = dy / distance;
|
||||
final double cos = dx / distance;
|
||||
|
||||
// Calculate the new destination with offset included
|
||||
int x = curX + (int) ((distance - offset) * cos);
|
||||
int y = curY + (int) ((distance - offset) * sin);
|
||||
int z = info.getEffected().getZ();
|
||||
final int x = curX + (int) ((distance - offset) * cos);
|
||||
final int y = curY + (int) ((distance - offset) * sin);
|
||||
final int z = info.getEffected().getZ();
|
||||
|
||||
final Location destination = GeoData.getInstance().moveCheck(info.getEffector().getX(), info.getEffector().getY(), info.getEffector().getZ(), x, y, z, info.getEffector().getInstanceId());
|
||||
|
||||
|
@@ -89,7 +89,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
|
||||
if (!_ignoreShieldDefence)
|
||||
{
|
||||
byte shield = Formulas.calcShldUse(attacker, target, skill, true);
|
||||
final byte shield = Formulas.calcShldUse(attacker, target, skill, true);
|
||||
switch (shield)
|
||||
{
|
||||
case Formulas.SHIELD_DEFENSE_FAILED:
|
||||
@@ -114,13 +114,13 @@ public final class EnergyAttack extends AbstractEffect
|
||||
|
||||
if (defence != -1)
|
||||
{
|
||||
double damageMultiplier = Formulas.calcWeaponTraitBonus(attacker, target) * Formulas.calcAttributeBonus(attacker, target, skill) * Formulas.calcGeneralTraitBonus(attacker, target, skill.getTraitType(), true);
|
||||
final double damageMultiplier = Formulas.calcWeaponTraitBonus(attacker, target) * Formulas.calcAttributeBonus(attacker, target, skill) * Formulas.calcGeneralTraitBonus(attacker, target, skill.getTraitType(), true);
|
||||
|
||||
boolean ss = info.getSkill().useSoulShot() && attacker.isChargedShot(ShotType.SOULSHOTS);
|
||||
double ssBoost = ss ? 2 : 1.0;
|
||||
final boolean ss = info.getSkill().useSoulShot() && attacker.isChargedShot(ShotType.SOULSHOTS);
|
||||
final double ssBoost = ss ? 2 : 1.0;
|
||||
|
||||
double weaponTypeBoost;
|
||||
L2Weapon weapon = attacker.getActiveWeaponItem();
|
||||
final L2Weapon weapon = attacker.getActiveWeaponItem();
|
||||
if ((weapon != null) && ((weapon.getItemType() == WeaponType.BOW) || (weapon.getItemType() == WeaponType.CROSSBOW)))
|
||||
{
|
||||
weaponTypeBoost = 70;
|
||||
@@ -147,7 +147,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
attacker.decreaseCharges(3);
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -174,7 +174,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
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;
|
||||
|
@@ -71,25 +71,25 @@ public final class FatalBlow extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
Skill skill = info.getSkill();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
final Skill skill = info.getSkill();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
final boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
double damage = Formulas.calcBlowDamage(activeChar, target, skill, shld, ss);
|
||||
|
||||
if (_targetAbnormalType != "NULL")
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(_targetAbnormalType, ",");
|
||||
final StringTokenizer st = new StringTokenizer(_targetAbnormalType, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
String abnormal = st.nextToken().trim();
|
||||
final String abnormal = st.nextToken().trim();
|
||||
if (target.getEffectList().getBuffInfoByAbnormalType(AbnormalType.valueOf(abnormal)) != null)
|
||||
{
|
||||
damage *= _skillAddPower;
|
||||
@@ -98,14 +98,14 @@ public final class FatalBlow extends AbstractEffect
|
||||
}
|
||||
}
|
||||
|
||||
boolean crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
final boolean crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
if (crit)
|
||||
{
|
||||
damage *= 2;
|
||||
}
|
||||
|
||||
// reduce damage if target has maxdamage buff
|
||||
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;
|
||||
@@ -123,7 +123,7 @@ public final class FatalBlow extends AbstractEffect
|
||||
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
final L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
activePlayer.sendDamageMessage(target, (int) damage, false, true, false);
|
||||
}
|
||||
|
||||
|
@@ -101,7 +101,7 @@ public final class Fishing extends AbstractEffect
|
||||
}
|
||||
|
||||
// check for equiped fishing rod
|
||||
L2Weapon equipedWeapon = player.getActiveWeaponItem();
|
||||
final L2Weapon equipedWeapon = player.getActiveWeaponItem();
|
||||
if (((equipedWeapon == null) || (equipedWeapon.getItemType() != WeaponType.FISHINGROD)))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_A_FISHING_POLE_EQUIPPED);
|
||||
@@ -109,7 +109,7 @@ public final class Fishing extends AbstractEffect
|
||||
}
|
||||
|
||||
// check for equiped lure
|
||||
L2ItemInstance equipedLeftHand = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND);
|
||||
final L2ItemInstance equipedLeftHand = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND);
|
||||
if ((equipedLeftHand == null) || (equipedLeftHand.getItemType() != EtcItemType.LURE))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_MUST_PUT_BAIT_ON_YOUR_HOOK_BEFORE_YOU_CAN_FISH);
|
||||
@@ -152,7 +152,7 @@ public final class Fishing extends AbstractEffect
|
||||
// search for fishing and water zone
|
||||
L2FishingZone fishingZone = null;
|
||||
L2WaterZone waterZone = null;
|
||||
for (final L2ZoneType zone : ZoneManager.getInstance().getZones(baitX, baitY))
|
||||
for (L2ZoneType zone : ZoneManager.getInstance().getZones(baitX, baitY))
|
||||
{
|
||||
if (zone instanceof L2FishingZone)
|
||||
{
|
||||
@@ -180,7 +180,7 @@ public final class Fishing extends AbstractEffect
|
||||
// search for fishing and water zone again
|
||||
fishingZone = null;
|
||||
waterZone = null;
|
||||
for (final L2ZoneType zone : ZoneManager.getInstance().getZones(baitX, baitY))
|
||||
for (L2ZoneType zone : ZoneManager.getInstance().getZones(baitX, baitY))
|
||||
{
|
||||
if (zone instanceof L2FishingZone)
|
||||
{
|
||||
@@ -243,7 +243,7 @@ public final class Fishing extends AbstractEffect
|
||||
}
|
||||
|
||||
// always use water zone, fishing zone high z is high in the air...
|
||||
int baitZ = waterZone.getWaterZ();
|
||||
final int baitZ = waterZone.getWaterZ();
|
||||
|
||||
if (!GeoData.getInstance().canSeeTarget(player.getX(), player.getY(), player.getZ(), baitX, baitY, baitZ))
|
||||
{
|
||||
|
@@ -49,10 +49,10 @@ public final class FocusMaxEnergy extends AbstractEffect
|
||||
final Skill sonicMastery = info.getEffected().getSkills().get(992);
|
||||
final Skill focusMastery = info.getEffected().getSkills().get(993);
|
||||
final Skill maximumForceMastery = info.getEffected().getSkills().get(10301);
|
||||
int maxCharge = (sonicMastery != null) ? sonicMastery.getLevel() : (focusMastery != null) ? focusMastery.getLevel() : (maximumForceMastery != null) ? 15 : 0;
|
||||
final int maxCharge = (sonicMastery != null) ? sonicMastery.getLevel() : (focusMastery != null) ? focusMastery.getLevel() : (maximumForceMastery != null) ? 15 : 0;
|
||||
if (maxCharge != 0)
|
||||
{
|
||||
int count = maxCharge - info.getEffected().getActingPlayer().getCharges();
|
||||
final int count = maxCharge - info.getEffected().getActingPlayer().getCharges();
|
||||
info.getEffected().getActingPlayer().increaseCharges(count, maxCharge);
|
||||
}
|
||||
}
|
||||
|
@@ -59,10 +59,10 @@ public final class FocusSouls extends AbstractEffect
|
||||
final int maxSouls = (int) target.calcStat(Stats.MAX_SOULS, 0, null, null);
|
||||
if (maxSouls > 0)
|
||||
{
|
||||
int amount = _charge;
|
||||
final int amount = _charge;
|
||||
if ((target.getChargedSouls() < maxSouls))
|
||||
{
|
||||
int count = ((target.getChargedSouls() + amount) <= maxSouls) ? amount : (maxSouls - target.getChargedSouls());
|
||||
final int count = ((target.getChargedSouls() + amount) <= maxSouls) ? amount : (maxSouls - target.getChargedSouls());
|
||||
target.increaseSouls(count);
|
||||
}
|
||||
else
|
||||
|
@@ -56,7 +56,7 @@ public final class GiveRecommendation extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2PcInstance target = info.getEffected() instanceof L2PcInstance ? (L2PcInstance) info.getEffected() : null;
|
||||
final L2PcInstance target = info.getEffected() instanceof L2PcInstance ? (L2PcInstance) info.getEffected() : null;
|
||||
if (target != null)
|
||||
{
|
||||
int recommendationsGiven = _amount;
|
||||
@@ -70,7 +70,7 @@ public final class GiveRecommendation extends AbstractEffect
|
||||
{
|
||||
target.setRecomHave(target.getRecomHave() + recommendationsGiven);
|
||||
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_OBTAINED_S1_RECOMMENDATION_S);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_OBTAINED_S1_RECOMMENDATION_S);
|
||||
sm.addInt(recommendationsGiven);
|
||||
target.sendPacket(sm);
|
||||
target.sendPacket(new UserInfo(target));
|
||||
@@ -78,7 +78,7 @@ public final class GiveRecommendation extends AbstractEffect
|
||||
}
|
||||
else
|
||||
{
|
||||
L2PcInstance player = info.getEffector() instanceof L2PcInstance ? (L2PcInstance) info.getEffector() : null;
|
||||
final L2PcInstance player = info.getEffector() instanceof L2PcInstance ? (L2PcInstance) info.getEffector() : null;
|
||||
if (player != null)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
||||
|
@@ -46,7 +46,7 @@ public final class Grow extends AbstractEffect
|
||||
{
|
||||
if (info.getEffected().isNpc())
|
||||
{
|
||||
L2Npc npc = (L2Npc) info.getEffected();
|
||||
final L2Npc npc = (L2Npc) info.getEffected();
|
||||
npc.setCollisionRadius(npc.getTemplate().getfCollisionRadius());
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public final class Grow extends AbstractEffect
|
||||
{
|
||||
if (info.getEffected().isNpc())
|
||||
{
|
||||
L2Npc npc = (L2Npc) info.getEffected();
|
||||
final L2Npc npc = (L2Npc) info.getEffected();
|
||||
npc.setCollisionRadius(npc.getTemplate().getCollisionRadiusGrown());
|
||||
}
|
||||
}
|
||||
|
@@ -63,8 +63,8 @@ public final class Heal extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
if ((target == null) || target.isDead() || target.isDoor() || target.isInvul())
|
||||
{
|
||||
return;
|
||||
@@ -73,8 +73,8 @@ public final class Heal extends AbstractEffect
|
||||
double amount = _power;
|
||||
double staticShotBonus = 0;
|
||||
int mAtkMul = 1;
|
||||
boolean sps = info.getSkill().isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
boolean bss = info.getSkill().isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
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())
|
||||
{
|
||||
@@ -134,14 +134,14 @@ public final class Heal extends AbstractEffect
|
||||
{
|
||||
if (activeChar.isPlayer() && (activeChar != target))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1);
|
||||
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
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED);
|
||||
sm.addInt((int) amount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ public final class HealOverTime extends AbstractEffect
|
||||
}
|
||||
|
||||
double hp = info.getEffected().getCurrentHp();
|
||||
double maxhp = info.getEffected().getMaxRecoverableHp();
|
||||
final double maxhp = info.getEffected().getMaxRecoverableHp();
|
||||
|
||||
// Not needed to set the HP and send update packet if player is already at max HP
|
||||
if (hp >= maxhp)
|
||||
|
@@ -57,15 +57,15 @@ public final class HealPercent extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
final L2Character target = info.getEffected();
|
||||
if ((target == null) || target.isDead() || target.isDoor())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double amount = 0;
|
||||
double power = _power;
|
||||
boolean full = (power == 100.0);
|
||||
final double power = _power;
|
||||
final boolean full = (power == 100.0);
|
||||
|
||||
amount = full ? target.getMaxHp() : (target.getMaxHp() * power) / 100.0;
|
||||
// Prevents overheal and negative amount
|
||||
|
@@ -42,7 +42,7 @@ public final class Hide extends AbstractEffect
|
||||
{
|
||||
if (info.getEffected().isPlayer())
|
||||
{
|
||||
L2PcInstance activeChar = info.getEffected().getActingPlayer();
|
||||
final L2PcInstance activeChar = info.getEffected().getActingPlayer();
|
||||
if (!activeChar.inObserverMode())
|
||||
{
|
||||
activeChar.setInvisible(false);
|
||||
@@ -55,7 +55,7 @@ public final class Hide extends AbstractEffect
|
||||
{
|
||||
if (info.getEffected().isPlayer())
|
||||
{
|
||||
L2PcInstance activeChar = info.getEffected().getActingPlayer();
|
||||
final L2PcInstance activeChar = info.getEffected().getActingPlayer();
|
||||
activeChar.setInvisible(true);
|
||||
|
||||
if ((activeChar.getAI().getNextIntention() != null) && (activeChar.getAI().getNextIntention().getCtrlIntention() == CtrlIntention.AI_INTENTION_ATTACK))
|
||||
|
@@ -63,8 +63,8 @@ public final class HpCpHeal extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
if ((target == null) || target.isDead() || target.isDoor() || target.isInvul())
|
||||
{
|
||||
return;
|
||||
@@ -73,8 +73,8 @@ public final class HpCpHeal extends AbstractEffect
|
||||
double amount = _power;
|
||||
double staticShotBonus = 0;
|
||||
int mAtkMul = 1;
|
||||
boolean sps = info.getSkill().isMagic() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
boolean bss = info.getSkill().isMagic() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
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())
|
||||
{
|
||||
@@ -134,14 +134,14 @@ public final class HpCpHeal extends AbstractEffect
|
||||
{
|
||||
if (activeChar.isPlayer() && (activeChar != target))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_HP_HAS_BEEN_RESTORED_BY_C1);
|
||||
sm.addString(activeChar.getName());
|
||||
sm.addInt((int) healAmount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
else
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED);
|
||||
sm.addInt((int) healAmount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
@@ -155,14 +155,14 @@ public final class HpCpHeal extends AbstractEffect
|
||||
|
||||
if (activeChar.isPlayer() && (activeChar != target))
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_CP_HAS_BEEN_RESTORED_BY_C1);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_CP_HAS_BEEN_RESTORED_BY_C1);
|
||||
sm.addString(activeChar.getName());
|
||||
sm.addInt((int) amount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
else
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CP_HAS_BEEN_RESTORED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CP_HAS_BEEN_RESTORED);
|
||||
sm.addInt((int) amount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
|
@@ -57,8 +57,8 @@ public final class HpDrain extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
|
||||
// TODO: Unhardcode Cubic Skill to avoid double damage
|
||||
if (activeChar.isAlikeDead() || (info.getSkill().getId() == 4050))
|
||||
@@ -66,15 +66,15 @@ public final class HpDrain extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, info.getSkill()));
|
||||
byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
int damage = (int) Formulas.calcMagicDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
final boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
final boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
final boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, info.getSkill()));
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
final int damage = (int) Formulas.calcMagicDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
|
||||
int drain = 0;
|
||||
int cp = (int) target.getCurrentCp();
|
||||
int hp = (int) target.getCurrentHp();
|
||||
final int cp = (int) target.getCurrentCp();
|
||||
final int hp = (int) target.getCurrentHp();
|
||||
|
||||
if (cp > 0)
|
||||
{
|
||||
|
@@ -60,9 +60,9 @@ public final class JumpToFriend extends AbstractEffect
|
||||
final int curY = info.getEffected().getY();
|
||||
|
||||
// Calculate distance between effector and effected current position
|
||||
double dx = info.getEffector().getX() - curX;
|
||||
double dy = info.getEffector().getY() - curY;
|
||||
double distance = Math.sqrt((dx * dx) + (dy * dy));
|
||||
final double dx = info.getEffector().getX() - curX;
|
||||
final double dy = info.getEffector().getY() - curY;
|
||||
final double distance = Math.sqrt((dx * dx) + (dy * dy));
|
||||
if (distance > 2000)
|
||||
{
|
||||
_log.info("EffectThrow was going to use invalid coordinates for characters, getEffected: " + curX + "," + curY + " and getEffector: " + info.getEffector().getX() + "," + info.getEffector().getY());
|
||||
|
@@ -53,8 +53,8 @@ public final class Lethal extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
if (activeChar.isPlayer() && !activeChar.getAccessLevel().canGiveDamage())
|
||||
{
|
||||
return;
|
||||
@@ -70,7 +70,7 @@ public final class Lethal extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
double chanceMultiplier = Formulas.calcAttributeBonus(activeChar, target, info.getSkill()) * Formulas.calcGeneralTraitBonus(activeChar, target, info.getSkill().getTraitType(), false);
|
||||
final double chanceMultiplier = Formulas.calcAttributeBonus(activeChar, target, info.getSkill()) * Formulas.calcGeneralTraitBonus(activeChar, target, info.getSkill().getTraitType(), false);
|
||||
// Lethal Strike
|
||||
if (Rnd.get(100) < (_fullLethal * chanceMultiplier))
|
||||
{
|
||||
|
@@ -55,8 +55,8 @@ public final class MagicalAttack extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
|
||||
// TODO: Unhardcode Cubic Skill to avoid double damage
|
||||
if (activeChar.isAlikeDead() || (info.getSkill().getId() == 4049))
|
||||
@@ -69,8 +69,8 @@ public final class MagicalAttack extends AbstractEffect
|
||||
target.stopFakeDeath(true);
|
||||
}
|
||||
|
||||
boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
final boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
final boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
final boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, info.getSkill()));
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
int damage = (int) Formulas.calcMagicDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
@@ -78,7 +78,7 @@ public final class MagicalAttack extends AbstractEffect
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
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;
|
||||
|
@@ -55,8 +55,8 @@ public final class MagicalAttackByAbnormal extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
@@ -68,8 +68,8 @@ public final class MagicalAttackByAbnormal extends AbstractEffect
|
||||
target.stopFakeDeath(true);
|
||||
}
|
||||
|
||||
boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
final boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
final boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
final boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, info.getSkill()));
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
int damage = (int) Formulas.calcMagicDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
@@ -80,7 +80,7 @@ public final class MagicalAttackByAbnormal extends AbstractEffect
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
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;
|
||||
|
@@ -55,7 +55,7 @@ public final class MagicalAttackMp extends AbstractEffect
|
||||
}
|
||||
if (info.getEffected().isPlayer())
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_RESISTED_C2_S_MAGIC);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_RESISTED_C2_S_MAGIC);
|
||||
sm.addCharName(info.getEffected());
|
||||
sm.addCharName(info.getEffector());
|
||||
info.getEffected().sendPacket(sm);
|
||||
@@ -80,20 +80,20 @@ public final class MagicalAttackMp extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
final boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
final boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
final boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, info.getSkill()));
|
||||
double damage = Formulas.calcManaDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
double mp = (damage > target.getCurrentMp() ? target.getCurrentMp() : damage);
|
||||
final double damage = Formulas.calcManaDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
final double mp = (damage > target.getCurrentMp() ? target.getCurrentMp() : damage);
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
@@ -103,7 +103,7 @@ public final class MagicalAttackMp extends AbstractEffect
|
||||
|
||||
if (target.isPlayer())
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_S_MP_HAS_BEEN_DRAINED_BY_C1);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_S_MP_HAS_BEEN_DRAINED_BY_C1);
|
||||
sm.addCharName(activeChar);
|
||||
sm.addInt((int) mp);
|
||||
target.sendPacket(sm);
|
||||
@@ -111,7 +111,7 @@ public final class MagicalAttackMp extends AbstractEffect
|
||||
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
SystemMessage sm2 = SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_S_MP_WAS_REDUCED_BY_S1);
|
||||
final SystemMessage sm2 = SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_S_MP_WAS_REDUCED_BY_S1);
|
||||
sm2.addInt((int) mp);
|
||||
activeChar.sendPacket(sm2);
|
||||
}
|
||||
|
@@ -55,8 +55,8 @@ public final class MagicalSoulAttack extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
@@ -68,8 +68,8 @@ public final class MagicalSoulAttack extends AbstractEffect
|
||||
target.stopFakeDeath(true);
|
||||
}
|
||||
|
||||
boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
final boolean sps = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
|
||||
final boolean bss = info.getSkill().useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
|
||||
final boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, info.getSkill()));
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
int damage = (int) Formulas.calcMagicDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
@@ -77,14 +77,14 @@ public final class MagicalSoulAttack extends AbstractEffect
|
||||
if ((info.getSkill().getMaxSoulConsumeCount() > 0) && activeChar.isPlayer())
|
||||
{
|
||||
// Souls Formula (each soul increase +4%)
|
||||
int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount();
|
||||
final int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount();
|
||||
damage *= 1 + (chargedSouls * 0.04);
|
||||
}
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
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;
|
||||
|
@@ -51,7 +51,7 @@ public final class ManaHeal extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
final L2Character target = info.getEffected();
|
||||
if ((target == null) || target.isDead() || target.isDoor() || target.isInvul())
|
||||
{
|
||||
return;
|
||||
|
@@ -58,7 +58,7 @@ public final class ManaHealByLevel extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
final L2Character target = info.getEffected();
|
||||
if ((target == null) || target.isDead() || target.isDoor() || target.isInvul())
|
||||
{
|
||||
return;
|
||||
@@ -71,7 +71,7 @@ public final class ManaHealByLevel extends AbstractEffect
|
||||
amount = target.calcStat(Stats.MANA_CHARGE, amount, null, null);
|
||||
if (target.getLevel() > info.getSkill().getMagicLevel())
|
||||
{
|
||||
int lvlDiff = target.getLevel() - info.getSkill().getMagicLevel();
|
||||
final int lvlDiff = target.getLevel() - info.getSkill().getMagicLevel();
|
||||
// if target is too high compared to skill level, the amount of recharged mp gradually decreases.
|
||||
if (lvlDiff == 6)
|
||||
{
|
||||
|
@@ -46,7 +46,7 @@ public final class ManaHealOverTime extends AbstractEffect
|
||||
}
|
||||
|
||||
double mp = info.getEffected().getCurrentMp();
|
||||
double maxmp = info.getEffected().getMaxRecoverableMp();
|
||||
final double maxmp = info.getEffected().getMaxRecoverableMp();
|
||||
|
||||
// Not needed to set the MP and send update packet if player is already at max MP
|
||||
if (mp >= maxmp)
|
||||
|
@@ -57,15 +57,15 @@ public final class ManaHealPercent extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
final L2Character target = info.getEffected();
|
||||
if ((target == null) || target.isDead() || target.isDoor())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double amount = 0;
|
||||
double power = _power;
|
||||
boolean full = (power == 100.0);
|
||||
final double power = _power;
|
||||
final boolean full = (power == 100.0);
|
||||
|
||||
amount = full ? target.getMaxMp() : (target.getMaxMp() * power) / 100.0;
|
||||
// Prevents overheal and negative amount
|
||||
|
@@ -101,7 +101,7 @@ public final class MaxCp extends AbstractEffect
|
||||
}
|
||||
if (_heal)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CP_HAS_BEEN_RESTORED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CP_HAS_BEEN_RESTORED);
|
||||
sm.addInt((int) amount);
|
||||
effected.sendPacket(sm);
|
||||
}
|
||||
|
@@ -102,7 +102,7 @@ public final class MaxHp extends AbstractEffect
|
||||
}
|
||||
if (_heal)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HP_HAS_BEEN_RESTORED);
|
||||
sm.addInt((int) amount);
|
||||
effected.sendPacket(sm);
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ public final class OpenCommonRecipeBook extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
L2PcInstance player = info.getEffector().getActingPlayer();
|
||||
final L2PcInstance player = info.getEffector().getActingPlayer();
|
||||
if (player.getPrivateStoreType() != PrivateStoreType.NONE)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.ITEM_CREATION_IS_NOT_POSSIBLE_WHILE_ENGAGED_IN_A_TRADE);
|
||||
|
@@ -52,7 +52,7 @@ public final class OpenDwarfRecipeBook extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
L2PcInstance player = info.getEffector().getActingPlayer();
|
||||
final L2PcInstance player = info.getEffector().getActingPlayer();
|
||||
if (player.getPrivateStoreType() != PrivateStoreType.NONE)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.ITEM_CREATION_IS_NOT_POSSIBLE_WHILE_ENGAGED_IN_A_TRADE);
|
||||
|
@@ -51,7 +51,7 @@ public final class Passive extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Attackable target = (L2Attackable) info.getEffected();
|
||||
final L2Attackable target = (L2Attackable) info.getEffected();
|
||||
target.abortAttack();
|
||||
target.abortCast();
|
||||
target.disableAllSkills();
|
||||
|
@@ -78,9 +78,9 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
Skill skill = info.getSkill();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
final Skill skill = info.getSkill();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
@@ -101,7 +101,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
// Physical damage critical rate is only affected by STR.
|
||||
boolean crit = false;
|
||||
@@ -122,7 +122,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
StringTokenizer st = new StringTokenizer(_type1, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
String item = st.nextToken().trim();
|
||||
final String item = st.nextToken().trim();
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(item))
|
||||
{
|
||||
damage *= _valueReduce;
|
||||
@@ -132,7 +132,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
st = new StringTokenizer(_type2, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
String item = st.nextToken().trim();
|
||||
final String item = st.nextToken().trim();
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(item))
|
||||
{
|
||||
damage *= _valueIncrease;
|
||||
@@ -144,7 +144,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
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,9 +63,9 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
Skill skill = info.getSkill();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
final Skill skill = info.getSkill();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
@@ -74,7 +74,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
|
||||
if (activeChar.isMovementDisabled())
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS);
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS);
|
||||
sm.addSkillName(skill);
|
||||
activeChar.sendPacket(sm);
|
||||
return;
|
||||
@@ -89,13 +89,13 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, ss);
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
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,9 +63,9 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
Skill skill = info.getSkill();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
final Skill skill = info.getSkill();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
@@ -86,7 +86,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
// Physical damage critical rate is only affected by STR.
|
||||
boolean crit = false;
|
||||
@@ -100,7 +100,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
if ((skill.getMaxSoulConsumeCount() > 0) && activeChar.isPlayer())
|
||||
{
|
||||
// Souls Formula (each soul increase +4%)
|
||||
int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= skill.getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : skill.getMaxSoulConsumeCount();
|
||||
final int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= skill.getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : skill.getMaxSoulConsumeCount();
|
||||
damage *= 1 + (chargedSouls * 0.04);
|
||||
}
|
||||
if (crit)
|
||||
@@ -111,7 +111,7 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
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 RebalanceHP extends AbstractEffect
|
||||
}
|
||||
}
|
||||
|
||||
double percentHP = currentHPs / fullHP;
|
||||
final double percentHP = currentHPs / fullHP;
|
||||
for (L2PcInstance member : party.getMembers())
|
||||
{
|
||||
if (!member.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, member, true))
|
||||
|
@@ -43,8 +43,8 @@ public final class ResistSkill extends AbstractEffect
|
||||
|
||||
for (int i = 1;; i++)
|
||||
{
|
||||
int skillId = params.getInt("skillId" + i, 0);
|
||||
int skillLvl = params.getInt("skillLvl" + i, 0);
|
||||
final int skillId = params.getInt("skillId" + i, 0);
|
||||
final int skillLvl = params.getInt("skillLvl" + i, 0);
|
||||
if (skillId == 0)
|
||||
{
|
||||
break;
|
||||
|
@@ -57,8 +57,8 @@ public final class Resurrection extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
|
@@ -62,9 +62,9 @@ public final class ResurrectionSpecial extends AbstractEffect
|
||||
{
|
||||
return;
|
||||
}
|
||||
L2PcInstance caster = info.getEffector().getActingPlayer();
|
||||
final L2PcInstance caster = info.getEffector().getActingPlayer();
|
||||
|
||||
Skill skill = info.getSkill();
|
||||
final Skill skill = info.getSkill();
|
||||
|
||||
if (info.getEffected().isPlayer())
|
||||
{
|
||||
@@ -73,7 +73,7 @@ public final class ResurrectionSpecial extends AbstractEffect
|
||||
}
|
||||
if (info.getEffected().isPet())
|
||||
{
|
||||
L2PetInstance pet = (L2PetInstance) info.getEffected();
|
||||
final L2PetInstance pet = (L2PetInstance) info.getEffected();
|
||||
info.getEffected().getActingPlayer().reviveRequest(pet.getActingPlayer(), skill, true, _power);
|
||||
}
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ public final class ShilensBreath extends AbstractEffect
|
||||
if (info.getEffected().isPlayer() && !info.getEffected().isDead())
|
||||
{
|
||||
final L2PcInstance player = (L2PcInstance) info.getEffected();
|
||||
int nextLv = info.getSkill().getLevel() - 1;
|
||||
final int nextLv = info.getSkill().getLevel() - 1;
|
||||
|
||||
if (nextLv > 0)
|
||||
{
|
||||
|
@@ -63,21 +63,21 @@ public final class SoulBlow extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
boolean ss = info.getSkill().useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
final boolean ss = info.getSkill().useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
double damage = Formulas.calcBlowDamage(activeChar, target, info.getSkill(), shld, ss);
|
||||
if ((info.getSkill().getMaxSoulConsumeCount() > 0) && activeChar.isPlayer())
|
||||
{
|
||||
// Souls Formula (each soul increase +4%)
|
||||
int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount();
|
||||
final int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount();
|
||||
damage *= 1 + (chargedSouls * 0.04);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public final class SoulBlow extends AbstractEffect
|
||||
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
final L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
activePlayer.sendDamageMessage(target, (int) damage, false, true, false);
|
||||
}
|
||||
// Check if damage should be reflected
|
||||
|
@@ -54,7 +54,7 @@ public final class StaticDamage extends AbstractEffect
|
||||
}
|
||||
|
||||
// reduce damage if target has maxdamage buff
|
||||
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;
|
||||
|
@@ -48,18 +48,18 @@ public final class SummonDebuff extends AbstractEffect
|
||||
@Override
|
||||
public boolean onActionTime(BuffInfo info)
|
||||
{
|
||||
L2PcInstance player = info.getEffected().getActingPlayer();
|
||||
final L2PcInstance player = info.getEffected().getActingPlayer();
|
||||
if (player.hasSummon())
|
||||
{
|
||||
if (player.getEffectList().isAffectedBySkill(PRICE_OF_SUMMONING_LION))
|
||||
{
|
||||
Skill skill = SkillData.getInstance().getSkill(PRICE_OF_SUMMONING_LION, 1);
|
||||
final Skill skill = SkillData.getInstance().getSkill(PRICE_OF_SUMMONING_LION, 1);
|
||||
skill.applyEffects(player, player);
|
||||
return true;
|
||||
}
|
||||
else if (player.getEffectList().isAffectedBySkill(PRICE_OF_SUMMONING_LUMI))
|
||||
{
|
||||
Skill skill = SkillData.getInstance().getSkill(PRICE_OF_SUMMONING_LUMI, 1);
|
||||
final Skill skill = SkillData.getInstance().getSkill(PRICE_OF_SUMMONING_LUMI, 1);
|
||||
skill.applyEffects(player, player);
|
||||
return true;
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ public final class TargetMe extends AbstractEffect
|
||||
{
|
||||
if (info.getEffected().getTarget() != info.getEffector())
|
||||
{
|
||||
L2PcInstance effector = info.getEffector().getActingPlayer();
|
||||
final L2PcInstance effector = info.getEffector().getActingPlayer();
|
||||
// If effector is null, then its not a player, but NPC. If its not null, then it should check if the skill is pvp skill.
|
||||
if ((effector == null) || effector.checkPvpSkill(info.getEffected(), info.getSkill()))
|
||||
{
|
||||
|
@@ -59,7 +59,7 @@ public final class TargetMeProbability extends AbstractEffect
|
||||
{
|
||||
if (info.getEffected().getTarget() != info.getEffector())
|
||||
{
|
||||
L2PcInstance effector = info.getEffector().getActingPlayer();
|
||||
final L2PcInstance effector = info.getEffector().getActingPlayer();
|
||||
// If effector is null, then its not a player, but NPC. If its not null, then it should check if the skill is pvp skill.
|
||||
if ((effector == null) || effector.checkPvpSkill(info.getEffected(), info.getSkill()))
|
||||
{
|
||||
|
@@ -58,15 +58,15 @@ public final class TeleportToTarget extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
L2Character activeChar = info.getEffector();
|
||||
L2Character target = info.getEffected();
|
||||
final L2Character activeChar = info.getEffector();
|
||||
final L2Character target = info.getEffected();
|
||||
if (target == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int px = target.getX();
|
||||
int py = target.getY();
|
||||
final int px = target.getX();
|
||||
final int py = target.getY();
|
||||
double ph = Util.convertHeadingToDegree(target.getHeading());
|
||||
|
||||
ph += 180;
|
||||
@@ -76,9 +76,9 @@ public final class TeleportToTarget extends AbstractEffect
|
||||
}
|
||||
|
||||
ph = (Math.PI * ph) / 180;
|
||||
int x = (int) (px + (25 * Math.cos(ph)));
|
||||
int y = (int) (py + (25 * Math.sin(ph)));
|
||||
int z = target.getZ();
|
||||
final int x = (int) (px + (25 * Math.cos(ph)));
|
||||
final int y = (int) (py + (25 * Math.sin(ph)));
|
||||
final int z = target.getZ();
|
||||
|
||||
final Location loc = GeoData.getInstance().moveCheck(activeChar.getX(), activeChar.getY(), activeChar.getZ(), x, y, z, activeChar.getInstanceId());
|
||||
|
||||
|
@@ -61,9 +61,9 @@ public final class ThrowHorizontal extends AbstractEffect
|
||||
final int curY = info.getEffected().getY();
|
||||
|
||||
// Calculate distance between effector and effected current position
|
||||
double dx = info.getEffector().getX() - curX;
|
||||
double dy = info.getEffector().getY() - curY;
|
||||
double distance = Math.sqrt((dx * dx) + (dy * dy));
|
||||
final double dx = info.getEffector().getX() - curX;
|
||||
final double dy = info.getEffector().getY() - curY;
|
||||
final double distance = Math.sqrt((dx * dx) + (dy * dy));
|
||||
if (distance > 2000)
|
||||
{
|
||||
_log.info("EffectThrow was going to use invalid coordinates for characters, getEffected: " + curX + "," + curY + " and getEffector: " + info.getEffector().getX() + "," + info.getEffector().getY());
|
||||
@@ -76,14 +76,14 @@ public final class ThrowHorizontal extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
int x = info.getEffector().getX();
|
||||
int y = info.getEffector().getY();
|
||||
int z = info.getEffected().getZ();
|
||||
final int x = info.getEffector().getX();
|
||||
final int y = info.getEffector().getY();
|
||||
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()))
|
||||
{
|
||||
L2PcInstance effector = (L2PcInstance) info.getEffector();
|
||||
final L2PcInstance effector = (L2PcInstance) info.getEffector();
|
||||
effector.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||
return;
|
||||
}
|
||||
|
@@ -60,10 +60,10 @@ public final class ThrowUp extends AbstractEffect
|
||||
final int curZ = info.getEffected().getZ();
|
||||
|
||||
// Calculate distance between effector and effected current position
|
||||
double dx = info.getEffector().getX() - curX;
|
||||
double dy = info.getEffector().getY() - curY;
|
||||
double dz = info.getEffector().getZ() - curZ;
|
||||
double distance = Math.sqrt((dx * dx) + (dy * dy));
|
||||
final double dx = info.getEffector().getX() - curX;
|
||||
final double dy = info.getEffector().getY() - curY;
|
||||
final double dz = info.getEffector().getZ() - curZ;
|
||||
final double distance = Math.sqrt((dx * dx) + (dy * dy));
|
||||
if (distance > 2000)
|
||||
{
|
||||
_log.info("EffectThrow was going to use invalid coordinates for characters, getEffected: " + curX + "," + curY + " and getEffector: " + info.getEffector().getX() + "," + info.getEffector().getY());
|
||||
@@ -93,9 +93,9 @@ public final class ThrowUp extends AbstractEffect
|
||||
cos = dx / distance;
|
||||
|
||||
// Calculate the new destination with offset included
|
||||
int x = info.getEffector().getX() - (int) (offset * cos);
|
||||
int y = info.getEffector().getY() - (int) (offset * sin);
|
||||
int z = info.getEffected().getZ();
|
||||
final int x = info.getEffector().getX() - (int) (offset * cos);
|
||||
final int y = info.getEffector().getY() - (int) (offset * sin);
|
||||
final int z = info.getEffected().getZ();
|
||||
|
||||
final Location destination = GeoData.getInstance().moveCheck(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), x, y, z, info.getEffected().getInstanceId());
|
||||
|
||||
|
@@ -258,7 +258,7 @@ public final class TriggerForce extends AbstractEffect
|
||||
}
|
||||
if ((activeForces >= 4) && (member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) != null) && (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) != null))
|
||||
{
|
||||
BuffInfo skill = member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY);
|
||||
final BuffInfo skill = member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY);
|
||||
if (!member.getEffectList().isAffectedBySkill(PARTY_SOLIDARITY) || (skill.getSkill().getLevel() != Math.min((activeForces - 3), 3)))
|
||||
{
|
||||
member.makeTriggerCast(SkillData.getInstance().getSkill(PARTY_SOLIDARITY, Math.min((activeForces - 3), 3)), member);
|
||||
|
@@ -46,10 +46,10 @@ public final class Unsummon extends AbstractEffect
|
||||
@Override
|
||||
public boolean calcSuccess(BuffInfo info)
|
||||
{
|
||||
int magicLevel = info.getSkill().getMagicLevel();
|
||||
final int magicLevel = info.getSkill().getMagicLevel();
|
||||
if ((magicLevel <= 0) || ((info.getEffected().getLevel() - 9) <= magicLevel))
|
||||
{
|
||||
double chance = _chance * Formulas.calcAttributeBonus(info.getEffector(), info.getEffected(), info.getSkill()) * Formulas.calcGeneralTraitBonus(info.getEffector(), info.getEffected(), info.getSkill().getTraitType(), false);
|
||||
final double chance = _chance * Formulas.calcAttributeBonus(info.getEffector(), info.getEffected(), info.getSkill()) * Formulas.calcGeneralTraitBonus(info.getEffector(), info.getEffected(), info.getSkill().getTraitType(), false);
|
||||
if (chance > (Rnd.nextDouble() * 100))
|
||||
{
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user