Command Post instance cleanup.

This commit is contained in:
MobiusDevelopment
2021-12-22 23:19:38 +00:00
parent 595a4831ca
commit 74a110a5cd
10 changed files with 2060 additions and 2130 deletions

View File

@@ -132,7 +132,9 @@ public class CommandPost extends AbstractInstance
@Override @Override
public String onAdvEvent(String event, Npc npc, Player player) public String onAdvEvent(String event, Npc npc, Player player)
{ {
if (event.contains("enterInstance")) switch (event)
{
case "enterInstance":
{ {
final Party party = player.getParty(); final Party party = player.getParty();
if (player.isInParty()) if (player.isInParty())
@@ -187,8 +189,9 @@ public class CommandPost extends AbstractInstance
{ {
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
break;
} }
else if (event.equals("check_status")) case "check_status":
{ {
final Instance world = player.getInstanceWorld(); final Instance world = player.getInstanceWorld();
if (!isInInstance(world)) if (!isInInstance(world))
@@ -343,10 +346,10 @@ public class CommandPost extends AbstractInstance
} }
case 7: case 7:
{ {
if (world.getAliveNpcs(GROUP_4).isEmpty()) // if (world.getAliveNpcs(GROUP_4).isEmpty())
{ // {
System.out.println("Status is 7."); // System.out.println("Status is 7.");
} // }
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
break; break;
@@ -356,6 +359,8 @@ public class CommandPost extends AbstractInstance
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
} }
break;
}
} }
return null; return null;
} }
@@ -366,27 +371,12 @@ public class CommandPost extends AbstractInstance
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (world != null) if (world != null)
{ {
npc.setInvul(false);
npc.setTargetable(true);
if (CommonUtil.contains(GROUP_1, npc.getId())) if (CommonUtil.contains(GROUP_1, npc.getId()))
{ {
npc.setInvul(false);
npc.setTargetable(true);
world.setStatus(4); world.setStatus(4);
} }
else if (CommonUtil.contains(GROUP_2, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_3, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_4, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
} }
super.onMoveFinished(npc); super.onMoveFinished(npc);
} }
@@ -395,6 +385,8 @@ public class CommandPost extends AbstractInstance
public String onEnterZone(Creature creature, ZoneType zone) public String onEnterZone(Creature creature, ZoneType zone)
{ {
final Instance world = creature.getInstanceWorld(); final Instance world = creature.getInstanceWorld();
if (world != null)
{
switch (zone.getId()) switch (zone.getId())
{ {
case 25901: case 25901:
@@ -423,6 +415,7 @@ public class CommandPost extends AbstractInstance
break; break;
} }
} }
}
return super.onEnterZone(creature, zone); return super.onEnterZone(creature, zone);
} }

View File

@@ -132,7 +132,9 @@ public class CommandPost extends AbstractInstance
@Override @Override
public String onAdvEvent(String event, Npc npc, Player player) public String onAdvEvent(String event, Npc npc, Player player)
{ {
if (event.contains("enterInstance")) switch (event)
{
case "enterInstance":
{ {
final Party party = player.getParty(); final Party party = player.getParty();
if (player.isInParty()) if (player.isInParty())
@@ -187,8 +189,9 @@ public class CommandPost extends AbstractInstance
{ {
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
break;
} }
else if (event.equals("check_status")) case "check_status":
{ {
final Instance world = player.getInstanceWorld(); final Instance world = player.getInstanceWorld();
if (!isInInstance(world)) if (!isInInstance(world))
@@ -343,10 +346,10 @@ public class CommandPost extends AbstractInstance
} }
case 7: case 7:
{ {
if (world.getAliveNpcs(GROUP_4).isEmpty()) // if (world.getAliveNpcs(GROUP_4).isEmpty())
{ // {
System.out.println("Status is 7."); // System.out.println("Status is 7.");
} // }
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
break; break;
@@ -356,6 +359,8 @@ public class CommandPost extends AbstractInstance
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
} }
break;
}
} }
return null; return null;
} }
@@ -366,27 +371,12 @@ public class CommandPost extends AbstractInstance
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (world != null) if (world != null)
{ {
npc.setInvul(false);
npc.setTargetable(true);
if (CommonUtil.contains(GROUP_1, npc.getId())) if (CommonUtil.contains(GROUP_1, npc.getId()))
{ {
npc.setInvul(false);
npc.setTargetable(true);
world.setStatus(4); world.setStatus(4);
} }
else if (CommonUtil.contains(GROUP_2, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_3, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_4, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
} }
super.onMoveFinished(npc); super.onMoveFinished(npc);
} }
@@ -395,6 +385,8 @@ public class CommandPost extends AbstractInstance
public String onEnterZone(Creature creature, ZoneType zone) public String onEnterZone(Creature creature, ZoneType zone)
{ {
final Instance world = creature.getInstanceWorld(); final Instance world = creature.getInstanceWorld();
if (world != null)
{
switch (zone.getId()) switch (zone.getId())
{ {
case 25901: case 25901:
@@ -423,6 +415,7 @@ public class CommandPost extends AbstractInstance
break; break;
} }
} }
}
return super.onEnterZone(creature, zone); return super.onEnterZone(creature, zone);
} }

View File

@@ -132,7 +132,9 @@ public class CommandPost extends AbstractInstance
@Override @Override
public String onAdvEvent(String event, Npc npc, Player player) public String onAdvEvent(String event, Npc npc, Player player)
{ {
if (event.contains("enterInstance")) switch (event)
{
case "enterInstance":
{ {
final Party party = player.getParty(); final Party party = player.getParty();
if (player.isInParty()) if (player.isInParty())
@@ -187,8 +189,9 @@ public class CommandPost extends AbstractInstance
{ {
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
break;
} }
else if (event.equals("check_status")) case "check_status":
{ {
final Instance world = player.getInstanceWorld(); final Instance world = player.getInstanceWorld();
if (!isInInstance(world)) if (!isInInstance(world))
@@ -343,10 +346,10 @@ public class CommandPost extends AbstractInstance
} }
case 7: case 7:
{ {
if (world.getAliveNpcs(GROUP_4).isEmpty()) // if (world.getAliveNpcs(GROUP_4).isEmpty())
{ // {
System.out.println("Status is 7."); // System.out.println("Status is 7.");
} // }
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
break; break;
@@ -356,6 +359,8 @@ public class CommandPost extends AbstractInstance
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
} }
break;
}
} }
return null; return null;
} }
@@ -366,27 +371,12 @@ public class CommandPost extends AbstractInstance
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (world != null) if (world != null)
{ {
npc.setInvul(false);
npc.setTargetable(true);
if (CommonUtil.contains(GROUP_1, npc.getId())) if (CommonUtil.contains(GROUP_1, npc.getId()))
{ {
npc.setInvul(false);
npc.setTargetable(true);
world.setStatus(4); world.setStatus(4);
} }
else if (CommonUtil.contains(GROUP_2, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_3, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_4, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
} }
super.onMoveFinished(npc); super.onMoveFinished(npc);
} }
@@ -395,6 +385,8 @@ public class CommandPost extends AbstractInstance
public String onEnterZone(Creature creature, ZoneType zone) public String onEnterZone(Creature creature, ZoneType zone)
{ {
final Instance world = creature.getInstanceWorld(); final Instance world = creature.getInstanceWorld();
if (world != null)
{
switch (zone.getId()) switch (zone.getId())
{ {
case 25901: case 25901:
@@ -423,6 +415,7 @@ public class CommandPost extends AbstractInstance
break; break;
} }
} }
}
return super.onEnterZone(creature, zone); return super.onEnterZone(creature, zone);
} }

View File

@@ -132,7 +132,9 @@ public class CommandPost extends AbstractInstance
@Override @Override
public String onAdvEvent(String event, Npc npc, Player player) public String onAdvEvent(String event, Npc npc, Player player)
{ {
if (event.contains("enterInstance")) switch (event)
{
case "enterInstance":
{ {
final Party party = player.getParty(); final Party party = player.getParty();
if (player.isInParty()) if (player.isInParty())
@@ -187,8 +189,9 @@ public class CommandPost extends AbstractInstance
{ {
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
break;
} }
else if (event.equals("check_status")) case "check_status":
{ {
final Instance world = player.getInstanceWorld(); final Instance world = player.getInstanceWorld();
if (!isInInstance(world)) if (!isInInstance(world))
@@ -343,10 +346,10 @@ public class CommandPost extends AbstractInstance
} }
case 7: case 7:
{ {
if (world.getAliveNpcs(GROUP_4).isEmpty()) // if (world.getAliveNpcs(GROUP_4).isEmpty())
{ // {
System.out.println("Status is 7."); // System.out.println("Status is 7.");
} // }
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
break; break;
@@ -356,6 +359,8 @@ public class CommandPost extends AbstractInstance
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
} }
break;
}
} }
return null; return null;
} }
@@ -366,27 +371,12 @@ public class CommandPost extends AbstractInstance
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (world != null) if (world != null)
{ {
npc.setInvul(false);
npc.setTargetable(true);
if (CommonUtil.contains(GROUP_1, npc.getId())) if (CommonUtil.contains(GROUP_1, npc.getId()))
{ {
npc.setInvul(false);
npc.setTargetable(true);
world.setStatus(4); world.setStatus(4);
} }
else if (CommonUtil.contains(GROUP_2, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_3, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_4, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
} }
super.onMoveFinished(npc); super.onMoveFinished(npc);
} }
@@ -395,6 +385,8 @@ public class CommandPost extends AbstractInstance
public String onEnterZone(Creature creature, ZoneType zone) public String onEnterZone(Creature creature, ZoneType zone)
{ {
final Instance world = creature.getInstanceWorld(); final Instance world = creature.getInstanceWorld();
if (world != null)
{
switch (zone.getId()) switch (zone.getId())
{ {
case 25901: case 25901:
@@ -423,6 +415,7 @@ public class CommandPost extends AbstractInstance
break; break;
} }
} }
}
return super.onEnterZone(creature, zone); return super.onEnterZone(creature, zone);
} }

View File

@@ -132,7 +132,9 @@ public class CommandPost extends AbstractInstance
@Override @Override
public String onAdvEvent(String event, Npc npc, Player player) public String onAdvEvent(String event, Npc npc, Player player)
{ {
if (event.contains("enterInstance")) switch (event)
{
case "enterInstance":
{ {
final Party party = player.getParty(); final Party party = player.getParty();
if (player.isInParty()) if (player.isInParty())
@@ -187,8 +189,9 @@ public class CommandPost extends AbstractInstance
{ {
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
break;
} }
else if (event.equals("check_status")) case "check_status":
{ {
final Instance world = player.getInstanceWorld(); final Instance world = player.getInstanceWorld();
if (!isInInstance(world)) if (!isInInstance(world))
@@ -343,10 +346,10 @@ public class CommandPost extends AbstractInstance
} }
case 7: case 7:
{ {
if (world.getAliveNpcs(GROUP_4).isEmpty()) // if (world.getAliveNpcs(GROUP_4).isEmpty())
{ // {
System.out.println("Status is 7."); // System.out.println("Status is 7.");
} // }
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
break; break;
@@ -356,6 +359,8 @@ public class CommandPost extends AbstractInstance
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
} }
break;
}
} }
return null; return null;
} }
@@ -366,27 +371,12 @@ public class CommandPost extends AbstractInstance
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (world != null) if (world != null)
{ {
npc.setInvul(false);
npc.setTargetable(true);
if (CommonUtil.contains(GROUP_1, npc.getId())) if (CommonUtil.contains(GROUP_1, npc.getId()))
{ {
npc.setInvul(false);
npc.setTargetable(true);
world.setStatus(4); world.setStatus(4);
} }
else if (CommonUtil.contains(GROUP_2, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_3, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_4, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
} }
super.onMoveFinished(npc); super.onMoveFinished(npc);
} }
@@ -395,6 +385,8 @@ public class CommandPost extends AbstractInstance
public String onEnterZone(Creature creature, ZoneType zone) public String onEnterZone(Creature creature, ZoneType zone)
{ {
final Instance world = creature.getInstanceWorld(); final Instance world = creature.getInstanceWorld();
if (world != null)
{
switch (zone.getId()) switch (zone.getId())
{ {
case 25901: case 25901:
@@ -423,6 +415,7 @@ public class CommandPost extends AbstractInstance
break; break;
} }
} }
}
return super.onEnterZone(creature, zone); return super.onEnterZone(creature, zone);
} }

View File

@@ -132,7 +132,9 @@ public class CommandPost extends AbstractInstance
@Override @Override
public String onAdvEvent(String event, Npc npc, Player player) public String onAdvEvent(String event, Npc npc, Player player)
{ {
if (event.contains("enterInstance")) switch (event)
{
case "enterInstance":
{ {
final Party party = player.getParty(); final Party party = player.getParty();
if (player.isInParty()) if (player.isInParty())
@@ -187,8 +189,9 @@ public class CommandPost extends AbstractInstance
{ {
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
break;
} }
else if (event.equals("check_status")) case "check_status":
{ {
final Instance world = player.getInstanceWorld(); final Instance world = player.getInstanceWorld();
if (!isInInstance(world)) if (!isInInstance(world))
@@ -343,10 +346,10 @@ public class CommandPost extends AbstractInstance
} }
case 7: case 7:
{ {
if (world.getAliveNpcs(GROUP_4).isEmpty()) // if (world.getAliveNpcs(GROUP_4).isEmpty())
{ // {
System.out.println("Status is 7."); // System.out.println("Status is 7.");
} // }
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
break; break;
@@ -356,6 +359,8 @@ public class CommandPost extends AbstractInstance
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
} }
break;
}
} }
return null; return null;
} }
@@ -366,27 +371,12 @@ public class CommandPost extends AbstractInstance
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (world != null) if (world != null)
{ {
npc.setInvul(false);
npc.setTargetable(true);
if (CommonUtil.contains(GROUP_1, npc.getId())) if (CommonUtil.contains(GROUP_1, npc.getId()))
{ {
npc.setInvul(false);
npc.setTargetable(true);
world.setStatus(4); world.setStatus(4);
} }
else if (CommonUtil.contains(GROUP_2, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_3, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_4, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
} }
super.onMoveFinished(npc); super.onMoveFinished(npc);
} }
@@ -395,6 +385,8 @@ public class CommandPost extends AbstractInstance
public String onEnterZone(Creature creature, ZoneType zone) public String onEnterZone(Creature creature, ZoneType zone)
{ {
final Instance world = creature.getInstanceWorld(); final Instance world = creature.getInstanceWorld();
if (world != null)
{
switch (zone.getId()) switch (zone.getId())
{ {
case 25901: case 25901:
@@ -423,6 +415,7 @@ public class CommandPost extends AbstractInstance
break; break;
} }
} }
}
return super.onEnterZone(creature, zone); return super.onEnterZone(creature, zone);
} }

View File

@@ -132,7 +132,9 @@ public class CommandPost extends AbstractInstance
@Override @Override
public String onAdvEvent(String event, Npc npc, Player player) public String onAdvEvent(String event, Npc npc, Player player)
{ {
if (event.contains("enterInstance")) switch (event)
{
case "enterInstance":
{ {
final Party party = player.getParty(); final Party party = player.getParty();
if (player.isInParty()) if (player.isInParty())
@@ -187,8 +189,9 @@ public class CommandPost extends AbstractInstance
{ {
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
break;
} }
else if (event.equals("check_status")) case "check_status":
{ {
final Instance world = player.getInstanceWorld(); final Instance world = player.getInstanceWorld();
if (!isInInstance(world)) if (!isInInstance(world))
@@ -343,10 +346,10 @@ public class CommandPost extends AbstractInstance
} }
case 7: case 7:
{ {
if (world.getAliveNpcs(GROUP_4).isEmpty()) // if (world.getAliveNpcs(GROUP_4).isEmpty())
{ // {
System.out.println("Status is 7."); // System.out.println("Status is 7.");
} // }
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
break; break;
@@ -356,6 +359,8 @@ public class CommandPost extends AbstractInstance
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
} }
break;
}
} }
return null; return null;
} }
@@ -366,27 +371,12 @@ public class CommandPost extends AbstractInstance
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (world != null) if (world != null)
{ {
npc.setInvul(false);
npc.setTargetable(true);
if (CommonUtil.contains(GROUP_1, npc.getId())) if (CommonUtil.contains(GROUP_1, npc.getId()))
{ {
npc.setInvul(false);
npc.setTargetable(true);
world.setStatus(4); world.setStatus(4);
} }
else if (CommonUtil.contains(GROUP_2, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_3, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_4, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
} }
super.onMoveFinished(npc); super.onMoveFinished(npc);
} }
@@ -395,6 +385,8 @@ public class CommandPost extends AbstractInstance
public String onEnterZone(Creature creature, ZoneType zone) public String onEnterZone(Creature creature, ZoneType zone)
{ {
final Instance world = creature.getInstanceWorld(); final Instance world = creature.getInstanceWorld();
if (world != null)
{
switch (zone.getId()) switch (zone.getId())
{ {
case 25901: case 25901:
@@ -423,6 +415,7 @@ public class CommandPost extends AbstractInstance
break; break;
} }
} }
}
return super.onEnterZone(creature, zone); return super.onEnterZone(creature, zone);
} }

View File

@@ -132,7 +132,9 @@ public class CommandPost extends AbstractInstance
@Override @Override
public String onAdvEvent(String event, Npc npc, Player player) public String onAdvEvent(String event, Npc npc, Player player)
{ {
if (event.contains("enterInstance")) switch (event)
{
case "enterInstance":
{ {
final Party party = player.getParty(); final Party party = player.getParty();
if (player.isInParty()) if (player.isInParty())
@@ -187,8 +189,9 @@ public class CommandPost extends AbstractInstance
{ {
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
break;
} }
else if (event.equals("check_status")) case "check_status":
{ {
final Instance world = player.getInstanceWorld(); final Instance world = player.getInstanceWorld();
if (!isInInstance(world)) if (!isInInstance(world))
@@ -343,10 +346,10 @@ public class CommandPost extends AbstractInstance
} }
case 7: case 7:
{ {
if (world.getAliveNpcs(GROUP_4).isEmpty()) // if (world.getAliveNpcs(GROUP_4).isEmpty())
{ // {
System.out.println("Status is 7."); // System.out.println("Status is 7.");
} // }
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
break; break;
@@ -356,6 +359,8 @@ public class CommandPost extends AbstractInstance
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
} }
break;
}
} }
return null; return null;
} }
@@ -366,27 +371,12 @@ public class CommandPost extends AbstractInstance
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (world != null) if (world != null)
{ {
npc.setInvul(false);
npc.setTargetable(true);
if (CommonUtil.contains(GROUP_1, npc.getId())) if (CommonUtil.contains(GROUP_1, npc.getId()))
{ {
npc.setInvul(false);
npc.setTargetable(true);
world.setStatus(4); world.setStatus(4);
} }
else if (CommonUtil.contains(GROUP_2, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_3, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_4, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
} }
super.onMoveFinished(npc); super.onMoveFinished(npc);
} }
@@ -395,6 +385,8 @@ public class CommandPost extends AbstractInstance
public String onEnterZone(Creature creature, ZoneType zone) public String onEnterZone(Creature creature, ZoneType zone)
{ {
final Instance world = creature.getInstanceWorld(); final Instance world = creature.getInstanceWorld();
if (world != null)
{
switch (zone.getId()) switch (zone.getId())
{ {
case 25901: case 25901:
@@ -423,6 +415,7 @@ public class CommandPost extends AbstractInstance
break; break;
} }
} }
}
return super.onEnterZone(creature, zone); return super.onEnterZone(creature, zone);
} }

View File

@@ -132,7 +132,9 @@ public class CommandPost extends AbstractInstance
@Override @Override
public String onAdvEvent(String event, Npc npc, Player player) public String onAdvEvent(String event, Npc npc, Player player)
{ {
if (event.contains("enterInstance")) switch (event)
{
case "enterInstance":
{ {
final Party party = player.getParty(); final Party party = player.getParty();
if (player.isInParty()) if (player.isInParty())
@@ -187,8 +189,9 @@ public class CommandPost extends AbstractInstance
{ {
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
break;
} }
else if (event.equals("check_status")) case "check_status":
{ {
final Instance world = player.getInstanceWorld(); final Instance world = player.getInstanceWorld();
if (!isInInstance(world)) if (!isInInstance(world))
@@ -343,10 +346,10 @@ public class CommandPost extends AbstractInstance
} }
case 7: case 7:
{ {
if (world.getAliveNpcs(GROUP_4).isEmpty()) // if (world.getAliveNpcs(GROUP_4).isEmpty())
{ // {
System.out.println("Status is 7."); // System.out.println("Status is 7.");
} // }
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
break; break;
@@ -356,6 +359,8 @@ public class CommandPost extends AbstractInstance
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
} }
break;
}
} }
return null; return null;
} }
@@ -366,27 +371,12 @@ public class CommandPost extends AbstractInstance
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (world != null) if (world != null)
{ {
npc.setInvul(false);
npc.setTargetable(true);
if (CommonUtil.contains(GROUP_1, npc.getId())) if (CommonUtil.contains(GROUP_1, npc.getId()))
{ {
npc.setInvul(false);
npc.setTargetable(true);
world.setStatus(4); world.setStatus(4);
} }
else if (CommonUtil.contains(GROUP_2, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_3, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_4, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
} }
super.onMoveFinished(npc); super.onMoveFinished(npc);
} }
@@ -395,6 +385,8 @@ public class CommandPost extends AbstractInstance
public String onEnterZone(Creature creature, ZoneType zone) public String onEnterZone(Creature creature, ZoneType zone)
{ {
final Instance world = creature.getInstanceWorld(); final Instance world = creature.getInstanceWorld();
if (world != null)
{
switch (zone.getId()) switch (zone.getId())
{ {
case 25901: case 25901:
@@ -423,6 +415,7 @@ public class CommandPost extends AbstractInstance
break; break;
} }
} }
}
return super.onEnterZone(creature, zone); return super.onEnterZone(creature, zone);
} }

View File

@@ -132,7 +132,9 @@ public class CommandPost extends AbstractInstance
@Override @Override
public String onAdvEvent(String event, Npc npc, Player player) public String onAdvEvent(String event, Npc npc, Player player)
{ {
if (event.contains("enterInstance")) switch (event)
{
case "enterInstance":
{ {
final Party party = player.getParty(); final Party party = player.getParty();
if (player.isInParty()) if (player.isInParty())
@@ -187,8 +189,9 @@ public class CommandPost extends AbstractInstance
{ {
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
break;
} }
else if (event.equals("check_status")) case "check_status":
{ {
final Instance world = player.getInstanceWorld(); final Instance world = player.getInstanceWorld();
if (!isInInstance(world)) if (!isInInstance(world))
@@ -343,10 +346,10 @@ public class CommandPost extends AbstractInstance
} }
case 7: case 7:
{ {
if (world.getAliveNpcs(GROUP_4).isEmpty()) // if (world.getAliveNpcs(GROUP_4).isEmpty())
{ // {
System.out.println("Status is 7."); // System.out.println("Status is 7.");
} // }
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
break; break;
@@ -356,6 +359,8 @@ public class CommandPost extends AbstractInstance
startQuestTimer("check_status", 3000, null, player); startQuestTimer("check_status", 3000, null, player);
} }
} }
break;
}
} }
return null; return null;
} }
@@ -366,27 +371,12 @@ public class CommandPost extends AbstractInstance
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (world != null) if (world != null)
{ {
npc.setInvul(false);
npc.setTargetable(true);
if (CommonUtil.contains(GROUP_1, npc.getId())) if (CommonUtil.contains(GROUP_1, npc.getId()))
{ {
npc.setInvul(false);
npc.setTargetable(true);
world.setStatus(4); world.setStatus(4);
} }
else if (CommonUtil.contains(GROUP_2, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_3, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
else if (CommonUtil.contains(GROUP_4, npc.getId()))
{
npc.setInvul(false);
npc.setTargetable(true);
}
} }
super.onMoveFinished(npc); super.onMoveFinished(npc);
} }
@@ -395,6 +385,8 @@ public class CommandPost extends AbstractInstance
public String onEnterZone(Creature creature, ZoneType zone) public String onEnterZone(Creature creature, ZoneType zone)
{ {
final Instance world = creature.getInstanceWorld(); final Instance world = creature.getInstanceWorld();
if (world != null)
{
switch (zone.getId()) switch (zone.getId())
{ {
case 25901: case 25901:
@@ -423,6 +415,7 @@ public class CommandPost extends AbstractInstance
break; break;
} }
} }
}
return super.onEnterZone(creature, zone); return super.onEnterZone(creature, zone);
} }