Addition of hit task for pistol weapons.
Contributed by champzix1.
This commit is contained in:
parent
b7810037fe
commit
346f8241a2
@ -1252,6 +1252,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
_hitTask = ThreadPool.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
|
||||
break;
|
||||
}
|
||||
case PISTOLS:
|
||||
{
|
||||
final int reuse = Formulas.calculateReuseTime(this, weaponItem);
|
||||
_disableRangedAttackEndTime = currentTime + TimeUnit.MILLISECONDS.toNanos(reuse);
|
||||
// Precaution. It happened in the past for _attackEndTime. Will not risk it.
|
||||
if (_disableRangedAttackEndTime < currentTime)
|
||||
{
|
||||
_disableRangedAttackEndTime = currentTime + TimeUnit.MILLISECONDS.toNanos(Integer.MAX_VALUE);
|
||||
}
|
||||
_hitTask = ThreadPool.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
|
||||
break;
|
||||
}
|
||||
case FIST:
|
||||
{
|
||||
if (!isPlayer())
|
||||
|
@ -1262,6 +1262,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
_hitTask = ThreadPool.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
|
||||
break;
|
||||
}
|
||||
case PISTOLS:
|
||||
{
|
||||
final int reuse = Formulas.calculateReuseTime(this, weaponItem);
|
||||
_disableRangedAttackEndTime = currentTime + TimeUnit.MILLISECONDS.toNanos(reuse);
|
||||
// Precaution. It happened in the past for _attackEndTime. Will not risk it.
|
||||
if (_disableRangedAttackEndTime < currentTime)
|
||||
{
|
||||
_disableRangedAttackEndTime = currentTime + TimeUnit.MILLISECONDS.toNanos(Integer.MAX_VALUE);
|
||||
}
|
||||
_hitTask = ThreadPool.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
|
||||
break;
|
||||
}
|
||||
case FIST:
|
||||
{
|
||||
if (!isPlayer())
|
||||
|
@ -1262,6 +1262,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
_hitTask = ThreadPool.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
|
||||
break;
|
||||
}
|
||||
case PISTOLS:
|
||||
{
|
||||
final int reuse = Formulas.calculateReuseTime(this, weaponItem);
|
||||
_disableRangedAttackEndTime = currentTime + TimeUnit.MILLISECONDS.toNanos(reuse);
|
||||
// Precaution. It happened in the past for _attackEndTime. Will not risk it.
|
||||
if (_disableRangedAttackEndTime < currentTime)
|
||||
{
|
||||
_disableRangedAttackEndTime = currentTime + TimeUnit.MILLISECONDS.toNanos(Integer.MAX_VALUE);
|
||||
}
|
||||
_hitTask = ThreadPool.schedule(() -> onHitTimeNotDual(weaponItem, attack, timeToHit, timeAtk), timeToHit);
|
||||
break;
|
||||
}
|
||||
case FIST:
|
||||
{
|
||||
if (!isPlayer())
|
||||
|
Loading…
Reference in New Issue
Block a user