Code improvements.
This commit is contained in:
@@ -19,7 +19,6 @@ package handlers.effecthandlers;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
@@ -89,8 +88,7 @@ public final class Backstab extends AbstractEffect
|
||||
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
final L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
activePlayer.sendDamageMessage(target, (int) damage, false, true, false);
|
||||
activeChar.getActingPlayer().sendDamageMessage(target, (int) damage, false, true, false);
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
|
@@ -41,8 +41,7 @@ public final class BlockAction extends AbstractEffect
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
|
||||
final String[] actions = params.getString("blockedActions").split(",");
|
||||
for (String action : actions)
|
||||
for (String action : params.getString("blockedActions").split(","))
|
||||
{
|
||||
_blockedActions.add(Integer.parseInt(action));
|
||||
}
|
||||
|
@@ -49,12 +49,9 @@ public final class CallParty extends AbstractEffect
|
||||
|
||||
for (L2PcInstance partyMember : info.getEffector().getParty().getMembers())
|
||||
{
|
||||
if (CallPc.checkSummonTargetStatus(partyMember, info.getEffector().getActingPlayer()))
|
||||
if (CallPc.checkSummonTargetStatus(partyMember, info.getEffector().getActingPlayer()) && (info.getEffector() != partyMember))
|
||||
{
|
||||
if (info.getEffector() != partyMember)
|
||||
{
|
||||
partyMember.teleToLocation(info.getEffector().getLocation(), true);
|
||||
}
|
||||
partyMember.teleToLocation(info.getEffector().getLocation(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,6 @@ import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.entity.Instance;
|
||||
import com.l2jmobius.gameserver.model.entity.TvTEvent;
|
||||
import com.l2jmobius.gameserver.model.holders.SummonRequestHolder;
|
||||
import com.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
@@ -151,14 +150,10 @@ public final class CallPc extends AbstractEffect
|
||||
return false;
|
||||
}
|
||||
|
||||
if (activeChar.getInstanceId() > 0)
|
||||
if ((activeChar.getInstanceId() > 0) && (!Config.ALLOW_SUMMON_IN_INSTANCE || !InstanceManager.getInstance().getInstance(activeChar.getInstanceId()).isSummonAllowed()))
|
||||
{
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
activeChar.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_FROM_YOUR_CURRENT_LOCATION);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@@ -54,19 +54,11 @@ public final class ChameleonRest extends AbstractEffect
|
||||
@Override
|
||||
public boolean onActionTime(BuffInfo info)
|
||||
{
|
||||
if (info.getEffected().isDead())
|
||||
if (info.getEffected().isDead() || (info.getEffected().isPlayer() && !info.getEffected().getActingPlayer().isSitting()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (info.getEffected().isPlayer())
|
||||
{
|
||||
if (!info.getEffected().getActingPlayer().isSitting())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
final double manaDam = _power * getTicksMultiplier();
|
||||
if (manaDam > info.getEffected().getCurrentMp())
|
||||
{
|
||||
|
@@ -111,13 +111,12 @@ public final class ConvertItem extends AbstractEffect
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_EQUIPMENT_S1_S2_HAS_BEEN_REMOVED);
|
||||
sm.addInt(item.getEnchantLevel());
|
||||
sm.addItemName(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_BEEN_UNEQUIPPED);
|
||||
sm.addItemName(item);
|
||||
}
|
||||
sm.addItemName(item);
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
|
||||
@@ -150,13 +149,12 @@ public final class ConvertItem extends AbstractEffect
|
||||
{
|
||||
msg = SystemMessage.getSystemMessage(SystemMessageId.EQUIPPED_S1_S2);
|
||||
msg.addInt(newItem.getEnchantLevel());
|
||||
msg.addItemName(newItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EQUIPPED_YOUR_S1);
|
||||
msg.addItemName(newItem);
|
||||
}
|
||||
msg.addItemName(newItem);
|
||||
player.sendPacket(msg);
|
||||
|
||||
final InventoryUpdate u = new InventoryUpdate();
|
||||
|
@@ -61,10 +61,8 @@ public final class CpHeal extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
double amount = _power;
|
||||
|
||||
// Prevents overheal and negative amount
|
||||
amount = Math.max(Math.min(amount, target.getMaxRecoverableCp() - target.getCurrentCp()), 0);
|
||||
final double amount = Math.max(Math.min(_power, target.getMaxRecoverableCp() - target.getCurrentCp()), 0);
|
||||
if (amount != 0)
|
||||
{
|
||||
target.setCurrentCp(amount + target.getCurrentCp());
|
||||
|
@@ -81,7 +81,7 @@ public final class DamOverTime extends AbstractEffect
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_FORCE_HAS_REACHED_MAXIMUM_CAPACITY);
|
||||
return false;
|
||||
}
|
||||
else if (_charge != 0)
|
||||
if (_charge != 0)
|
||||
{
|
||||
info.getEffected().getActingPlayer().increaseCharges(1, _charge);
|
||||
}
|
||||
|
@@ -47,26 +47,13 @@ public final class Detection extends AbstractEffect
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final L2PcInstance player = info.getEffector().getActingPlayer();
|
||||
final L2PcInstance target = info.getEffected().getActingPlayer();
|
||||
|
||||
if (target.isInvisible())
|
||||
if (!target.isInvisible() || player.isInPartyWith(target) || player.isInClanWith(target) || player.isInAllyWith(target))
|
||||
{
|
||||
if (player.isInPartyWith(target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (player.isInClanWith(target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (player.isInAllyWith(target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Remove Hide.
|
||||
target.getEffectList().stopSkillEffects(true, AbnormalType.HIDE);
|
||||
return;
|
||||
}
|
||||
// Remove Hide.
|
||||
target.getEffectList().stopSkillEffects(true, AbnormalType.HIDE);
|
||||
}
|
||||
}
|
||||
|
@@ -16,8 +16,6 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
@@ -64,8 +62,7 @@ public final class DispelByCategory extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
final List<BuffInfo> canceled = Formulas.calcCancelStealEffects(info.getEffector(), info.getEffected(), info.getSkill(), _slot, _rate, _max);
|
||||
for (BuffInfo can : canceled)
|
||||
for (BuffInfo can : Formulas.calcCancelStealEffects(info.getEffector(), info.getEffected(), info.getSkill(), _slot, _rate, _max))
|
||||
{
|
||||
info.getEffected().getEffectList().stopSkillEffects(true, can.getSkill());
|
||||
}
|
||||
|
@@ -87,13 +87,10 @@ public final class DispelBySlot extends AbstractEffect
|
||||
for (Entry<AbnormalType, Short> entry : _dispelAbnormals.entrySet())
|
||||
{
|
||||
// Dispel transformations (buff and by GM)
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM))
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM) && (effected.isTransformed() || (effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0))))
|
||||
{
|
||||
if (effected.isTransformed() || (effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0)))
|
||||
{
|
||||
info.getEffected().stopTransformation(true);
|
||||
continue;
|
||||
}
|
||||
info.getEffected().stopTransformation(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
final BuffInfo toDispel = effectList.getBuffInfoByAbnormalType(entry.getKey());
|
||||
|
@@ -92,12 +92,9 @@ public final class DispelBySlotProbability extends AbstractEffect
|
||||
if ((Rnd.get(100) < _rate))
|
||||
{
|
||||
// Dispel transformations (buff and by GM)
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM))
|
||||
if ((entry.getKey() == AbnormalType.TRANSFORM) && (effected.isTransformed() || (effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0))))
|
||||
{
|
||||
if (effected.isTransformed() || (effected.isPlayer() || (entry.getValue() == effected.getActingPlayer().getTransformationId()) || (entry.getValue() < 0)))
|
||||
{
|
||||
info.getEffected().stopTransformation(true);
|
||||
}
|
||||
info.getEffected().stopTransformation(true);
|
||||
}
|
||||
|
||||
final BuffInfo toDispel = effectList.getBuffInfoByAbnormalType(entry.getKey());
|
||||
|
@@ -87,8 +87,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
|
||||
if (!_ignoreShieldDefence)
|
||||
{
|
||||
final byte shield = Formulas.calcShldUse(attacker, target, skill, true);
|
||||
switch (shield)
|
||||
switch (Formulas.calcShldUse(attacker, target, skill, true))
|
||||
{
|
||||
case Formulas.SHIELD_DEFENSE_FAILED:
|
||||
{
|
||||
|
@@ -55,13 +55,10 @@ public final class FakeDeath extends AbstractEffect
|
||||
}
|
||||
|
||||
final double manaDam = _power * getTicksMultiplier();
|
||||
if (manaDam > info.getEffected().getCurrentMp())
|
||||
if ((manaDam > info.getEffected().getCurrentMp()) && info.getSkill().isToggle())
|
||||
{
|
||||
if (info.getSkill().isToggle())
|
||||
{
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
|
||||
return false;
|
||||
}
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
|
||||
return false;
|
||||
}
|
||||
|
||||
info.getEffected().reduceCurrentMp(manaDam);
|
||||
|
@@ -21,7 +21,6 @@ import java.util.StringTokenizer;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
@@ -87,8 +86,7 @@ public final class FatalBlow extends AbstractEffect
|
||||
final StringTokenizer st = new StringTokenizer(_targetAbnormalType, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
final String abnormal = st.nextToken().trim();
|
||||
if (target.getEffectList().getBuffInfoByAbnormalType(AbnormalType.valueOf(abnormal)) != null)
|
||||
if (target.getEffectList().getBuffInfoByAbnormalType(AbnormalType.valueOf(st.nextToken().trim())) != null)
|
||||
{
|
||||
damage *= _skillAddPower;
|
||||
break;
|
||||
@@ -121,8 +119,7 @@ public final class FatalBlow extends AbstractEffect
|
||||
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
final L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
activePlayer.sendDamageMessage(target, (int) damage, false, true, false);
|
||||
activeChar.getActingPlayer().sendDamageMessage(target, (int) damage, false, true, false);
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
|
@@ -50,8 +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)
|
||||
{
|
||||
final int count = maxCharge - info.getEffected().getActingPlayer().getCharges();
|
||||
info.getEffected().getActingPlayer().increaseCharges(count, maxCharge);
|
||||
info.getEffected().getActingPlayer().increaseCharges((maxCharge - info.getEffected().getActingPlayer().getCharges()), maxCharge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -57,11 +57,9 @@ public final class FocusSouls extends AbstractEffect
|
||||
final int maxSouls = (int) target.calcStat(Stats.MAX_SOULS, 0, null, null);
|
||||
if (maxSouls > 0)
|
||||
{
|
||||
final int amount = _charge;
|
||||
if ((target.getChargedSouls() < maxSouls))
|
||||
{
|
||||
final int count = ((target.getChargedSouls() + amount) <= maxSouls) ? amount : (maxSouls - target.getChargedSouls());
|
||||
target.increaseSouls(count);
|
||||
target.increaseSouls(((target.getChargedSouls() + _charge) <= maxSouls) ? _charge : (maxSouls - target.getChargedSouls()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -55,32 +55,28 @@ public final class GiveRecommendation extends AbstractEffect
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
final L2PcInstance target = info.getEffected() instanceof L2PcInstance ? (L2PcInstance) info.getEffected() : null;
|
||||
if (target != null)
|
||||
if (target == null)
|
||||
{
|
||||
int recommendationsGiven = _amount;
|
||||
return;
|
||||
}
|
||||
|
||||
final int recommendationsGiven = (target.getRecomHave() + _amount) >= 255 ? 255 - target.getRecomHave() : _amount;
|
||||
if (recommendationsGiven > 0)
|
||||
{
|
||||
target.setRecomHave(target.getRecomHave() + recommendationsGiven);
|
||||
|
||||
if ((target.getRecomHave() + _amount) >= 255)
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_OBTAINED_S1_RECOMMENDATION_S);
|
||||
sm.addInt(recommendationsGiven);
|
||||
target.sendPacket(sm);
|
||||
target.sendPacket(new UserInfo(target));
|
||||
target.sendPacket(new ExVoteSystemInfo(target));
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2PcInstance player = info.getEffector() instanceof L2PcInstance ? (L2PcInstance) info.getEffector() : null;
|
||||
if (player != null)
|
||||
{
|
||||
recommendationsGiven = 255 - target.getRecomHave();
|
||||
}
|
||||
|
||||
if (recommendationsGiven > 0)
|
||||
{
|
||||
target.setRecomHave(target.getRecomHave() + recommendationsGiven);
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_OBTAINED_S1_RECOMMENDATION_S);
|
||||
sm.addInt(recommendationsGiven);
|
||||
target.sendPacket(sm);
|
||||
target.sendPacket(new UserInfo(target));
|
||||
target.sendPacket(new ExVoteSystemInfo(target));
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2PcInstance player = info.getEffector() instanceof L2PcInstance ? (L2PcInstance) info.getEffector() : null;
|
||||
if (player != null)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
||||
}
|
||||
player.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -90,15 +90,14 @@ public final class Harvesting extends AbstractEffect
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HARVESTED_S2);
|
||||
sm.addString(player.getName());
|
||||
sm.addItemName(item.getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HARVESTED_S3_S2_S);
|
||||
sm.addString(player.getName());
|
||||
sm.addLong(item.getCount());
|
||||
sm.addItemName(item.getId());
|
||||
}
|
||||
sm.addItemName(item.getId());
|
||||
player.getParty().broadcastToPartyMembers(player, sm);
|
||||
}
|
||||
}
|
||||
@@ -127,12 +126,7 @@ public final class Harvesting extends AbstractEffect
|
||||
|
||||
// apply penalty, target <=> player levels
|
||||
// 5% penalty for each level
|
||||
int basicSuccess = 100;
|
||||
if (diff > 5)
|
||||
{
|
||||
basicSuccess -= (diff - 5) * 5;
|
||||
}
|
||||
|
||||
int basicSuccess = diff > 5 ? 100 - ((diff - 5) * 5) : 100;
|
||||
// success rate can't be less than 1%
|
||||
if (basicSuccess < 1)
|
||||
{
|
||||
|
@@ -73,34 +73,36 @@ public final class MagicalAttack extends AbstractEffect
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
int damage = (int) Formulas.calcMagicDam(activeChar, target, info.getSkill(), shld, sps, bss, mcrit);
|
||||
|
||||
if (damage > 0)
|
||||
if (damage <= 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
}
|
||||
|
||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||
if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
|
||||
{
|
||||
target.breakAttack();
|
||||
target.breakCast();
|
||||
}
|
||||
|
||||
// Shield Deflect Magic: Reflect all damage on caster.
|
||||
if (target.getStat().calcStat(Stats.VENGEANCE_SKILL_MAGIC_DAMAGE, 0, target, info.getSkill()) > Rnd.get(100))
|
||||
{
|
||||
activeChar.reduceCurrentHp(damage, target, info.getSkill());
|
||||
activeChar.notifyDamageReceived(damage, target, info.getSkill(), mcrit, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), mcrit, false);
|
||||
activeChar.sendDamageMessage(target, damage, mcrit, false, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// reduce damage if target has maxdamage buff
|
||||
final double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
}
|
||||
|
||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||
if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
|
||||
{
|
||||
target.breakAttack();
|
||||
target.breakCast();
|
||||
}
|
||||
|
||||
// Shield Deflect Magic: Reflect all damage on caster.
|
||||
if (target.getStat().calcStat(Stats.VENGEANCE_SKILL_MAGIC_DAMAGE, 0, target, info.getSkill()) > Rnd.get(100))
|
||||
{
|
||||
activeChar.reduceCurrentHp(damage, target, info.getSkill());
|
||||
activeChar.notifyDamageReceived(damage, target, info.getSkill(), mcrit, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), mcrit, false);
|
||||
activeChar.sendDamageMessage(target, damage, mcrit, false, false);
|
||||
}
|
||||
}
|
||||
}
|
@@ -74,9 +74,7 @@ public final class MagicalSoulAttack extends AbstractEffect
|
||||
|
||||
if ((info.getSkill().getMaxSoulConsumeCount() > 0) && activeChar.isPlayer())
|
||||
{
|
||||
// Souls Formula (each soul increase +4%)
|
||||
final int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount();
|
||||
damage *= 1 + (chargedSouls * 0.04);
|
||||
damage *= 1 + (((activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount()) * 0.04);
|
||||
}
|
||||
|
||||
if (damage > 0)
|
||||
|
@@ -114,5 +114,4 @@ public final class MaxCp extends AbstractEffect
|
||||
charStat.getActiveChar().removeStatsOwner(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -114,5 +114,4 @@ public final class MaxHp extends AbstractEffect
|
||||
charStat.getActiveChar().removeStatsOwner(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -102,12 +102,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
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;
|
||||
if (skill.getBaseCritRate() > 0)
|
||||
{
|
||||
crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
}
|
||||
|
||||
final boolean crit = (skill.getBaseCritRate() > 0) && Formulas.calcCrit(activeChar, target, skill);
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, ss);
|
||||
|
||||
if (crit)
|
||||
@@ -120,8 +115,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
StringTokenizer st = new StringTokenizer(_type1, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
final String item = st.nextToken().trim();
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(item))
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(st.nextToken().trim()))
|
||||
{
|
||||
damage *= _valueReduce;
|
||||
break;
|
||||
@@ -130,8 +124,7 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
st = new StringTokenizer(_type2, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
final String item = st.nextToken().trim();
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(item))
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(st.nextToken().trim()))
|
||||
{
|
||||
damage *= _valueIncrease;
|
||||
break;
|
||||
|
@@ -80,12 +80,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
// Physical damage critical rate is only affected by STR.
|
||||
boolean crit = false;
|
||||
if (skill.getBaseCritRate() > 0)
|
||||
{
|
||||
crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
}
|
||||
|
||||
final boolean crit = (skill.getBaseCritRate() > 0) && Formulas.calcCrit(activeChar, target, skill);
|
||||
int damage = 0;
|
||||
final boolean ss = skill.isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, ss);
|
||||
|
@@ -87,19 +87,13 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
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;
|
||||
if (skill.getBaseCritRate() > 0)
|
||||
{
|
||||
crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
}
|
||||
|
||||
final boolean crit = (skill.getBaseCritRate() > 0) && Formulas.calcCrit(activeChar, target, skill);
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, ss);
|
||||
|
||||
if ((skill.getMaxSoulConsumeCount() > 0) && activeChar.isPlayer())
|
||||
{
|
||||
// Souls Formula (each soul increase +4%)
|
||||
final int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= skill.getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : skill.getMaxSoulConsumeCount();
|
||||
damage *= 1 + (chargedSouls * 0.04);
|
||||
damage *= 1 + (((activeChar.getActingPlayer().getChargedSouls() <= skill.getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : skill.getMaxSoulConsumeCount()) * 0.04);
|
||||
}
|
||||
if (crit)
|
||||
{
|
||||
|
@@ -86,12 +86,11 @@ public final class RebalanceHP extends AbstractEffect
|
||||
}
|
||||
}
|
||||
|
||||
final double percentHP = currentHPs / fullHP;
|
||||
for (L2PcInstance member : party.getMembers())
|
||||
{
|
||||
if (!member.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, member, true))
|
||||
{
|
||||
double newHP = member.getMaxHp() * percentHP;
|
||||
double newHP = (member.getMaxHp() * currentHPs) / fullHP;
|
||||
if (newHP > member.getCurrentHp()) // The target gets healed
|
||||
{
|
||||
// The heal will be blocked if the current hp passes the limit
|
||||
@@ -104,14 +103,12 @@ public final class RebalanceHP extends AbstractEffect
|
||||
newHP = member.getMaxRecoverableHp();
|
||||
}
|
||||
}
|
||||
|
||||
member.setCurrentHp(newHP);
|
||||
}
|
||||
|
||||
final L2Summon summon = member.getPet();
|
||||
if ((summon != null) && (!summon.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, summon, true)))
|
||||
{
|
||||
double newHP = summon.getMaxHp() * percentHP;
|
||||
double newHP = (summon.getMaxHp() * currentHPs) / fullHP;
|
||||
if (newHP > summon.getCurrentHp()) // The target gets healed
|
||||
{
|
||||
// The heal will be blocked if the current hp passes the limit
|
||||
@@ -131,7 +128,7 @@ public final class RebalanceHP extends AbstractEffect
|
||||
{
|
||||
if (!servitors.isDead() && Util.checkIfInRange(skill.getAffectRange(), effector, summon, true))
|
||||
{
|
||||
double newHP = servitors.getMaxHp() * percentHP;
|
||||
double newHP = (servitors.getMaxHp() * currentHPs) / fullHP;
|
||||
if (newHP > servitors.getCurrentHp()) // The target gets healed
|
||||
{
|
||||
// The heal will be blocked if the current hp passes the limit
|
||||
|
@@ -59,31 +59,22 @@ public final class Relax extends AbstractEffect
|
||||
return false;
|
||||
}
|
||||
|
||||
if (info.getEffected().isPlayer())
|
||||
if (info.getEffected().isPlayer() && !info.getEffected().getActingPlayer().isSitting())
|
||||
{
|
||||
if (!info.getEffected().getActingPlayer().isSitting())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((info.getEffected().getCurrentHp() + 1) > info.getEffected().getMaxRecoverableHp())
|
||||
if (((info.getEffected().getCurrentHp() + 1) > info.getEffected().getMaxRecoverableHp()) && info.getSkill().isToggle())
|
||||
{
|
||||
if (info.getSkill().isToggle())
|
||||
{
|
||||
info.getEffected().sendPacket(SystemMessageId.THAT_SKILL_HAS_BEEN_DE_ACTIVATED_AS_HP_WAS_FULLY_RECOVERED);
|
||||
return false;
|
||||
}
|
||||
info.getEffected().sendPacket(SystemMessageId.THAT_SKILL_HAS_BEEN_DE_ACTIVATED_AS_HP_WAS_FULLY_RECOVERED);
|
||||
return false;
|
||||
}
|
||||
|
||||
final double manaDam = _power * getTicksMultiplier();
|
||||
if (manaDam > info.getEffected().getCurrentMp())
|
||||
if ((manaDam > info.getEffected().getCurrentMp()) && info.getSkill().isToggle())
|
||||
{
|
||||
if (info.getSkill().isToggle())
|
||||
{
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
|
||||
return false;
|
||||
}
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
|
||||
return false;
|
||||
}
|
||||
|
||||
info.getEffected().reduceCurrentMp(manaDam);
|
||||
|
@@ -71,8 +71,7 @@ public final class ResurrectionSpecial extends AbstractEffect
|
||||
}
|
||||
if (info.getEffected().isPet())
|
||||
{
|
||||
final L2PetInstance pet = (L2PetInstance) info.getEffected();
|
||||
info.getEffected().getActingPlayer().reviveRequest(pet.getActingPlayer(), skill, true, _power);
|
||||
info.getEffected().getActingPlayer().reviveRequest(((L2PetInstance) info.getEffected()).getActingPlayer(), skill, true, _power);
|
||||
}
|
||||
}
|
||||
}
|
@@ -51,12 +51,7 @@ public final class RunAway extends AbstractEffect
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
if (!info.getEffected().isAttackable())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Rnd.get(100) > _power)
|
||||
if (!info.getEffected().isAttackable() || (Rnd.get(100) > _power))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -50,8 +50,7 @@ public class ShiftTarget extends AbstractEffect
|
||||
continue;
|
||||
}
|
||||
|
||||
final L2Attackable hater = (L2Attackable) obj;
|
||||
hater.addDamageHate(info.getEffected(), 0, hater.getHating(info.getEffector()) + 1);
|
||||
((L2Attackable) obj).addDamageHate(info.getEffected(), 0, ((L2Attackable) obj).getHating(info.getEffector()) + 1);
|
||||
}
|
||||
}
|
||||
}
|
@@ -19,7 +19,6 @@ package handlers.effecthandlers;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
@@ -75,8 +74,7 @@ public final class SoulBlow extends AbstractEffect
|
||||
if ((info.getSkill().getMaxSoulConsumeCount() > 0) && activeChar.isPlayer())
|
||||
{
|
||||
// Souls Formula (each soul increase +4%)
|
||||
final int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount();
|
||||
damage *= 1 + (chargedSouls * 0.04);
|
||||
damage *= 1 + (((activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount()) * 0.04);
|
||||
}
|
||||
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
@@ -91,8 +89,7 @@ public final class SoulBlow extends AbstractEffect
|
||||
|
||||
if (activeChar.isPlayer())
|
||||
{
|
||||
final L2PcInstance activePlayer = activeChar.getActingPlayer();
|
||||
activePlayer.sendDamageMessage(target, (int) damage, false, true, false);
|
||||
activeChar.getActingPlayer().sendDamageMessage(target, (int) damage, false, true, false);
|
||||
}
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(activeChar, target, info.getSkill(), true);
|
||||
|
@@ -56,23 +56,24 @@ public final class SoulEating extends AbstractEffect
|
||||
private void onExperienceReceived(L2Playable playable, long exp)
|
||||
{
|
||||
// TODO: Verify logic.
|
||||
if (playable.isPlayer() && (exp >= _expNeeded))
|
||||
if (!playable.isPlayer() || (exp < _expNeeded))
|
||||
{
|
||||
final L2PcInstance player = playable.getActingPlayer();
|
||||
final int maxSouls = (int) player.calcStat(Stats.MAX_SOULS, 0, null, null);
|
||||
if (player.getChargedSouls() >= maxSouls)
|
||||
{
|
||||
playable.sendPacket(SystemMessageId.SOUL_CANNOT_BE_ABSORBED_ANYMORE);
|
||||
return;
|
||||
}
|
||||
|
||||
player.increaseSouls(1);
|
||||
|
||||
if ((player.getTarget() != null) && player.getTarget().isNpc())
|
||||
{
|
||||
final L2Npc npc = (L2Npc) playable.getTarget();
|
||||
player.broadcastPacket(new ExSpawnEmitter(player, npc), 500);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final L2PcInstance player = playable.getActingPlayer();
|
||||
final int maxSouls = (int) player.calcStat(Stats.MAX_SOULS, 0, null, null);
|
||||
if (player.getChargedSouls() >= maxSouls)
|
||||
{
|
||||
playable.sendPacket(SystemMessageId.SOUL_CANNOT_BE_ABSORBED_ANYMORE);
|
||||
return;
|
||||
}
|
||||
|
||||
player.increaseSouls(1);
|
||||
|
||||
if ((player.getTarget() != null) && player.getTarget().isNpc())
|
||||
{
|
||||
player.broadcastPacket(new ExSpawnEmitter(player, (L2Npc) playable.getTarget()), 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -89,12 +89,7 @@ public final class SummonCubic extends AbstractEffect
|
||||
// 8 at 101 (+1 Power)
|
||||
// 12 at 130 (+30 Power)
|
||||
// Because 12 is max 5115-5117 skills
|
||||
int _cubicSkillLevel = info.getSkill().getLevel();
|
||||
if (_cubicSkillLevel > 100)
|
||||
{
|
||||
_cubicSkillLevel = ((info.getSkill().getLevel() - 100) / 7) + 8;
|
||||
}
|
||||
|
||||
final int _cubicSkillLevel = info.getSkill().getLevel() > 100 ? ((info.getSkill().getLevel() - 100) / 7) + 8 : info.getSkill().getLevel();
|
||||
// If cubic is already present, it's replaced.
|
||||
final L2CubicInstance cubic = player.getCubicById(_cubicId);
|
||||
if (cubic != null)
|
||||
|
@@ -55,7 +55,7 @@ public final class SummonDebuff extends AbstractEffect
|
||||
skill.applyEffects(player, player);
|
||||
return true;
|
||||
}
|
||||
else if (player.getEffectList().isAffectedBySkill(PRICE_OF_SUMMONING_LUMI))
|
||||
if (player.getEffectList().isAffectedBySkill(PRICE_OF_SUMMONING_LUMI))
|
||||
{
|
||||
final Skill skill = SkillData.getInstance().getSkill(PRICE_OF_SUMMONING_LUMI, 1);
|
||||
skill.applyEffects(player, player);
|
||||
|
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import com.l2jmobius.gameserver.enums.CastleSide;
|
||||
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.entity.Castle;
|
||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
|
||||
|
||||
/**
|
||||
@@ -56,9 +54,6 @@ public final class TakeCastle extends AbstractEffect
|
||||
}
|
||||
|
||||
final L2PcInstance effector = info.getEffector().getActingPlayer();
|
||||
final Castle castle = CastleManager.getInstance().getCastle(effector);
|
||||
final L2Character effected = info.getEffected();
|
||||
|
||||
castle.engrave(effector.getClan(), effected, _side);
|
||||
CastleManager.getInstance().getCastle(effector).engrave(effector.getClan(), info.getEffected(), _side);
|
||||
}
|
||||
}
|
||||
|
@@ -65,9 +65,8 @@ public final class TeleportToTarget extends AbstractEffect
|
||||
|
||||
final int px = target.getX();
|
||||
final int py = target.getY();
|
||||
double ph = Util.convertHeadingToDegree(target.getHeading());
|
||||
double ph = Util.convertHeadingToDegree(target.getHeading()) + 180;
|
||||
|
||||
ph += 180;
|
||||
if (ph > 360)
|
||||
{
|
||||
ph -= 360;
|
||||
|
@@ -57,12 +57,7 @@ public final class TrapRemove extends AbstractEffect
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
final L2Character target = info.getEffected();
|
||||
if (!target.isTrap())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.isAlikeDead())
|
||||
if (!target.isTrap() || target.isAlikeDead())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -77,13 +77,7 @@ public final class TriggerForce extends AbstractEffect
|
||||
{
|
||||
final L2PcInstance effector = info.getEffector().getActingPlayer();
|
||||
final L2PcInstance effected = info.getEffected().getActingPlayer();
|
||||
|
||||
if (effected.isDead() || (effector == null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_skill.getSkillId() == 0)
|
||||
if (effected.isDead() || (effector == null) || (_skill.getSkillId() == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -240,20 +234,13 @@ public final class TriggerForce extends AbstractEffect
|
||||
activeForces++;
|
||||
}
|
||||
|
||||
if ((activeForces < 4) || ((member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) == null) || (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) == null)))
|
||||
if (((activeForces < 4) || ((member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) == null) || (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) == null))) && (member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY) != null))
|
||||
{
|
||||
if (member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY) != null)
|
||||
{
|
||||
member.getEffectList().remove(true, member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY));
|
||||
}
|
||||
member.getEffectList().remove(true, member.getEffectList().getBuffInfoBySkillId(PARTY_SOLIDARITY));
|
||||
}
|
||||
if ((activeForces >= 4) && (member.getEffectList().getBuffInfoBySkillId(AEORE_FORCE) != null) && (member.getEffectList().getBuffInfoBySkillId(SIGEL_FORCE) != null))
|
||||
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))))
|
||||
{
|
||||
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);
|
||||
}
|
||||
member.makeTriggerCast(SkillData.getInstance().getSkill(PARTY_SOLIDARITY, Math.min((activeForces - 3), 3)), member);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -116,28 +116,21 @@ public final class TriggerSkillByAttack extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
if (_allowWeapons > 0)
|
||||
if ((_allowWeapons > 0) && ((event.getAttacker().getActiveWeaponItem() == null) || ((event.getAttacker().getActiveWeaponItem().getItemType().mask() & _allowWeapons) == 0)))
|
||||
{
|
||||
if ((event.getAttacker().getActiveWeaponItem() == null) || ((event.getAttacker().getActiveWeaponItem().getItemType().mask() & _allowWeapons) == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
final Skill triggerSkill = _skill.getSkill();
|
||||
final L2Object[] targets = targetHandler.getTargetList(triggerSkill, event.getAttacker(), false, event.getTarget());
|
||||
|
||||
for (L2Object triggerTarget : targets)
|
||||
for (L2Object triggerTarget : targetHandler.getTargetList(triggerSkill, event.getAttacker(), false, event.getTarget()))
|
||||
{
|
||||
if ((triggerTarget == null) || !triggerTarget.isCharacter())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final L2Character targetChar = (L2Character) triggerTarget;
|
||||
if (!targetChar.isInvul())
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getAttacker().makeTriggerCast(triggerSkill, targetChar);
|
||||
event.getAttacker().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -77,19 +77,15 @@ public final class TriggerSkillByAvoid extends AbstractEffect
|
||||
}
|
||||
|
||||
final Skill triggerSkill = _skill.getSkill();
|
||||
final L2Object[] targets = targetHandler.getTargetList(triggerSkill, event.getTarget(), false, event.getAttacker());
|
||||
|
||||
for (L2Object triggerTarget : targets)
|
||||
for (L2Object triggerTarget : targetHandler.getTargetList(triggerSkill, event.getTarget(), false, event.getAttacker()))
|
||||
{
|
||||
if ((triggerTarget == null) || !triggerTarget.isCharacter())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final L2Character targetChar = (L2Character) triggerTarget;
|
||||
if (!targetChar.isInvul())
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getTarget().makeTriggerCast(triggerSkill, targetChar);
|
||||
event.getTarget().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -90,18 +90,15 @@ public final class TriggerSkillByDamage extends AbstractEffect
|
||||
}
|
||||
|
||||
final Skill triggerSkill = _skill.getSkill();
|
||||
final L2Object[] targets = targetHandler.getTargetList(triggerSkill, event.getTarget(), false, event.getAttacker());
|
||||
for (L2Object triggerTarget : targets)
|
||||
for (L2Object triggerTarget : targetHandler.getTargetList(triggerSkill, event.getTarget(), false, event.getAttacker()))
|
||||
{
|
||||
if ((triggerTarget == null) || !triggerTarget.isCharacter())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final L2Character targetChar = (L2Character) triggerTarget;
|
||||
if (!targetChar.isInvul())
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getTarget().makeTriggerCast(triggerSkill, targetChar);
|
||||
event.getTarget().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -85,19 +85,15 @@ public final class TriggerSkillBySkill extends AbstractEffect
|
||||
}
|
||||
|
||||
final Skill triggerSkill = _skill.getSkill();
|
||||
final L2Object[] targets = targetHandler.getTargetList(triggerSkill, event.getCaster(), false, event.getTarget());
|
||||
|
||||
for (L2Object triggerTarget : targets)
|
||||
for (L2Object triggerTarget : targetHandler.getTargetList(triggerSkill, event.getCaster(), false, event.getTarget()))
|
||||
{
|
||||
if ((triggerTarget == null) || !triggerTarget.isCharacter())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final L2Character targetChar = (L2Character) triggerTarget;
|
||||
if (!targetChar.isInvul())
|
||||
if (!((L2Character) triggerTarget).isInvul())
|
||||
{
|
||||
event.getCaster().makeTriggerCast(triggerSkill, targetChar);
|
||||
event.getCaster().makeTriggerCast(triggerSkill, ((L2Character) triggerTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -45,13 +45,9 @@ 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))
|
||||
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)))
|
||||
{
|
||||
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;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user