Support for Resurrection effects with HP MP CP percent parameters.
This commit is contained in:
@ -149,7 +149,7 @@ public abstract class Playable extends Creature
|
||||
{
|
||||
if (player.isInSiege())
|
||||
{
|
||||
getActingPlayer().reviveRequest(getActingPlayer(), false, 0);
|
||||
getActingPlayer().reviveRequest(getActingPlayer(), false, 0, 0, 0, 0);
|
||||
}
|
||||
player.setCharmOfCourage(false);
|
||||
player.sendPacket(new EtcStatusUpdate(player));
|
||||
|
@ -753,6 +753,9 @@ public class PlayerInstance extends Playable
|
||||
private boolean _canRevive = true;
|
||||
private int _reviveRequested = 0;
|
||||
private double _revivePower = 0;
|
||||
private int _reviveHpPercent = 0;
|
||||
private int _reviveMpPercent = 0;
|
||||
private int _reviveCpPercent = 0;
|
||||
private boolean _revivePet = false;
|
||||
|
||||
private double _cpUpdateIncCheck = .0;
|
||||
@ -10195,7 +10198,7 @@ public class PlayerInstance extends Playable
|
||||
restoreExp(revivePower);
|
||||
}
|
||||
|
||||
public void reviveRequest(PlayerInstance reviver, boolean isPet, int power)
|
||||
public void reviveRequest(PlayerInstance reviver, boolean isPet, int power, int reviveHp, int reviveMp, int reviveCp)
|
||||
{
|
||||
if (isResurrectionBlocked())
|
||||
{
|
||||
@ -10222,6 +10225,9 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
_reviveRequested = 1;
|
||||
_revivePower = Formulas.calculateSkillResurrectRestorePercent(power, reviver);
|
||||
_reviveHpPercent = reviveHp;
|
||||
_reviveMpPercent = reviveMp;
|
||||
_reviveCpPercent = reviveCp;
|
||||
_revivePet = isPet;
|
||||
if (hasCharmOfCourage())
|
||||
{
|
||||
@ -10274,6 +10280,43 @@ public class PlayerInstance extends Playable
|
||||
}
|
||||
_reviveRequested = 0;
|
||||
_revivePower = 0;
|
||||
|
||||
// Support for specific HP/MP/CP percentage restored.
|
||||
final Creature effected = _revivePet ? _pet : this;
|
||||
if (effected == null)
|
||||
{
|
||||
_reviveHpPercent = 0;
|
||||
_reviveMpPercent = 0;
|
||||
_reviveCpPercent = 0;
|
||||
return;
|
||||
}
|
||||
if (_reviveHpPercent > 0)
|
||||
{
|
||||
final double amount = (effected.getMaxHp() * _reviveHpPercent) / 100;
|
||||
if (amount > 0)
|
||||
{
|
||||
effected.setCurrentHp(amount, true);
|
||||
}
|
||||
_reviveHpPercent = 0;
|
||||
}
|
||||
if (_reviveMpPercent > 0)
|
||||
{
|
||||
final double amount = (effected.getMaxMp() * _reviveMpPercent) / 100;
|
||||
if (amount > 0)
|
||||
{
|
||||
effected.setCurrentMp(amount, true);
|
||||
}
|
||||
_reviveMpPercent = 0;
|
||||
}
|
||||
if (_reviveCpPercent > 0)
|
||||
{
|
||||
final double amount = (effected.getMaxCp() * _reviveCpPercent) / 100;
|
||||
if (amount > 0)
|
||||
{
|
||||
effected.setCurrentCp(amount, true);
|
||||
}
|
||||
_reviveCpPercent = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isReviveRequested()
|
||||
|
Reference in New Issue
Block a user