Reverted ranged attack task addition but kept delay adjustment.

This commit is contained in:
MobiusDevelopment 2020-06-02 22:10:15 +00:00
parent a3e8e337fe
commit e13c3757d2
15 changed files with 30 additions and 255 deletions

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -259,7 +259,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1017,14 +1016,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1063,14 +1055,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -259,7 +259,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1017,14 +1016,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1063,14 +1055,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -259,7 +259,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1017,14 +1016,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1063,14 +1055,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;

View File

@ -258,7 +258,6 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
// set by the start of attack, in game ticks // set by the start of attack, in game ticks
private volatile long _attackEndTime; private volatile long _attackEndTime;
private volatile long _disableRangedAttackEndTime; private volatile long _disableRangedAttackEndTime;
private volatile ScheduledFuture<?> _enableRangedAttackTask;
private CreatureAI _ai = null; private CreatureAI _ai = null;
@ -1016,14 +1015,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{ {
if (isPlayer()) if (isPlayer())
{ {
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 300);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 300);
}
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
} }
return; return;
@ -1062,14 +1054,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
if (_status.getCurrentMp() < mpConsume) if (_status.getCurrentMp() < mpConsume)
{ {
// If PlayerInstance doesn't have enough MP, stop the attack // If PlayerInstance doesn't have enough MP, stop the attack
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled()) ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
{
_enableRangedAttackTask = ThreadPool.schedule(() ->
{
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
_enableRangedAttackTask = null;
}, 1000);
}
sendPacket(SystemMessageId.NOT_ENOUGH_MP); sendPacket(SystemMessageId.NOT_ENOUGH_MP);
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return; return;