Addition of ranged attack enable task.
This commit is contained in:
parent
109862e5b4
commit
4eeac28627
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -259,6 +259,7 @@ 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,7 +1017,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1055,7 +1063,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -259,6 +259,7 @@ 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,7 +1017,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1055,7 +1063,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -259,6 +259,7 @@ 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,7 +1017,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1055,7 +1063,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
@ -258,6 +258,7 @@ 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;
|
||||||
|
|
||||||
@ -1015,7 +1016,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
|||||||
{
|
{
|
||||||
if (isPlayer())
|
if (isPlayer())
|
||||||
{
|
{
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_enableRangedAttackTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT);
|
||||||
|
_enableRangedAttackTask = null;
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
sendPacket(ActionFailed.STATIC_PACKET);
|
sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1054,7 +1062,14 @@ 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
|
||||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
if ((_enableRangedAttackTask == null) || _enableRangedAttackTask.isDone() || _enableRangedAttackTask.isCancelled())
|
||||||
|
{
|
||||||
|
_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;
|
||||||
|
Loading…
Reference in New Issue
Block a user