|
@@ -94,6 +94,7 @@ public class PcStatus extends PlayableStatus
|
|
|
|
|
|
int fullValue = (int) value;
|
|
|
int tDmg = 0;
|
|
|
+ int mpDam = 0;
|
|
|
|
|
|
if (attacker != null && attacker != getActiveChar())
|
|
|
{
|
|
@@ -119,8 +120,7 @@ public class PcStatus extends PlayableStatus
|
|
|
|
|
|
// Check and calculate transfered damage
|
|
|
final L2Summon summon = getActiveChar().getPet();
|
|
|
- //TODO correct range
|
|
|
- if (summon != null && summon instanceof L2SummonInstance && Util.checkIfInRange(900, getActiveChar(), summon, true))
|
|
|
+ if (summon != null && summon instanceof L2SummonInstance && Util.checkIfInRange(1000, getActiveChar(), summon, true))
|
|
|
{
|
|
|
tDmg = (int)value * (int)getActiveChar().getStat().calcStat(Stats.TRANSFER_DAMAGE_PERCENT, 0, null, null) /100;
|
|
|
|
|
@@ -134,6 +134,28 @@ public class PcStatus extends PlayableStatus
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ mpDam = (int) value * (int) getActiveChar().getStat().calcStat(Stats.MANA_SHIELD_PERCENT, 0, null, null) / 100;
|
|
|
+
|
|
|
+ if (mpDam > 0)
|
|
|
+ {
|
|
|
+ mpDam = (int) (value - mpDam);
|
|
|
+ if (mpDam > getActiveChar().getCurrentMp())
|
|
|
+ {
|
|
|
+ getActiveChar().sendPacket(SystemMessage.getSystemMessage(SystemMessageId.MP_BECAME_0_ARCANE_SHIELD_DISAPPEARING));
|
|
|
+ getActiveChar().getFirstEffect(1556).stopEffectTask();
|
|
|
+ value = mpDam - getActiveChar().getCurrentMp();
|
|
|
+ getActiveChar().setCurrentMp(0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ getActiveChar().reduceCurrentMp(mpDam);
|
|
|
+ SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.ARCANE_SHIELD_DECREASED_YOUR_MP_BY_S1_INSTEAD_OF_HP);
|
|
|
+ smsg.addNumber(mpDam);
|
|
|
+ getActiveChar().sendPacket(smsg);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (!ignoreCP && attacker instanceof L2Playable)
|
|
|
{
|
|
|
if (getCurrentCp() >= value)
|