Sync with L2jServer HighFive Sep 8th 2015.
This commit is contained in:
@@ -26,7 +26,7 @@ import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.stats.BaseStats;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.model.stats.Formulas;
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,7 @@ public final class Backstab extends AbstractEffect
|
||||
@Override
|
||||
public boolean calcSuccess(BuffInfo info)
|
||||
{
|
||||
return info.getEffector().isBehindTarget() && !Formulas.calcPhysicalSkillEvasion(info.getEffector(), info.getEffected(), info.getSkill()) && Formulas.calcBlowSuccess(info.getEffector(), info.getEffected(), info.getSkill());
|
||||
return !info.getEffector().isInFrontOf(info.getEffected()) && !Formulas.calcPhysicalSkillEvasion(info.getEffector(), info.getEffected(), info.getSkill()) && Formulas.calcBlowSuccess(info.getEffector(), info.getEffected(), info.getSkill());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -68,18 +68,19 @@ public final class Backstab extends AbstractEffect
|
||||
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
boolean ss = info.getSkill().useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
double damage = Formulas.calcBackstabDamage(activeChar, target, info.getSkill(), shld, ss);
|
||||
Skill skill = info.getSkill();
|
||||
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
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
|
||||
if (Formulas.calcCrit(info.getSkill().getBaseCritRate() * 10 * BaseStats.STR.calcBonus(activeChar), true, target))
|
||||
if (Formulas.calcCrit(activeChar, target, skill))
|
||||
{
|
||||
damage *= 2;
|
||||
}
|
||||
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), true, false);
|
||||
target.reduceCurrentHp(damage, activeChar, skill);
|
||||
target.notifyDamageReceived(damage, activeChar, skill, true, false);
|
||||
|
||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||
if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
|
||||
@@ -95,6 +96,6 @@ public final class Backstab extends AbstractEffect
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(activeChar, target, info.getSkill(), true);
|
||||
Formulas.calcDamageReflected(activeChar, target, skill, true);
|
||||
}
|
||||
}
|
@@ -28,6 +28,7 @@ import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
@@ -80,8 +81,8 @@ public class ClassChange extends AbstractEffect
|
||||
msg.addClassId(activeClass);
|
||||
msg.addClassId(player.getClassId().getId());
|
||||
player.sendPacket(msg);
|
||||
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
}, 1000);
|
||||
}
|
||||
|
@@ -32,6 +32,7 @@ public final class DamOverTime extends AbstractEffect
|
||||
{
|
||||
private final boolean _canKill;
|
||||
private final double _power;
|
||||
private final int _charge;
|
||||
|
||||
public DamOverTime(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
@@ -39,6 +40,7 @@ public final class DamOverTime extends AbstractEffect
|
||||
|
||||
_canKill = params.getBoolean("canKill", false);
|
||||
_power = params.getDouble("power", 0);
|
||||
_charge = params.getInt("charge", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -76,6 +78,16 @@ public final class DamOverTime extends AbstractEffect
|
||||
}
|
||||
}
|
||||
|
||||
if ((_charge != 0) && (info.getEffected().getActingPlayer().getCharges() >= _charge))
|
||||
{
|
||||
info.getEffected().sendPacket(SystemMessageId.YOUR_FORCE_HAS_REACHED_MAXIMUM_CAPACITY);
|
||||
return false;
|
||||
}
|
||||
else if (_charge != 0)
|
||||
{
|
||||
info.getEffected().getActingPlayer().increaseCharges(1, _charge);
|
||||
}
|
||||
|
||||
info.getEffected().reduceCurrentHpByDOT(damage, info.getEffector(), info.getSkill());
|
||||
info.getEffected().notifyDamageReceived(damage, info.getEffector(), info.getSkill(), false, true);
|
||||
return info.getSkill().isToggle();
|
||||
|
@@ -85,7 +85,7 @@ public final class EnergyAttack extends AbstractEffect
|
||||
final Skill skill = info.getSkill();
|
||||
|
||||
double attack = attacker.getPAtk(target);
|
||||
int defence = target.getPDef(attacker);
|
||||
double defence = target.getPDef(attacker);
|
||||
|
||||
if (!_ignoreShieldDefence)
|
||||
{
|
||||
@@ -130,11 +130,27 @@ public final class EnergyAttack extends AbstractEffect
|
||||
weaponTypeBoost = 77;
|
||||
}
|
||||
|
||||
// charge count should be the count before casting the skill but since its reduced before calling effects
|
||||
// we add skill consume charges to current charges
|
||||
double energyChargesBoost = (((attacker.getCharges() + skill.getChargeConsume()) - 1) * 0.2) + 1;
|
||||
double energyChargesBoost = 1;
|
||||
if (attacker.getCharges() == 1)
|
||||
{
|
||||
energyChargesBoost = 1.1;
|
||||
attacker.decreaseCharges(1);
|
||||
}
|
||||
else if (attacker.getCharges() == 2)
|
||||
{
|
||||
energyChargesBoost = 1.2;
|
||||
attacker.decreaseCharges(2);
|
||||
}
|
||||
else if (attacker.getCharges() >= 3)
|
||||
{
|
||||
energyChargesBoost = 1.3;
|
||||
attacker.decreaseCharges(3);
|
||||
}
|
||||
|
||||
double addPower = (attacker.getStat().calcStat(Stats.MOMENTUM_SKILL_POWER, 1, null, null));
|
||||
|
||||
attack += _power;
|
||||
attack *= addPower;
|
||||
attack *= ssBoost;
|
||||
attack *= energyChargesBoost;
|
||||
attack *= weaponTypeBoost;
|
||||
@@ -157,6 +173,13 @@ 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));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
}
|
||||
|
||||
attacker.sendDamageMessage(target, (int) damage, false, critical, false);
|
||||
target.reduceCurrentHp(damage, attacker, skill);
|
||||
target.notifyDamageReceived(damage, attacker, skill, critical, false);
|
||||
|
@@ -18,6 +18,8 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ShotType;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
@@ -25,9 +27,11 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jserver.gameserver.model.skills.AbnormalType;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.stats.BaseStats;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.model.stats.Formulas;
|
||||
import com.l2jserver.gameserver.model.stats.Stats;
|
||||
|
||||
/**
|
||||
* Fatal Blow effect implementation.
|
||||
@@ -35,9 +39,15 @@ import com.l2jserver.gameserver.model.stats.Formulas;
|
||||
*/
|
||||
public final class FatalBlow extends AbstractEffect
|
||||
{
|
||||
private final String _targetAbnormalType;
|
||||
private final double _skillAddPower;
|
||||
|
||||
public FatalBlow(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
|
||||
_targetAbnormalType = params.getString("targetAbnormalType", "NULL");
|
||||
_skillAddPower = params.getDouble("skillAddPower", 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,25 +73,46 @@ public final class FatalBlow extends AbstractEffect
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
Skill skill = info.getSkill();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
boolean ss = info.getSkill().useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
double damage = Formulas.calcBlowDamage(activeChar, target, info.getSkill(), shld, ss);
|
||||
boolean ss = skill.useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
double damage = Formulas.calcBlowDamage(activeChar, target, skill, shld, ss);
|
||||
|
||||
// Crit rate base crit rate for skill, modified with STR bonus
|
||||
boolean crit = Formulas.calcCrit(info.getSkill().getBaseCritRate() * 10 * BaseStats.STR.calcBonus(activeChar), true, target);
|
||||
if (_targetAbnormalType != "NULL")
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(_targetAbnormalType, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
String abnormal = st.nextToken().trim();
|
||||
if (target.getEffectList().getBuffInfoByAbnormalType(AbnormalType.valueOf(abnormal)) != null)
|
||||
{
|
||||
damage *= _skillAddPower;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
if (crit)
|
||||
{
|
||||
damage *= 2;
|
||||
}
|
||||
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), crit, false);
|
||||
// reduce damage if target has maxdamage buff
|
||||
double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
}
|
||||
|
||||
target.reduceCurrentHp(damage, activeChar, skill);
|
||||
target.notifyDamageReceived(damage, activeChar, skill, crit, false);
|
||||
|
||||
// Manage attack or cast break of the target (calculating rate, sending message...)
|
||||
if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
|
||||
@@ -97,6 +128,6 @@ public final class FatalBlow extends AbstractEffect
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(activeChar, target, info.getSkill(), true);
|
||||
Formulas.calcDamageReflected(activeChar, target, skill, true);
|
||||
}
|
||||
}
|
@@ -48,7 +48,8 @@ public final class FocusMaxEnergy extends AbstractEffect
|
||||
{
|
||||
final Skill sonicMastery = info.getEffected().getSkills().get(992);
|
||||
final Skill focusMastery = info.getEffected().getSkills().get(993);
|
||||
int maxCharge = (sonicMastery != null) ? sonicMastery.getLevel() : (focusMastery != null) ? focusMastery.getLevel() : 0;
|
||||
final Skill maximumForceMastery = info.getEffected().getSkills().get(10301);
|
||||
int maxCharge = (sonicMastery != null) ? sonicMastery.getLevel() : (focusMastery != null) ? focusMastery.getLevel() : (maximumForceMastery != null) ? 15 : 0;
|
||||
if (maxCharge != 0)
|
||||
{
|
||||
int count = maxCharge - info.getEffected().getActingPlayer().getCharges();
|
||||
|
@@ -130,7 +130,7 @@ public final class HpCpHeal extends AbstractEffect
|
||||
{
|
||||
target.sendPacket(SystemMessageId.REJUVENATING_HP);
|
||||
}
|
||||
else
|
||||
else if (healAmount != 0)
|
||||
{
|
||||
if (activeChar.isPlayer() && (activeChar != target))
|
||||
{
|
||||
@@ -152,20 +152,20 @@ public final class HpCpHeal extends AbstractEffect
|
||||
if (amount != 0)
|
||||
{
|
||||
target.setCurrentCp(amount + target.getCurrentCp());
|
||||
}
|
||||
|
||||
if (activeChar.isPlayer() && (activeChar != target))
|
||||
{
|
||||
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);
|
||||
sm.addInt((int) healAmount);
|
||||
target.sendPacket(sm);
|
||||
|
||||
if (activeChar.isPlayer() && (activeChar != target))
|
||||
{
|
||||
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);
|
||||
sm.addInt((int) amount);
|
||||
target.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -25,6 +25,8 @@ import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.effects.EffectFlag;
|
||||
import com.l2jserver.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.network.serverpackets.FlyToLocation;
|
||||
import com.l2jserver.gameserver.network.serverpackets.FlyToLocation.FlyType;
|
||||
@@ -53,6 +55,18 @@ public final class KnockDown extends AbstractEffect
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEffectFlags()
|
||||
{
|
||||
return EffectFlag.STUNNED.getMask();
|
||||
}
|
||||
|
||||
@Override
|
||||
public L2EffectType getEffectType()
|
||||
{
|
||||
return L2EffectType.STUN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(BuffInfo info)
|
||||
{
|
||||
|
@@ -79,6 +79,13 @@ 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));
|
||||
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))
|
||||
{
|
||||
|
@@ -83,6 +83,13 @@ public final class MagicalSoulAttack extends AbstractEffect
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
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))
|
||||
{
|
||||
|
@@ -18,15 +18,19 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ShotType;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jserver.gameserver.model.items.type.WeaponType;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.stats.BaseStats;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.model.stats.Formulas;
|
||||
import com.l2jserver.gameserver.model.stats.Stats;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
@@ -36,9 +40,21 @@ import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
*/
|
||||
public final class PhysicalAttack extends AbstractEffect
|
||||
{
|
||||
private final String _type1;
|
||||
private final double _valueReduce;
|
||||
private final String _type2;
|
||||
private final double _valueIncrease;
|
||||
private final boolean _isLastAttack;
|
||||
|
||||
public PhysicalAttack(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
super(attachCond, applyCond, set, params);
|
||||
|
||||
_type1 = params.getString("weaponTypeDec", "NONE");
|
||||
_valueReduce = params.getDouble("valueDec", 1);
|
||||
_type2 = params.getString("weaponTypeInc", "NONE");
|
||||
_valueIncrease = params.getDouble("valueInc", 1);
|
||||
_isLastAttack = params.getBoolean("isLastAttack", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,16 +80,17 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
Skill skill = info.getSkill();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (((info.getSkill().getFlyRadius() > 0) || (info.getSkill().getFlyType() != null)) && activeChar.isMovementDisabled())
|
||||
if (((info.getSkill().getFlyRadius() > 0) || (skill.getFlyType() != null)) && activeChar.isMovementDisabled())
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS);
|
||||
sm.addSkillName(info.getSkill());
|
||||
sm.addSkillName(skill);
|
||||
activeChar.sendPacket(sm);
|
||||
return;
|
||||
}
|
||||
@@ -84,37 +101,82 @@ public final class PhysicalAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
boolean ss = info.getSkill().isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
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 (info.getSkill().getBaseCritRate() > 0)
|
||||
if (skill.getBaseCritRate() > 0)
|
||||
{
|
||||
crit = Formulas.calcCrit(info.getSkill().getBaseCritRate() * 10 * BaseStats.STR.calcBonus(activeChar), true, target);
|
||||
crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
}
|
||||
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, info.getSkill(), shld, false, ss);
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, ss);
|
||||
|
||||
if (crit)
|
||||
{
|
||||
damage *= 2;
|
||||
}
|
||||
|
||||
if ((activeChar.getActiveWeaponItem() != null) && (_type1 != "NONE") && (_type2 != "NONE"))
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(_type1, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
String item = st.nextToken().trim();
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(item))
|
||||
{
|
||||
damage *= _valueReduce;
|
||||
break;
|
||||
}
|
||||
}
|
||||
st = new StringTokenizer(_type2, ",");
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
String item = st.nextToken().trim();
|
||||
if (activeChar.getActiveWeaponItem().getItemType() == WeaponType.valueOf(item))
|
||||
{
|
||||
damage *= _valueIncrease;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
// reduce damage if target has maxdamage buff
|
||||
double maxDamage = (target.getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
}
|
||||
|
||||
activeChar.sendDamageMessage(target, damage, false, crit, false);
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), crit, false);
|
||||
if (_isLastAttack && !target.isPlayer() && !target.isRaid())
|
||||
{
|
||||
if (damage < target.getCurrentHp())
|
||||
{
|
||||
target.setCurrentHp(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
target.reduceCurrentHp(damage, activeChar, skill);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
target.reduceCurrentHp(damage, activeChar, skill);
|
||||
target.notifyDamageReceived(damage, activeChar, skill, crit, false);
|
||||
}
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(activeChar, target, info.getSkill(), crit);
|
||||
Formulas.calcDamageReflected(activeChar, target, skill, crit);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOUR_ATTACK_HAS_FAILED);
|
||||
}
|
||||
|
||||
if (info.getSkill().isSuicideAttack())
|
||||
if (skill.isSuicideAttack())
|
||||
{
|
||||
activeChar.doDie(activeChar);
|
||||
}
|
||||
|
@@ -25,8 +25,9 @@ import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.stats.BaseStats;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.model.stats.Formulas;
|
||||
import com.l2jserver.gameserver.model.stats.Stats;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
@@ -64,6 +65,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
Skill skill = info.getSkill();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
@@ -73,31 +75,38 @@ public final class PhysicalAttackHpLink extends AbstractEffect
|
||||
if (activeChar.isMovementDisabled())
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS);
|
||||
sm.addSkillName(info.getSkill());
|
||||
sm.addSkillName(skill);
|
||||
activeChar.sendPacket(sm);
|
||||
return;
|
||||
}
|
||||
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, skill);
|
||||
// Physical damage critical rate is only affected by STR.
|
||||
boolean crit = false;
|
||||
if (info.getSkill().getBaseCritRate() > 0)
|
||||
if (skill.getBaseCritRate() > 0)
|
||||
{
|
||||
crit = Formulas.calcCrit(info.getSkill().getBaseCritRate() * 10 * BaseStats.STR.calcBonus(activeChar), true, target);
|
||||
crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
boolean ss = info.getSkill().isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, info.getSkill(), shld, false, ss);
|
||||
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));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
}
|
||||
|
||||
activeChar.sendDamageMessage(target, damage, false, crit, false);
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), crit, false);
|
||||
target.reduceCurrentHp(damage, activeChar, skill);
|
||||
target.notifyDamageReceived(damage, activeChar, skill, crit, false);
|
||||
|
||||
// Check if damage should be reflected.
|
||||
Formulas.calcDamageReflected(activeChar, target, info.getSkill(), crit);
|
||||
Formulas.calcDamageReflected(activeChar, target, skill, crit);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -25,8 +25,9 @@ import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.stats.BaseStats;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.model.stats.Formulas;
|
||||
import com.l2jserver.gameserver.model.stats.Stats;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
@@ -64,16 +65,17 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
{
|
||||
L2Character target = info.getEffected();
|
||||
L2Character activeChar = info.getEffector();
|
||||
Skill skill = info.getSkill();
|
||||
|
||||
if (activeChar.isAlikeDead())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (((info.getSkill().getFlyRadius() > 0) || (info.getSkill().getFlyType() != null)) && activeChar.isMovementDisabled())
|
||||
if (((skill.getFlyRadius() > 0) || (skill.getFlyType() != null)) && activeChar.isMovementDisabled())
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS);
|
||||
sm.addSkillName(info.getSkill());
|
||||
sm.addSkillName(skill);
|
||||
activeChar.sendPacket(sm);
|
||||
return;
|
||||
}
|
||||
@@ -84,21 +86,21 @@ public final class PhysicalSoulAttack extends AbstractEffect
|
||||
}
|
||||
|
||||
int damage = 0;
|
||||
boolean ss = info.getSkill().isPhysical() && activeChar.isChargedShot(ShotType.SOULSHOTS);
|
||||
final byte shld = Formulas.calcShldUse(activeChar, target, info.getSkill());
|
||||
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 (info.getSkill().getBaseCritRate() > 0)
|
||||
if (skill.getBaseCritRate() > 0)
|
||||
{
|
||||
crit = Formulas.calcCrit(info.getSkill().getBaseCritRate() * 10 * BaseStats.STR.calcBonus(activeChar), true, target);
|
||||
crit = Formulas.calcCrit(activeChar, target, skill);
|
||||
}
|
||||
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, info.getSkill(), shld, false, ss);
|
||||
damage = (int) Formulas.calcPhysDam(activeChar, target, skill, shld, false, ss);
|
||||
|
||||
if ((info.getSkill().getMaxSoulConsumeCount() > 0) && activeChar.isPlayer())
|
||||
if ((skill.getMaxSoulConsumeCount() > 0) && activeChar.isPlayer())
|
||||
{
|
||||
// Souls Formula (each soul increase +4%)
|
||||
int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= info.getSkill().getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : info.getSkill().getMaxSoulConsumeCount();
|
||||
int chargedSouls = (activeChar.getActingPlayer().getChargedSouls() <= skill.getMaxSoulConsumeCount()) ? activeChar.getActingPlayer().getChargedSouls() : skill.getMaxSoulConsumeCount();
|
||||
damage *= 1 + (chargedSouls * 0.04);
|
||||
}
|
||||
if (crit)
|
||||
@@ -108,19 +110,26 @@ 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));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
damage = (int) maxDamage;
|
||||
}
|
||||
|
||||
activeChar.sendDamageMessage(target, damage, false, crit, false);
|
||||
target.reduceCurrentHp(damage, activeChar, info.getSkill());
|
||||
target.notifyDamageReceived(damage, activeChar, info.getSkill(), crit, false);
|
||||
target.reduceCurrentHp(damage, activeChar, skill);
|
||||
target.notifyDamageReceived(damage, activeChar, skill, crit, false);
|
||||
|
||||
// Check if damage should be reflected
|
||||
Formulas.calcDamageReflected(activeChar, target, info.getSkill(), crit);
|
||||
Formulas.calcDamageReflected(activeChar, target, skill, crit);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOUR_ATTACK_HAS_FAILED);
|
||||
}
|
||||
|
||||
if (info.getSkill().isSuicideAttack())
|
||||
if (skill.isSuicideAttack())
|
||||
{
|
||||
activeChar.doDie(activeChar);
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@ import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.stats.Stats;
|
||||
|
||||
/**
|
||||
* Static Damage effect implementation.
|
||||
@@ -29,7 +30,7 @@ import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
*/
|
||||
public final class StaticDamage extends AbstractEffect
|
||||
{
|
||||
private final int _power;
|
||||
private int _power;
|
||||
|
||||
public StaticDamage(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
@@ -52,6 +53,13 @@ public final class StaticDamage extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
// reduce damage if target has maxdamage buff
|
||||
double maxDamage = (info.getEffected().getStat().calcStat(Stats.MAX_SKILL_DAMAGE, 0, null, null));
|
||||
if (maxDamage > 0)
|
||||
{
|
||||
_power = (int) maxDamage;
|
||||
}
|
||||
|
||||
info.getEffected().reduceCurrentHp(_power, info.getEffector(), info.getSkill());
|
||||
info.getEffected().notifyDamageReceived(_power, info.getEffector(), info.getSkill(), false, false);
|
||||
|
||||
|
@@ -28,6 +28,7 @@ import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.holders.ItemHolder;
|
||||
import com.l2jserver.gameserver.model.holders.SkillHolder;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
|
||||
/**
|
||||
@@ -42,6 +43,7 @@ public final class Summon extends AbstractEffect
|
||||
private final int _lifeTime;
|
||||
private final int _consumeItemInterval;
|
||||
private final int _summonPoints;
|
||||
private final SkillHolder _debuff;
|
||||
|
||||
public Summon(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
|
||||
{
|
||||
@@ -58,6 +60,7 @@ public final class Summon extends AbstractEffect
|
||||
_consumeItemInterval = params.getInt("consumeItemInterval", 0);
|
||||
_lifeTime = params.getInt("lifeTime", 3600) * 1000;
|
||||
_summonPoints = params.getInt("summonPoints", 0);
|
||||
_debuff = new SkillHolder(params.getInt("debuffId", 0), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,5 +118,9 @@ public final class Summon extends AbstractEffect
|
||||
summon.setShowSummonAnimation(true);
|
||||
summon.setRunning();
|
||||
summon.spawnMe();
|
||||
if (_debuff.getSkillId() != 0)
|
||||
{
|
||||
_debuff.getSkill().applyEffects(player, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -44,6 +44,7 @@ public final class TriggerSkillBySkill extends AbstractEffect
|
||||
private final int _chance;
|
||||
private final SkillHolder _skill;
|
||||
private final L2TargetType _targetType;
|
||||
private final int AQUAMARINE = 17822;
|
||||
|
||||
/**
|
||||
* @param attachCond
|
||||
@@ -64,12 +65,12 @@ public final class TriggerSkillBySkill extends AbstractEffect
|
||||
|
||||
public void onSkillUseEvent(OnCreatureSkillUse event)
|
||||
{
|
||||
if ((_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLvl() == 0) || (_castSkillId == 0)))
|
||||
if ((_chance == 0) || ((_skill.getSkillId() == 0) || (_skill.getSkillLvl() == 0) || ((_castSkillId == 0) && (_skill.getSkillId() != AQUAMARINE))))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_castSkillId != event.getSkill().getId())
|
||||
if ((_castSkillId != event.getSkill().getId()) && (_skill.getSkillId() != AQUAMARINE))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user