Fixed setImobilized exploit.

This commit is contained in:
MobiusDevelopment 2022-01-20 18:01:27 +00:00
parent 75ba003efb
commit 226d559381
4 changed files with 16 additions and 22 deletions

View File

@ -156,7 +156,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
private boolean _isMuted = false; // Cannot use magic
private boolean _isPhysicalMuted = false; // Cannot use psychical skills
private boolean _isKilledAlready = false;
private int _isImmobilized = 0;
private boolean _isImmobilized = false;
private boolean _isOverloaded = false; // the char is carrying too much
private boolean _isParalyzed = false;
private boolean _isRiding = false; // Is Riding strider?
@ -2159,7 +2159,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
*/
public boolean isImmobilized()
{
return _isImmobilized > 0;
return _isImmobilized;
}
/**
@ -2171,13 +2171,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
// Stop this if he is moving
getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
if (value)
if (_isImmobilized != value)
{
_isImmobilized++;
}
else
{
_isImmobilized--;
_isImmobilized = value;
}
}
@ -8541,7 +8537,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
return;
}
_nextReducingHPByOverTime = Chronos.currentTimeMillis() + (period * 1000);
_nextReducingHPByOverTime = Chronos.currentTimeMillis() + (period * 880);
reduceCurrentHp(amount, attacker, awake);
}
@ -8554,7 +8550,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
return;
}
_nextReducingMPByOverTime = Chronos.currentTimeMillis() + (period * 1000);
_nextReducingMPByOverTime = Chronos.currentTimeMillis() + (period * 880);
reduceCurrentMp(amount);
}

View File

@ -39,19 +39,20 @@ final class EffectImobileBuff extends Effect
@Override
public void onStart()
{
super.onStart();
getEffector().setImmobilized(true);
}
@Override
public void onExit()
{
super.onExit();
getEffector().setImmobilized(false);
}
@Override
public boolean onActionTime()
{
// just stop this effect
return false;
}
}

View File

@ -158,7 +158,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
private boolean _isMuted = false; // Cannot use magic
private boolean _isPhysicalMuted = false; // Cannot use psychical skills
private boolean _isKilledAlready = false;
private int _isImmobilized = 0;
private boolean _isImmobilized = false;
private boolean _isOverloaded = false; // the char is carrying too much
private boolean _isParalyzed = false;
private boolean _isRiding = false; // Is Riding strider?
@ -2202,7 +2202,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
*/
public boolean isImmobilized()
{
return _isImmobilized > 0;
return _isImmobilized;
}
/**
@ -2214,13 +2214,9 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
// Stop this if he is moving
getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
if (value)
if (_isImmobilized != value)
{
_isImmobilized++;
}
else
{
_isImmobilized--;
_isImmobilized = value;
}
}
@ -8588,7 +8584,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
return;
}
_nextReducingHPByOverTime = Chronos.currentTimeMillis() + (period * 1000);
_nextReducingHPByOverTime = Chronos.currentTimeMillis() + (period * 880);
reduceCurrentHp(amount, attacker, awake);
}
@ -8601,7 +8597,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
return;
}
_nextReducingMPByOverTime = Chronos.currentTimeMillis() + (period * 1000);
_nextReducingMPByOverTime = Chronos.currentTimeMillis() + (period * 880);
reduceCurrentMp(amount);
}

View File

@ -39,19 +39,20 @@ final class EffectImobileBuff extends Effect
@Override
public void onStart()
{
super.onStart();
getEffector().setImmobilized(true);
}
@Override
public void onExit()
{
super.onExit();
getEffector().setImmobilized(false);
}
@Override
public boolean onActionTime()
{
// just stop this effect
return false;
}
}