Sync with L2jServer HighFive Sep 8th 2015.

This commit is contained in:
MobiusDev
2015-09-08 19:52:45 +00:00
parent 4e2af7c19a
commit 40380c4860
738 changed files with 14444 additions and 13328 deletions

View File

@@ -28,7 +28,7 @@ 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;
@@ -80,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;
}
@@ -100,16 +101,16 @@ 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)
{
@@ -158,24 +159,24 @@ public final class PhysicalAttack extends AbstractEffect
}
else
{
target.reduceCurrentHp(damage, activeChar, info.getSkill());
target.reduceCurrentHp(damage, activeChar, skill);
}
}
else
{
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);
}