Instance related adjustments.

This commit is contained in:
MobiusDevelopment
2020-02-26 10:56:19 +00:00
parent 740acfdbd8
commit a6fc6eb2cd
81 changed files with 7566 additions and 6403 deletions

View File

@@ -100,8 +100,8 @@ public class ScarletVanHalisha extends AbstractNpcAI
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
cancelQuestTimers("attack");
cancelQuestTimers("random_Target");
cancelQuestTimer("attack", npc, null);
cancelQuestTimer("random_Target", npc, null);
return super.onKill(npc, killer, isSummon);
}

View File

@@ -171,7 +171,7 @@ public class OctavisWarzone extends AbstractInstance
{
world.openCloseDoor(MAIN_DOOR_2, false);
world.openCloseDoor(MAIN_DOOR_1, false);
world.getParameters().set("TELEPORT_ACTIVE", true);
world.setParameter("TELEPORT_ACTIVE", true);
npc.teleToLocation(BATTLE_LOC);
playMovie(world, Movie.SC_OCTABIS_OPENING);
getTimers().addTimer("START_STAGE_1", 26500, npc, null);

View File

@@ -251,7 +251,7 @@ public class AltarOfShilen extends AbstractInstance
world.setStatus(7);
onStatusChanged(world);
npc.deleteMe();
cancelQuestTimers("check_player");
cancelQuestTimer("check_player", npc, null);
}
break;
}

View File

@@ -73,321 +73,373 @@ public class ChamberOfProphecies extends AbstractInstance
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
if (event.equals("enterInstance"))
switch (event)
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
htmltext = event;
break;
}
}
else if (player != null)
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
case "33996-02.html":
{
return null;
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
switch (event)
case "33980-03.html":
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
htmltext = event;
break;
return null;
}
case "33996-02.html":
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "enterInstance":
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-03.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "status":
{
if (world.isStatus(0))
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
htmltext = "31639-01.html";
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
}
break;
}
case "teleport":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimer("CHECK_STATUS", npc, player);
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "status":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
if (world.isStatus(0))
{
htmltext = "31639-01.html";
break;
}
htmltext = "31639-02.html";
break;
}
case "CHECK_STATUS":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
case 1:
{
case 0:
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 1:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 2:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
case 2:
{
npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
addAttackDesire(npc, monster);
return;
});
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
}
break;
}
case "OPEN_DOOR1":
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
return null;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
if (npc.getId() == FERIN)
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
break;
addAttackDesire(npc, monster);
return;
});
}
case "SEY_KAIN":
break;
}
case "OPEN_DOOR1":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == VAN_HALTER)
{
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY3":
cancelQuestTimer("ATTACK", npc, player);
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY_KAIN_1":
cancelQuestTimer("ATTACK1", npc, player);
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_2":
break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
break;
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
case "SEY4":
break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_3":
break;
}
case "SEY_KAIN_1":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
case "REST":
break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == FERIN)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
case "SEY_KAIN_4":
break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
case "CLOSE":
break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
case "DESPAWN_WIZARD":
break;
}
case "REST":
{
if (npc.getId() == FERIN)
{
world.despawnGroup("q10753_16_instance_wizard");
break;
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimer("BROADCAST_TEXT", npc, player);
}
case "exit":
break;
}
case "SEY_KAIN_4":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt((int) 1.0D));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
return null;
}
case "finish":
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimer("ATTACK2", npc, player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
}
case "CLOSE":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
world.finishInstance(0);
break;
return null;
}
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
}
case "DESPAWN_WIZARD":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt(1));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
}
case "finish":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.finishInstance(0);
break;
}
}
return htmltext;

View File

@@ -34,7 +34,7 @@ import instances.AbstractInstance;
* Nornils Garden Instance
* @URL https://l2wiki.com/Nornils_Garden
* @Video https://www.youtube.com/watch?v=6QKzzmJ5GUs
* @author Gigi
* @author Gigi, Mobius
* @date 2017-02-22 - [15:22:27]
*/
public class NornilsGarden extends AbstractInstance
@@ -120,7 +120,7 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(5) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200016, true);
cancelQuestTimers("stage2");
cancelQuestTimer("stage2", npc, null);
world.spawnGroup("wave_3");
}
break;
@@ -130,14 +130,13 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(6) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200201, true);
cancelQuestTimers("stage3");
cancelQuestTimers("check_agrro");
cancelQuestTimer("stage3", npc, null);
}
break;
}
case "check_agrro":
{
if ((world != null) && !npc.isDead() && !npc.isInCombat())
if ((world != null) && !npc.isDead() && !npc.isInCombat() && !world.getDoor(16200201).isOpen())
{
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, knownChar ->
{
@@ -148,6 +147,7 @@ public class NornilsGarden extends AbstractInstance
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, knownChar);
}
});
startQuestTimer("check_agrro", 1000, npc, null);
}
break;
}
@@ -209,7 +209,7 @@ public class NornilsGarden extends AbstractInstance
{
if (npc.getId() == BOZ_STAGE1)
{
cancelQuestTimers("stage1_1");
cancelQuestTimer("stage1_1", npc, null);
world.openCloseDoor(16200015, true);
world.setStatus(1);
}
@@ -301,7 +301,7 @@ public class NornilsGarden extends AbstractInstance
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
{
((Attackable) npc).setCanReturnToSpawnPoint(false);
startQuestTimer("check_agrro", 1000, npc, null, true);
startQuestTimer("check_agrro", 1000, npc, null);
}
return super.onSpawn(npc);
}

View File

@@ -100,8 +100,8 @@ public class ScarletVanHalisha extends AbstractNpcAI
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
cancelQuestTimers("attack");
cancelQuestTimers("random_Target");
cancelQuestTimer("attack", npc, null);
cancelQuestTimer("random_Target", npc, null);
return super.onKill(npc, killer, isSummon);
}

View File

@@ -171,7 +171,7 @@ public class OctavisWarzone extends AbstractInstance
{
world.openCloseDoor(MAIN_DOOR_2, false);
world.openCloseDoor(MAIN_DOOR_1, false);
world.getParameters().set("TELEPORT_ACTIVE", true);
world.setParameter("TELEPORT_ACTIVE", true);
npc.teleToLocation(BATTLE_LOC);
playMovie(world, Movie.SC_OCTABIS_OPENING);
getTimers().addTimer("START_STAGE_1", 26500, npc, null);

View File

@@ -251,7 +251,7 @@ public class AltarOfShilen extends AbstractInstance
world.setStatus(7);
onStatusChanged(world);
npc.deleteMe();
cancelQuestTimers("check_player");
cancelQuestTimer("check_player", npc, null);
}
break;
}

View File

@@ -192,7 +192,7 @@ public class AshenShadowRevolutionaries extends AbstractInstance
}
if (questGiver.getId() == 34097) // Adonius
{
world.getParameters().set("CAPTIVES", world.spawnGroup("captives"));
world.setParameter("CAPTIVES", world.spawnGroup("captives"));
for (Npc captive : world.getParameters().getList("CAPTIVES", Npc.class))
{
captive.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FLESH_STONE);

View File

@@ -73,321 +73,373 @@ public class ChamberOfProphecies extends AbstractInstance
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
if (event.equals("enterInstance"))
switch (event)
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
htmltext = event;
break;
}
}
else if (player != null)
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
case "33996-02.html":
{
return null;
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
switch (event)
case "33980-03.html":
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
htmltext = event;
break;
return null;
}
case "33996-02.html":
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "enterInstance":
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-03.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "status":
{
if (world.isStatus(0))
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
htmltext = "31639-01.html";
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
}
break;
}
case "teleport":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimer("CHECK_STATUS", npc, player);
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "status":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
if (world.isStatus(0))
{
htmltext = "31639-01.html";
break;
}
htmltext = "31639-02.html";
break;
}
case "CHECK_STATUS":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
case 1:
{
case 0:
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 1:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 2:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
case 2:
{
npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
addAttackDesire(npc, monster);
return;
});
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
}
break;
}
case "OPEN_DOOR1":
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
return null;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
if (npc.getId() == FERIN)
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
break;
addAttackDesire(npc, monster);
return;
});
}
case "SEY_KAIN":
break;
}
case "OPEN_DOOR1":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == VAN_HALTER)
{
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY3":
cancelQuestTimer("ATTACK", npc, player);
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY_KAIN_1":
cancelQuestTimer("ATTACK1", npc, player);
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_2":
break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
break;
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
case "SEY4":
break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_3":
break;
}
case "SEY_KAIN_1":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
case "REST":
break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == FERIN)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
case "SEY_KAIN_4":
break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
case "CLOSE":
break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
case "DESPAWN_WIZARD":
break;
}
case "REST":
{
if (npc.getId() == FERIN)
{
world.despawnGroup("q10753_16_instance_wizard");
break;
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimer("BROADCAST_TEXT", npc, player);
}
case "exit":
break;
}
case "SEY_KAIN_4":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt((int) 1.0D));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
return null;
}
case "finish":
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimer("ATTACK2", npc, player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
}
case "CLOSE":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
world.finishInstance(0);
break;
return null;
}
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
}
case "DESPAWN_WIZARD":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt(1));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
}
case "finish":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.finishInstance(0);
break;
}
}
return htmltext;

View File

@@ -55,7 +55,7 @@ import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti;
/**
* Mystic Tavern Tauti Instance
* @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk
* @author Gigi
* @author Gigi, Mobius
*/
public class StoryOfTauti extends AbstractInstance
{
@@ -93,14 +93,13 @@ public class StoryOfTauti extends AbstractInstance
private static final Location TELEPORT = new Location(153267, -148441, -11560);
private static final int ZONE_1ST_TRIGER = 24137770;
private static final int SKILL_TRIGER = 24138880;
private static Npc _deton;
private static Npc _seal_device;
protected int _count = 0;
public StoryOfTauti()
{
super(TEMPLATE_ID);
addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addSpawnId(FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL);
addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL);
addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE);
@@ -142,9 +141,9 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(1) || world.isStatus(4))
{
_deton.setTarget(player);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
world.getNpc(DETON).setTarget(player);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
@@ -155,64 +154,64 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_status":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()))
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
startQuestTimer("msg_1", 7000, _deton, null);
startQuestTimer("msg_1", 7000, world.getNpc(DETON), null);
break;
}
case "msg_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, world.getNpc(DETON), null);
break;
}
case "msg_2":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, world.getNpc(DETON), null);
break;
}
case "msg_3":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
break;
}
case "msg_4":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, world.getNpc(DETON), null);
break;
}
case "msg_5":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, world.getNpc(DETON), null);
break;
}
case "msg_6":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
break;
}
case "spawn_stacato":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_1", 50000, _deton, null);
startQuestTimer("spawn_stacato_1", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_1":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_2", 50000, _deton, null);
startQuestTimer("spawn_stacato_2", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_2":
@@ -223,13 +222,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_flower":
{
if (!npc.isDead())
if ((world != null) && !npc.isDead())
{
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000))
{
if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0))
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, nearby.getLocation(), 23);
if (npc.calculateDistance3D(nearby) < 100)
{
@@ -245,6 +244,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
}
startQuestTimer("check_flower", 3000, npc, null);
}
break;
}
@@ -255,13 +255,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_7":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
break;
}
case "spawn_scorpion":
{
world.spawnGroup("flame_scorpion");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
if (getRandom(10) < 5)
{
world.spawnGroup("ifrit");
@@ -275,7 +275,7 @@ public class StoryOfTauti extends AbstractInstance
{
if ((pl != null) && !pl.isDead())
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23);
addAttackPlayerDesire(npc, pl);
}
@@ -288,36 +288,36 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_8":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, world.getNpc(DETON), null);
break;
}
case "msg_9":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, world.getNpc(DETON), null);
break;
}
case "msg_10":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
break;
}
case "spawn_golem":
{
world.spawnGroup("golem");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away", 10000, _deton, null);
startQuestTimer("run_away", 10000, world.getNpc(DETON), null);
break;
}
case "run_away":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, world.getNpc(DETON), null);
break;
}
case "delete_daton":
@@ -328,35 +328,35 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_11":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
break;
}
case "msg_12":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, world.getNpc(DETON), null);
break;
}
case "msg_13":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
break;
}
case "spawn_scarab":
{
world.spawnGroup("flame_scarab");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away_1", 8000, _deton, null);
startQuestTimer("run_away_1", 8000, world.getNpc(DETON), null);
break;
}
case "run_away_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, world.getNpc(DETON), null);
break;
}
case "switch_quest":
@@ -496,7 +496,6 @@ public class StoryOfTauti extends AbstractInstance
}
case "end_instance":
{
cancelQuestTimers("check_flower");
_count = 0;
for (Npc n : world.getAliveNpcs())
{
@@ -521,14 +520,14 @@ public class StoryOfTauti extends AbstractInstance
{
if (npc.isScriptValue(0))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
npc.setScriptValue(1);
break;
}
if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60))
{
_seal_device.setDisplayEffect(1);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
npc.setScriptValue(2);
break;
}
@@ -569,10 +568,10 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30))
{
world.spawnGroup("last_deton");
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, _deton, null);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, world.getNpc(DETON), null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.setStatus(11);
}
if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5))
@@ -603,7 +602,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
});
startQuestTimer("end_instance", 52000, _deton, null);
startQuestTimer("end_instance", 52000, world.getNpc(DETON), null);
world.despawnGroup("last_deton");
world.despawnGroup("last_archagel");
playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE);
@@ -627,21 +626,20 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
cancelQuestTimers("end_instance");
cancelQuestTimers("check_flower");
cancelQuestTimer("end_instance", world.getNpc(DETON), null);
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME)));
world.setStatus(4);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, world.getNpc(DETON), null);
}
break;
}
@@ -650,7 +648,7 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("msg_8", 3000, _deton, null);
startQuestTimer("msg_8", 3000, world.getNpc(DETON), null);
world.setStatus(6);
}
break;
@@ -660,9 +658,9 @@ public class StoryOfTauti extends AbstractInstance
_seal_device.setDisplayEffect(3);
_seal_device.doDie(npc);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, _deton, null);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, world.getNpc(DETON), null);
break;
}
case SEALED_ANGEL:
@@ -690,13 +688,13 @@ public class StoryOfTauti extends AbstractInstance
if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1))
{
world.setStatus(2);
_deton.setTarget(null);
_deton.stopMove(null);
startQuestTimer("msg_4", 7000, _deton, null);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
startQuestTimer("msg_4", 7000, world.getNpc(DETON), null);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME)));
startQuestTimer("end_instance", 190000, _deton, null);
startQuestTimer("spawn_stacato", 5000, _deton, null);
startQuestTimer("end_instance", 190000, world.getNpc(DETON), null);
startQuestTimer("spawn_stacato", 5000, world.getNpc(DETON), null);
}
break;
}
@@ -704,7 +702,7 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(0))
{
startQuestTimer("check_status", 21000, _deton, player);
startQuestTimer("check_status", 21000, world.getNpc(DETON), player);
world.setStatus(1);
}
break;
@@ -714,8 +712,8 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(4))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, world.getNpc(DETON), player);
world.setStatus(5);
}
break;
@@ -724,8 +722,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -753,8 +751,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -773,11 +771,6 @@ public class StoryOfTauti extends AbstractInstance
{
switch (npc.getId())
{
case DETON:
{
_deton = npc;
break;
}
case SEAL_DEVICE:
{
_seal_device = npc;
@@ -798,7 +791,7 @@ public class StoryOfTauti extends AbstractInstance
}
case FLAME_STACATO:
{
startQuestTimer("check_flower", 3000, npc, null, true);
startQuestTimer("check_flower", 3000, npc, null);
break;
}
case FLAME_SCORPION:

View File

@@ -34,7 +34,7 @@ import instances.AbstractInstance;
* Nornils Garden Instance
* @URL https://l2wiki.com/Nornils_Garden
* @Video https://www.youtube.com/watch?v=6QKzzmJ5GUs
* @author Gigi
* @author Gigi, Mobius
* @date 2017-02-22 - [15:22:27]
*/
public class NornilsGarden extends AbstractInstance
@@ -120,7 +120,7 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(5) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200016, true);
cancelQuestTimers("stage2");
cancelQuestTimer("stage2", npc, null);
world.spawnGroup("wave_3");
}
break;
@@ -130,14 +130,13 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(6) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200201, true);
cancelQuestTimers("stage3");
cancelQuestTimers("check_agrro");
cancelQuestTimer("stage3", npc, null);
}
break;
}
case "check_agrro":
{
if ((world != null) && !npc.isDead() && !npc.isInCombat())
if ((world != null) && !npc.isDead() && !npc.isInCombat() && !world.getDoor(16200201).isOpen())
{
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, knownChar ->
{
@@ -148,6 +147,7 @@ public class NornilsGarden extends AbstractInstance
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, knownChar);
}
});
startQuestTimer("check_agrro", 1000, npc, null);
}
break;
}
@@ -209,7 +209,7 @@ public class NornilsGarden extends AbstractInstance
{
if (npc.getId() == BOZ_STAGE1)
{
cancelQuestTimers("stage1_1");
cancelQuestTimer("stage1_1", npc, null);
world.openCloseDoor(16200015, true);
world.setStatus(1);
}
@@ -301,7 +301,7 @@ public class NornilsGarden extends AbstractInstance
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
{
((Attackable) npc).setCanReturnToSpawnPoint(false);
startQuestTimer("check_agrro", 1000, npc, null, true);
startQuestTimer("check_agrro", 1000, npc, null);
}
return super.onSpawn(npc);
}

View File

@@ -100,8 +100,8 @@ public class ScarletVanHalisha extends AbstractNpcAI
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
cancelQuestTimers("attack");
cancelQuestTimers("random_Target");
cancelQuestTimer("attack", npc, null);
cancelQuestTimer("random_Target", npc, null);
return super.onKill(npc, killer, isSummon);
}

View File

@@ -171,7 +171,7 @@ public class OctavisWarzone extends AbstractInstance
{
world.openCloseDoor(MAIN_DOOR_2, false);
world.openCloseDoor(MAIN_DOOR_1, false);
world.getParameters().set("TELEPORT_ACTIVE", true);
world.setParameter("TELEPORT_ACTIVE", true);
npc.teleToLocation(BATTLE_LOC);
playMovie(world, Movie.SC_OCTABIS_OPENING);
getTimers().addTimer("START_STAGE_1", 26500, npc, null);

View File

@@ -251,7 +251,7 @@ public class AltarOfShilen extends AbstractInstance
world.setStatus(7);
onStatusChanged(world);
npc.deleteMe();
cancelQuestTimers("check_player");
cancelQuestTimer("check_player", npc, null);
}
break;
}

View File

@@ -192,7 +192,7 @@ public class AshenShadowRevolutionaries extends AbstractInstance
}
if (questGiver.getId() == 34097) // Adonius
{
world.getParameters().set("CAPTIVES", world.spawnGroup("captives"));
world.setParameter("CAPTIVES", world.spawnGroup("captives"));
for (Npc captive : world.getParameters().getList("CAPTIVES", Npc.class))
{
captive.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FLESH_STONE);

View File

@@ -73,321 +73,373 @@ public class ChamberOfProphecies extends AbstractInstance
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
if (event.equals("enterInstance"))
switch (event)
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
htmltext = event;
break;
}
}
else if (player != null)
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
case "33996-02.html":
{
return null;
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
switch (event)
case "33980-03.html":
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
htmltext = event;
break;
return null;
}
case "33996-02.html":
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "enterInstance":
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-03.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "status":
{
if (world.isStatus(0))
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
htmltext = "31639-01.html";
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
}
break;
}
case "teleport":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimer("CHECK_STATUS", npc, player);
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "status":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
if (world.isStatus(0))
{
htmltext = "31639-01.html";
break;
}
htmltext = "31639-02.html";
break;
}
case "CHECK_STATUS":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
case 1:
{
case 0:
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 1:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 2:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
case 2:
{
npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
addAttackDesire(npc, monster);
return;
});
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
}
break;
}
case "OPEN_DOOR1":
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
return null;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
if (npc.getId() == FERIN)
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
break;
addAttackDesire(npc, monster);
return;
});
}
case "SEY_KAIN":
break;
}
case "OPEN_DOOR1":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == VAN_HALTER)
{
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY3":
cancelQuestTimer("ATTACK", npc, player);
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY_KAIN_1":
cancelQuestTimer("ATTACK1", npc, player);
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_2":
break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
break;
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
case "SEY4":
break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_3":
break;
}
case "SEY_KAIN_1":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
case "REST":
break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == FERIN)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
case "SEY_KAIN_4":
break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
case "CLOSE":
break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
case "DESPAWN_WIZARD":
break;
}
case "REST":
{
if (npc.getId() == FERIN)
{
world.despawnGroup("q10753_16_instance_wizard");
break;
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimer("BROADCAST_TEXT", npc, player);
}
case "exit":
break;
}
case "SEY_KAIN_4":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt((int) 1.0D));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
return null;
}
case "finish":
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimer("ATTACK2", npc, player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
}
case "CLOSE":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
world.finishInstance(0);
break;
return null;
}
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
}
case "DESPAWN_WIZARD":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt(1));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
}
case "finish":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.finishInstance(0);
break;
}
}
return htmltext;

View File

@@ -55,7 +55,7 @@ import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti;
/**
* Mystic Tavern Tauti Instance
* @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk
* @author Gigi
* @author Gigi, Mobius
*/
public class StoryOfTauti extends AbstractInstance
{
@@ -93,14 +93,13 @@ public class StoryOfTauti extends AbstractInstance
private static final Location TELEPORT = new Location(153267, -148441, -11560);
private static final int ZONE_1ST_TRIGER = 24137770;
private static final int SKILL_TRIGER = 24138880;
private static Npc _deton;
private static Npc _seal_device;
protected int _count = 0;
public StoryOfTauti()
{
super(TEMPLATE_ID);
addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addSpawnId(FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL);
addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL);
addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE);
@@ -142,9 +141,9 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(1) || world.isStatus(4))
{
_deton.setTarget(player);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
world.getNpc(DETON).setTarget(player);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
@@ -155,64 +154,64 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_status":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()))
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
startQuestTimer("msg_1", 7000, _deton, null);
startQuestTimer("msg_1", 7000, world.getNpc(DETON), null);
break;
}
case "msg_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, world.getNpc(DETON), null);
break;
}
case "msg_2":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, world.getNpc(DETON), null);
break;
}
case "msg_3":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
break;
}
case "msg_4":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, world.getNpc(DETON), null);
break;
}
case "msg_5":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, world.getNpc(DETON), null);
break;
}
case "msg_6":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
break;
}
case "spawn_stacato":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_1", 50000, _deton, null);
startQuestTimer("spawn_stacato_1", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_1":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_2", 50000, _deton, null);
startQuestTimer("spawn_stacato_2", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_2":
@@ -223,13 +222,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_flower":
{
if (!npc.isDead())
if ((world != null) && !npc.isDead())
{
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000))
{
if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0))
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, nearby.getLocation(), 23);
if (npc.calculateDistance3D(nearby) < 100)
{
@@ -245,6 +244,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
}
startQuestTimer("check_flower", 3000, npc, null);
}
break;
}
@@ -255,13 +255,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_7":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
break;
}
case "spawn_scorpion":
{
world.spawnGroup("flame_scorpion");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
if (getRandom(10) < 5)
{
world.spawnGroup("ifrit");
@@ -275,7 +275,7 @@ public class StoryOfTauti extends AbstractInstance
{
if ((pl != null) && !pl.isDead())
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23);
addAttackPlayerDesire(npc, pl);
}
@@ -288,36 +288,36 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_8":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, world.getNpc(DETON), null);
break;
}
case "msg_9":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, world.getNpc(DETON), null);
break;
}
case "msg_10":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
break;
}
case "spawn_golem":
{
world.spawnGroup("golem");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away", 10000, _deton, null);
startQuestTimer("run_away", 10000, world.getNpc(DETON), null);
break;
}
case "run_away":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, world.getNpc(DETON), null);
break;
}
case "delete_daton":
@@ -328,35 +328,35 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_11":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
break;
}
case "msg_12":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, world.getNpc(DETON), null);
break;
}
case "msg_13":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
break;
}
case "spawn_scarab":
{
world.spawnGroup("flame_scarab");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away_1", 8000, _deton, null);
startQuestTimer("run_away_1", 8000, world.getNpc(DETON), null);
break;
}
case "run_away_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, world.getNpc(DETON), null);
break;
}
case "switch_quest":
@@ -496,7 +496,6 @@ public class StoryOfTauti extends AbstractInstance
}
case "end_instance":
{
cancelQuestTimers("check_flower");
_count = 0;
for (Npc n : world.getAliveNpcs())
{
@@ -521,14 +520,14 @@ public class StoryOfTauti extends AbstractInstance
{
if (npc.isScriptValue(0))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
npc.setScriptValue(1);
break;
}
if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60))
{
_seal_device.setDisplayEffect(1);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
npc.setScriptValue(2);
break;
}
@@ -569,10 +568,10 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30))
{
world.spawnGroup("last_deton");
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, _deton, null);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, world.getNpc(DETON), null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.setStatus(11);
}
if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5))
@@ -603,7 +602,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
});
startQuestTimer("end_instance", 52000, _deton, null);
startQuestTimer("end_instance", 52000, world.getNpc(DETON), null);
world.despawnGroup("last_deton");
world.despawnGroup("last_archagel");
playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE);
@@ -627,21 +626,20 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
cancelQuestTimers("end_instance");
cancelQuestTimers("check_flower");
cancelQuestTimer("end_instance", world.getNpc(DETON), null);
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME)));
world.setStatus(4);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, world.getNpc(DETON), null);
}
break;
}
@@ -650,7 +648,7 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("msg_8", 3000, _deton, null);
startQuestTimer("msg_8", 3000, world.getNpc(DETON), null);
world.setStatus(6);
}
break;
@@ -660,9 +658,9 @@ public class StoryOfTauti extends AbstractInstance
_seal_device.setDisplayEffect(3);
_seal_device.doDie(npc);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, _deton, null);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, world.getNpc(DETON), null);
break;
}
case SEALED_ANGEL:
@@ -690,13 +688,13 @@ public class StoryOfTauti extends AbstractInstance
if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1))
{
world.setStatus(2);
_deton.setTarget(null);
_deton.stopMove(null);
startQuestTimer("msg_4", 7000, _deton, null);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
startQuestTimer("msg_4", 7000, world.getNpc(DETON), null);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME)));
startQuestTimer("end_instance", 190000, _deton, null);
startQuestTimer("spawn_stacato", 5000, _deton, null);
startQuestTimer("end_instance", 190000, world.getNpc(DETON), null);
startQuestTimer("spawn_stacato", 5000, world.getNpc(DETON), null);
}
break;
}
@@ -704,7 +702,7 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(0))
{
startQuestTimer("check_status", 21000, _deton, player);
startQuestTimer("check_status", 21000, world.getNpc(DETON), player);
world.setStatus(1);
}
break;
@@ -714,8 +712,8 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(4))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, world.getNpc(DETON), player);
world.setStatus(5);
}
break;
@@ -724,8 +722,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -753,8 +751,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -773,11 +771,6 @@ public class StoryOfTauti extends AbstractInstance
{
switch (npc.getId())
{
case DETON:
{
_deton = npc;
break;
}
case SEAL_DEVICE:
{
_seal_device = npc;
@@ -798,7 +791,7 @@ public class StoryOfTauti extends AbstractInstance
}
case FLAME_STACATO:
{
startQuestTimer("check_flower", 3000, npc, null, true);
startQuestTimer("check_flower", 3000, npc, null);
break;
}
case FLAME_SCORPION:

View File

@@ -34,7 +34,7 @@ import instances.AbstractInstance;
* Nornils Garden Instance
* @URL https://l2wiki.com/Nornils_Garden
* @Video https://www.youtube.com/watch?v=6QKzzmJ5GUs
* @author Gigi
* @author Gigi, Mobius
* @date 2017-02-22 - [15:22:27]
*/
public class NornilsGarden extends AbstractInstance
@@ -120,7 +120,7 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(5) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200016, true);
cancelQuestTimers("stage2");
cancelQuestTimer("stage2", npc, null);
world.spawnGroup("wave_3");
}
break;
@@ -130,14 +130,13 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(6) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200201, true);
cancelQuestTimers("stage3");
cancelQuestTimers("check_agrro");
cancelQuestTimer("stage3", npc, null);
}
break;
}
case "check_agrro":
{
if ((world != null) && !npc.isDead() && !npc.isInCombat())
if ((world != null) && !npc.isDead() && !npc.isInCombat() && !world.getDoor(16200201).isOpen())
{
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, knownChar ->
{
@@ -148,6 +147,7 @@ public class NornilsGarden extends AbstractInstance
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, knownChar);
}
});
startQuestTimer("check_agrro", 1000, npc, null);
}
break;
}
@@ -209,7 +209,7 @@ public class NornilsGarden extends AbstractInstance
{
if (npc.getId() == BOZ_STAGE1)
{
cancelQuestTimers("stage1_1");
cancelQuestTimer("stage1_1", npc, null);
world.openCloseDoor(16200015, true);
world.setStatus(1);
}
@@ -301,7 +301,7 @@ public class NornilsGarden extends AbstractInstance
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
{
((Attackable) npc).setCanReturnToSpawnPoint(false);
startQuestTimer("check_agrro", 1000, npc, null, true);
startQuestTimer("check_agrro", 1000, npc, null);
}
return super.onSpawn(npc);
}

View File

@@ -100,8 +100,8 @@ public class ScarletVanHalisha extends AbstractNpcAI
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
cancelQuestTimers("attack");
cancelQuestTimers("random_Target");
cancelQuestTimer("attack", npc, null);
cancelQuestTimer("random_Target", npc, null);
return super.onKill(npc, killer, isSummon);
}

View File

@@ -171,7 +171,7 @@ public class OctavisWarzone extends AbstractInstance
{
world.openCloseDoor(MAIN_DOOR_2, false);
world.openCloseDoor(MAIN_DOOR_1, false);
world.getParameters().set("TELEPORT_ACTIVE", true);
world.setParameter("TELEPORT_ACTIVE", true);
npc.teleToLocation(BATTLE_LOC);
playMovie(world, Movie.SC_OCTABIS_OPENING);
getTimers().addTimer("START_STAGE_1", 26500, npc, null);

View File

@@ -252,7 +252,7 @@ public class AltarOfShilen extends AbstractInstance
world.setStatus(7);
onStatusChanged(world);
npc.deleteMe();
cancelQuestTimers("check_player");
cancelQuestTimer("check_player", npc, null);
}
break;
}

View File

@@ -192,7 +192,7 @@ public class AshenShadowRevolutionaries extends AbstractInstance
}
if (questGiver.getId() == 34097) // Adonius
{
world.getParameters().set("CAPTIVES", world.spawnGroup("captives"));
world.setParameter("CAPTIVES", world.spawnGroup("captives"));
for (Npc captive : world.getParameters().getList("CAPTIVES", Npc.class))
{
captive.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FLESH_STONE);

View File

@@ -73,321 +73,373 @@ public class ChamberOfProphecies extends AbstractInstance
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
if (event.equals("enterInstance"))
switch (event)
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
htmltext = event;
break;
}
}
else if (player != null)
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
case "33996-02.html":
{
return null;
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
switch (event)
case "33980-03.html":
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
htmltext = event;
break;
return null;
}
case "33996-02.html":
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "enterInstance":
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-03.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "status":
{
if (world.isStatus(0))
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
htmltext = "31639-01.html";
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
}
break;
}
case "teleport":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimer("CHECK_STATUS", npc, player);
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "status":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
if (world.isStatus(0))
{
htmltext = "31639-01.html";
break;
}
htmltext = "31639-02.html";
break;
}
case "CHECK_STATUS":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
case 1:
{
case 0:
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 1:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 2:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
case 2:
{
npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
addAttackDesire(npc, monster);
return;
});
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
}
break;
}
case "OPEN_DOOR1":
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
return null;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
if (npc.getId() == FERIN)
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
break;
addAttackDesire(npc, monster);
return;
});
}
case "SEY_KAIN":
break;
}
case "OPEN_DOOR1":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == VAN_HALTER)
{
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY3":
cancelQuestTimer("ATTACK", npc, player);
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY_KAIN_1":
cancelQuestTimer("ATTACK1", npc, player);
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_2":
break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
break;
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
case "SEY4":
break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_3":
break;
}
case "SEY_KAIN_1":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
case "REST":
break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == FERIN)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
case "SEY_KAIN_4":
break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
case "CLOSE":
break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
case "DESPAWN_WIZARD":
break;
}
case "REST":
{
if (npc.getId() == FERIN)
{
world.despawnGroup("q10753_16_instance_wizard");
break;
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimer("BROADCAST_TEXT", npc, player);
}
case "exit":
break;
}
case "SEY_KAIN_4":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt((int) 1.0D));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
return null;
}
case "finish":
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimer("ATTACK2", npc, player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
}
case "CLOSE":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
world.finishInstance(0);
break;
return null;
}
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
}
case "DESPAWN_WIZARD":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt(1));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
}
case "finish":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.finishInstance(0);
break;
}
}
return htmltext;

View File

@@ -55,7 +55,7 @@ import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti;
/**
* Mystic Tavern Tauti Instance
* @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk
* @author Gigi
* @author Gigi, Mobius
*/
public class StoryOfTauti extends AbstractInstance
{
@@ -93,14 +93,13 @@ public class StoryOfTauti extends AbstractInstance
private static final Location TELEPORT = new Location(153267, -148441, -11560);
private static final int ZONE_1ST_TRIGER = 24137770;
private static final int SKILL_TRIGER = 24138880;
private static Npc _deton;
private static Npc _seal_device;
protected int _count = 0;
public StoryOfTauti()
{
super(TEMPLATE_ID);
addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addSpawnId(FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL);
addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL);
addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE);
@@ -142,9 +141,9 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(1) || world.isStatus(4))
{
_deton.setTarget(player);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
world.getNpc(DETON).setTarget(player);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
@@ -155,64 +154,64 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_status":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()))
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
startQuestTimer("msg_1", 7000, _deton, null);
startQuestTimer("msg_1", 7000, world.getNpc(DETON), null);
break;
}
case "msg_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, world.getNpc(DETON), null);
break;
}
case "msg_2":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, world.getNpc(DETON), null);
break;
}
case "msg_3":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
break;
}
case "msg_4":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, world.getNpc(DETON), null);
break;
}
case "msg_5":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, world.getNpc(DETON), null);
break;
}
case "msg_6":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
break;
}
case "spawn_stacato":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_1", 50000, _deton, null);
startQuestTimer("spawn_stacato_1", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_1":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_2", 50000, _deton, null);
startQuestTimer("spawn_stacato_2", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_2":
@@ -223,13 +222,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_flower":
{
if (!npc.isDead())
if ((world != null) && !npc.isDead())
{
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000))
{
if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0))
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, nearby.getLocation(), 23);
if (npc.calculateDistance3D(nearby) < 100)
{
@@ -245,6 +244,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
}
startQuestTimer("check_flower", 3000, npc, null);
}
break;
}
@@ -255,13 +255,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_7":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
break;
}
case "spawn_scorpion":
{
world.spawnGroup("flame_scorpion");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
if (getRandom(10) < 5)
{
world.spawnGroup("ifrit");
@@ -275,7 +275,7 @@ public class StoryOfTauti extends AbstractInstance
{
if ((pl != null) && !pl.isDead())
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23);
addAttackPlayerDesire(npc, pl);
}
@@ -288,36 +288,36 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_8":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, world.getNpc(DETON), null);
break;
}
case "msg_9":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, world.getNpc(DETON), null);
break;
}
case "msg_10":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
break;
}
case "spawn_golem":
{
world.spawnGroup("golem");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away", 10000, _deton, null);
startQuestTimer("run_away", 10000, world.getNpc(DETON), null);
break;
}
case "run_away":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, world.getNpc(DETON), null);
break;
}
case "delete_daton":
@@ -328,35 +328,35 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_11":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
break;
}
case "msg_12":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, world.getNpc(DETON), null);
break;
}
case "msg_13":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
break;
}
case "spawn_scarab":
{
world.spawnGroup("flame_scarab");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away_1", 8000, _deton, null);
startQuestTimer("run_away_1", 8000, world.getNpc(DETON), null);
break;
}
case "run_away_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, world.getNpc(DETON), null);
break;
}
case "switch_quest":
@@ -496,7 +496,6 @@ public class StoryOfTauti extends AbstractInstance
}
case "end_instance":
{
cancelQuestTimers("check_flower");
_count = 0;
for (Npc n : world.getAliveNpcs())
{
@@ -521,14 +520,14 @@ public class StoryOfTauti extends AbstractInstance
{
if (npc.isScriptValue(0))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
npc.setScriptValue(1);
break;
}
if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60))
{
_seal_device.setDisplayEffect(1);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
npc.setScriptValue(2);
break;
}
@@ -569,10 +568,10 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30))
{
world.spawnGroup("last_deton");
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, _deton, null);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, world.getNpc(DETON), null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.setStatus(11);
}
if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5))
@@ -603,7 +602,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
});
startQuestTimer("end_instance", 52000, _deton, null);
startQuestTimer("end_instance", 52000, world.getNpc(DETON), null);
world.despawnGroup("last_deton");
world.despawnGroup("last_archagel");
playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE);
@@ -627,21 +626,20 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
cancelQuestTimers("end_instance");
cancelQuestTimers("check_flower");
cancelQuestTimer("end_instance", world.getNpc(DETON), null);
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME)));
world.setStatus(4);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, world.getNpc(DETON), null);
}
break;
}
@@ -650,7 +648,7 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("msg_8", 3000, _deton, null);
startQuestTimer("msg_8", 3000, world.getNpc(DETON), null);
world.setStatus(6);
}
break;
@@ -660,9 +658,9 @@ public class StoryOfTauti extends AbstractInstance
_seal_device.setDisplayEffect(3);
_seal_device.doDie(npc);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, _deton, null);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, world.getNpc(DETON), null);
break;
}
case SEALED_ANGEL:
@@ -690,13 +688,13 @@ public class StoryOfTauti extends AbstractInstance
if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1))
{
world.setStatus(2);
_deton.setTarget(null);
_deton.stopMove(null);
startQuestTimer("msg_4", 7000, _deton, null);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
startQuestTimer("msg_4", 7000, world.getNpc(DETON), null);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME)));
startQuestTimer("end_instance", 190000, _deton, null);
startQuestTimer("spawn_stacato", 5000, _deton, null);
startQuestTimer("end_instance", 190000, world.getNpc(DETON), null);
startQuestTimer("spawn_stacato", 5000, world.getNpc(DETON), null);
}
break;
}
@@ -704,7 +702,7 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(0))
{
startQuestTimer("check_status", 21000, _deton, player);
startQuestTimer("check_status", 21000, world.getNpc(DETON), player);
world.setStatus(1);
}
break;
@@ -714,8 +712,8 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(4))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, world.getNpc(DETON), player);
world.setStatus(5);
}
break;
@@ -724,8 +722,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -753,8 +751,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -773,11 +771,6 @@ public class StoryOfTauti extends AbstractInstance
{
switch (npc.getId())
{
case DETON:
{
_deton = npc;
break;
}
case SEAL_DEVICE:
{
_seal_device = npc;
@@ -798,7 +791,7 @@ public class StoryOfTauti extends AbstractInstance
}
case FLAME_STACATO:
{
startQuestTimer("check_flower", 3000, npc, null, true);
startQuestTimer("check_flower", 3000, npc, null);
break;
}
case FLAME_SCORPION:

View File

@@ -34,7 +34,7 @@ import instances.AbstractInstance;
* Nornils Garden Instance
* @URL https://l2wiki.com/Nornils_Garden
* @Video https://www.youtube.com/watch?v=6QKzzmJ5GUs
* @author Gigi
* @author Gigi, Mobius
* @date 2017-02-22 - [15:22:27]
*/
public class NornilsGarden extends AbstractInstance
@@ -120,7 +120,7 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(5) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200016, true);
cancelQuestTimers("stage2");
cancelQuestTimer("stage2", npc, null);
world.spawnGroup("wave_3");
}
break;
@@ -130,14 +130,13 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(6) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200201, true);
cancelQuestTimers("stage3");
cancelQuestTimers("check_agrro");
cancelQuestTimer("stage3", npc, null);
}
break;
}
case "check_agrro":
{
if ((world != null) && !npc.isDead() && !npc.isInCombat())
if ((world != null) && !npc.isDead() && !npc.isInCombat() && !world.getDoor(16200201).isOpen())
{
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, knownChar ->
{
@@ -148,6 +147,7 @@ public class NornilsGarden extends AbstractInstance
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, knownChar);
}
});
startQuestTimer("check_agrro", 1000, npc, null);
}
break;
}
@@ -209,7 +209,7 @@ public class NornilsGarden extends AbstractInstance
{
if (npc.getId() == BOZ_STAGE1)
{
cancelQuestTimers("stage1_1");
cancelQuestTimer("stage1_1", npc, null);
world.openCloseDoor(16200015, true);
world.setStatus(1);
}
@@ -301,7 +301,7 @@ public class NornilsGarden extends AbstractInstance
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
{
((Attackable) npc).setCanReturnToSpawnPoint(false);
startQuestTimer("check_agrro", 1000, npc, null, true);
startQuestTimer("check_agrro", 1000, npc, null);
}
return super.onSpawn(npc);
}

View File

@@ -100,8 +100,8 @@ public class ScarletVanHalisha extends AbstractNpcAI
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
cancelQuestTimers("attack");
cancelQuestTimers("random_Target");
cancelQuestTimer("attack", npc, null);
cancelQuestTimer("random_Target", npc, null);
return super.onKill(npc, killer, isSummon);
}

View File

@@ -171,7 +171,7 @@ public class OctavisWarzone extends AbstractInstance
{
world.openCloseDoor(MAIN_DOOR_2, false);
world.openCloseDoor(MAIN_DOOR_1, false);
world.getParameters().set("TELEPORT_ACTIVE", true);
world.setParameter("TELEPORT_ACTIVE", true);
npc.teleToLocation(BATTLE_LOC);
playMovie(world, Movie.SC_OCTABIS_OPENING);
getTimers().addTimer("START_STAGE_1", 26500, npc, null);

View File

@@ -252,7 +252,7 @@ public class AltarOfShilen extends AbstractInstance
world.setStatus(7);
onStatusChanged(world);
npc.deleteMe();
cancelQuestTimers("check_player");
cancelQuestTimer("check_player", npc, null);
}
break;
}

View File

@@ -192,7 +192,7 @@ public class AshenShadowRevolutionaries extends AbstractInstance
}
if (questGiver.getId() == 34097) // Adonius
{
world.getParameters().set("CAPTIVES", world.spawnGroup("captives"));
world.setParameter("CAPTIVES", world.spawnGroup("captives"));
for (Npc captive : world.getParameters().getList("CAPTIVES", Npc.class))
{
captive.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FLESH_STONE);

View File

@@ -73,321 +73,373 @@ public class ChamberOfProphecies extends AbstractInstance
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
if (event.equals("enterInstance"))
switch (event)
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
htmltext = event;
break;
}
}
else if (player != null)
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
case "33996-02.html":
{
return null;
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
switch (event)
case "33980-03.html":
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
htmltext = event;
break;
return null;
}
case "33996-02.html":
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "enterInstance":
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-03.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "status":
{
if (world.isStatus(0))
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
htmltext = "31639-01.html";
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
}
break;
}
case "teleport":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimer("CHECK_STATUS", npc, player);
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "status":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
if (world.isStatus(0))
{
htmltext = "31639-01.html";
break;
}
htmltext = "31639-02.html";
break;
}
case "CHECK_STATUS":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
case 1:
{
case 0:
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 1:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 2:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
case 2:
{
npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
addAttackDesire(npc, monster);
return;
});
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
}
break;
}
case "OPEN_DOOR1":
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
return null;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
if (npc.getId() == FERIN)
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
break;
addAttackDesire(npc, monster);
return;
});
}
case "SEY_KAIN":
break;
}
case "OPEN_DOOR1":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == VAN_HALTER)
{
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY3":
cancelQuestTimer("ATTACK", npc, player);
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY_KAIN_1":
cancelQuestTimer("ATTACK1", npc, player);
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_2":
break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
break;
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
case "SEY4":
break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_3":
break;
}
case "SEY_KAIN_1":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
case "REST":
break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == FERIN)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
case "SEY_KAIN_4":
break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
case "CLOSE":
break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
case "DESPAWN_WIZARD":
break;
}
case "REST":
{
if (npc.getId() == FERIN)
{
world.despawnGroup("q10753_16_instance_wizard");
break;
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimer("BROADCAST_TEXT", npc, player);
}
case "exit":
break;
}
case "SEY_KAIN_4":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MIN_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt((int) 1.0D));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
return null;
}
case "finish":
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimer("ATTACK2", npc, player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
}
case "CLOSE":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
world.finishInstance(0);
break;
return null;
}
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
}
case "DESPAWN_WIZARD":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MIN_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt(1));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
}
case "finish":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.finishInstance(0);
break;
}
}
return htmltext;

View File

@@ -55,7 +55,7 @@ import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti;
/**
* Mystic Tavern Tauti Instance
* @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk
* @author Gigi
* @author Gigi, Mobius
*/
public class StoryOfTauti extends AbstractInstance
{
@@ -93,14 +93,13 @@ public class StoryOfTauti extends AbstractInstance
private static final Location TELEPORT = new Location(153267, -148441, -11560);
private static final int ZONE_1ST_TRIGER = 24137770;
private static final int SKILL_TRIGER = 24138880;
private static Npc _deton;
private static Npc _seal_device;
protected int _count = 0;
public StoryOfTauti()
{
super(TEMPLATE_ID);
addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addSpawnId(FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL);
addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL);
addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE);
@@ -142,9 +141,9 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(1) || world.isStatus(4))
{
_deton.setTarget(player);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
world.getNpc(DETON).setTarget(player);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
@@ -155,64 +154,64 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_status":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()))
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
startQuestTimer("msg_1", 7000, _deton, null);
startQuestTimer("msg_1", 7000, world.getNpc(DETON), null);
break;
}
case "msg_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, world.getNpc(DETON), null);
break;
}
case "msg_2":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, world.getNpc(DETON), null);
break;
}
case "msg_3":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
break;
}
case "msg_4":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, world.getNpc(DETON), null);
break;
}
case "msg_5":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, world.getNpc(DETON), null);
break;
}
case "msg_6":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
break;
}
case "spawn_stacato":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_1", 50000, _deton, null);
startQuestTimer("spawn_stacato_1", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_1":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_2", 50000, _deton, null);
startQuestTimer("spawn_stacato_2", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_2":
@@ -223,13 +222,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_flower":
{
if (!npc.isDead())
if ((world != null) && !npc.isDead())
{
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000))
{
if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0))
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, nearby.getLocation(), 23);
if (npc.calculateDistance3D(nearby) < 100)
{
@@ -245,6 +244,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
}
startQuestTimer("check_flower", 3000, npc, null);
}
break;
}
@@ -255,13 +255,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_7":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
break;
}
case "spawn_scorpion":
{
world.spawnGroup("flame_scorpion");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
if (getRandom(10) < 5)
{
world.spawnGroup("ifrit");
@@ -275,7 +275,7 @@ public class StoryOfTauti extends AbstractInstance
{
if ((pl != null) && !pl.isDead())
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23);
addAttackPlayerDesire(npc, pl);
}
@@ -288,36 +288,36 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_8":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, world.getNpc(DETON), null);
break;
}
case "msg_9":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, world.getNpc(DETON), null);
break;
}
case "msg_10":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
break;
}
case "spawn_golem":
{
world.spawnGroup("golem");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away", 10000, _deton, null);
startQuestTimer("run_away", 10000, world.getNpc(DETON), null);
break;
}
case "run_away":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, world.getNpc(DETON), null);
break;
}
case "delete_daton":
@@ -328,35 +328,35 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_11":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
break;
}
case "msg_12":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, world.getNpc(DETON), null);
break;
}
case "msg_13":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
break;
}
case "spawn_scarab":
{
world.spawnGroup("flame_scarab");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away_1", 8000, _deton, null);
startQuestTimer("run_away_1", 8000, world.getNpc(DETON), null);
break;
}
case "run_away_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, world.getNpc(DETON), null);
break;
}
case "switch_quest":
@@ -496,7 +496,6 @@ public class StoryOfTauti extends AbstractInstance
}
case "end_instance":
{
cancelQuestTimers("check_flower");
_count = 0;
for (Npc n : world.getAliveNpcs())
{
@@ -521,14 +520,14 @@ public class StoryOfTauti extends AbstractInstance
{
if (npc.isScriptValue(0))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
npc.setScriptValue(1);
break;
}
if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60))
{
_seal_device.setDisplayEffect(1);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
npc.setScriptValue(2);
break;
}
@@ -569,10 +568,10 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30))
{
world.spawnGroup("last_deton");
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, _deton, null);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, world.getNpc(DETON), null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.setStatus(11);
}
if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5))
@@ -603,7 +602,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
});
startQuestTimer("end_instance", 52000, _deton, null);
startQuestTimer("end_instance", 52000, world.getNpc(DETON), null);
world.despawnGroup("last_deton");
world.despawnGroup("last_archagel");
playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE);
@@ -627,21 +626,20 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
cancelQuestTimers("end_instance");
cancelQuestTimers("check_flower");
cancelQuestTimer("end_instance", world.getNpc(DETON), null);
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME)));
world.setStatus(4);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, world.getNpc(DETON), null);
}
break;
}
@@ -650,7 +648,7 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("msg_8", 3000, _deton, null);
startQuestTimer("msg_8", 3000, world.getNpc(DETON), null);
world.setStatus(6);
}
break;
@@ -660,9 +658,9 @@ public class StoryOfTauti extends AbstractInstance
_seal_device.setDisplayEffect(3);
_seal_device.doDie(npc);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, _deton, null);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, world.getNpc(DETON), null);
break;
}
case SEALED_ANGEL:
@@ -690,13 +688,13 @@ public class StoryOfTauti extends AbstractInstance
if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1))
{
world.setStatus(2);
_deton.setTarget(null);
_deton.stopMove(null);
startQuestTimer("msg_4", 7000, _deton, null);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
startQuestTimer("msg_4", 7000, world.getNpc(DETON), null);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME)));
startQuestTimer("end_instance", 190000, _deton, null);
startQuestTimer("spawn_stacato", 5000, _deton, null);
startQuestTimer("end_instance", 190000, world.getNpc(DETON), null);
startQuestTimer("spawn_stacato", 5000, world.getNpc(DETON), null);
}
break;
}
@@ -704,7 +702,7 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(0))
{
startQuestTimer("check_status", 21000, _deton, player);
startQuestTimer("check_status", 21000, world.getNpc(DETON), player);
world.setStatus(1);
}
break;
@@ -714,8 +712,8 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(4))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, world.getNpc(DETON), player);
world.setStatus(5);
}
break;
@@ -724,8 +722,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -753,8 +751,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -773,11 +771,6 @@ public class StoryOfTauti extends AbstractInstance
{
switch (npc.getId())
{
case DETON:
{
_deton = npc;
break;
}
case SEAL_DEVICE:
{
_seal_device = npc;
@@ -798,7 +791,7 @@ public class StoryOfTauti extends AbstractInstance
}
case FLAME_STACATO:
{
startQuestTimer("check_flower", 3000, npc, null, true);
startQuestTimer("check_flower", 3000, npc, null);
break;
}
case FLAME_SCORPION:

View File

@@ -34,7 +34,7 @@ import instances.AbstractInstance;
* Nornils Garden Instance
* @URL https://l2wiki.com/Nornils_Garden
* @Video https://www.youtube.com/watch?v=6QKzzmJ5GUs
* @author Gigi
* @author Gigi, Mobius
* @date 2017-02-22 - [15:22:27]
*/
public class NornilsGarden extends AbstractInstance
@@ -120,7 +120,7 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(5) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200016, true);
cancelQuestTimers("stage2");
cancelQuestTimer("stage2", npc, null);
world.spawnGroup("wave_3");
}
break;
@@ -130,14 +130,13 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(6) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200201, true);
cancelQuestTimers("stage3");
cancelQuestTimers("check_agrro");
cancelQuestTimer("stage3", npc, null);
}
break;
}
case "check_agrro":
{
if ((world != null) && !npc.isDead() && !npc.isInCombat())
if ((world != null) && !npc.isDead() && !npc.isInCombat() && !world.getDoor(16200201).isOpen())
{
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, knownChar ->
{
@@ -148,6 +147,7 @@ public class NornilsGarden extends AbstractInstance
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, knownChar);
}
});
startQuestTimer("check_agrro", 1000, npc, null);
}
break;
}
@@ -209,7 +209,7 @@ public class NornilsGarden extends AbstractInstance
{
if (npc.getId() == BOZ_STAGE1)
{
cancelQuestTimers("stage1_1");
cancelQuestTimer("stage1_1", npc, null);
world.openCloseDoor(16200015, true);
world.setStatus(1);
}
@@ -301,7 +301,7 @@ public class NornilsGarden extends AbstractInstance
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
{
((Attackable) npc).setCanReturnToSpawnPoint(false);
startQuestTimer("check_agrro", 1000, npc, null, true);
startQuestTimer("check_agrro", 1000, npc, null);
}
return super.onSpawn(npc);
}

View File

@@ -100,8 +100,8 @@ public class ScarletVanHalisha extends AbstractNpcAI
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
cancelQuestTimers("attack");
cancelQuestTimers("random_Target");
cancelQuestTimer("attack", npc, null);
cancelQuestTimer("random_Target", npc, null);
return super.onKill(npc, killer, isSummon);
}

View File

@@ -171,7 +171,7 @@ public class OctavisWarzone extends AbstractInstance
{
world.openCloseDoor(MAIN_DOOR_2, false);
world.openCloseDoor(MAIN_DOOR_1, false);
world.getParameters().set("TELEPORT_ACTIVE", true);
world.setParameter("TELEPORT_ACTIVE", true);
npc.teleToLocation(BATTLE_LOC);
playMovie(world, Movie.SC_OCTABIS_OPENING);
getTimers().addTimer("START_STAGE_1", 26500, npc, null);

View File

@@ -252,7 +252,7 @@ public class AltarOfShilen extends AbstractInstance
world.setStatus(7);
onStatusChanged(world);
npc.deleteMe();
cancelQuestTimers("check_player");
cancelQuestTimer("check_player", npc, null);
}
break;
}

View File

@@ -192,7 +192,7 @@ public class AshenShadowRevolutionaries extends AbstractInstance
}
if (questGiver.getId() == 34097) // Adonius
{
world.getParameters().set("CAPTIVES", world.spawnGroup("captives"));
world.setParameter("CAPTIVES", world.spawnGroup("captives"));
for (Npc captive : world.getParameters().getList("CAPTIVES", Npc.class))
{
captive.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FLESH_STONE);

View File

@@ -73,321 +73,373 @@ public class ChamberOfProphecies extends AbstractInstance
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
if (event.equals("enterInstance"))
switch (event)
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
htmltext = event;
break;
}
}
else if (player != null)
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
case "33996-02.html":
{
return null;
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
switch (event)
case "33980-03.html":
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
htmltext = event;
break;
return null;
}
case "33996-02.html":
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "enterInstance":
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-03.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "status":
{
if (world.isStatus(0))
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
htmltext = "31639-01.html";
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
}
break;
}
case "teleport":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimer("CHECK_STATUS", npc, player);
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "status":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
if (world.isStatus(0))
{
htmltext = "31639-01.html";
break;
}
htmltext = "31639-02.html";
break;
}
case "CHECK_STATUS":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
case 1:
{
case 0:
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 1:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 2:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
case 2:
{
npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
addAttackDesire(npc, monster);
return;
});
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
}
break;
}
case "OPEN_DOOR1":
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
return null;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
if (npc.getId() == FERIN)
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
break;
addAttackDesire(npc, monster);
return;
});
}
case "SEY_KAIN":
break;
}
case "OPEN_DOOR1":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == VAN_HALTER)
{
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY3":
cancelQuestTimer("ATTACK", npc, player);
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY_KAIN_1":
cancelQuestTimer("ATTACK1", npc, player);
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_2":
break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
break;
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
case "SEY4":
break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_3":
break;
}
case "SEY_KAIN_1":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
case "REST":
break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == FERIN)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
case "SEY_KAIN_4":
break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
case "CLOSE":
break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
case "DESPAWN_WIZARD":
break;
}
case "REST":
{
if (npc.getId() == FERIN)
{
world.despawnGroup("q10753_16_instance_wizard");
break;
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimer("BROADCAST_TEXT", npc, player);
}
case "exit":
break;
}
case "SEY_KAIN_4":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt((int) 1.0D));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
return null;
}
case "finish":
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimer("ATTACK2", npc, player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
}
case "CLOSE":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
world.finishInstance(0);
break;
return null;
}
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
}
case "DESPAWN_WIZARD":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt(1));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
}
case "finish":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.finishInstance(0);
break;
}
}
return htmltext;

View File

@@ -55,7 +55,7 @@ import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti;
/**
* Mystic Tavern Tauti Instance
* @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk
* @author Gigi
* @author Gigi, Mobius
*/
public class StoryOfTauti extends AbstractInstance
{
@@ -93,14 +93,13 @@ public class StoryOfTauti extends AbstractInstance
private static final Location TELEPORT = new Location(153267, -148441, -11560);
private static final int ZONE_1ST_TRIGER = 24137770;
private static final int SKILL_TRIGER = 24138880;
private static Npc _deton;
private static Npc _seal_device;
protected int _count = 0;
public StoryOfTauti()
{
super(TEMPLATE_ID);
addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addSpawnId(FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL);
addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL);
addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE);
@@ -142,9 +141,9 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(1) || world.isStatus(4))
{
_deton.setTarget(player);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
world.getNpc(DETON).setTarget(player);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
@@ -155,64 +154,64 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_status":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()))
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
startQuestTimer("msg_1", 7000, _deton, null);
startQuestTimer("msg_1", 7000, world.getNpc(DETON), null);
break;
}
case "msg_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, world.getNpc(DETON), null);
break;
}
case "msg_2":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, world.getNpc(DETON), null);
break;
}
case "msg_3":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
break;
}
case "msg_4":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, world.getNpc(DETON), null);
break;
}
case "msg_5":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, world.getNpc(DETON), null);
break;
}
case "msg_6":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
break;
}
case "spawn_stacato":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_1", 50000, _deton, null);
startQuestTimer("spawn_stacato_1", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_1":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_2", 50000, _deton, null);
startQuestTimer("spawn_stacato_2", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_2":
@@ -223,13 +222,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_flower":
{
if (!npc.isDead())
if ((world != null) && !npc.isDead())
{
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000))
{
if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0))
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, nearby.getLocation(), 23);
if (npc.calculateDistance3D(nearby) < 100)
{
@@ -245,6 +244,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
}
startQuestTimer("check_flower", 3000, npc, null);
}
break;
}
@@ -255,13 +255,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_7":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
break;
}
case "spawn_scorpion":
{
world.spawnGroup("flame_scorpion");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
if (getRandom(10) < 5)
{
world.spawnGroup("ifrit");
@@ -275,7 +275,7 @@ public class StoryOfTauti extends AbstractInstance
{
if ((pl != null) && !pl.isDead())
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23);
addAttackPlayerDesire(npc, pl);
}
@@ -288,36 +288,36 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_8":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, world.getNpc(DETON), null);
break;
}
case "msg_9":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, world.getNpc(DETON), null);
break;
}
case "msg_10":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
break;
}
case "spawn_golem":
{
world.spawnGroup("golem");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away", 10000, _deton, null);
startQuestTimer("run_away", 10000, world.getNpc(DETON), null);
break;
}
case "run_away":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, world.getNpc(DETON), null);
break;
}
case "delete_daton":
@@ -328,35 +328,35 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_11":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
break;
}
case "msg_12":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, world.getNpc(DETON), null);
break;
}
case "msg_13":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
break;
}
case "spawn_scarab":
{
world.spawnGroup("flame_scarab");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away_1", 8000, _deton, null);
startQuestTimer("run_away_1", 8000, world.getNpc(DETON), null);
break;
}
case "run_away_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, world.getNpc(DETON), null);
break;
}
case "switch_quest":
@@ -496,7 +496,6 @@ public class StoryOfTauti extends AbstractInstance
}
case "end_instance":
{
cancelQuestTimers("check_flower");
_count = 0;
for (Npc n : world.getAliveNpcs())
{
@@ -521,14 +520,14 @@ public class StoryOfTauti extends AbstractInstance
{
if (npc.isScriptValue(0))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
npc.setScriptValue(1);
break;
}
if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60))
{
_seal_device.setDisplayEffect(1);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
npc.setScriptValue(2);
break;
}
@@ -569,10 +568,10 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30))
{
world.spawnGroup("last_deton");
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, _deton, null);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, world.getNpc(DETON), null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.setStatus(11);
}
if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5))
@@ -603,7 +602,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
});
startQuestTimer("end_instance", 52000, _deton, null);
startQuestTimer("end_instance", 52000, world.getNpc(DETON), null);
world.despawnGroup("last_deton");
world.despawnGroup("last_archagel");
playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE);
@@ -627,21 +626,20 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
cancelQuestTimers("end_instance");
cancelQuestTimers("check_flower");
cancelQuestTimer("end_instance", world.getNpc(DETON), null);
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME)));
world.setStatus(4);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, world.getNpc(DETON), null);
}
break;
}
@@ -650,7 +648,7 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("msg_8", 3000, _deton, null);
startQuestTimer("msg_8", 3000, world.getNpc(DETON), null);
world.setStatus(6);
}
break;
@@ -660,9 +658,9 @@ public class StoryOfTauti extends AbstractInstance
_seal_device.setDisplayEffect(3);
_seal_device.doDie(npc);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, _deton, null);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, world.getNpc(DETON), null);
break;
}
case SEALED_ANGEL:
@@ -690,13 +688,13 @@ public class StoryOfTauti extends AbstractInstance
if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1))
{
world.setStatus(2);
_deton.setTarget(null);
_deton.stopMove(null);
startQuestTimer("msg_4", 7000, _deton, null);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
startQuestTimer("msg_4", 7000, world.getNpc(DETON), null);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME)));
startQuestTimer("end_instance", 190000, _deton, null);
startQuestTimer("spawn_stacato", 5000, _deton, null);
startQuestTimer("end_instance", 190000, world.getNpc(DETON), null);
startQuestTimer("spawn_stacato", 5000, world.getNpc(DETON), null);
}
break;
}
@@ -704,7 +702,7 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(0))
{
startQuestTimer("check_status", 21000, _deton, player);
startQuestTimer("check_status", 21000, world.getNpc(DETON), player);
world.setStatus(1);
}
break;
@@ -714,8 +712,8 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(4))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, world.getNpc(DETON), player);
world.setStatus(5);
}
break;
@@ -724,8 +722,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -753,8 +751,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -773,11 +771,6 @@ public class StoryOfTauti extends AbstractInstance
{
switch (npc.getId())
{
case DETON:
{
_deton = npc;
break;
}
case SEAL_DEVICE:
{
_seal_device = npc;
@@ -798,7 +791,7 @@ public class StoryOfTauti extends AbstractInstance
}
case FLAME_STACATO:
{
startQuestTimer("check_flower", 3000, npc, null, true);
startQuestTimer("check_flower", 3000, npc, null);
break;
}
case FLAME_SCORPION:

View File

@@ -34,7 +34,7 @@ import instances.AbstractInstance;
* Nornils Garden Instance
* @URL https://l2wiki.com/Nornils_Garden
* @Video https://www.youtube.com/watch?v=6QKzzmJ5GUs
* @author Gigi
* @author Gigi, Mobius
* @date 2017-02-22 - [15:22:27]
*/
public class NornilsGarden extends AbstractInstance
@@ -120,7 +120,7 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(5) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200016, true);
cancelQuestTimers("stage2");
cancelQuestTimer("stage2", npc, null);
world.spawnGroup("wave_3");
}
break;
@@ -130,14 +130,13 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(6) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200201, true);
cancelQuestTimers("stage3");
cancelQuestTimers("check_agrro");
cancelQuestTimer("stage3", npc, null);
}
break;
}
case "check_agrro":
{
if ((world != null) && !npc.isDead() && !npc.isInCombat())
if ((world != null) && !npc.isDead() && !npc.isInCombat() && !world.getDoor(16200201).isOpen())
{
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, knownChar ->
{
@@ -148,6 +147,7 @@ public class NornilsGarden extends AbstractInstance
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, knownChar);
}
});
startQuestTimer("check_agrro", 1000, npc, null);
}
break;
}
@@ -209,7 +209,7 @@ public class NornilsGarden extends AbstractInstance
{
if (npc.getId() == BOZ_STAGE1)
{
cancelQuestTimers("stage1_1");
cancelQuestTimer("stage1_1", npc, null);
world.openCloseDoor(16200015, true);
world.setStatus(1);
}
@@ -301,7 +301,7 @@ public class NornilsGarden extends AbstractInstance
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
{
((Attackable) npc).setCanReturnToSpawnPoint(false);
startQuestTimer("check_agrro", 1000, npc, null, true);
startQuestTimer("check_agrro", 1000, npc, null);
}
return super.onSpawn(npc);
}

View File

@@ -100,8 +100,8 @@ public class ScarletVanHalisha extends AbstractNpcAI
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
cancelQuestTimers("attack");
cancelQuestTimers("random_Target");
cancelQuestTimer("attack", npc, null);
cancelQuestTimer("random_Target", npc, null);
return super.onKill(npc, killer, isSummon);
}

View File

@@ -171,7 +171,7 @@ public class OctavisWarzone extends AbstractInstance
{
world.openCloseDoor(MAIN_DOOR_2, false);
world.openCloseDoor(MAIN_DOOR_1, false);
world.getParameters().set("TELEPORT_ACTIVE", true);
world.setParameter("TELEPORT_ACTIVE", true);
npc.teleToLocation(BATTLE_LOC);
playMovie(world, Movie.SC_OCTABIS_OPENING);
getTimers().addTimer("START_STAGE_1", 26500, npc, null);

View File

@@ -252,7 +252,7 @@ public class AltarOfShilen extends AbstractInstance
world.setStatus(7);
onStatusChanged(world);
npc.deleteMe();
cancelQuestTimers("check_player");
cancelQuestTimer("check_player", npc, null);
}
break;
}

View File

@@ -192,7 +192,7 @@ public class AshenShadowRevolutionaries extends AbstractInstance
}
if (questGiver.getId() == 34097) // Adonius
{
world.getParameters().set("CAPTIVES", world.spawnGroup("captives"));
world.setParameter("CAPTIVES", world.spawnGroup("captives"));
for (Npc captive : world.getParameters().getList("CAPTIVES", Npc.class))
{
captive.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FLESH_STONE);

View File

@@ -73,321 +73,373 @@ public class ChamberOfProphecies extends AbstractInstance
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
if (event.equals("enterInstance"))
switch (event)
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
htmltext = event;
break;
}
}
else if (player != null)
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
case "33996-02.html":
{
return null;
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
switch (event)
case "33980-03.html":
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
htmltext = event;
break;
return null;
}
case "33996-02.html":
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "enterInstance":
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-03.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "status":
{
if (world.isStatus(0))
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
htmltext = "31639-01.html";
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
}
break;
}
case "teleport":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimer("CHECK_STATUS", npc, player);
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "status":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
if (world.isStatus(0))
{
htmltext = "31639-01.html";
break;
}
htmltext = "31639-02.html";
break;
}
case "CHECK_STATUS":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
case 1:
{
case 0:
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 1:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 2:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
case 2:
{
npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
addAttackDesire(npc, monster);
return;
});
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
}
break;
}
case "OPEN_DOOR1":
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
return null;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
if (npc.getId() == FERIN)
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
break;
addAttackDesire(npc, monster);
return;
});
}
case "SEY_KAIN":
break;
}
case "OPEN_DOOR1":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == VAN_HALTER)
{
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY3":
cancelQuestTimer("ATTACK", npc, player);
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY_KAIN_1":
cancelQuestTimer("ATTACK1", npc, player);
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_2":
break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
break;
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
case "SEY4":
break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_3":
break;
}
case "SEY_KAIN_1":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
case "REST":
break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == FERIN)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
case "SEY_KAIN_4":
break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
case "CLOSE":
break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
case "DESPAWN_WIZARD":
break;
}
case "REST":
{
if (npc.getId() == FERIN)
{
world.despawnGroup("q10753_16_instance_wizard");
break;
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimer("BROADCAST_TEXT", npc, player);
}
case "exit":
break;
}
case "SEY_KAIN_4":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt((int) 1.0D));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
return null;
}
case "finish":
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimer("ATTACK2", npc, player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
}
case "CLOSE":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
world.finishInstance(0);
break;
return null;
}
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
}
case "DESPAWN_WIZARD":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt(1));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
}
case "finish":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.finishInstance(0);
break;
}
}
return htmltext;

View File

@@ -55,7 +55,7 @@ import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti;
/**
* Mystic Tavern Tauti Instance
* @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk
* @author Gigi
* @author Gigi, Mobius
*/
public class StoryOfTauti extends AbstractInstance
{
@@ -93,14 +93,13 @@ public class StoryOfTauti extends AbstractInstance
private static final Location TELEPORT = new Location(153267, -148441, -11560);
private static final int ZONE_1ST_TRIGER = 24137770;
private static final int SKILL_TRIGER = 24138880;
private static Npc _deton;
private static Npc _seal_device;
protected int _count = 0;
public StoryOfTauti()
{
super(TEMPLATE_ID);
addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addSpawnId(FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL);
addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL);
addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE);
@@ -142,9 +141,9 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(1) || world.isStatus(4))
{
_deton.setTarget(player);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
world.getNpc(DETON).setTarget(player);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
@@ -155,64 +154,64 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_status":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()))
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
startQuestTimer("msg_1", 7000, _deton, null);
startQuestTimer("msg_1", 7000, world.getNpc(DETON), null);
break;
}
case "msg_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, world.getNpc(DETON), null);
break;
}
case "msg_2":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, world.getNpc(DETON), null);
break;
}
case "msg_3":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
break;
}
case "msg_4":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, world.getNpc(DETON), null);
break;
}
case "msg_5":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, world.getNpc(DETON), null);
break;
}
case "msg_6":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
break;
}
case "spawn_stacato":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_1", 50000, _deton, null);
startQuestTimer("spawn_stacato_1", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_1":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_2", 50000, _deton, null);
startQuestTimer("spawn_stacato_2", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_2":
@@ -223,13 +222,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_flower":
{
if (!npc.isDead())
if ((world != null) && !npc.isDead())
{
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000))
{
if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0))
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, nearby.getLocation(), 23);
if (npc.calculateDistance3D(nearby) < 100)
{
@@ -245,6 +244,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
}
startQuestTimer("check_flower", 3000, npc, null);
}
break;
}
@@ -255,13 +255,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_7":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
break;
}
case "spawn_scorpion":
{
world.spawnGroup("flame_scorpion");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
if (getRandom(10) < 5)
{
world.spawnGroup("ifrit");
@@ -275,7 +275,7 @@ public class StoryOfTauti extends AbstractInstance
{
if ((pl != null) && !pl.isDead())
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23);
addAttackPlayerDesire(npc, pl);
}
@@ -288,36 +288,36 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_8":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, world.getNpc(DETON), null);
break;
}
case "msg_9":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, world.getNpc(DETON), null);
break;
}
case "msg_10":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
break;
}
case "spawn_golem":
{
world.spawnGroup("golem");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away", 10000, _deton, null);
startQuestTimer("run_away", 10000, world.getNpc(DETON), null);
break;
}
case "run_away":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, world.getNpc(DETON), null);
break;
}
case "delete_daton":
@@ -328,35 +328,35 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_11":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
break;
}
case "msg_12":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, world.getNpc(DETON), null);
break;
}
case "msg_13":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
break;
}
case "spawn_scarab":
{
world.spawnGroup("flame_scarab");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away_1", 8000, _deton, null);
startQuestTimer("run_away_1", 8000, world.getNpc(DETON), null);
break;
}
case "run_away_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, world.getNpc(DETON), null);
break;
}
case "switch_quest":
@@ -496,7 +496,6 @@ public class StoryOfTauti extends AbstractInstance
}
case "end_instance":
{
cancelQuestTimers("check_flower");
_count = 0;
for (Npc n : world.getAliveNpcs())
{
@@ -521,14 +520,14 @@ public class StoryOfTauti extends AbstractInstance
{
if (npc.isScriptValue(0))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
npc.setScriptValue(1);
break;
}
if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60))
{
_seal_device.setDisplayEffect(1);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
npc.setScriptValue(2);
break;
}
@@ -569,10 +568,10 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30))
{
world.spawnGroup("last_deton");
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, _deton, null);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, world.getNpc(DETON), null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.setStatus(11);
}
if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5))
@@ -603,7 +602,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
});
startQuestTimer("end_instance", 52000, _deton, null);
startQuestTimer("end_instance", 52000, world.getNpc(DETON), null);
world.despawnGroup("last_deton");
world.despawnGroup("last_archagel");
playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE);
@@ -627,21 +626,20 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
cancelQuestTimers("end_instance");
cancelQuestTimers("check_flower");
cancelQuestTimer("end_instance", world.getNpc(DETON), null);
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME)));
world.setStatus(4);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, world.getNpc(DETON), null);
}
break;
}
@@ -650,7 +648,7 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("msg_8", 3000, _deton, null);
startQuestTimer("msg_8", 3000, world.getNpc(DETON), null);
world.setStatus(6);
}
break;
@@ -660,9 +658,9 @@ public class StoryOfTauti extends AbstractInstance
_seal_device.setDisplayEffect(3);
_seal_device.doDie(npc);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, _deton, null);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, world.getNpc(DETON), null);
break;
}
case SEALED_ANGEL:
@@ -690,13 +688,13 @@ public class StoryOfTauti extends AbstractInstance
if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1))
{
world.setStatus(2);
_deton.setTarget(null);
_deton.stopMove(null);
startQuestTimer("msg_4", 7000, _deton, null);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
startQuestTimer("msg_4", 7000, world.getNpc(DETON), null);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME)));
startQuestTimer("end_instance", 190000, _deton, null);
startQuestTimer("spawn_stacato", 5000, _deton, null);
startQuestTimer("end_instance", 190000, world.getNpc(DETON), null);
startQuestTimer("spawn_stacato", 5000, world.getNpc(DETON), null);
}
break;
}
@@ -704,7 +702,7 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(0))
{
startQuestTimer("check_status", 21000, _deton, player);
startQuestTimer("check_status", 21000, world.getNpc(DETON), player);
world.setStatus(1);
}
break;
@@ -714,8 +712,8 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(4))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, world.getNpc(DETON), player);
world.setStatus(5);
}
break;
@@ -724,8 +722,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -753,8 +751,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -773,11 +771,6 @@ public class StoryOfTauti extends AbstractInstance
{
switch (npc.getId())
{
case DETON:
{
_deton = npc;
break;
}
case SEAL_DEVICE:
{
_seal_device = npc;
@@ -798,7 +791,7 @@ public class StoryOfTauti extends AbstractInstance
}
case FLAME_STACATO:
{
startQuestTimer("check_flower", 3000, npc, null, true);
startQuestTimer("check_flower", 3000, npc, null);
break;
}
case FLAME_SCORPION:

View File

@@ -34,7 +34,7 @@ import instances.AbstractInstance;
* Nornils Garden Instance
* @URL https://l2wiki.com/Nornils_Garden
* @Video https://www.youtube.com/watch?v=6QKzzmJ5GUs
* @author Gigi
* @author Gigi, Mobius
* @date 2017-02-22 - [15:22:27]
*/
public class NornilsGarden extends AbstractInstance
@@ -120,7 +120,7 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(5) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200016, true);
cancelQuestTimers("stage2");
cancelQuestTimer("stage2", npc, null);
world.spawnGroup("wave_3");
}
break;
@@ -130,14 +130,13 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(6) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200201, true);
cancelQuestTimers("stage3");
cancelQuestTimers("check_agrro");
cancelQuestTimer("stage3", npc, null);
}
break;
}
case "check_agrro":
{
if ((world != null) && !npc.isDead() && !npc.isInCombat())
if ((world != null) && !npc.isDead() && !npc.isInCombat() && !world.getDoor(16200201).isOpen())
{
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, knownChar ->
{
@@ -148,6 +147,7 @@ public class NornilsGarden extends AbstractInstance
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, knownChar);
}
});
startQuestTimer("check_agrro", 1000, npc, null);
}
break;
}
@@ -209,7 +209,7 @@ public class NornilsGarden extends AbstractInstance
{
if (npc.getId() == BOZ_STAGE1)
{
cancelQuestTimers("stage1_1");
cancelQuestTimer("stage1_1", npc, null);
world.openCloseDoor(16200015, true);
world.setStatus(1);
}
@@ -301,7 +301,7 @@ public class NornilsGarden extends AbstractInstance
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
{
((Attackable) npc).setCanReturnToSpawnPoint(false);
startQuestTimer("check_agrro", 1000, npc, null, true);
startQuestTimer("check_agrro", 1000, npc, null);
}
return super.onSpawn(npc);
}

View File

@@ -100,8 +100,8 @@ public class ScarletVanHalisha extends AbstractNpcAI
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
cancelQuestTimers("attack");
cancelQuestTimers("random_Target");
cancelQuestTimer("attack", npc, null);
cancelQuestTimer("random_Target", npc, null);
return super.onKill(npc, killer, isSummon);
}

View File

@@ -171,7 +171,7 @@ public class OctavisWarzone extends AbstractInstance
{
world.openCloseDoor(MAIN_DOOR_2, false);
world.openCloseDoor(MAIN_DOOR_1, false);
world.getParameters().set("TELEPORT_ACTIVE", true);
world.setParameter("TELEPORT_ACTIVE", true);
npc.teleToLocation(BATTLE_LOC);
playMovie(world, Movie.SC_OCTABIS_OPENING);
getTimers().addTimer("START_STAGE_1", 26500, npc, null);

View File

@@ -252,7 +252,7 @@ public class AltarOfShilen extends AbstractInstance
world.setStatus(7);
onStatusChanged(world);
npc.deleteMe();
cancelQuestTimers("check_player");
cancelQuestTimer("check_player", npc, null);
}
break;
}

View File

@@ -192,7 +192,7 @@ public class AshenShadowRevolutionaries extends AbstractInstance
}
if (questGiver.getId() == 34097) // Adonius
{
world.getParameters().set("CAPTIVES", world.spawnGroup("captives"));
world.setParameter("CAPTIVES", world.spawnGroup("captives"));
for (Npc captive : world.getParameters().getList("CAPTIVES", Npc.class))
{
captive.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.FLESH_STONE);

View File

@@ -73,321 +73,373 @@ public class ChamberOfProphecies extends AbstractInstance
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
if (event.equals("enterInstance"))
switch (event)
{
final QuestState qs = player.getQuestState(Q11027_PathOfDestinyOvercome.class.getSimpleName());
if (qs != null)
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(4, true);
htmltext = event;
break;
}
}
else if (player != null)
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
case "33996-02.html":
{
return null;
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
switch (event)
case "33980-03.html":
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
htmltext = event;
break;
return null;
}
case "33996-02.html":
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "enterInstance":
{
final QuestState qs = player.getQuestState(Q11027_PathOfDestinyOvercome.class.getSimpleName());
if (qs != null)
{
world.broadcastPacket(ExShowUsm.USM_Q015_E);
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-03.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "status":
{
if (world.isStatus(0))
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
htmltext = "31639-01.html";
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(4, true);
}
break;
}
case "teleport":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimer("CHECK_STATUS", npc, player);
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "status":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
if (world.isStatus(0))
{
htmltext = "31639-01.html";
break;
}
htmltext = "31639-02.html";
break;
}
case "CHECK_STATUS":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), player);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
case 1:
{
case 0:
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 1:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 2:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
case 2:
{
npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
addAttackDesire(npc, monster);
return;
});
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, player);
}
break;
}
break;
}
case "OPEN_DOOR1":
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
return null;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
if (npc.getId() == FERIN)
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
break;
addAttackDesire(npc, monster);
return;
});
}
case "SEY_KAIN":
break;
}
case "OPEN_DOOR1":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == VAN_HALTER)
{
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY3":
cancelQuestTimer("ATTACK", npc, player);
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
return null;
}
case "SEY_KAIN_1":
cancelQuestTimer("ATTACK1", npc, player);
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_2":
break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
break;
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
case "SEY4":
break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
case "SEY_KAIN_3":
break;
}
case "SEY_KAIN_1":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
case "REST":
break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{
if (npc.getId() == FERIN)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
case "SEY_KAIN_4":
break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
case "CLOSE":
break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
case "DESPAWN_WIZARD":
break;
}
case "REST":
{
if (npc.getId() == FERIN)
{
world.despawnGroup("q10753_16_instance_wizard");
break;
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimer("BROADCAST_TEXT", npc, player);
}
case "exit":
break;
}
case "SEY_KAIN_4":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt((int) 1.0D));
final QuestState qs = player.getQuestState(Q11027_PathOfDestinyOvercome.class.getSimpleName());
if (qs != null)
{
qs.setCond(5, true);
}
break;
return null;
}
case "finish":
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimer("ATTACK2", npc, player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, null, player);
break;
}
case "CLOSE":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
world.finishInstance(0);
break;
return null;
}
final Npc grail = world.getNpc(GRAIL);
if ((grail != null) && (player.calculateDistance2D(grail) < 390))
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
}
case "DESPAWN_WIZARD":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt(1));
final QuestState qs = player.getQuestState(Q11027_PathOfDestinyOvercome.class.getSimpleName());
if (qs != null)
{
qs.setCond(5, true);
}
break;
}
case "finish":
{
final Instance world = player.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
world.finishInstance(0);
break;
}
}
return htmltext;

View File

@@ -55,7 +55,7 @@ import quests.Q00833_DevilsTreasureTauti.Q00833_DevilsTreasureTauti;
/**
* Mystic Tavern Tauti Instance
* @VIDEO https://www.youtube.com/watch?v=uPXWZ1ZCtFk
* @author Gigi
* @author Gigi, Mobius
*/
public class StoryOfTauti extends AbstractInstance
{
@@ -93,14 +93,13 @@ public class StoryOfTauti extends AbstractInstance
private static final Location TELEPORT = new Location(153267, -148441, -11560);
private static final int ZONE_1ST_TRIGER = 24137770;
private static final int SKILL_TRIGER = 24138880;
private static Npc _deton;
private static Npc _seal_device;
protected int _count = 0;
public StoryOfTauti()
{
super(TEMPLATE_ID);
addSpawnId(DETON, SEAL_DEVICE, FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addSpawnId(FLAME_FLOWER, FLAME_STACATO, FLAME_SCORPION, FLAME_SCARAB, FLAME_GOLEM, NPC_1, SEAL_ARCHANGEL);
addAttackId(SEAL_TOMBSTONE, SEAL_ARCHANGEL);
addKillId(FLAME_STACATO, FLAME_SCORPION, SEAL_TOMBSTONE, SEALED_ANGEL);
addSkillSeeId(FLAME_FLOWER, SEAL_TOMBSTONE);
@@ -142,9 +141,9 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(1) || world.isStatus(4))
{
_deton.setTarget(player);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
world.getNpc(DETON).setTarget(player);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
@@ -155,64 +154,64 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_status":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARE_YOU_THE_ONES_WHO_WILL_BE_HELPING_OUT_WELCOME_I_VE_BEEN_WAITING_FOR_YOU);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl != null) && ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM()))
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
startQuestTimer("msg_1", 7000, _deton, null);
startQuestTimer("msg_1", 7000, world.getNpc(DETON), null);
break;
}
case "msg_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAD_A_HARD_TIME_WORKING_BY_MYSELF_I_M_GLAD_YOU_ARE_HERE_NOW);
startQuestTimer("msg_2", 10000, world.getNpc(DETON), null);
break;
}
case "msg_2":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_WORRY_ABOUT_THE_REWARD_WE_LL_FIND_THAT_TREASURE);
startQuestTimer("msg_3", 10000, world.getNpc(DETON), null);
break;
}
case "msg_3":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_M_GLAD_POWERFUL_PEOPLE_LIKE_YOU_GUYS_ARE_HELPING_ME);
break;
}
case "msg_4":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_I_M_SURE_I_VE_SEEN_THIS_BEFORE_YES_THAT_MEANS_THE_STAKATOS);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE);
startQuestTimer("msg_5", 7000, world.getNpc(DETON), null);
break;
}
case "msg_5":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TO_SAVE_THE_FLAME_FLOWER_YOU_NEED_HEAL_WAIT_RADIANT_HEAL_YES_I_M_SURE);
startQuestTimer("msg_6", 10000, world.getNpc(DETON), null);
break;
}
case "msg_6":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELL_THERE_S_NOT_MUCH_DIFFERENCE_RIGHT_OR_IS_THERE);
break;
}
case "spawn_stacato":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_1", 50000, _deton, null);
startQuestTimer("spawn_stacato_1", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_1":
{
world.spawnGroup("flame_stacato");
startQuestTimer("spawn_stacato_2", 50000, _deton, null);
startQuestTimer("spawn_stacato_2", 50000, world.getNpc(DETON), null);
break;
}
case "spawn_stacato_2":
@@ -223,13 +222,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "check_flower":
{
if (!npc.isDead())
if ((world != null) && !npc.isDead())
{
for (Npc nearby : World.getInstance().getVisibleObjectsInRange(npc, FriendlyNpcInstance.class, 1000))
{
if ((nearby.getId() == FLAME_FLOWER) && npc.isScriptValue(0) && nearby.isScriptValue(0))
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, nearby.getLocation(), 23);
if (npc.calculateDistance3D(nearby) < 100)
{
@@ -245,6 +244,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
}
startQuestTimer("check_flower", 3000, npc, null);
}
break;
}
@@ -255,13 +255,13 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_7":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LET_S_HAVE_SOME_FUN);
break;
}
case "spawn_scorpion":
{
world.spawnGroup("flame_scorpion");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EEK_SAVE_THIS_DWARF_I_M_JUST_AN_ARCHAEOLOGIST_I_LL_GIVE_YOU_EVERYTHING_I_HAVE);
if (getRandom(10) < 5)
{
world.spawnGroup("ifrit");
@@ -275,7 +275,7 @@ public class StoryOfTauti extends AbstractInstance
{
if ((pl != null) && !pl.isDead())
{
_deton.setRunning();
world.getNpc(DETON).setRunning();
addMoveToDesire(npc, new Location(pl.getX() + getRandom(-40, 40), pl.getY() + getRandom(-40, 40), pl.getZ()), 23);
addAttackPlayerDesire(npc, pl);
}
@@ -288,36 +288,36 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_8":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_TRULY_ARE_AMAZING_YOU_ACTUALLY_DEFEATED_THOSE_NASTY_GUYS);
startQuestTimer("msg_9", 8000, world.getNpc(DETON), null);
break;
}
case "msg_9":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_PATH_SPLITS_NOW_WELL_LET_S_GO_WHICH_WAY);
startQuestTimer("msg_10", 10000, world.getNpc(DETON), null);
break;
}
case "msg_10":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.BOTH_LOOK_PRETTY_BAD_BUT_WE_MUST_KEEP_GOING);
break;
}
case "spawn_golem":
{
world.spawnGroup("golem");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_WHAT_ARE_THESE_MONSTERS_HOW_OLD_DO_YOU_HAVE_BE_TO_GET_THAT_BIG);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LOOK_AT_THAT_FLAME_GOLEM_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away", 10000, _deton, null);
startQuestTimer("run_away", 10000, world.getNpc(DETON), null);
break;
}
case "run_away":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_LL_LEAVE_THOSE_MONSTERS_TO_YOU_I_LL_GO_CHECK_OUT_SOMETHING_OVER_THERE_IT_S_VERY_IMPORTANT);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 3500, world.getNpc(DETON), null);
break;
}
case "delete_daton":
@@ -328,35 +328,35 @@ public class StoryOfTauti extends AbstractInstance
}
case "msg_11":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YES_THE_SEAL_IS_GONE_WELL_YOU_GO_ON_AHEAD_I_LL_MAKE_SOME_RUBBED_COPIES_FIRST);
break;
}
case "msg_12":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_T_BELIEVE_YOU_ACTUALLY_FELL_FOR_THAT_I_WAS_JUST_USING_YOU_KAHAHA);
startQuestTimer("msg_13", 9000, world.getNpc(DETON), null);
break;
}
case "msg_13":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TAUTI_SO_THIS_IS_TAUTI_GIVE_ME_YOUR_POWER_YOU_ARE_MINE_KAHAHAHA);
break;
}
case "spawn_scarab":
{
world.spawnGroup("flame_scarab");
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAHHH_THIS_WAY_WAS_DANGEROUS_TOO_SAVE_ME);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.THAT_FLAME_SCARAB_IT_S_TERRIFYING, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("run_away_1", 8000, _deton, null);
startQuestTimer("run_away_1", 8000, world.getNpc(DETON), null);
break;
}
case "run_away_1":
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
_deton.setTarget(null);
_deton.stopMove(null);
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DO_SOMETHING_ABOUT_THESE_MONSTERS_SHOW_ME_YOUR_STRENGTH_I_LL_BE_WAITING_OVER_THERE);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_1);
startQuestTimer("delete_daton", 5000, world.getNpc(DETON), null);
break;
}
case "switch_quest":
@@ -496,7 +496,6 @@ public class StoryOfTauti extends AbstractInstance
}
case "end_instance":
{
cancelQuestTimers("check_flower");
_count = 0;
for (Npc n : world.getAliveNpcs())
{
@@ -521,14 +520,14 @@ public class StoryOfTauti extends AbstractInstance
{
if (npc.isScriptValue(0))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SEALED_TABLET_ATTACK_THE_FLAME_FLOWERS_OH_PLANT_THE_FLAME_FLOWERS_AROUND_THE_TABLET_AND_ATTACK_IT_NOW);
npc.setScriptValue(1);
break;
}
if (npc.isScriptValue(1) && (npc.getCurrentHpPercent() < 60))
{
_seal_device.setDisplayEffect(1);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YES_LOOK_AT_THAT_THE_SEAL_IS_BREAKING_JUST_A_LITTLE_MORE);
npc.setScriptValue(2);
break;
}
@@ -569,10 +568,10 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(10) && (npc.getCurrentHpPercent() < 30))
{
world.spawnGroup("last_deton");
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, _deton, null);
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_3);
startQuestTimer("msg_12", 6000, world.getNpc(DETON), null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NICE_NICE_I_SEE_THAT_EVERYONE_S_FIGHTING_HARD_FOR_ME);
world.setStatus(11);
}
if (world.isStatus(11) && (npc.getCurrentHpPercent() < 5))
@@ -603,7 +602,7 @@ public class StoryOfTauti extends AbstractInstance
}
}
});
startQuestTimer("end_instance", 52000, _deton, null);
startQuestTimer("end_instance", 52000, world.getNpc(DETON), null);
world.despawnGroup("last_deton");
world.despawnGroup("last_archagel");
playMovie(world.getPlayers(), Movie.EPIC_TAUTI_SCENE);
@@ -627,21 +626,20 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(3) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
cancelQuestTimers("end_instance");
cancelQuestTimers("check_flower");
cancelQuestTimer("end_instance", world.getNpc(DETON), null);
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, true, true, 0, 0, NpcStringId.ELAPSED_TIME)));
world.setStatus(4);
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1000, pl ->
{
if ((pl.isInParty() && pl.getParty().isLeader(pl)) || pl.isGM())
{
_deton.setTarget(pl);
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
world.getNpc(DETON).setTarget(pl);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, pl);
}
});
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, _deton, null);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ANYWAY_THE_STAKATOS_WILL_NOT_COME_OUT_ANYMORE_WHY_WELL);
startQuestTimer("msg_7", 7000, world.getNpc(DETON), null);
}
break;
}
@@ -650,7 +648,7 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(5) && (world.getAliveNpcs(MonsterInstance.class).size() < 2))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LEFT_OR_RIGHT_WHICH_WAY, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
startQuestTimer("msg_8", 3000, _deton, null);
startQuestTimer("msg_8", 3000, world.getNpc(DETON), null);
world.setStatus(6);
}
break;
@@ -660,9 +658,9 @@ public class StoryOfTauti extends AbstractInstance
_seal_device.setDisplayEffect(3);
_seal_device.doDie(npc);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.LET_S_GO_DOWN_THIS_WAY_I_LL_BE_RIGHT_BEHIND_YOU, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.setRunning();
_deton.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, _deton, null);
world.getNpc(DETON).setRunning();
world.getNpc(DETON).getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, DETON_MOVE_2);
startQuestTimer("msg_11", 3000, world.getNpc(DETON), null);
break;
}
case SEALED_ANGEL:
@@ -690,13 +688,13 @@ public class StoryOfTauti extends AbstractInstance
if (((player.isInParty() && player.getParty().isLeader(player)) || player.isGM()) && world.isStatus(1))
{
world.setStatus(2);
_deton.setTarget(null);
_deton.stopMove(null);
startQuestTimer("msg_4", 7000, _deton, null);
world.getNpc(DETON).setTarget(null);
world.getNpc(DETON).stopMove(null);
startQuestTimer("msg_4", 7000, world.getNpc(DETON), null);
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.IT_S_A_FLAME_FLOWER_THESE_SHOULD_COME_IN_HANDY_LATER_ON, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
world.getPlayers().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 180, 0, NpcStringId.ELAPSED_TIME)));
startQuestTimer("end_instance", 190000, _deton, null);
startQuestTimer("spawn_stacato", 5000, _deton, null);
startQuestTimer("end_instance", 190000, world.getNpc(DETON), null);
startQuestTimer("spawn_stacato", 5000, world.getNpc(DETON), null);
}
break;
}
@@ -704,7 +702,7 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(0))
{
startQuestTimer("check_status", 21000, _deton, player);
startQuestTimer("check_status", 21000, world.getNpc(DETON), player);
world.setStatus(1);
}
break;
@@ -714,8 +712,8 @@ public class StoryOfTauti extends AbstractInstance
if (world.isStatus(4))
{
world.broadcastPacket(new ExShowScreenMessage(NpcStringId.A_CROSSROADS_I_DON_T_KNOW_WHICH_WAY_WE_SHOULD_TAKE, ExShowScreenMessage.BOTTOM_RIGHT, 10000, false));
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_WHAT_IS_THIS_I_DON_T_THINK_I_VE_BEEN_AROUND_HERE_BEFORE_THIS_EERIE_FEELING);
startQuestTimer("spawn_scorpion", 5000, world.getNpc(DETON), player);
world.setStatus(5);
}
break;
@@ -724,8 +722,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OKAY_IT_DOES_LOOK_BETTER_THAN_THE_OTHER_WAY_THE_AIR_FEELS_BETTER_ALREADY);
startQuestTimer("spawn_golem", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -753,8 +751,8 @@ public class StoryOfTauti extends AbstractInstance
{
if (world.isStatus(6))
{
_deton.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, _deton, player);
world.getNpc(DETON).broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_WAY_FEELS_MUCH_SAFER_GOOD_CHOICE_THE_AIR_FEELS_DIFFERENT);
startQuestTimer("spawn_scarab", 7000, world.getNpc(DETON), player);
world.setStatus(7);
}
break;
@@ -773,11 +771,6 @@ public class StoryOfTauti extends AbstractInstance
{
switch (npc.getId())
{
case DETON:
{
_deton = npc;
break;
}
case SEAL_DEVICE:
{
_seal_device = npc;
@@ -798,7 +791,7 @@ public class StoryOfTauti extends AbstractInstance
}
case FLAME_STACATO:
{
startQuestTimer("check_flower", 3000, npc, null, true);
startQuestTimer("check_flower", 3000, npc, null);
break;
}
case FLAME_SCORPION:

View File

@@ -34,7 +34,7 @@ import instances.AbstractInstance;
* Nornils Garden Instance
* @URL https://l2wiki.com/Nornils_Garden
* @Video https://www.youtube.com/watch?v=6QKzzmJ5GUs
* @author Gigi
* @author Gigi, Mobius
* @date 2017-02-22 - [15:22:27]
*/
public class NornilsGarden extends AbstractInstance
@@ -120,7 +120,7 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(5) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200016, true);
cancelQuestTimers("stage2");
cancelQuestTimer("stage2", npc, null);
world.spawnGroup("wave_3");
}
break;
@@ -130,14 +130,13 @@ public class NornilsGarden extends AbstractInstance
if (world.isStatus(6) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.openCloseDoor(16200201, true);
cancelQuestTimers("stage3");
cancelQuestTimers("check_agrro");
cancelQuestTimer("stage3", npc, null);
}
break;
}
case "check_agrro":
{
if ((world != null) && !npc.isDead() && !npc.isInCombat())
if ((world != null) && !npc.isDead() && !npc.isInCombat() && !world.getDoor(16200201).isOpen())
{
World.getInstance().forEachVisibleObjectInRange(npc, PlayerInstance.class, 1500, knownChar ->
{
@@ -148,6 +147,7 @@ public class NornilsGarden extends AbstractInstance
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, knownChar);
}
});
startQuestTimer("check_agrro", 1000, npc, null);
}
break;
}
@@ -209,7 +209,7 @@ public class NornilsGarden extends AbstractInstance
{
if (npc.getId() == BOZ_STAGE1)
{
cancelQuestTimers("stage1_1");
cancelQuestTimer("stage1_1", npc, null);
world.openCloseDoor(16200015, true);
world.setStatus(1);
}
@@ -301,7 +301,7 @@ public class NornilsGarden extends AbstractInstance
if (isInInstance(world) && (CommonUtil.contains(ATTACABLE_MONSTERS, npc.getId())))
{
((Attackable) npc).setCanReturnToSpawnPoint(false);
startQuestTimer("check_agrro", 1000, npc, null, true);
startQuestTimer("check_agrro", 1000, npc, null);
}
return super.onSpawn(npc);
}

View File

@@ -137,7 +137,7 @@ public class SSQDisciplesNecropolisPast extends AbstractInstance
{
anakimGroup.add(addSpawn(entry.getKey(), entry.getValue(), false, 0, false, world.getInstanceId()));
}
world.getParameters().set("anakimGroup", anakimGroup);
world.setParameter("anakimGroup", anakimGroup);
}
private synchronized void checkDoors(Npc npc, InstanceWorld world)

View File

@@ -1173,10 +1173,10 @@ public class FinalEmperialTomb extends AbstractInstance implements IXmlReader
case 27:
{
final Npc activeScarlet = _world.getParameters().getObject("activeScarlet", Npc.class);
_world.getParameters().set("scarlet_x", activeScarlet.getX());
_world.getParameters().set("scarlet_y", activeScarlet.getY());
_world.getParameters().set("scarlet_z", activeScarlet.getZ());
_world.getParameters().set("scarlet_h", activeScarlet.getHeading());
_world.setParameter("scarlet_x", activeScarlet.getX());
_world.setParameter("scarlet_y", activeScarlet.getY());
_world.setParameter("scarlet_z", activeScarlet.getZ());
_world.setParameter("scarlet_h", activeScarlet.getHeading());
final int scarlet_a;
if (activeScarlet.getHeading() < 32768)
{
@@ -1186,7 +1186,7 @@ public class FinalEmperialTomb extends AbstractInstance implements IXmlReader
{
scarlet_a = Math.abs(540 - (int) (activeScarlet.getHeading() / 182.044444444));
}
_world.getParameters().set("scarlet_a", scarlet_a);
_world.setParameter("scarlet_a", scarlet_a);
broadCastPacket(_world, new SpecialCamera(activeScarlet, 250, scarlet_a, 12, 0, 1000, 0, 0, 1, 0, 0));
broadCastPacket(_world, new SpecialCamera(activeScarlet, 250, scarlet_a, 12, 0, 10000, 0, 0, 1, 0, 0));
ThreadPool.schedule(new IntroTask(_world, 28), 500);

View File

@@ -137,7 +137,7 @@ public class SSQDisciplesNecropolisPast extends AbstractInstance
{
anakimGroup.add(addSpawn(entry.getKey(), entry.getValue(), false, 0, false, world.getInstanceId()));
}
world.getParameters().set("anakimGroup", anakimGroup);
world.setParameter("anakimGroup", anakimGroup);
}
private synchronized void checkDoors(Npc npc, InstanceWorld world)

View File

@@ -43,17 +43,17 @@ public class ResidenceOfKingIgnis extends AbstractInstance
private static final int FREYA = 29109;
private static final int IGNIS = 29105;
// Skills
private static SkillHolder FIRE_RAG_1 = new SkillHolder(50050, 1);
private static SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
private static SkillHolder FIRE_RAG_3 = new SkillHolder(50050, 3);
private static SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
private static SkillHolder FIRE_RAG_5 = new SkillHolder(50050, 5);
private static SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
private static SkillHolder FIRE_RAG_7 = new SkillHolder(50050, 7);
private static SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
private static SkillHolder FIRE_RAG_9 = new SkillHolder(50050, 9);
private static SkillHolder FIRE_RAG_10 = new SkillHolder(50050, 10);
private static SkillHolder FREYA_SAFETY_ZONE = new SkillHolder(50052, 1); // Just for an effect
private static final SkillHolder FIRE_RAG_1 = new SkillHolder(50050, 1);
private static final SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
private static final SkillHolder FIRE_RAG_3 = new SkillHolder(50050, 3);
private static final SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
private static final SkillHolder FIRE_RAG_5 = new SkillHolder(50050, 5);
private static final SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
private static final SkillHolder FIRE_RAG_7 = new SkillHolder(50050, 7);
private static final SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
private static final SkillHolder FIRE_RAG_9 = new SkillHolder(50050, 9);
private static final SkillHolder FIRE_RAG_10 = new SkillHolder(50050, 10);
private static final SkillHolder FREYA_SAFETY_ZONE = new SkillHolder(50052, 1); // Just for an effect
// Misc
private static final int TEMPLATE_ID = 195;
private static final Map<PlayerInstance, Integer> _playerFireRage = new ConcurrentHashMap<>();

View File

@@ -18,9 +18,7 @@ package instances.ResidenceOfKingPetram;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -28,7 +26,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import instances.AbstractInstance;
/**
* @author RobikBobik
* @author RobikBobik, Mobius
* @NOTE: Retail like working
* @TODO: Rewrite code to modern style.
* @TODO: Petram Skills and minion skills
@@ -41,17 +39,11 @@ public class ResidenceOfKingPetram extends AbstractInstance
private static final int PETRAM_PIECE = 29116;
private static final int PETRAM_FRAGMENT = 29117;
// Skills
private static SkillHolder EARTh_ENERGY = new SkillHolder(50066, 1); // When spawn Minion.
private static SkillHolder EARTh_FURY = new SkillHolder(50059, 1); // When change invul state.
private static SkillHolder TEST = new SkillHolder(5712, 1); // TODO: This test skill is only for visual effect, but need to find correct skill ID.
private static final SkillHolder EARTH_ENERGY = new SkillHolder(50066, 1); // When spawn Minion.
private static final SkillHolder EARTH_FURY = new SkillHolder(50059, 1); // When change invul state.
private static final SkillHolder TEST = new SkillHolder(5712, 1); // TODO: This test skill is only for visual effect, but need to find correct skill ID.
// Misc
private static final int TEMPLATE_ID = 198;
private RaidBossInstance _petram = null;
private MonsterInstance _minion_1 = null;
private MonsterInstance _minion_2 = null;
private MonsterInstance _minion_3 = null;
private MonsterInstance _minion_4 = null;
private boolean _spawned_minions;
public ResidenceOfKingPetram()
{
@@ -70,54 +62,63 @@ public class ResidenceOfKingPetram extends AbstractInstance
case "ENTER":
{
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
_petram = (RaidBossInstance) player.getInstanceWorld().getNpc(PETRAM);
}
break;
}
case "SPAWN_MINION":
{
_petram.useMagic(EARTh_ENERGY.getSkill());
// Prevent to double or higher spawn when HP is between 68-70% + etc...
if (!_spawned_minions)
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_minion_1 = (MonsterInstance) addSpawn(npc, PETRAM_PIECE, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId());
_minion_2 = (MonsterInstance) addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId());
_minion_3 = (MonsterInstance) addSpawn(npc, PETRAM_PIECE, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId());
_minion_4 = (MonsterInstance) addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId());
_spawned_minions = true;
world.getNpc(PETRAM).doCast(EARTH_ENERGY.getSkill());
// Prevent to double or higher spawn when HP is between 68-70% + etc...
if (!world.getParameters().getBoolean("spawnedMinions", false))
{
world.setParameter("minion1", addSpawn(npc, PETRAM_PIECE, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId()));
world.setParameter("minion2", addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId()));
world.setParameter("minion3", addSpawn(npc, PETRAM_PIECE, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId()));
world.setParameter("minion4", addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId()));
world.getParameters().set("spawnedMinions", true);
}
startQuestTimer("SUPPORT_PETRAM", 3000, npc, null);
}
startQuestTimer("SUPPORT_PETRAM", 3000, npc, null);
break;
}
case "SUPPORT_PETRAM":
{
_minion_1.setTarget(_petram);
_minion_1.useMagic(TEST.getSkill());
_minion_2.setTarget(_petram);
_minion_2.useMagic(TEST.getSkill());
_minion_3.setTarget(_petram);
_minion_3.useMagic(TEST.getSkill());
_minion_4.setTarget(_petram);
_minion_4.useMagic(TEST.getSkill());
startQuestTimer("SUPPORT_PETRAM", 10100, npc, null); // NOTE: When find correct skill this number is reuse skill + 100
final Instance world = npc.getInstanceWorld();
if (world != null)
{
world.getParameters().getObject("minion1", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion1", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion2", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion2", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion3", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion3", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion4", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion4", Npc.class).doCast(TEST.getSkill());
startQuestTimer("SUPPORT_PETRAM", 10100, npc, null); // NOTE: When find correct skill this number is reuse skill + 100
}
break;
}
case "INVUL_MODE":
{
_petram.useMagic(EARTh_FURY.getSkill());
if (_petram.isInvul())
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_petram.setInvul(false);
_petram.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
}
else
{
_petram.setInvul(true);
_petram.broadcastSay(ChatType.NPC_SHOUT, "HaHa, fighters lets kill them. Now Im invul!!!");
final Npc petram = world.getNpc(PETRAM);
petram.doCast(EARTH_FURY.getSkill());
if (petram.isInvul())
{
petram.setInvul(false);
petram.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
}
else
{
petram.setInvul(true);
petram.broadcastSay(ChatType.NPC_SHOUT, "HaHa, fighters lets kill them. Now Im invul!!!");
}
}
break;
}
@@ -157,18 +158,20 @@ public class ResidenceOfKingPetram extends AbstractInstance
@Override
public String onKill(Npc npc, PlayerInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world == null)
{
return null;
}
if (npc.getId() == PETRAM)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
world.finishInstance();
}
world.finishInstance();
}
else if ((_minion_1.isDead()) && (_minion_2.isDead()) && (_minion_3.isDead()) && (_minion_4.isDead()))
else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()) && (world.getParameters().getObject("minion4", Npc.class).isDead()))
{
startQuestTimer("INVUL_MODE", 3000, _petram, null);
_spawned_minions = false;
startQuestTimer("INVUL_MODE", 3000, world.getNpc(PETRAM), null);
world.getParameters().set("spawnedMinions", false);
}
return super.onKill(npc, player, isSummon);
}

View File

@@ -17,9 +17,7 @@
package instances.ResidenceOfKingProcella;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.skills.SkillCaster;
@@ -27,7 +25,7 @@ import org.l2jmobius.gameserver.model.skills.SkillCaster;
import instances.AbstractInstance;
/**
* @author RobikBobik
* @author RobikBobik, Mobius
* @NOTE: Retail like working
* @TODO: Rewrite code to modern style.
*/
@@ -46,12 +44,7 @@ public class ResidenceOfKingProcella extends AbstractInstance
private static final SkillHolder HURRICANE_BOLT_LV_1 = new SkillHolder(50043, 1); // When player in Radius + para
// Misc
private static final int TEMPLATE_ID = 197;
private static int STORM_MAX_COUNT = 16; // TODO: Max is limit ?
private int _procellaStormCount;
private RaidBossInstance _procella;
private MonsterInstance _minion1;
private MonsterInstance _minion2;
private MonsterInstance _minion3;
private static final int STORM_MAX_COUNT = 16; // TODO: Max is limit ?
public ResidenceOfKingProcella()
{
@@ -69,46 +62,56 @@ public class ResidenceOfKingProcella extends AbstractInstance
case "ENTER":
{
enterInstance(player, npc, TEMPLATE_ID);
_procella = (RaidBossInstance) addSpawn(PROCELLA, 212862, 179828, -15489, 49151, false, 0, true, player.getInstanceId());
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), _procella, player);
startQuestTimer("SPAWN_STORM", 5000, _procella, player);
_procellaStormCount = 0;
final Instance world = player.getInstanceWorld();
if (world != null)
{
final Npc procella = addSpawn(PROCELLA, 212862, 179828, -15489, 49151, false, 0, true, player.getInstanceId());
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), procella, player);
startQuestTimer("SPAWN_STORM", 5000, procella, player);
world.setParameter("stormCount", 0);
}
break;
}
case "SPAWN_MINION":
{
if (npc.getId() == PROCELLA)
final Instance world = npc.getInstanceWorld();
if ((world != null) && (npc.getId() == PROCELLA))
{
_minion1 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId());
_minion2 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_2, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId());
_minion3 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_3, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId());
startQuestTimer("HIDE_PROCELLA", 1000, _procella, null);
world.setParameter("minion1", addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId()));
world.setParameter("minion2", addSpawn(PROCELLA_GUARDIAN_2, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId()));
world.setParameter("minion3", addSpawn(PROCELLA_GUARDIAN_3, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId()));
startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
}
break;
}
case "SPAWN_STORM":
{
if (_procellaStormCount < STORM_MAX_COUNT)
final Instance world = npc.getInstanceWorld();
if ((world != null) && (world.getParameters().getInt("stormCount", 0) < STORM_MAX_COUNT))
{
_procella.useMagic(HURRICANE_SUMMON.getSkill());
final Npc procellaStorm = addSpawn(PROCELLA_STORM, _procella.getX() + getRandom(-500, 500), _procella.getY() + getRandom(-500, 500), _procella.getZ(), 31011, true, 0, true, npc.getInstanceId());
world.getNpc(PROCELLA).doCast(HURRICANE_SUMMON.getSkill());
final Npc procellaStorm = addSpawn(PROCELLA_STORM, world.getNpc(PROCELLA).getX() + getRandom(-500, 500), world.getNpc(PROCELLA).getY() + getRandom(-500, 500), world.getNpc(PROCELLA).getZ(), 31011, true, 0, true, npc.getInstanceId());
procellaStorm.setRandomWalking(true);
_procellaStormCount++;
startQuestTimer("SPAWN_STORM", 60000, _procella, null);
world.getParameters().increaseInt("stormCount", 1);
startQuestTimer("SPAWN_STORM", 60000, world.getNpc(PROCELLA), null);
startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, procellaStorm, player); // All time checking
}
break;
}
case "HIDE_PROCELLA":
{
if (_procella.isInvisible())
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_procella.setInvisible(false);
}
else
{
_procella.setInvisible(true);
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), _procella, player);
if (world.getNpc(PROCELLA).isInvisible())
{
world.getNpc(PROCELLA).setInvisible(false);
}
else
{
world.getNpc(PROCELLA).setInvisible(true);
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), world.getNpc(PROCELLA), player);
}
}
break;
}
@@ -151,21 +154,24 @@ public class ResidenceOfKingProcella extends AbstractInstance
@Override
public String onKill(Npc npc, PlayerInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world == null)
{
return null;
}
if (npc.getId() == PROCELLA)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
cancelQuestTimer("SPAWN_MINION", npc, player);
cancelQuestTimer("SPAWN_STORM", npc, player);
cancelQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", npc, player);
world.finishInstance();
}
cancelQuestTimer("SPAWN_MINION", npc, player);
cancelQuestTimer("SPAWN_STORM", npc, player);
cancelQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", npc, player);
world.finishInstance();
}
else if ((_minion1.isDead()) && (_minion2.isDead()) && (_minion3.isDead()))
else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()))
{
startQuestTimer("HIDE_PROCELLA", 1000, _procella, null);
startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
}
return super.onKill(npc, player, isSummon);
}

View File

@@ -41,12 +41,12 @@ public class ResidenceOfQueenNebula extends AbstractInstance
private static final int WATER_SLIME = 29111;
// Skills
private static final int AQUA_RAGE = 50036;
private static SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
private static SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
private static SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
private static SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
private static SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
private static SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
private static final SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
private static final SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
private static final SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
private static final SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
private static final SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
private static final SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
// Misc
private static final int TEMPLATE_ID = 196;

View File

@@ -47,10 +47,10 @@ public class SevenSignsRBs extends AbstractInstance
private static final int ANAKIM_TEMPLATE_ID = 200;
private static final int LILITH_TEMPLATE_ID = 199;
private static int MAX_PLAYERS_IN_ZONE = 300;
private static final int MAX_PLAYERS_IN_ZONE = 300;
private static final NoRestartZone _anakim_zone = ZoneManager.getInstance().getZoneById(70052, NoRestartZone.class);
private static final NoRestartZone _lilith_zone = ZoneManager.getInstance().getZoneById(70053, NoRestartZone.class);
private static final NoRestartZone ANAKIM_ZONE = ZoneManager.getInstance().getZoneById(70052, NoRestartZone.class);
private static final NoRestartZone LILITH_ZONE = ZoneManager.getInstance().getZoneById(70053, NoRestartZone.class);
// TELEPORTS
private static final Location[] TELEPORT_TO_DARK_ELVEN =
@@ -89,7 +89,7 @@ public class SevenSignsRBs extends AbstractInstance
final boolean isInCC = party.isInCommandChannel();
final List<PlayerInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
if (members.size() > (MAX_PLAYERS_IN_ZONE - _anakim_zone.getPlayersInside().size()))
if (members.size() > (MAX_PLAYERS_IN_ZONE - ANAKIM_ZONE.getPlayersInside().size()))
{
player.sendMessage("Lilith Sanctum reached 300 players. You cannot enter now.");
}
@@ -128,7 +128,7 @@ public class SevenSignsRBs extends AbstractInstance
final boolean isInCC = party.isInCommandChannel();
final List<PlayerInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
if (members.size() > (MAX_PLAYERS_IN_ZONE - _lilith_zone.getPlayersInside().size()))
if (members.size() > (MAX_PLAYERS_IN_ZONE - LILITH_ZONE.getPlayersInside().size()))
{
player.sendMessage("Lilith Sanctum reached 300 players. You cannot enter now.");
}
@@ -161,7 +161,7 @@ public class SevenSignsRBs extends AbstractInstance
}
case "REMOVE_PLAYERS_FROM_ZONE_ANAKIM":
{
for (Creature charInside : _anakim_zone.getCharactersInside())
for (Creature charInside : ANAKIM_ZONE.getCharactersInside())
{
if ((charInside != null) && charInside.isPlayer())
{
@@ -172,7 +172,7 @@ public class SevenSignsRBs extends AbstractInstance
}
case "REMOVE_PLAYERS_FROM_ZONE_LILITH":
{
for (Creature charInside : _lilith_zone.getCharactersInside())
for (Creature charInside : LILITH_ZONE.getCharactersInside())
{
if ((charInside != null) && charInside.isPlayer())
{

View File

@@ -43,17 +43,17 @@ public class ResidenceOfKingIgnis extends AbstractInstance
private static final int FREYA = 29109;
private static final int IGNIS = 29105;
// Skills
private static SkillHolder FIRE_RAG_1 = new SkillHolder(50050, 1);
private static SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
private static SkillHolder FIRE_RAG_3 = new SkillHolder(50050, 3);
private static SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
private static SkillHolder FIRE_RAG_5 = new SkillHolder(50050, 5);
private static SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
private static SkillHolder FIRE_RAG_7 = new SkillHolder(50050, 7);
private static SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
private static SkillHolder FIRE_RAG_9 = new SkillHolder(50050, 9);
private static SkillHolder FIRE_RAG_10 = new SkillHolder(50050, 10);
private static SkillHolder FREYA_SAFETY_ZONE = new SkillHolder(50052, 1); // Just for an effect
private static final SkillHolder FIRE_RAG_1 = new SkillHolder(50050, 1);
private static final SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
private static final SkillHolder FIRE_RAG_3 = new SkillHolder(50050, 3);
private static final SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
private static final SkillHolder FIRE_RAG_5 = new SkillHolder(50050, 5);
private static final SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
private static final SkillHolder FIRE_RAG_7 = new SkillHolder(50050, 7);
private static final SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
private static final SkillHolder FIRE_RAG_9 = new SkillHolder(50050, 9);
private static final SkillHolder FIRE_RAG_10 = new SkillHolder(50050, 10);
private static final SkillHolder FREYA_SAFETY_ZONE = new SkillHolder(50052, 1); // Just for an effect
// Misc
private static final int TEMPLATE_ID = 195;
private static final Map<PlayerInstance, Integer> _playerFireRage = new ConcurrentHashMap<>();

View File

@@ -18,9 +18,7 @@ package instances.ResidenceOfKingPetram;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -28,7 +26,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import instances.AbstractInstance;
/**
* @author RobikBobik
* @author RobikBobik, Mobius
* @NOTE: Retail like working
* @TODO: Rewrite code to modern style.
* @TODO: Petram Skills and minion skills
@@ -41,17 +39,11 @@ public class ResidenceOfKingPetram extends AbstractInstance
private static final int PETRAM_PIECE = 29116;
private static final int PETRAM_FRAGMENT = 29117;
// Skills
private static SkillHolder EARTh_ENERGY = new SkillHolder(50066, 1); // When spawn Minion.
private static SkillHolder EARTh_FURY = new SkillHolder(50059, 1); // When change invul state.
private static SkillHolder TEST = new SkillHolder(5712, 1); // TODO: This test skill is only for visual effect, but need to find correct skill ID.
private static final SkillHolder EARTH_ENERGY = new SkillHolder(50066, 1); // When spawn Minion.
private static final SkillHolder EARTH_FURY = new SkillHolder(50059, 1); // When change invul state.
private static final SkillHolder TEST = new SkillHolder(5712, 1); // TODO: This test skill is only for visual effect, but need to find correct skill ID.
// Misc
private static final int TEMPLATE_ID = 198;
private RaidBossInstance _petram = null;
private MonsterInstance _minion_1 = null;
private MonsterInstance _minion_2 = null;
private MonsterInstance _minion_3 = null;
private MonsterInstance _minion_4 = null;
private boolean _spawned_minions;
public ResidenceOfKingPetram()
{
@@ -70,54 +62,63 @@ public class ResidenceOfKingPetram extends AbstractInstance
case "ENTER":
{
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
_petram = (RaidBossInstance) player.getInstanceWorld().getNpc(PETRAM);
}
break;
}
case "SPAWN_MINION":
{
_petram.useMagic(EARTh_ENERGY.getSkill());
// Prevent to double or higher spawn when HP is between 68-70% + etc...
if (!_spawned_minions)
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_minion_1 = (MonsterInstance) addSpawn(npc, PETRAM_PIECE, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId());
_minion_2 = (MonsterInstance) addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId());
_minion_3 = (MonsterInstance) addSpawn(npc, PETRAM_PIECE, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId());
_minion_4 = (MonsterInstance) addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId());
_spawned_minions = true;
world.getNpc(PETRAM).doCast(EARTH_ENERGY.getSkill());
// Prevent to double or higher spawn when HP is between 68-70% + etc...
if (!world.getParameters().getBoolean("spawnedMinions", false))
{
world.setParameter("minion1", addSpawn(npc, PETRAM_PIECE, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId()));
world.setParameter("minion2", addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId()));
world.setParameter("minion3", addSpawn(npc, PETRAM_PIECE, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId()));
world.setParameter("minion4", addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId()));
world.getParameters().set("spawnedMinions", true);
}
startQuestTimer("SUPPORT_PETRAM", 3000, npc, null);
}
startQuestTimer("SUPPORT_PETRAM", 3000, npc, null);
break;
}
case "SUPPORT_PETRAM":
{
_minion_1.setTarget(_petram);
_minion_1.useMagic(TEST.getSkill());
_minion_2.setTarget(_petram);
_minion_2.useMagic(TEST.getSkill());
_minion_3.setTarget(_petram);
_minion_3.useMagic(TEST.getSkill());
_minion_4.setTarget(_petram);
_minion_4.useMagic(TEST.getSkill());
startQuestTimer("SUPPORT_PETRAM", 10100, npc, null); // NOTE: When find correct skill this number is reuse skill + 100
final Instance world = npc.getInstanceWorld();
if (world != null)
{
world.getParameters().getObject("minion1", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion1", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion2", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion2", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion3", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion3", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion4", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion4", Npc.class).doCast(TEST.getSkill());
startQuestTimer("SUPPORT_PETRAM", 10100, npc, null); // NOTE: When find correct skill this number is reuse skill + 100
}
break;
}
case "INVUL_MODE":
{
_petram.useMagic(EARTh_FURY.getSkill());
if (_petram.isInvul())
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_petram.setInvul(false);
_petram.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
}
else
{
_petram.setInvul(true);
_petram.broadcastSay(ChatType.NPC_SHOUT, "HaHa, fighters lets kill them. Now Im invul!!!");
final Npc petram = world.getNpc(PETRAM);
petram.doCast(EARTH_FURY.getSkill());
if (petram.isInvul())
{
petram.setInvul(false);
petram.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
}
else
{
petram.setInvul(true);
petram.broadcastSay(ChatType.NPC_SHOUT, "HaHa, fighters lets kill them. Now Im invul!!!");
}
}
break;
}
@@ -157,18 +158,20 @@ public class ResidenceOfKingPetram extends AbstractInstance
@Override
public String onKill(Npc npc, PlayerInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world == null)
{
return null;
}
if (npc.getId() == PETRAM)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
world.finishInstance();
}
world.finishInstance();
}
else if ((_minion_1.isDead()) && (_minion_2.isDead()) && (_minion_3.isDead()) && (_minion_4.isDead()))
else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()) && (world.getParameters().getObject("minion4", Npc.class).isDead()))
{
startQuestTimer("INVUL_MODE", 3000, _petram, null);
_spawned_minions = false;
startQuestTimer("INVUL_MODE", 3000, world.getNpc(PETRAM), null);
world.getParameters().set("spawnedMinions", false);
}
return super.onKill(npc, player, isSummon);
}

View File

@@ -17,9 +17,7 @@
package instances.ResidenceOfKingProcella;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.skills.SkillCaster;
@@ -27,7 +25,7 @@ import org.l2jmobius.gameserver.model.skills.SkillCaster;
import instances.AbstractInstance;
/**
* @author RobikBobik
* @author RobikBobik, Mobius
* @NOTE: Retail like working
* @TODO: Rewrite code to modern style.
*/
@@ -46,12 +44,7 @@ public class ResidenceOfKingProcella extends AbstractInstance
private static final SkillHolder HURRICANE_BOLT_LV_1 = new SkillHolder(50043, 1); // When player in Radius + para
// Misc
private static final int TEMPLATE_ID = 197;
private static int STORM_MAX_COUNT = 16; // TODO: Max is limit ?
private int _procellaStormCount;
private RaidBossInstance _procella;
private MonsterInstance _minion1;
private MonsterInstance _minion2;
private MonsterInstance _minion3;
private static final int STORM_MAX_COUNT = 16; // TODO: Max is limit ?
public ResidenceOfKingProcella()
{
@@ -69,46 +62,56 @@ public class ResidenceOfKingProcella extends AbstractInstance
case "ENTER":
{
enterInstance(player, npc, TEMPLATE_ID);
_procella = (RaidBossInstance) addSpawn(PROCELLA, 212862, 179828, -15489, 49151, false, 0, true, player.getInstanceId());
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), _procella, player);
startQuestTimer("SPAWN_STORM", 5000, _procella, player);
_procellaStormCount = 0;
final Instance world = player.getInstanceWorld();
if (world != null)
{
final Npc procella = addSpawn(PROCELLA, 212862, 179828, -15489, 49151, false, 0, true, player.getInstanceId());
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), procella, player);
startQuestTimer("SPAWN_STORM", 5000, procella, player);
world.setParameter("stormCount", 0);
}
break;
}
case "SPAWN_MINION":
{
if (npc.getId() == PROCELLA)
final Instance world = npc.getInstanceWorld();
if ((world != null) && (npc.getId() == PROCELLA))
{
_minion1 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId());
_minion2 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_2, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId());
_minion3 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_3, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId());
startQuestTimer("HIDE_PROCELLA", 1000, _procella, null);
world.setParameter("minion1", addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId()));
world.setParameter("minion2", addSpawn(PROCELLA_GUARDIAN_2, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId()));
world.setParameter("minion3", addSpawn(PROCELLA_GUARDIAN_3, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId()));
startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
}
break;
}
case "SPAWN_STORM":
{
if (_procellaStormCount < STORM_MAX_COUNT)
final Instance world = npc.getInstanceWorld();
if ((world != null) && (world.getParameters().getInt("stormCount", 0) < STORM_MAX_COUNT))
{
_procella.useMagic(HURRICANE_SUMMON.getSkill());
final Npc procellaStorm = addSpawn(PROCELLA_STORM, _procella.getX() + getRandom(-500, 500), _procella.getY() + getRandom(-500, 500), _procella.getZ(), 31011, true, 0, true, npc.getInstanceId());
world.getNpc(PROCELLA).doCast(HURRICANE_SUMMON.getSkill());
final Npc procellaStorm = addSpawn(PROCELLA_STORM, world.getNpc(PROCELLA).getX() + getRandom(-500, 500), world.getNpc(PROCELLA).getY() + getRandom(-500, 500), world.getNpc(PROCELLA).getZ(), 31011, true, 0, true, npc.getInstanceId());
procellaStorm.setRandomWalking(true);
_procellaStormCount++;
startQuestTimer("SPAWN_STORM", 60000, _procella, null);
world.getParameters().increaseInt("stormCount", 1);
startQuestTimer("SPAWN_STORM", 60000, world.getNpc(PROCELLA), null);
startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, procellaStorm, player); // All time checking
}
break;
}
case "HIDE_PROCELLA":
{
if (_procella.isInvisible())
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_procella.setInvisible(false);
}
else
{
_procella.setInvisible(true);
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), _procella, player);
if (world.getNpc(PROCELLA).isInvisible())
{
world.getNpc(PROCELLA).setInvisible(false);
}
else
{
world.getNpc(PROCELLA).setInvisible(true);
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), world.getNpc(PROCELLA), player);
}
}
break;
}
@@ -151,21 +154,24 @@ public class ResidenceOfKingProcella extends AbstractInstance
@Override
public String onKill(Npc npc, PlayerInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world == null)
{
return null;
}
if (npc.getId() == PROCELLA)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
cancelQuestTimer("SPAWN_MINION", npc, player);
cancelQuestTimer("SPAWN_STORM", npc, player);
cancelQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", npc, player);
world.finishInstance();
}
cancelQuestTimer("SPAWN_MINION", npc, player);
cancelQuestTimer("SPAWN_STORM", npc, player);
cancelQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", npc, player);
world.finishInstance();
}
else if ((_minion1.isDead()) && (_minion2.isDead()) && (_minion3.isDead()))
else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()))
{
startQuestTimer("HIDE_PROCELLA", 1000, _procella, null);
startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
}
return super.onKill(npc, player, isSummon);
}

View File

@@ -41,12 +41,12 @@ public class ResidenceOfQueenNebula extends AbstractInstance
private static final int WATER_SLIME = 29111;
// Skills
private static final int AQUA_RAGE = 50036;
private static SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
private static SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
private static SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
private static SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
private static SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
private static SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
private static final SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
private static final SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
private static final SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
private static final SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
private static final SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
private static final SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
// Misc
private static final int TEMPLATE_ID = 196;

View File

@@ -47,10 +47,10 @@ public class SevenSignsRBs extends AbstractInstance
private static final int ANAKIM_TEMPLATE_ID = 200;
private static final int LILITH_TEMPLATE_ID = 199;
private static int MAX_PLAYERS_IN_ZONE = 300;
private static final int MAX_PLAYERS_IN_ZONE = 300;
private static final NoRestartZone _anakim_zone = ZoneManager.getInstance().getZoneById(70052, NoRestartZone.class);
private static final NoRestartZone _lilith_zone = ZoneManager.getInstance().getZoneById(70053, NoRestartZone.class);
private static final NoRestartZone ANAKIM_ZONE = ZoneManager.getInstance().getZoneById(70052, NoRestartZone.class);
private static final NoRestartZone LILITH_ZONE = ZoneManager.getInstance().getZoneById(70053, NoRestartZone.class);
// TELEPORTS
private static final Location[] TELEPORT_TO_DARK_ELVEN =
@@ -89,7 +89,7 @@ public class SevenSignsRBs extends AbstractInstance
final boolean isInCC = party.isInCommandChannel();
final List<PlayerInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
if (members.size() > (MAX_PLAYERS_IN_ZONE - _anakim_zone.getPlayersInside().size()))
if (members.size() > (MAX_PLAYERS_IN_ZONE - ANAKIM_ZONE.getPlayersInside().size()))
{
player.sendMessage("Lilith Sanctum reached 300 players. You cannot enter now.");
}
@@ -128,7 +128,7 @@ public class SevenSignsRBs extends AbstractInstance
final boolean isInCC = party.isInCommandChannel();
final List<PlayerInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
if (members.size() > (MAX_PLAYERS_IN_ZONE - _lilith_zone.getPlayersInside().size()))
if (members.size() > (MAX_PLAYERS_IN_ZONE - LILITH_ZONE.getPlayersInside().size()))
{
player.sendMessage("Lilith Sanctum reached 300 players. You cannot enter now.");
}
@@ -161,7 +161,7 @@ public class SevenSignsRBs extends AbstractInstance
}
case "REMOVE_PLAYERS_FROM_ZONE_ANAKIM":
{
for (Creature charInside : _anakim_zone.getCharactersInside())
for (Creature charInside : ANAKIM_ZONE.getCharactersInside())
{
if ((charInside != null) && charInside.isPlayer())
{
@@ -172,7 +172,7 @@ public class SevenSignsRBs extends AbstractInstance
}
case "REMOVE_PLAYERS_FROM_ZONE_LILITH":
{
for (Creature charInside : _lilith_zone.getCharactersInside())
for (Creature charInside : LILITH_ZONE.getCharactersInside())
{
if ((charInside != null) && charInside.isPlayer())
{

View File

@@ -18,7 +18,6 @@ package instances.GolbergRoom;
import org.l2jmobius.gameserver.model.Party;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
@@ -26,7 +25,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import instances.AbstractInstance;
/**
* @author RobikBobik
* @author RobikBobik, Mobius
* @NOTE: Party instance retail like work.
* @TODO: Find what all drops from GOLBERG_TREASURE_CHEST
* @TODO: Golberg skills
@@ -42,9 +41,6 @@ public class GolbergRoom extends AbstractInstance
// Misc
private static final int TEMPLATE_ID = 207;
private MonsterInstance _golberg;
private int _treasureCounter;
public GolbergRoom()
{
super(TEMPLATE_ID);
@@ -82,8 +78,7 @@ public class GolbergRoom extends AbstractInstance
}
member.teleToLocation(player, 10, world);
}
_golberg = (MonsterInstance) player.getInstanceWorld().getNpc(18359);
startQuestTimer("GOLBERG_MOVE", 5000, _golberg, player);
startQuestTimer("GOLBERG_MOVE", 5000, world.getNpc(GOLBERG), player);
}
break;
}
@@ -93,7 +88,7 @@ public class GolbergRoom extends AbstractInstance
if (world != null)
{
player.sendPacket(new ExShowScreenMessage("Rats have become kings while I've been dormant.", 5000));
startQuestTimer("NEXT_TEXT", 7000, _golberg, player);
startQuestTimer("NEXT_TEXT", 7000, world.getNpc(GOLBERG), player);
}
npc.moveToLocation(11711, -86508, -10928, 0);
break;
@@ -104,7 +99,7 @@ public class GolbergRoom extends AbstractInstance
if (world != null)
{
player.sendPacket(new ExShowScreenMessage("Zaken or whatever is going wild all over the southern sea.", 5000));
startQuestTimer("NEXT_TEXT_2", 7000, _golberg, player);
startQuestTimer("NEXT_TEXT_2", 7000, world.getNpc(GOLBERG), player);
}
break;
}
@@ -119,13 +114,19 @@ public class GolbergRoom extends AbstractInstance
}
case "SPAWN_TRESURE":
{
final Instance world = player.getInstanceWorld();
if (world == null)
{
return null;
}
if (player.isGM())
{
if (_treasureCounter <= 27)
if (world.getParameters().getInt("treasureCounter", 0) <= 27)
{
addSpawn(GOLBERG_TREASURE_CHEST, 11708 + getRandom(-1000, 1000), -86505 + getRandom(-1000, 1000), -10928, 0, true, -1, true, player.getInstanceId());
startQuestTimer("SPAWN_TRESURE", 1000, npc, player);
_treasureCounter++;
world.getParameters().increaseInt("treasureCounter", 1);
}
}
else if (player.getParty() != null)
@@ -134,81 +135,81 @@ public class GolbergRoom extends AbstractInstance
{
case 2:
{
if (_treasureCounter <= 1)
if (world.getParameters().getInt("treasureCounter", 0) <= 1)
{
addSpawn(GOLBERG_TREASURE_CHEST, 11708 + getRandom(-1000, 1000), -86505 + getRandom(-1000, 1000), -10928, 0, true, -1, true, player.getInstanceId());
startQuestTimer("SPAWN_TRESURE", 1000, npc, player);
_treasureCounter++;
world.getParameters().increaseInt("treasureCounter", 1);
}
break;
}
case 3:
{
if (_treasureCounter <= 2)
if (world.getParameters().getInt("treasureCounter", 0) <= 2)
{
addSpawn(GOLBERG_TREASURE_CHEST, 11708 + getRandom(-1000, 1000), -86505 + getRandom(-1000, 1000), -10928, 0, true, -1, true, player.getInstanceId());
startQuestTimer("SPAWN_TRESURE", 1000, npc, player);
_treasureCounter++;
world.getParameters().increaseInt("treasureCounter", 1);
}
break;
}
case 4:
{
if (_treasureCounter <= 4)
if (world.getParameters().getInt("treasureCounter", 0) <= 4)
{
addSpawn(GOLBERG_TREASURE_CHEST, 11708 + getRandom(-1000, 1000), -86505 + getRandom(-1000, 1000), -10928, 0, true, -1, true, player.getInstanceId());
startQuestTimer("SPAWN_TRESURE", 1000, npc, player);
_treasureCounter++;
world.getParameters().increaseInt("treasureCounter", 1);
}
break;
}
case 5:
{
if (_treasureCounter <= 7)
if (world.getParameters().getInt("treasureCounter", 0) <= 7)
{
addSpawn(GOLBERG_TREASURE_CHEST, 11708 + getRandom(-1000, 1000), -86505 + getRandom(-1000, 1000), -10928, 0, true, -1, true, player.getInstanceId());
startQuestTimer("SPAWN_TRESURE", 1000, npc, player);
_treasureCounter++;
world.getParameters().increaseInt("treasureCounter", 1);
}
break;
}
case 6:
{
if (_treasureCounter <= 10)
if (world.getParameters().getInt("treasureCounter", 0) <= 10)
{
addSpawn(GOLBERG_TREASURE_CHEST, 11708 + getRandom(-1000, 1000), -86505 + getRandom(-1000, 1000), -10928, 0, true, -1, true, player.getInstanceId());
startQuestTimer("SPAWN_TRESURE", 1000, npc, player);
_treasureCounter++;
world.getParameters().increaseInt("treasureCounter", 1);
}
break;
}
case 7:
{
if (_treasureCounter <= 13)
if (world.getParameters().getInt("treasureCounter", 0) <= 13)
{
addSpawn(GOLBERG_TREASURE_CHEST, 11708 + getRandom(-1000, 1000), -86505 + getRandom(-1000, 1000), -10928, 0, true, -1, true, player.getInstanceId());
startQuestTimer("SPAWN_TRESURE", 1000, npc, player);
_treasureCounter++;
world.getParameters().increaseInt("treasureCounter", 1);
}
break;
}
case 8:
{
if (_treasureCounter <= 16)
if (world.getParameters().getInt("treasureCounter", 0) <= 16)
{
addSpawn(GOLBERG_TREASURE_CHEST, 11708 + getRandom(-1000, 1000), -86505 + getRandom(-1000, 1000), -10928, 0, true, -1, true, player.getInstanceId());
startQuestTimer("SPAWN_TRESURE", 1000, npc, player);
_treasureCounter++;
world.getParameters().increaseInt("treasureCounter", 1);
}
break;
}
case 9:
{
if (_treasureCounter <= 27)
if (world.getParameters().getInt("treasureCounter", 0) <= 27)
{
addSpawn(GOLBERG_TREASURE_CHEST, 11708 + getRandom(-1000, 1000), -86505 + getRandom(-1000, 1000), -10928, 0, true, -1, true, player.getInstanceId());
startQuestTimer("SPAWN_TRESURE", 1000, npc, player);
_treasureCounter++;
world.getParameters().increaseInt("treasureCounter", 1);
}
break;
}

View File

@@ -43,17 +43,17 @@ public class ResidenceOfKingIgnis extends AbstractInstance
private static final int FREYA = 29109;
private static final int IGNIS = 29105;
// Skills
private static SkillHolder FIRE_RAG_1 = new SkillHolder(50050, 1);
private static SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
private static SkillHolder FIRE_RAG_3 = new SkillHolder(50050, 3);
private static SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
private static SkillHolder FIRE_RAG_5 = new SkillHolder(50050, 5);
private static SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
private static SkillHolder FIRE_RAG_7 = new SkillHolder(50050, 7);
private static SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
private static SkillHolder FIRE_RAG_9 = new SkillHolder(50050, 9);
private static SkillHolder FIRE_RAG_10 = new SkillHolder(50050, 10);
private static SkillHolder FREYA_SAFETY_ZONE = new SkillHolder(50052, 1); // Just for an effect
private static final SkillHolder FIRE_RAG_1 = new SkillHolder(50050, 1);
private static final SkillHolder FIRE_RAG_2 = new SkillHolder(50050, 2);
private static final SkillHolder FIRE_RAG_3 = new SkillHolder(50050, 3);
private static final SkillHolder FIRE_RAG_4 = new SkillHolder(50050, 4);
private static final SkillHolder FIRE_RAG_5 = new SkillHolder(50050, 5);
private static final SkillHolder FIRE_RAG_6 = new SkillHolder(50050, 6);
private static final SkillHolder FIRE_RAG_7 = new SkillHolder(50050, 7);
private static final SkillHolder FIRE_RAG_8 = new SkillHolder(50050, 8);
private static final SkillHolder FIRE_RAG_9 = new SkillHolder(50050, 9);
private static final SkillHolder FIRE_RAG_10 = new SkillHolder(50050, 10);
private static final SkillHolder FREYA_SAFETY_ZONE = new SkillHolder(50052, 1); // Just for an effect
// Misc
private static final int TEMPLATE_ID = 195;
private static final Map<PlayerInstance, Integer> _playerFireRage = new ConcurrentHashMap<>();

View File

@@ -18,9 +18,7 @@ package instances.ResidenceOfKingPetram;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.skills.Skill;
@@ -28,7 +26,7 @@ import org.l2jmobius.gameserver.model.skills.Skill;
import instances.AbstractInstance;
/**
* @author RobikBobik
* @author RobikBobik, Mobius
* @NOTE: Retail like working
* @TODO: Rewrite code to modern style.
* @TODO: Petram Skills and minion skills
@@ -41,17 +39,11 @@ public class ResidenceOfKingPetram extends AbstractInstance
private static final int PETRAM_PIECE = 29116;
private static final int PETRAM_FRAGMENT = 29117;
// Skills
private static SkillHolder EARTh_ENERGY = new SkillHolder(50066, 1); // When spawn Minion.
private static SkillHolder EARTh_FURY = new SkillHolder(50059, 1); // When change invul state.
private static SkillHolder TEST = new SkillHolder(5712, 1); // TODO: This test skill is only for visual effect, but need to find correct skill ID.
private static final SkillHolder EARTH_ENERGY = new SkillHolder(50066, 1); // When spawn Minion.
private static final SkillHolder EARTH_FURY = new SkillHolder(50059, 1); // When change invul state.
private static final SkillHolder TEST = new SkillHolder(5712, 1); // TODO: This test skill is only for visual effect, but need to find correct skill ID.
// Misc
private static final int TEMPLATE_ID = 198;
private RaidBossInstance _petram = null;
private MonsterInstance _minion_1 = null;
private MonsterInstance _minion_2 = null;
private MonsterInstance _minion_3 = null;
private MonsterInstance _minion_4 = null;
private boolean _spawned_minions;
public ResidenceOfKingPetram()
{
@@ -70,54 +62,63 @@ public class ResidenceOfKingPetram extends AbstractInstance
case "ENTER":
{
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
_petram = (RaidBossInstance) player.getInstanceWorld().getNpc(PETRAM);
}
break;
}
case "SPAWN_MINION":
{
_petram.useMagic(EARTh_ENERGY.getSkill());
// Prevent to double or higher spawn when HP is between 68-70% + etc...
if (!_spawned_minions)
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_minion_1 = (MonsterInstance) addSpawn(npc, PETRAM_PIECE, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId());
_minion_2 = (MonsterInstance) addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId());
_minion_3 = (MonsterInstance) addSpawn(npc, PETRAM_PIECE, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId());
_minion_4 = (MonsterInstance) addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId());
_spawned_minions = true;
world.getNpc(PETRAM).doCast(EARTH_ENERGY.getSkill());
// Prevent to double or higher spawn when HP is between 68-70% + etc...
if (!world.getParameters().getBoolean("spawnedMinions", false))
{
world.setParameter("minion1", addSpawn(npc, PETRAM_PIECE, 221543, 191530, -15486, 1131, false, -1, true, npc.getInstanceId()));
world.setParameter("minion2", addSpawn(npc, PETRAM_FRAGMENT, 222069, 192019, -15486, 49364, false, -1, true, npc.getInstanceId()));
world.setParameter("minion3", addSpawn(npc, PETRAM_PIECE, 222595, 191479, -15486, 34013, false, -1, true, npc.getInstanceId()));
world.setParameter("minion4", addSpawn(npc, PETRAM_FRAGMENT, 222077, 191017, -15486, 16383, false, -1, true, npc.getInstanceId()));
world.setParameter("spawnedMinions", true);
}
startQuestTimer("SUPPORT_PETRAM", 3000, npc, null);
}
startQuestTimer("SUPPORT_PETRAM", 3000, npc, null);
break;
}
case "SUPPORT_PETRAM":
{
_minion_1.setTarget(_petram);
_minion_1.useMagic(TEST.getSkill());
_minion_2.setTarget(_petram);
_minion_2.useMagic(TEST.getSkill());
_minion_3.setTarget(_petram);
_minion_3.useMagic(TEST.getSkill());
_minion_4.setTarget(_petram);
_minion_4.useMagic(TEST.getSkill());
startQuestTimer("SUPPORT_PETRAM", 10100, npc, null); // NOTE: When find correct skill this number is reuse skill + 100
final Instance world = npc.getInstanceWorld();
if (world != null)
{
world.getParameters().getObject("minion1", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion1", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion2", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion2", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion3", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion3", Npc.class).doCast(TEST.getSkill());
world.getParameters().getObject("minion4", Npc.class).setTarget(world.getNpc(PETRAM));
world.getParameters().getObject("minion4", Npc.class).doCast(TEST.getSkill());
startQuestTimer("SUPPORT_PETRAM", 10100, npc, null); // NOTE: When find correct skill this number is reuse skill + 100
}
break;
}
case "INVUL_MODE":
{
_petram.useMagic(EARTh_FURY.getSkill());
if (_petram.isInvul())
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_petram.setInvul(false);
_petram.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
}
else
{
_petram.setInvul(true);
_petram.broadcastSay(ChatType.NPC_SHOUT, "HaHa, fighters lets kill them. Now Im invul!!!");
final Npc petram = world.getNpc(PETRAM);
petram.doCast(EARTH_FURY.getSkill());
if (petram.isInvul())
{
petram.setInvul(false);
petram.broadcastSay(ChatType.NPC_SHOUT, "Nooooo... Nooooo...");
}
else
{
petram.setInvul(true);
petram.broadcastSay(ChatType.NPC_SHOUT, "HaHa, fighters lets kill them. Now Im invul!!!");
}
}
break;
}
@@ -157,18 +158,20 @@ public class ResidenceOfKingPetram extends AbstractInstance
@Override
public String onKill(Npc npc, PlayerInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world == null)
{
return null;
}
if (npc.getId() == PETRAM)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
world.finishInstance();
}
world.finishInstance();
}
else if ((_minion_1.isDead()) && (_minion_2.isDead()) && (_minion_3.isDead()) && (_minion_4.isDead()))
else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()) && (world.getParameters().getObject("minion4", Npc.class).isDead()))
{
startQuestTimer("INVUL_MODE", 3000, _petram, null);
_spawned_minions = false;
startQuestTimer("INVUL_MODE", 3000, world.getNpc(PETRAM), null);
world.setParameter("spawnedMinions", false);
}
return super.onKill(npc, player, isSummon);
}

View File

@@ -17,9 +17,7 @@
package instances.ResidenceOfKingProcella;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.skills.SkillCaster;
@@ -27,7 +25,7 @@ import org.l2jmobius.gameserver.model.skills.SkillCaster;
import instances.AbstractInstance;
/**
* @author RobikBobik
* @author RobikBobik, Mobius
* @NOTE: Retail like working
* @TODO: Rewrite code to modern style.
*/
@@ -46,12 +44,7 @@ public class ResidenceOfKingProcella extends AbstractInstance
private static final SkillHolder HURRICANE_BOLT_LV_1 = new SkillHolder(50043, 1); // When player in Radius + para
// Misc
private static final int TEMPLATE_ID = 197;
private static int STORM_MAX_COUNT = 16; // TODO: Max is limit ?
private int _procellaStormCount;
private RaidBossInstance _procella;
private MonsterInstance _minion1;
private MonsterInstance _minion2;
private MonsterInstance _minion3;
private static final int STORM_MAX_COUNT = 16; // TODO: Max is limit ?
public ResidenceOfKingProcella()
{
@@ -69,46 +62,56 @@ public class ResidenceOfKingProcella extends AbstractInstance
case "ENTER":
{
enterInstance(player, npc, TEMPLATE_ID);
_procella = (RaidBossInstance) addSpawn(PROCELLA, 212862, 179828, -15489, 49151, false, 0, true, player.getInstanceId());
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), _procella, player);
startQuestTimer("SPAWN_STORM", 5000, _procella, player);
_procellaStormCount = 0;
final Instance world = player.getInstanceWorld();
if (world != null)
{
final Npc procella = addSpawn(PROCELLA, 212862, 179828, -15489, 49151, false, 0, true, player.getInstanceId());
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), procella, player);
startQuestTimer("SPAWN_STORM", 5000, procella, player);
world.setParameter("stormCount", 0);
}
break;
}
case "SPAWN_MINION":
{
if (npc.getId() == PROCELLA)
final Instance world = npc.getInstanceWorld();
if ((world != null) && (npc.getId() == PROCELLA))
{
_minion1 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId());
_minion2 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_2, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId());
_minion3 = (MonsterInstance) addSpawn(PROCELLA_GUARDIAN_3, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId());
startQuestTimer("HIDE_PROCELLA", 1000, _procella, null);
world.setParameter("minion1", addSpawn(PROCELLA_GUARDIAN_1, 212663, 179421, -15486, 31011, true, 0, true, npc.getInstanceId()));
world.setParameter("minion2", addSpawn(PROCELLA_GUARDIAN_2, 213258, 179822, -15486, 12001, true, 0, true, npc.getInstanceId()));
world.setParameter("minion3", addSpawn(PROCELLA_GUARDIAN_3, 212558, 179974, -15486, 12311, true, 0, true, npc.getInstanceId()));
startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
}
break;
}
case "SPAWN_STORM":
{
if (_procellaStormCount < STORM_MAX_COUNT)
final Instance world = npc.getInstanceWorld();
if ((world != null) && (world.getParameters().getInt("stormCount", 0) < STORM_MAX_COUNT))
{
_procella.useMagic(HURRICANE_SUMMON.getSkill());
final Npc procellaStorm = addSpawn(PROCELLA_STORM, _procella.getX() + getRandom(-500, 500), _procella.getY() + getRandom(-500, 500), _procella.getZ(), 31011, true, 0, true, npc.getInstanceId());
world.getNpc(PROCELLA).doCast(HURRICANE_SUMMON.getSkill());
final Npc procellaStorm = addSpawn(PROCELLA_STORM, world.getNpc(PROCELLA).getX() + getRandom(-500, 500), world.getNpc(PROCELLA).getY() + getRandom(-500, 500), world.getNpc(PROCELLA).getZ(), 31011, true, 0, true, npc.getInstanceId());
procellaStorm.setRandomWalking(true);
_procellaStormCount++;
startQuestTimer("SPAWN_STORM", 60000, _procella, null);
world.getParameters().increaseInt("stormCount", 1);
startQuestTimer("SPAWN_STORM", 60000, world.getNpc(PROCELLA), null);
startQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", 100, procellaStorm, player); // All time checking
}
break;
}
case "HIDE_PROCELLA":
{
if (_procella.isInvisible())
final Instance world = npc.getInstanceWorld();
if (world != null)
{
_procella.setInvisible(false);
}
else
{
_procella.setInvisible(true);
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), _procella, player);
if (world.getNpc(PROCELLA).isInvisible())
{
world.getNpc(PROCELLA).setInvisible(false);
}
else
{
world.getNpc(PROCELLA).setInvisible(true);
startQuestTimer("SPAWN_MINION", 300000 + getRandom(-15000, 15000), world.getNpc(PROCELLA), player);
}
}
break;
}
@@ -151,21 +154,24 @@ public class ResidenceOfKingProcella extends AbstractInstance
@Override
public String onKill(Npc npc, PlayerInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world == null)
{
return null;
}
if (npc.getId() == PROCELLA)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
cancelQuestTimer("SPAWN_MINION", npc, player);
cancelQuestTimer("SPAWN_STORM", npc, player);
cancelQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", npc, player);
world.finishInstance();
}
cancelQuestTimer("SPAWN_MINION", npc, player);
cancelQuestTimer("SPAWN_STORM", npc, player);
cancelQuestTimer("CHECK_CHAR_INSIDE_RADIUS_NPC", npc, player);
world.finishInstance();
}
else if ((_minion1.isDead()) && (_minion2.isDead()) && (_minion3.isDead()))
else if ((world.getParameters().getObject("minion1", Npc.class).isDead()) && (world.getParameters().getObject("minion2", Npc.class).isDead()) && (world.getParameters().getObject("minion3", Npc.class).isDead()))
{
startQuestTimer("HIDE_PROCELLA", 1000, _procella, null);
startQuestTimer("HIDE_PROCELLA", 1000, world.getNpc(PROCELLA), null);
}
return super.onKill(npc, player, isSummon);
}

View File

@@ -41,12 +41,12 @@ public class ResidenceOfQueenNebula extends AbstractInstance
private static final int WATER_SLIME = 29111;
// Skills
private static final int AQUA_RAGE = 50036;
private static SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
private static SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
private static SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
private static SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
private static SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
private static SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
private static final SkillHolder AQUA_RAGE_1 = new SkillHolder(AQUA_RAGE, 1);
private static final SkillHolder AQUA_RAGE_2 = new SkillHolder(AQUA_RAGE, 2);
private static final SkillHolder AQUA_RAGE_3 = new SkillHolder(AQUA_RAGE, 3);
private static final SkillHolder AQUA_RAGE_4 = new SkillHolder(AQUA_RAGE, 4);
private static final SkillHolder AQUA_RAGE_5 = new SkillHolder(AQUA_RAGE, 5);
private static final SkillHolder AQUA_SUMMON = new SkillHolder(50037, 1);
// Misc
private static final int TEMPLATE_ID = 196;

View File

@@ -47,10 +47,10 @@ public class SevenSignsRBs extends AbstractInstance
private static final int ANAKIM_TEMPLATE_ID = 200;
private static final int LILITH_TEMPLATE_ID = 199;
private static int MAX_PLAYERS_IN_ZONE = 300;
private static final int MAX_PLAYERS_IN_ZONE = 300;
private static final NoRestartZone _anakim_zone = ZoneManager.getInstance().getZoneById(70052, NoRestartZone.class);
private static final NoRestartZone _lilith_zone = ZoneManager.getInstance().getZoneById(70053, NoRestartZone.class);
private static final NoRestartZone ANAKIM_ZONE = ZoneManager.getInstance().getZoneById(70052, NoRestartZone.class);
private static final NoRestartZone LILITH_ZONE = ZoneManager.getInstance().getZoneById(70053, NoRestartZone.class);
// TELEPORTS
private static final Location[] TELEPORT_TO_DARK_ELVEN =
@@ -89,7 +89,7 @@ public class SevenSignsRBs extends AbstractInstance
final boolean isInCC = party.isInCommandChannel();
final List<PlayerInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
if (members.size() > (MAX_PLAYERS_IN_ZONE - _anakim_zone.getPlayersInside().size()))
if (members.size() > (MAX_PLAYERS_IN_ZONE - ANAKIM_ZONE.getPlayersInside().size()))
{
player.sendMessage("Lilith Sanctum reached 300 players. You cannot enter now.");
}
@@ -128,7 +128,7 @@ public class SevenSignsRBs extends AbstractInstance
final boolean isInCC = party.isInCommandChannel();
final List<PlayerInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
if (members.size() > (MAX_PLAYERS_IN_ZONE - _lilith_zone.getPlayersInside().size()))
if (members.size() > (MAX_PLAYERS_IN_ZONE - LILITH_ZONE.getPlayersInside().size()))
{
player.sendMessage("Lilith Sanctum reached 300 players. You cannot enter now.");
}
@@ -161,7 +161,7 @@ public class SevenSignsRBs extends AbstractInstance
}
case "REMOVE_PLAYERS_FROM_ZONE_ANAKIM":
{
for (Creature charInside : _anakim_zone.getCharactersInside())
for (Creature charInside : ANAKIM_ZONE.getCharactersInside())
{
if ((charInside != null) && charInside.isPlayer())
{
@@ -172,7 +172,7 @@ public class SevenSignsRBs extends AbstractInstance
}
case "REMOVE_PLAYERS_FROM_ZONE_LILITH":
{
for (Creature charInside : _lilith_zone.getCharactersInside())
for (Creature charInside : LILITH_ZONE.getCharactersInside())
{
if ((charInside != null) && charInside.isPlayer())
{