Improvements for Chamber of Prophecies instance.

This commit is contained in:
MobiusDev 2017-11-06 11:29:32 +00:00
parent 1169e90c1b
commit 32ebf9c12a
24 changed files with 855 additions and 849 deletions

View File

@ -10,10 +10,6 @@
<location x="-78696" y="251000" z="-2998" /> <location x="-78696" y="251000" z="-2998" />
</exit> </exit>
</locations> </locations>
<parameters>
<param name="vanhalter" value="33999" />
<param name="ferin" value="34001" />
</parameters>
<conditions> <conditions>
<condition type="Level"> <condition type="Level">
<param name="min" value="85" /> <param name="min" value="85" />
@ -27,7 +23,7 @@
</doorlist> </doorlist>
<spawnlist> <spawnlist>
<group name="q10753_16_instance_halter_1" spawnByDefault="true"> <group name="q10753_16_instance_halter_1" spawnByDefault="true">
<npc id="33979" x="-88424" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Kain van Halter --> <npc id="31639" x="-88424" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Kain van Halter -->
<npc id="34001" x="-88584" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Ferin --> <npc id="34001" x="-88584" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Ferin -->
</group> </group>
<group name="q10753_16_instance_halter_1_1" spawnByDefault="false"> <group name="q10753_16_instance_halter_1_1" spawnByDefault="false">
@ -35,7 +31,7 @@
<npc id="34001" x="-88581" y="184785" z="-10472" heading="49980" respawnTime="60sec" /> <!-- Ferin --> <npc id="34001" x="-88581" y="184785" z="-10472" heading="49980" respawnTime="60sec" /> <!-- Ferin -->
</group> </group>
<group name="q10753_16_instance_halter_2" spawnByDefault="false"> <group name="q10753_16_instance_halter_2" spawnByDefault="false">
<npc id="33979" x="-88440" y="173352" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Kain van Halter --> <npc id="31639" x="-88440" y="173352" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Kain van Halter -->
<npc id="34001" x="-88440" y="173240" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Ferin --> <npc id="34001" x="-88440" y="173240" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Ferin -->
</group> </group>
<group name="q10753_16_instance_grail" spawnByDefault="false"> <group name="q10753_16_instance_grail" spawnByDefault="false">

View File

@ -16,7 +16,6 @@
*/ */
package instances.ChamberOfProphecies; package instances.ChamberOfProphecies;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ai.CtrlIntention; import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
@ -24,6 +23,7 @@ import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.instancezone.Instance; import com.l2jmobius.gameserver.model.instancezone.Instance;
import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.model.quest.QuestState;
@ -39,32 +39,25 @@ import instances.AbstractInstance;
import quests.Q10753_WindsOfFateChoices.Q10753_WindsOfFateChoices; import quests.Q10753_WindsOfFateChoices.Q10753_WindsOfFateChoices;
/** /**
* Chamber of Propercies instance. * Chamber of Prophecies instance.
* @author Gigi * @author Gigi, Mobius
*/ */
public final class ChamberOfProphecies extends AbstractInstance public final class ChamberOfProphecies extends AbstractInstance
{ {
// NPCs // NPCs
private static final int KAIN_VAN_HALTER = 33979; private static final int KAIN_VAN_HALTER = 31639;
private static final int VAN_HALTER = 33999; private static final int VAN_HALTER = 33999;
private static final int FERIN = 34001; private static final int FERIN = 34001;
private static final int GRAIL = 33996; private static final int GRAIL = 33996;
private static final int MYSTERIOUS_WIZARD = 33980; private static final int MYSTERIOUS_WIZARD = 33980;
// Misc // Misc
private static final int DOOR_2 = 17230102;
private static final int DOOR_3 = 17230103;
private static final int DOOR_4 = 17230104;
private static final int TEMPLATE_ID = 255; private static final int TEMPLATE_ID = 255;
private static final int PROPHECY_MACHINE = 39540; private static final int PROPHECY_MACHINE = 39540;
private static final int ATELIA = 39542; private static final int ATELIA = 39542;
private static final Location FIRST_ROOM_LOC = new Location(-88503, 184754, -10440, 48891); private static final Location FIRST_ROOM_LOC = new Location(-88503, 184754, -10440, 48891);
// Monsters
private static final int[] ATTACABLE_MONSTERS =
{
19568, // Sacred Wizard
19569, // Sacred Soldier
19570, // Sacred Slayer
19571, // Makkum
19572, // Abyssal Shadow
19573, // Secluded Shadow
};
public ChamberOfProphecies() public ChamberOfProphecies()
{ {
@ -74,332 +67,345 @@ public final class ChamberOfProphecies extends AbstractInstance
addTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD); addTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD);
addSeeCreatureId(FERIN); addSeeCreatureId(FERIN);
addSeeCreatureId(VAN_HALTER); addSeeCreatureId(VAN_HALTER);
addKillId(ATTACABLE_MONSTERS);
} }
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = null; String htmltext = null;
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (event.equals("enterInstance")) if (event.equals("enterInstance"))
{ {
enterInstance(player, npc, TEMPLATE_ID); final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (hasQuestItems(player, PROPHECY_MACHINE)) if (qs != null)
{ {
takeItems(player, PROPHECY_MACHINE, 1); enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
} }
qs.setCond(16, true);
} }
else else
{ {
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (isInInstance(world)) if (!isInInstance(world))
{ {
switch (event) return null;
}
switch (event)
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{ {
case "33979-01.html": htmltext = event;
case "33996-01.html": break;
case "33980-01.html": }
case "33980-02.html": case "33996-02.html":
{
world.broadcastPacket(ExShowUsm.USM_Q015_E); // TODO not show usim movie
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))
{ {
htmltext = event; htmltext = "31639-01.html";
break; break;
} }
case "33996-02.html": htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe();
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, player.getInstanceWorld().getNpc(KAIN_VAN_HALTER), null);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
{ {
world.broadcastPacket(ExShowUsm.USM_Q015_E); // TODO not show usim movie case 0:
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))
{ {
htmltext = "33979-01.html"; if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
final L2Npc ferin = world.getNpc(FERIN);
final L2Npc halter = world.getNpc(VAN_HALTER);
final L2PcInstance pl = world.getFirstPlayer();
startQuestTimer("SEY2", 14000, ferin, pl);
startQuestTimer("SEY_KAIN", 24000, halter, pl);
startQuestTimer("OPEN_DOOR1", 5000, npc, pl);
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break; break;
} }
htmltext = "33979-02.html"; case 1:
break;
}
case "teleport":
{
player.teleToLocation(FIRST_ROOM_LOC);
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setIsRunning(true);
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
((L2Attackable) npc).setCanStopAttackByTime(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{ {
npc.setTarget(player); if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{ {
L2World.getInstance().forEachVisibleObjectInRange(npc, L2Npc.class, 3000, chars -> world.spawnGroup("wof_room2_1");
{ world.setStatus(2);
if (CommonUtil.contains(ATTACABLE_MONSTERS, chars.getId()))
{
addAttackDesire(npc, chars);
return;
}
});
} }
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 2:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
final L2Npc ferin = world.getNpc(FERIN);
final L2PcInstance pl = world.getFirstPlayer();
startQuestTimer("SEY3", 8000, ferin, pl);
startQuestTimer("OPEN_DOOR2", 5000, npc, pl);
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 3:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
final L2Npc halter = world.getNpc(VAN_HALTER);
startQuestTimer("SEY_KAIN_1", 5000, halter, world.getFirstPlayer());
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 4:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
final L2Npc ferin = world.getNpc(FERIN);
final L2Npc halter = world.getNpc(VAN_HALTER);
final L2PcInstance pl = world.getFirstPlayer();
startQuestTimer("SEY_KAIN_2", 3000, halter, pl);
startQuestTimer("SEY4", 7000, ferin, pl);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, null);
}
break;
} }
break;
} }
case "OPEN_DOOR1": break;
{ }
cancelQuestTimers("ATTACK"); case "ATTACK":
world.setStatus(1); case "ATTACK1":
world.openCloseDoor(17230102, true); case "ATTACK2":
world.spawnGroup("wof_room2"); {
break; npc.setIsRunning(true);
} ((L2Attackable) npc).setCanReturnToSpawnPoint(false);
case "OPEN_DOOR2": ((L2Attackable) npc).setCanStopAttackByTime(false);
{ if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
cancelQuestTimers("ATTACK1");
final int halter = world.getTemplateParameters().getInt("vanhalter");
final L2Npc npcss = world.getNpc(halter);
startQuestTimer("ATTACK2", 200, npcss, player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(17230103, true);
break;
}
case "BROADCAST_TEXT":
{ {
npc.setTarget(player); npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); 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.getId() == FERIN) if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{ {
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET)); L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 3000, chars ->
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0)); {
addAttackDesire(npc, chars);
return;
});
} }
break;
} }
case "SEY_KAIN": break;
}
case "OPEN_DOOR1":
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
final L2Npc halter = world.getNpc(VAN_HALTER);
startQuestTimer("ATTACK2", 200, 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.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));
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;
} }
case "SEY3": break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{ {
if (npc.getId() == FERIN) startQuestTimer("ATTACK1", 200, npc, player, true);
{ npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
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.holter_quest_1", 0, 0, 0, 0, 0));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
} }
case "SEY_KAIN_1": break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{ {
if (npc.getId() == VAN_HALTER) 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));
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
} }
case "SEY_KAIN_2": 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.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
{
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;
} }
case "SEY4": break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{ {
if (npc.getId() == FERIN) 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));
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS)); startQuestTimer("SEY_KAIN_3", 7000, npc, player);
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
} }
case "SEY_KAIN_3": break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{ {
if (npc.getId() == VAN_HALTER) npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
{ startQuestTimer("REST", 5000, npc, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO)); npc.setScriptValue(1);
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
} }
case "REST": break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{ {
if (npc.getId() == FERIN) 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.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player); npc.setScriptValue(1);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
} }
case "SEY_KAIN_4": break;
}
case "REST":
{
if (npc.getId() == FERIN)
{ {
world.setStatus(5); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
world.spawnGroup("q10753_16_instance_grail"); cancelQuestTimers("BROADCAST_TEXT");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(17230104, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, npc, player);
break;
} }
case "CLOSE": break;
}
case "SEY_KAIN_4":
{
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;
}
case "CLOSE":
{
if (player.calculateDistance(world.getNpc(GRAIL), false, false) < 390)
{ {
world.openCloseDoor(17230104, false); world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1"); world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4"); world.despawnGroup("wof_room4");
break;
} }
case "DESPAWN_WIZARD": else
{ {
world.despawnGroup("q10753_16_instance_wizard"); startQuestTimer("CLOSE", 3000, null, player);
break;
} }
case "exit": break;
}
case "DESPAWN_WIZARD":
{
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(SystemMessage.getSystemMessage(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)
{ {
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(SystemMessage.getSystemMessage(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));
qs.setCond(17, true); qs.setCond(17, true);
break;
}
case "finish":
{
world.finishInstance(0);
break;
} }
break;
}
case "finish":
{
world.finishInstance(0);
break;
} }
} }
} }
return htmltext; return htmltext;
} }
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
final int ferin = world.getTemplateParameters().getInt("ferin");
final int halter = world.getTemplateParameters().getInt("vanhalter");
final L2Npc npcs = world.getNpc(ferin);
final L2Npc npcss = world.getNpc(halter);
startQuestTimer("SEY2", 14000, npcs, player);
startQuestTimer("SEY_KAIN", 24000, npcss, player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
break;
}
case 1:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
break;
}
case 2:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
final int ferin = world.getTemplateParameters().getInt("ferin");
final L2Npc npcs = world.getNpc(ferin);
startQuestTimer("SEY3", 8000, npcs, player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
break;
}
case 3:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(17230103, false);
final int halter = world.getTemplateParameters().getInt("vanhalter");
final L2Npc npcss = world.getNpc(halter);
startQuestTimer("SEY_KAIN_1", 5000, npcss, player);
}
break;
}
case 4:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
final int halter = world.getTemplateParameters().getInt("vanhalter");
final int ferin = world.getTemplateParameters().getInt("ferin");
final L2Npc npcss = world.getNpc(halter);
final L2Npc npcs = world.getNpc(ferin);
startQuestTimer("SEY_KAIN_2", 3000, npcss, player);
startQuestTimer("SEY4", 7000, npcs, player);
}
break;
}
}
}
return null;
}
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {
@ -411,7 +417,7 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
if ((qs != null) && qs.isCond(16)) if ((qs != null) && qs.isCond(16))
{ {
htmltext = "33979.html"; htmltext = "31639.html";
} }
break; break;
} }

View File

@ -162,7 +162,7 @@ public final class FortressOfTheDead extends AbstractInstance
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {
final QuestState qs = player.getQuestState(Q10752_WindsOfFateAPromise.class.getSimpleName()); final QuestState qs = player.getQuestState(Q10752_WindsOfFateAPromise.class.getSimpleName());
if (qs.isCond(8)) if ((qs != null) && qs.isCond(8))
{ {
return "33979.html"; return "33979.html";
} }

View File

@ -1334,7 +1334,7 @@
<attack physical="1189.0459514498" magical="811.85773400546" critical="4" attackSpeed="253" range="40" /> <attack physical="1189.0459514498" magical="811.85773400546" critical="4" attackSpeed="253" range="40" />
<defence physical="36100" magical="26400.364174348" /> <defence physical="36100" magical="26400.364174348" />
</stats> </stats>
<status attackable="false" /> <status attackable="false" targetable="false" talkable="false" />
<skill_list> <skill_list>
<skill id="4416" level="6" /> <!-- Humanoids --> <skill id="4416" level="6" /> <!-- Humanoids -->
</skill_list> </skill_list>

View File

@ -28,7 +28,7 @@
<run ground="120" /> <run ground="120" />
</speed> </speed>
</stats> </stats>
<status attackable="false" /> <status attackable="false" talkable="false"/>
<collision> <collision>
<radius normal="9.5" /> <radius normal="9.5" />
<height normal="22.4" /> <height normal="22.4" />

View File

@ -10,10 +10,6 @@
<location x="-78696" y="251000" z="-2998" /> <location x="-78696" y="251000" z="-2998" />
</exit> </exit>
</locations> </locations>
<parameters>
<param name="vanhalter" value="33999" />
<param name="ferin" value="34001" />
</parameters>
<conditions> <conditions>
<condition type="Level"> <condition type="Level">
<param name="min" value="85" /> <param name="min" value="85" />
@ -27,7 +23,7 @@
</doorlist> </doorlist>
<spawnlist> <spawnlist>
<group name="q10753_16_instance_halter_1" spawnByDefault="true"> <group name="q10753_16_instance_halter_1" spawnByDefault="true">
<npc id="33979" x="-88424" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Kain van Halter --> <npc id="31639" x="-88424" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Kain van Halter -->
<npc id="34001" x="-88584" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Ferin --> <npc id="34001" x="-88584" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Ferin -->
</group> </group>
<group name="q10753_16_instance_halter_1_1" spawnByDefault="false"> <group name="q10753_16_instance_halter_1_1" spawnByDefault="false">
@ -35,7 +31,7 @@
<npc id="34001" x="-88581" y="184785" z="-10472" heading="49980" respawnTime="60sec" /> <!-- Ferin --> <npc id="34001" x="-88581" y="184785" z="-10472" heading="49980" respawnTime="60sec" /> <!-- Ferin -->
</group> </group>
<group name="q10753_16_instance_halter_2" spawnByDefault="false"> <group name="q10753_16_instance_halter_2" spawnByDefault="false">
<npc id="33979" x="-88440" y="173352" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Kain van Halter --> <npc id="31639" x="-88440" y="173352" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Kain van Halter -->
<npc id="34001" x="-88440" y="173240" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Ferin --> <npc id="34001" x="-88440" y="173240" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Ferin -->
</group> </group>
<group name="q10753_16_instance_grail" spawnByDefault="false"> <group name="q10753_16_instance_grail" spawnByDefault="false">

View File

@ -16,7 +16,6 @@
*/ */
package instances.ChamberOfProphecies; package instances.ChamberOfProphecies;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ai.CtrlIntention; import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
@ -24,6 +23,7 @@ import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.instancezone.Instance; import com.l2jmobius.gameserver.model.instancezone.Instance;
import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.model.quest.QuestState;
@ -39,32 +39,25 @@ import instances.AbstractInstance;
import quests.Q10753_WindsOfFateChoices.Q10753_WindsOfFateChoices; import quests.Q10753_WindsOfFateChoices.Q10753_WindsOfFateChoices;
/** /**
* Chamber of Propercies instance. * Chamber of Prophecies instance.
* @author Gigi * @author Gigi, Mobius
*/ */
public final class ChamberOfProphecies extends AbstractInstance public final class ChamberOfProphecies extends AbstractInstance
{ {
// NPCs // NPCs
private static final int KAIN_VAN_HALTER = 33979; private static final int KAIN_VAN_HALTER = 31639;
private static final int VAN_HALTER = 33999; private static final int VAN_HALTER = 33999;
private static final int FERIN = 34001; private static final int FERIN = 34001;
private static final int GRAIL = 33996; private static final int GRAIL = 33996;
private static final int MYSTERIOUS_WIZARD = 33980; private static final int MYSTERIOUS_WIZARD = 33980;
// Misc // Misc
private static final int DOOR_2 = 17230102;
private static final int DOOR_3 = 17230103;
private static final int DOOR_4 = 17230104;
private static final int TEMPLATE_ID = 255; private static final int TEMPLATE_ID = 255;
private static final int PROPHECY_MACHINE = 39540; private static final int PROPHECY_MACHINE = 39540;
private static final int ATELIA = 39542; private static final int ATELIA = 39542;
private static final Location FIRST_ROOM_LOC = new Location(-88503, 184754, -10440, 48891); private static final Location FIRST_ROOM_LOC = new Location(-88503, 184754, -10440, 48891);
// Monsters
private static final int[] ATTACABLE_MONSTERS =
{
19568, // Sacred Wizard
19569, // Sacred Soldier
19570, // Sacred Slayer
19571, // Makkum
19572, // Abyssal Shadow
19573, // Secluded Shadow
};
public ChamberOfProphecies() public ChamberOfProphecies()
{ {
@ -74,332 +67,345 @@ public final class ChamberOfProphecies extends AbstractInstance
addTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD); addTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD);
addSeeCreatureId(FERIN); addSeeCreatureId(FERIN);
addSeeCreatureId(VAN_HALTER); addSeeCreatureId(VAN_HALTER);
addKillId(ATTACABLE_MONSTERS);
} }
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = null; String htmltext = null;
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (event.equals("enterInstance")) if (event.equals("enterInstance"))
{ {
enterInstance(player, npc, TEMPLATE_ID); final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (hasQuestItems(player, PROPHECY_MACHINE)) if (qs != null)
{ {
takeItems(player, PROPHECY_MACHINE, 1); enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
} }
qs.setCond(16, true);
} }
else else
{ {
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (isInInstance(world)) if (!isInInstance(world))
{ {
switch (event) return null;
}
switch (event)
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{ {
case "33979-01.html": htmltext = event;
case "33996-01.html": break;
case "33980-01.html": }
case "33980-02.html": case "33996-02.html":
{
world.broadcastPacket(ExShowUsm.USM_Q015_E); // TODO not show usim movie
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))
{ {
htmltext = event; htmltext = "31639-01.html";
break; break;
} }
case "33996-02.html": htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe();
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, player.getInstanceWorld().getNpc(KAIN_VAN_HALTER), null);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
{ {
world.broadcastPacket(ExShowUsm.USM_Q015_E); // TODO not show usim movie case 0:
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))
{ {
htmltext = "33979-01.html"; if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
final L2Npc ferin = world.getNpc(FERIN);
final L2Npc halter = world.getNpc(VAN_HALTER);
final L2PcInstance pl = world.getFirstPlayer();
startQuestTimer("SEY2", 14000, ferin, pl);
startQuestTimer("SEY_KAIN", 24000, halter, pl);
startQuestTimer("OPEN_DOOR1", 5000, npc, pl);
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break; break;
} }
htmltext = "33979-02.html"; case 1:
break;
}
case "teleport":
{
player.teleToLocation(FIRST_ROOM_LOC);
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setIsRunning(true);
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
((L2Attackable) npc).setCanStopAttackByTime(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{ {
npc.setTarget(player); if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{ {
L2World.getInstance().forEachVisibleObjectInRange(npc, L2Npc.class, 3000, chars -> world.spawnGroup("wof_room2_1");
{ world.setStatus(2);
if (CommonUtil.contains(ATTACABLE_MONSTERS, chars.getId()))
{
addAttackDesire(npc, chars);
return;
}
});
} }
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 2:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
final L2Npc ferin = world.getNpc(FERIN);
final L2PcInstance pl = world.getFirstPlayer();
startQuestTimer("SEY3", 8000, ferin, pl);
startQuestTimer("OPEN_DOOR2", 5000, npc, pl);
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 3:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
final L2Npc halter = world.getNpc(VAN_HALTER);
startQuestTimer("SEY_KAIN_1", 5000, halter, world.getFirstPlayer());
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 4:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
final L2Npc ferin = world.getNpc(FERIN);
final L2Npc halter = world.getNpc(VAN_HALTER);
final L2PcInstance pl = world.getFirstPlayer();
startQuestTimer("SEY_KAIN_2", 3000, halter, pl);
startQuestTimer("SEY4", 7000, ferin, pl);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, null);
}
break;
} }
break;
} }
case "OPEN_DOOR1": break;
{ }
cancelQuestTimers("ATTACK"); case "ATTACK":
world.setStatus(1); case "ATTACK1":
world.openCloseDoor(17230102, true); case "ATTACK2":
world.spawnGroup("wof_room2"); {
break; npc.setIsRunning(true);
} ((L2Attackable) npc).setCanReturnToSpawnPoint(false);
case "OPEN_DOOR2": ((L2Attackable) npc).setCanStopAttackByTime(false);
{ if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
cancelQuestTimers("ATTACK1");
final int halter = world.getTemplateParameters().getInt("vanhalter");
final L2Npc npcss = world.getNpc(halter);
startQuestTimer("ATTACK2", 200, npcss, player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(17230103, true);
break;
}
case "BROADCAST_TEXT":
{ {
npc.setTarget(player); npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); 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.getId() == FERIN) if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{ {
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET)); L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 3000, chars ->
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0)); {
addAttackDesire(npc, chars);
return;
});
} }
break;
} }
case "SEY_KAIN": break;
}
case "OPEN_DOOR1":
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
final L2Npc halter = world.getNpc(VAN_HALTER);
startQuestTimer("ATTACK2", 200, 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.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));
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;
} }
case "SEY3": break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{ {
if (npc.getId() == FERIN) startQuestTimer("ATTACK1", 200, npc, player, true);
{ npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
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.holter_quest_1", 0, 0, 0, 0, 0));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
} }
case "SEY_KAIN_1": break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{ {
if (npc.getId() == VAN_HALTER) 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));
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
} }
case "SEY_KAIN_2": 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.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
{
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;
} }
case "SEY4": break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{ {
if (npc.getId() == FERIN) 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));
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS)); startQuestTimer("SEY_KAIN_3", 7000, npc, player);
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
} }
case "SEY_KAIN_3": break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{ {
if (npc.getId() == VAN_HALTER) npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
{ startQuestTimer("REST", 5000, npc, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO)); npc.setScriptValue(1);
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
} }
case "REST": break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{ {
if (npc.getId() == FERIN) 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.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player); npc.setScriptValue(1);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
} }
case "SEY_KAIN_4": break;
}
case "REST":
{
if (npc.getId() == FERIN)
{ {
world.setStatus(5); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
world.spawnGroup("q10753_16_instance_grail"); cancelQuestTimers("BROADCAST_TEXT");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(17230104, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, npc, player);
break;
} }
case "CLOSE": break;
}
case "SEY_KAIN_4":
{
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;
}
case "CLOSE":
{
if (player.calculateDistance(world.getNpc(GRAIL), false, false) < 390)
{ {
world.openCloseDoor(17230104, false); world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1"); world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4"); world.despawnGroup("wof_room4");
break;
} }
case "DESPAWN_WIZARD": else
{ {
world.despawnGroup("q10753_16_instance_wizard"); startQuestTimer("CLOSE", 3000, null, player);
break;
} }
case "exit": break;
}
case "DESPAWN_WIZARD":
{
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(SystemMessage.getSystemMessage(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)
{ {
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(SystemMessage.getSystemMessage(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));
qs.setCond(17, true); qs.setCond(17, true);
break;
}
case "finish":
{
world.finishInstance(0);
break;
} }
break;
}
case "finish":
{
world.finishInstance(0);
break;
} }
} }
} }
return htmltext; return htmltext;
} }
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
final int ferin = world.getTemplateParameters().getInt("ferin");
final int halter = world.getTemplateParameters().getInt("vanhalter");
final L2Npc npcs = world.getNpc(ferin);
final L2Npc npcss = world.getNpc(halter);
startQuestTimer("SEY2", 14000, npcs, player);
startQuestTimer("SEY_KAIN", 24000, npcss, player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
break;
}
case 1:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
break;
}
case 2:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
final int ferin = world.getTemplateParameters().getInt("ferin");
final L2Npc npcs = world.getNpc(ferin);
startQuestTimer("SEY3", 8000, npcs, player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
break;
}
case 3:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(17230103, false);
final int halter = world.getTemplateParameters().getInt("vanhalter");
final L2Npc npcss = world.getNpc(halter);
startQuestTimer("SEY_KAIN_1", 5000, npcss, player);
}
break;
}
case 4:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
final int halter = world.getTemplateParameters().getInt("vanhalter");
final int ferin = world.getTemplateParameters().getInt("ferin");
final L2Npc npcss = world.getNpc(halter);
final L2Npc npcs = world.getNpc(ferin);
startQuestTimer("SEY_KAIN_2", 3000, npcss, player);
startQuestTimer("SEY4", 7000, npcs, player);
}
break;
}
}
}
return null;
}
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {
@ -411,7 +417,7 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
if ((qs != null) && qs.isCond(16)) if ((qs != null) && qs.isCond(16))
{ {
htmltext = "33979.html"; htmltext = "31639.html";
} }
break; break;
} }

View File

@ -162,7 +162,7 @@ public final class FortressOfTheDead extends AbstractInstance
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {
final QuestState qs = player.getQuestState(Q10752_WindsOfFateAPromise.class.getSimpleName()); final QuestState qs = player.getQuestState(Q10752_WindsOfFateAPromise.class.getSimpleName());
if (qs.isCond(8)) if ((qs != null) && qs.isCond(8))
{ {
return "33979.html"; return "33979.html";
} }

View File

@ -1336,7 +1336,7 @@
<attack physical="1189.0459514498" magical="811.85773400546" critical="4" attackSpeed="253" range="40" /> <attack physical="1189.0459514498" magical="811.85773400546" critical="4" attackSpeed="253" range="40" />
<defence physical="36100" magical="26400.364174348" /> <defence physical="36100" magical="26400.364174348" />
</stats> </stats>
<status attackable="false" /> <status attackable="false" targetable="false" talkable="false" />
<skill_list> <skill_list>
<skill id="4416" level="6" /> <!-- Humanoids --> <skill id="4416" level="6" /> <!-- Humanoids -->
</skill_list> </skill_list>

View File

@ -28,7 +28,7 @@
<run ground="120" /> <run ground="120" />
</speed> </speed>
</stats> </stats>
<status attackable="false" /> <status attackable="false" talkable="false"/>
<collision> <collision>
<radius normal="9.5" /> <radius normal="9.5" />
<height normal="22.4" /> <height normal="22.4" />

View File

@ -10,10 +10,6 @@
<location x="-78696" y="251000" z="-2998" /> <location x="-78696" y="251000" z="-2998" />
</exit> </exit>
</locations> </locations>
<parameters>
<param name="vanhalter" value="33999" />
<param name="ferin" value="34001" />
</parameters>
<conditions> <conditions>
<condition type="Level"> <condition type="Level">
<param name="min" value="85" /> <param name="min" value="85" />
@ -27,7 +23,7 @@
</doorlist> </doorlist>
<spawnlist> <spawnlist>
<group name="q10753_16_instance_halter_1" spawnByDefault="true"> <group name="q10753_16_instance_halter_1" spawnByDefault="true">
<npc id="33979" x="-88424" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Kain van Halter --> <npc id="31639" x="-88424" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Kain van Halter -->
<npc id="34001" x="-88584" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Ferin --> <npc id="34001" x="-88584" y="186904" z="-10476" heading="49151" respawnTime="60sec" /> <!-- Ferin -->
</group> </group>
<group name="q10753_16_instance_halter_1_1" spawnByDefault="false"> <group name="q10753_16_instance_halter_1_1" spawnByDefault="false">
@ -35,7 +31,7 @@
<npc id="34001" x="-88581" y="184785" z="-10472" heading="49980" respawnTime="60sec" /> <!-- Ferin --> <npc id="34001" x="-88581" y="184785" z="-10472" heading="49980" respawnTime="60sec" /> <!-- Ferin -->
</group> </group>
<group name="q10753_16_instance_halter_2" spawnByDefault="false"> <group name="q10753_16_instance_halter_2" spawnByDefault="false">
<npc id="33979" x="-88440" y="173352" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Kain van Halter --> <npc id="31639" x="-88440" y="173352" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Kain van Halter -->
<npc id="34001" x="-88440" y="173240" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Ferin --> <npc id="34001" x="-88440" y="173240" z="-10476" heading="31287" respawnTime="60sec" /> <!-- Ferin -->
</group> </group>
<group name="q10753_16_instance_grail" spawnByDefault="false"> <group name="q10753_16_instance_grail" spawnByDefault="false">

View File

@ -16,7 +16,6 @@
*/ */
package instances.ChamberOfProphecies; package instances.ChamberOfProphecies;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.ai.CtrlIntention; import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.L2World;
@ -24,6 +23,7 @@ import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.instancezone.Instance; import com.l2jmobius.gameserver.model.instancezone.Instance;
import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.model.quest.QuestState;
@ -39,32 +39,25 @@ import instances.AbstractInstance;
import quests.Q10753_WindsOfFateChoices.Q10753_WindsOfFateChoices; import quests.Q10753_WindsOfFateChoices.Q10753_WindsOfFateChoices;
/** /**
* Chamber of Propercies instance. * Chamber of Prophecies instance.
* @author Gigi * @author Gigi, Mobius
*/ */
public final class ChamberOfProphecies extends AbstractInstance public final class ChamberOfProphecies extends AbstractInstance
{ {
// NPCs // NPCs
private static final int KAIN_VAN_HALTER = 33979; private static final int KAIN_VAN_HALTER = 31639;
private static final int VAN_HALTER = 33999; private static final int VAN_HALTER = 33999;
private static final int FERIN = 34001; private static final int FERIN = 34001;
private static final int GRAIL = 33996; private static final int GRAIL = 33996;
private static final int MYSTERIOUS_WIZARD = 33980; private static final int MYSTERIOUS_WIZARD = 33980;
// Misc // Misc
private static final int DOOR_2 = 17230102;
private static final int DOOR_3 = 17230103;
private static final int DOOR_4 = 17230104;
private static final int TEMPLATE_ID = 255; private static final int TEMPLATE_ID = 255;
private static final int PROPHECY_MACHINE = 39540; private static final int PROPHECY_MACHINE = 39540;
private static final int ATELIA = 39542; private static final int ATELIA = 39542;
private static final Location FIRST_ROOM_LOC = new Location(-88503, 184754, -10440, 48891); private static final Location FIRST_ROOM_LOC = new Location(-88503, 184754, -10440, 48891);
// Monsters
private static final int[] ATTACABLE_MONSTERS =
{
19568, // Sacred Wizard
19569, // Sacred Soldier
19570, // Sacred Slayer
19571, // Makkum
19572, // Abyssal Shadow
19573, // Secluded Shadow
};
public ChamberOfProphecies() public ChamberOfProphecies()
{ {
@ -74,332 +67,345 @@ public final class ChamberOfProphecies extends AbstractInstance
addTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD); addTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD);
addSeeCreatureId(FERIN); addSeeCreatureId(FERIN);
addSeeCreatureId(VAN_HALTER); addSeeCreatureId(VAN_HALTER);
addKillId(ATTACABLE_MONSTERS);
} }
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = null; String htmltext = null;
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (event.equals("enterInstance")) if (event.equals("enterInstance"))
{ {
enterInstance(player, npc, TEMPLATE_ID); final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (hasQuestItems(player, PROPHECY_MACHINE)) if (qs != null)
{ {
takeItems(player, PROPHECY_MACHINE, 1); enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
} }
qs.setCond(16, true);
} }
else else
{ {
final Instance world = npc.getInstanceWorld(); final Instance world = npc.getInstanceWorld();
if (isInInstance(world)) if (!isInInstance(world))
{ {
switch (event) return null;
}
switch (event)
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{ {
case "33979-01.html": htmltext = event;
case "33996-01.html": break;
case "33980-01.html": }
case "33980-02.html": case "33996-02.html":
{
world.broadcastPacket(ExShowUsm.USM_Q015_E); // TODO not show usim movie
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))
{ {
htmltext = event; htmltext = "31639-01.html";
break; break;
} }
case "33996-02.html": htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe();
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, player.getInstanceWorld().getNpc(KAIN_VAN_HALTER), null);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
{ {
world.broadcastPacket(ExShowUsm.USM_Q015_E); // TODO not show usim movie case 0:
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))
{ {
htmltext = "33979-01.html"; if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
final L2Npc ferin = world.getNpc(FERIN);
final L2Npc halter = world.getNpc(VAN_HALTER);
final L2PcInstance pl = world.getFirstPlayer();
startQuestTimer("SEY2", 14000, ferin, pl);
startQuestTimer("SEY_KAIN", 24000, halter, pl);
startQuestTimer("OPEN_DOOR1", 5000, npc, pl);
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break; break;
} }
htmltext = "33979-02.html"; case 1:
break;
}
case "teleport":
{
player.teleToLocation(FIRST_ROOM_LOC);
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setIsRunning(true);
((L2Attackable) npc).setCanReturnToSpawnPoint(false);
((L2Attackable) npc).setCanStopAttackByTime(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{ {
npc.setTarget(player); if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{ {
L2World.getInstance().forEachVisibleObjectInRange(npc, L2Npc.class, 3000, chars -> world.spawnGroup("wof_room2_1");
{ world.setStatus(2);
if (CommonUtil.contains(ATTACABLE_MONSTERS, chars.getId()))
{
addAttackDesire(npc, chars);
return;
}
});
} }
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 2:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
final L2Npc ferin = world.getNpc(FERIN);
final L2PcInstance pl = world.getFirstPlayer();
startQuestTimer("SEY3", 8000, ferin, pl);
startQuestTimer("OPEN_DOOR2", 5000, npc, pl);
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 3:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
final L2Npc halter = world.getNpc(VAN_HALTER);
startQuestTimer("SEY_KAIN_1", 5000, halter, world.getFirstPlayer());
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 4:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
final L2Npc ferin = world.getNpc(FERIN);
final L2Npc halter = world.getNpc(VAN_HALTER);
final L2PcInstance pl = world.getFirstPlayer();
startQuestTimer("SEY_KAIN_2", 3000, halter, pl);
startQuestTimer("SEY4", 7000, ferin, pl);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, null);
}
break;
} }
break;
} }
case "OPEN_DOOR1": break;
{ }
cancelQuestTimers("ATTACK"); case "ATTACK":
world.setStatus(1); case "ATTACK1":
world.openCloseDoor(17230102, true); case "ATTACK2":
world.spawnGroup("wof_room2"); {
break; npc.setIsRunning(true);
} ((L2Attackable) npc).setCanReturnToSpawnPoint(false);
case "OPEN_DOOR2": ((L2Attackable) npc).setCanStopAttackByTime(false);
{ if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
cancelQuestTimers("ATTACK1");
final int halter = world.getTemplateParameters().getInt("vanhalter");
final L2Npc npcss = world.getNpc(halter);
startQuestTimer("ATTACK2", 200, npcss, player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(17230103, true);
break;
}
case "BROADCAST_TEXT":
{ {
npc.setTarget(player); npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); 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.getId() == FERIN) if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{ {
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET)); L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 3000, chars ->
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0)); {
addAttackDesire(npc, chars);
return;
});
} }
break;
} }
case "SEY_KAIN": break;
}
case "OPEN_DOOR1":
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
final L2Npc halter = world.getNpc(VAN_HALTER);
startQuestTimer("ATTACK2", 200, 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.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));
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;
} }
case "SEY3": break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{ {
if (npc.getId() == FERIN) startQuestTimer("ATTACK1", 200, npc, player, true);
{ npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
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.holter_quest_1", 0, 0, 0, 0, 0));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
} }
case "SEY_KAIN_1": break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{ {
if (npc.getId() == VAN_HALTER) 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));
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
} }
case "SEY_KAIN_2": 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.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
{
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;
} }
case "SEY4": break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{ {
if (npc.getId() == FERIN) 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));
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS)); startQuestTimer("SEY_KAIN_3", 7000, npc, player);
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
} }
case "SEY_KAIN_3": break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{ {
if (npc.getId() == VAN_HALTER) npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
{ startQuestTimer("REST", 5000, npc, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO)); npc.setScriptValue(1);
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
} }
case "REST": break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{ {
if (npc.getId() == FERIN) 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.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player); npc.setScriptValue(1);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
} }
case "SEY_KAIN_4": break;
}
case "REST":
{
if (npc.getId() == FERIN)
{ {
world.setStatus(5); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
world.spawnGroup("q10753_16_instance_grail"); cancelQuestTimers("BROADCAST_TEXT");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(17230104, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, npc, player);
break;
} }
case "CLOSE": break;
}
case "SEY_KAIN_4":
{
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;
}
case "CLOSE":
{
if (player.calculateDistance(world.getNpc(GRAIL), false, false) < 390)
{ {
world.openCloseDoor(17230104, false); world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1"); world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4"); world.despawnGroup("wof_room4");
break;
} }
case "DESPAWN_WIZARD": else
{ {
world.despawnGroup("q10753_16_instance_wizard"); startQuestTimer("CLOSE", 3000, null, player);
break;
} }
case "exit": break;
}
case "DESPAWN_WIZARD":
{
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(SystemMessage.getSystemMessage(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)
{ {
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(SystemMessage.getSystemMessage(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));
qs.setCond(17, true); qs.setCond(17, true);
break;
}
case "finish":
{
world.finishInstance(0);
break;
} }
break;
}
case "finish":
{
world.finishInstance(0);
break;
} }
} }
} }
return htmltext; return htmltext;
} }
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
final int ferin = world.getTemplateParameters().getInt("ferin");
final int halter = world.getTemplateParameters().getInt("vanhalter");
final L2Npc npcs = world.getNpc(ferin);
final L2Npc npcss = world.getNpc(halter);
startQuestTimer("SEY2", 14000, npcs, player);
startQuestTimer("SEY_KAIN", 24000, npcss, player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
break;
}
case 1:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
break;
}
case 2:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
final int ferin = world.getTemplateParameters().getInt("ferin");
final L2Npc npcs = world.getNpc(ferin);
startQuestTimer("SEY3", 8000, npcs, player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
break;
}
case 3:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(17230103, false);
final int halter = world.getTemplateParameters().getInt("vanhalter");
final L2Npc npcss = world.getNpc(halter);
startQuestTimer("SEY_KAIN_1", 5000, npcss, player);
}
break;
}
case 4:
{
if (world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
final int halter = world.getTemplateParameters().getInt("vanhalter");
final int ferin = world.getTemplateParameters().getInt("ferin");
final L2Npc npcss = world.getNpc(halter);
final L2Npc npcs = world.getNpc(ferin);
startQuestTimer("SEY_KAIN_2", 3000, npcss, player);
startQuestTimer("SEY4", 7000, npcs, player);
}
break;
}
}
}
return null;
}
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {
@ -411,7 +417,7 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
if ((qs != null) && qs.isCond(16)) if ((qs != null) && qs.isCond(16))
{ {
htmltext = "33979.html"; htmltext = "31639.html";
} }
break; break;
} }

View File

@ -162,7 +162,7 @@ public final class FortressOfTheDead extends AbstractInstance
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {
final QuestState qs = player.getQuestState(Q10752_WindsOfFateAPromise.class.getSimpleName()); final QuestState qs = player.getQuestState(Q10752_WindsOfFateAPromise.class.getSimpleName());
if (qs.isCond(8)) if ((qs != null) && qs.isCond(8))
{ {
return "33979.html"; return "33979.html";
} }

View File

@ -1336,7 +1336,7 @@
<attack physical="1189.0459514498" magical="811.85773400546" critical="4" attackSpeed="253" range="40" /> <attack physical="1189.0459514498" magical="811.85773400546" critical="4" attackSpeed="253" range="40" />
<defence physical="36100" magical="26400.364174348" /> <defence physical="36100" magical="26400.364174348" />
</stats> </stats>
<status attackable="false" /> <status attackable="false" targetable="false" talkable="false" />
<skill_list> <skill_list>
<skill id="4416" level="6" /> <!-- Humanoids --> <skill id="4416" level="6" /> <!-- Humanoids -->
</skill_list> </skill_list>

View File

@ -28,7 +28,7 @@
<run ground="120" /> <run ground="120" />
</speed> </speed>
</stats> </stats>
<status attackable="false" /> <status attackable="false" talkable="false"/>
<collision> <collision>
<radius normal="9.5" /> <radius normal="9.5" />
<height normal="22.4" /> <height normal="22.4" />