Reverted ranged attack task addition but kept delay adjustment.
This commit is contained in:
parent
a3e8e337fe
commit
e13c3757d2
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user