Improved Fantasy Isle Parade.
This commit is contained in:
@@ -120,7 +120,7 @@ public final class Parade extends AbstractNpcAI
|
|||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
int npcIndex;
|
int npcIndex;
|
||||||
CopyOnWriteArrayList<L2Npc> spawns;
|
CopyOnWriteArrayList<L2Npc> spawns = new CopyOnWriteArrayList<>();
|
||||||
ScheduledFuture<?> spawnTask;
|
ScheduledFuture<?> spawnTask;
|
||||||
ScheduledFuture<?> deleteTask;
|
ScheduledFuture<?> deleteTask;
|
||||||
ScheduledFuture<?> cleanTask;
|
ScheduledFuture<?> cleanTask;
|
||||||
@@ -141,16 +141,12 @@ public final class Parade extends AbstractNpcAI
|
|||||||
void load()
|
void load()
|
||||||
{
|
{
|
||||||
npcIndex = 0;
|
npcIndex = 0;
|
||||||
spawns = new CopyOnWriteArrayList<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clean()
|
void clean()
|
||||||
{
|
{
|
||||||
if (spawns != null)
|
spawns.forEach(L2Npc::deleteMe);
|
||||||
{
|
spawns.clear();
|
||||||
spawns.forEach(L2Npc::deleteMe);
|
|
||||||
}
|
|
||||||
spawns = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long timeLeftMilli(int hh, int mm, int ss)
|
private long timeLeftMilli(int hh, int mm, int ss)
|
||||||
@@ -199,6 +195,7 @@ public final class Parade extends AbstractNpcAI
|
|||||||
final int[] start = START[route][i];
|
final int[] start = START[route][i];
|
||||||
final int[] goal = GOAL[route][i];
|
final int[] goal = GOAL[route][i];
|
||||||
final L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
final L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
||||||
|
actor.setRunning();
|
||||||
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
||||||
spawns.add(actor);
|
spawns.add(actor);
|
||||||
}
|
}
|
||||||
@@ -242,12 +239,9 @@ public final class Parade extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
spawnTask.cancel(false);
|
spawnTask.cancel(true);
|
||||||
spawnTask = null;
|
deleteTask.cancel(true);
|
||||||
deleteTask.cancel(false);
|
cleanTask.cancel(true);
|
||||||
deleteTask = null;
|
|
||||||
cleanTask.cancel(false);
|
|
||||||
cleanTask = null;
|
|
||||||
clean();
|
clean();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3473,7 +3473,7 @@
|
|||||||
<defence fire="150" water="150" wind="150" earth="150" holy="150" dark="150" default="150" />
|
<defence fire="150" water="150" wind="150" earth="150" holy="150" dark="150" default="150" />
|
||||||
</attribute>
|
</attribute>
|
||||||
<speed>
|
<speed>
|
||||||
<walk ground="60" />
|
<walk ground="40" />
|
||||||
<run ground="40" />
|
<run ground="40" />
|
||||||
</speed>
|
</speed>
|
||||||
<abnormalResist physical="10" magical="10" />
|
<abnormalResist physical="10" magical="10" />
|
||||||
|
@@ -120,7 +120,7 @@ public final class Parade extends AbstractNpcAI
|
|||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
int npcIndex;
|
int npcIndex;
|
||||||
CopyOnWriteArrayList<L2Npc> spawns;
|
CopyOnWriteArrayList<L2Npc> spawns = new CopyOnWriteArrayList<>();
|
||||||
ScheduledFuture<?> spawnTask;
|
ScheduledFuture<?> spawnTask;
|
||||||
ScheduledFuture<?> deleteTask;
|
ScheduledFuture<?> deleteTask;
|
||||||
ScheduledFuture<?> cleanTask;
|
ScheduledFuture<?> cleanTask;
|
||||||
@@ -141,16 +141,12 @@ public final class Parade extends AbstractNpcAI
|
|||||||
void load()
|
void load()
|
||||||
{
|
{
|
||||||
npcIndex = 0;
|
npcIndex = 0;
|
||||||
spawns = new CopyOnWriteArrayList<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clean()
|
void clean()
|
||||||
{
|
{
|
||||||
if (spawns != null)
|
spawns.forEach(L2Npc::deleteMe);
|
||||||
{
|
spawns.clear();
|
||||||
spawns.forEach(L2Npc::deleteMe);
|
|
||||||
}
|
|
||||||
spawns = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long timeLeftMilli(int hh, int mm, int ss)
|
private long timeLeftMilli(int hh, int mm, int ss)
|
||||||
@@ -199,6 +195,7 @@ public final class Parade extends AbstractNpcAI
|
|||||||
final int[] start = START[route][i];
|
final int[] start = START[route][i];
|
||||||
final int[] goal = GOAL[route][i];
|
final int[] goal = GOAL[route][i];
|
||||||
final L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
final L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
||||||
|
actor.setRunning();
|
||||||
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
||||||
spawns.add(actor);
|
spawns.add(actor);
|
||||||
}
|
}
|
||||||
@@ -242,12 +239,9 @@ public final class Parade extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
spawnTask.cancel(false);
|
spawnTask.cancel(true);
|
||||||
spawnTask = null;
|
deleteTask.cancel(true);
|
||||||
deleteTask.cancel(false);
|
cleanTask.cancel(true);
|
||||||
deleteTask = null;
|
|
||||||
cleanTask.cancel(false);
|
|
||||||
cleanTask = null;
|
|
||||||
clean();
|
clean();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3473,7 +3473,7 @@
|
|||||||
<defence fire="150" water="150" wind="150" earth="150" holy="150" dark="150" default="150" />
|
<defence fire="150" water="150" wind="150" earth="150" holy="150" dark="150" default="150" />
|
||||||
</attribute>
|
</attribute>
|
||||||
<speed>
|
<speed>
|
||||||
<walk ground="60" />
|
<walk ground="40" />
|
||||||
<run ground="40" />
|
<run ground="40" />
|
||||||
</speed>
|
</speed>
|
||||||
<abnormalResist physical="10" magical="10" />
|
<abnormalResist physical="10" magical="10" />
|
||||||
|
@@ -120,7 +120,7 @@ public final class Parade extends AbstractNpcAI
|
|||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
int npcIndex;
|
int npcIndex;
|
||||||
CopyOnWriteArrayList<L2Npc> spawns;
|
CopyOnWriteArrayList<L2Npc> spawns = new CopyOnWriteArrayList<>();
|
||||||
ScheduledFuture<?> spawnTask;
|
ScheduledFuture<?> spawnTask;
|
||||||
ScheduledFuture<?> deleteTask;
|
ScheduledFuture<?> deleteTask;
|
||||||
ScheduledFuture<?> cleanTask;
|
ScheduledFuture<?> cleanTask;
|
||||||
@@ -141,16 +141,12 @@ public final class Parade extends AbstractNpcAI
|
|||||||
void load()
|
void load()
|
||||||
{
|
{
|
||||||
npcIndex = 0;
|
npcIndex = 0;
|
||||||
spawns = new CopyOnWriteArrayList<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clean()
|
void clean()
|
||||||
{
|
{
|
||||||
if (spawns != null)
|
spawns.forEach(L2Npc::deleteMe);
|
||||||
{
|
spawns.clear();
|
||||||
spawns.forEach(L2Npc::deleteMe);
|
|
||||||
}
|
|
||||||
spawns = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long timeLeftMilli(int hh, int mm, int ss)
|
private long timeLeftMilli(int hh, int mm, int ss)
|
||||||
@@ -199,6 +195,7 @@ public final class Parade extends AbstractNpcAI
|
|||||||
final int[] start = START[route][i];
|
final int[] start = START[route][i];
|
||||||
final int[] goal = GOAL[route][i];
|
final int[] goal = GOAL[route][i];
|
||||||
final L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
final L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
||||||
|
actor.setRunning();
|
||||||
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
||||||
spawns.add(actor);
|
spawns.add(actor);
|
||||||
}
|
}
|
||||||
@@ -242,12 +239,9 @@ public final class Parade extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
spawnTask.cancel(false);
|
spawnTask.cancel(true);
|
||||||
spawnTask = null;
|
deleteTask.cancel(true);
|
||||||
deleteTask.cancel(false);
|
cleanTask.cancel(true);
|
||||||
deleteTask = null;
|
|
||||||
cleanTask.cancel(false);
|
|
||||||
cleanTask = null;
|
|
||||||
clean();
|
clean();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3473,7 +3473,7 @@
|
|||||||
<defence fire="150" water="150" wind="150" earth="150" holy="150" dark="150" default="150" />
|
<defence fire="150" water="150" wind="150" earth="150" holy="150" dark="150" default="150" />
|
||||||
</attribute>
|
</attribute>
|
||||||
<speed>
|
<speed>
|
||||||
<walk ground="60" />
|
<walk ground="40" />
|
||||||
<run ground="40" />
|
<run ground="40" />
|
||||||
</speed>
|
</speed>
|
||||||
<abnormalResist physical="10" magical="10" />
|
<abnormalResist physical="10" magical="10" />
|
||||||
|
@@ -120,7 +120,7 @@ public final class Parade extends AbstractNpcAI
|
|||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
int npcIndex;
|
int npcIndex;
|
||||||
CopyOnWriteArrayList<L2Npc> spawns;
|
CopyOnWriteArrayList<L2Npc> spawns = new CopyOnWriteArrayList<>();
|
||||||
ScheduledFuture<?> spawnTask;
|
ScheduledFuture<?> spawnTask;
|
||||||
ScheduledFuture<?> deleteTask;
|
ScheduledFuture<?> deleteTask;
|
||||||
ScheduledFuture<?> cleanTask;
|
ScheduledFuture<?> cleanTask;
|
||||||
@@ -143,16 +143,12 @@ public final class Parade extends AbstractNpcAI
|
|||||||
void load()
|
void load()
|
||||||
{
|
{
|
||||||
npcIndex = 0;
|
npcIndex = 0;
|
||||||
spawns = new CopyOnWriteArrayList<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clean()
|
void clean()
|
||||||
{
|
{
|
||||||
if (spawns != null)
|
spawns.forEach(L2Npc::deleteMe);
|
||||||
{
|
spawns.clear();
|
||||||
spawns.forEach(L2Npc::deleteMe);
|
|
||||||
}
|
|
||||||
spawns = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long timeLeftMilli(int hh, int mm, int ss)
|
private long timeLeftMilli(int hh, int mm, int ss)
|
||||||
@@ -201,6 +197,7 @@ public final class Parade extends AbstractNpcAI
|
|||||||
final int[] start = START[route][i];
|
final int[] start = START[route][i];
|
||||||
final int[] goal = GOAL[route][i];
|
final int[] goal = GOAL[route][i];
|
||||||
final L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
final L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
||||||
|
actor.setRunning();
|
||||||
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
||||||
spawns.add(actor);
|
spawns.add(actor);
|
||||||
}
|
}
|
||||||
@@ -244,12 +241,9 @@ public final class Parade extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
spawnTask.cancel(false);
|
spawnTask.cancel(true);
|
||||||
spawnTask = null;
|
deleteTask.cancel(true);
|
||||||
deleteTask.cancel(false);
|
cleanTask.cancel(true);
|
||||||
deleteTask = null;
|
|
||||||
cleanTask.cancel(false);
|
|
||||||
cleanTask = null;
|
|
||||||
clean();
|
clean();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user