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,15 +67,16 @@ 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"))
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{ {
enterInstance(player, npc, TEMPLATE_ID); enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE)) if (hasQuestItems(player, PROPHECY_MACHINE))
@ -91,14 +85,18 @@ public final class ChamberOfProphecies extends AbstractInstance
} }
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))
{ {
return null;
}
switch (event) switch (event)
{ {
case "33979-01.html": case "31639-01.html":
case "33996-01.html": case "33996-01.html":
case "33980-01.html": case "33980-01.html":
case "33980-02.html": case "33980-02.html":
@ -140,17 +138,94 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
if (world.isStatus(0)) if (world.isStatus(0))
{ {
htmltext = "33979-01.html"; htmltext = "31639-01.html";
break; break;
} }
htmltext = "33979-02.html"; htmltext = "31639-02.html";
break; break;
} }
case "teleport": case "teleport":
{ {
player.teleToLocation(FIRST_ROOM_LOC); world.getNpc(FERIN).deleteMe();
world.spawnGroup("q10753_16_instance_halter_1_1"); world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1"); 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())
{
case 0:
{
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;
}
case 1:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
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; break;
} }
case "ATTACK": case "ATTACK":
@ -160,7 +235,7 @@ public final class ChamberOfProphecies extends AbstractInstance
npc.setIsRunning(true); npc.setIsRunning(true);
((L2Attackable) npc).setCanReturnToSpawnPoint(false); ((L2Attackable) npc).setCanReturnToSpawnPoint(false);
((L2Attackable) npc).setCanStopAttackByTime(false); ((L2Attackable) npc).setCanStopAttackByTime(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty()) if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{ {
npc.setTarget(player); npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
@ -169,13 +244,10 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{ {
L2World.getInstance().forEachVisibleObjectInRange(npc, L2Npc.class, 3000, chars -> L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 3000, chars ->
{
if (CommonUtil.contains(ATTACABLE_MONSTERS, chars.getId()))
{ {
addAttackDesire(npc, chars); addAttackDesire(npc, chars);
return; return;
}
}); });
} }
} }
@ -185,19 +257,18 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
cancelQuestTimers("ATTACK"); cancelQuestTimers("ATTACK");
world.setStatus(1); world.setStatus(1);
world.openCloseDoor(17230102, true); world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2"); world.spawnGroup("wof_room2");
break; break;
} }
case "OPEN_DOOR2": case "OPEN_DOOR2":
{ {
cancelQuestTimers("ATTACK1"); cancelQuestTimers("ATTACK1");
final int halter = world.getTemplateParameters().getInt("vanhalter"); final L2Npc halter = world.getNpc(VAN_HALTER);
final L2Npc npcss = world.getNpc(halter); startQuestTimer("ATTACK2", 200, halter, player, true);
startQuestTimer("ATTACK2", 200, npcss, player, true);
world.setStatus(3); world.setStatus(3);
world.spawnGroup("wof_room3"); world.spawnGroup("wof_room3");
world.openCloseDoor(17230103, true); world.openCloseDoor(DOOR_3, true);
break; break;
} }
case "BROADCAST_TEXT": case "BROADCAST_TEXT":
@ -289,17 +360,24 @@ public final class ChamberOfProphecies extends AbstractInstance
world.setStatus(5); world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail"); world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000); showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(17230104, true); world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2"); cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, npc, player); startQuestTimer("CLOSE", 15000, null, player);
break; break;
} }
case "CLOSE": case "CLOSE":
{ {
world.openCloseDoor(17230104, false); if (player.calculateDistance(world.getNpc(GRAIL), false, false) < 390)
{
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");
}
else
{
startQuestTimer("CLOSE", 3000, null, player);
}
break; break;
} }
case "DESPAWN_WIZARD": case "DESPAWN_WIZARD":
@ -311,7 +389,11 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
startQuestTimer("finish", 3000, npc, player); 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)); 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)
{
qs.setCond(17, true); qs.setCond(17, true);
}
break; break;
} }
case "finish": case "finish":
@ -321,85 +403,9 @@ public final class ChamberOfProphecies extends AbstractInstance
} }
} }
} }
}
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,15 +67,16 @@ 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"))
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{ {
enterInstance(player, npc, TEMPLATE_ID); enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE)) if (hasQuestItems(player, PROPHECY_MACHINE))
@ -91,14 +85,18 @@ public final class ChamberOfProphecies extends AbstractInstance
} }
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))
{ {
return null;
}
switch (event) switch (event)
{ {
case "33979-01.html": case "31639-01.html":
case "33996-01.html": case "33996-01.html":
case "33980-01.html": case "33980-01.html":
case "33980-02.html": case "33980-02.html":
@ -140,17 +138,94 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
if (world.isStatus(0)) if (world.isStatus(0))
{ {
htmltext = "33979-01.html"; htmltext = "31639-01.html";
break; break;
} }
htmltext = "33979-02.html"; htmltext = "31639-02.html";
break; break;
} }
case "teleport": case "teleport":
{ {
player.teleToLocation(FIRST_ROOM_LOC); world.getNpc(FERIN).deleteMe();
world.spawnGroup("q10753_16_instance_halter_1_1"); world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1"); 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())
{
case 0:
{
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;
}
case 1:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
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; break;
} }
case "ATTACK": case "ATTACK":
@ -160,7 +235,7 @@ public final class ChamberOfProphecies extends AbstractInstance
npc.setIsRunning(true); npc.setIsRunning(true);
((L2Attackable) npc).setCanReturnToSpawnPoint(false); ((L2Attackable) npc).setCanReturnToSpawnPoint(false);
((L2Attackable) npc).setCanStopAttackByTime(false); ((L2Attackable) npc).setCanStopAttackByTime(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty()) if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{ {
npc.setTarget(player); npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
@ -169,13 +244,10 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{ {
L2World.getInstance().forEachVisibleObjectInRange(npc, L2Npc.class, 3000, chars -> L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 3000, chars ->
{
if (CommonUtil.contains(ATTACABLE_MONSTERS, chars.getId()))
{ {
addAttackDesire(npc, chars); addAttackDesire(npc, chars);
return; return;
}
}); });
} }
} }
@ -185,19 +257,18 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
cancelQuestTimers("ATTACK"); cancelQuestTimers("ATTACK");
world.setStatus(1); world.setStatus(1);
world.openCloseDoor(17230102, true); world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2"); world.spawnGroup("wof_room2");
break; break;
} }
case "OPEN_DOOR2": case "OPEN_DOOR2":
{ {
cancelQuestTimers("ATTACK1"); cancelQuestTimers("ATTACK1");
final int halter = world.getTemplateParameters().getInt("vanhalter"); final L2Npc halter = world.getNpc(VAN_HALTER);
final L2Npc npcss = world.getNpc(halter); startQuestTimer("ATTACK2", 200, halter, player, true);
startQuestTimer("ATTACK2", 200, npcss, player, true);
world.setStatus(3); world.setStatus(3);
world.spawnGroup("wof_room3"); world.spawnGroup("wof_room3");
world.openCloseDoor(17230103, true); world.openCloseDoor(DOOR_3, true);
break; break;
} }
case "BROADCAST_TEXT": case "BROADCAST_TEXT":
@ -289,17 +360,24 @@ public final class ChamberOfProphecies extends AbstractInstance
world.setStatus(5); world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail"); world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000); showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(17230104, true); world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2"); cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, npc, player); startQuestTimer("CLOSE", 15000, null, player);
break; break;
} }
case "CLOSE": case "CLOSE":
{ {
world.openCloseDoor(17230104, false); if (player.calculateDistance(world.getNpc(GRAIL), false, false) < 390)
{
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");
}
else
{
startQuestTimer("CLOSE", 3000, null, player);
}
break; break;
} }
case "DESPAWN_WIZARD": case "DESPAWN_WIZARD":
@ -311,7 +389,11 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
startQuestTimer("finish", 3000, npc, player); 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)); 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)
{
qs.setCond(17, true); qs.setCond(17, true);
}
break; break;
} }
case "finish": case "finish":
@ -321,85 +403,9 @@ public final class ChamberOfProphecies extends AbstractInstance
} }
} }
} }
}
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,15 +67,16 @@ 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"))
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{ {
enterInstance(player, npc, TEMPLATE_ID); enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE)) if (hasQuestItems(player, PROPHECY_MACHINE))
@ -91,14 +85,18 @@ public final class ChamberOfProphecies extends AbstractInstance
} }
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))
{ {
return null;
}
switch (event) switch (event)
{ {
case "33979-01.html": case "31639-01.html":
case "33996-01.html": case "33996-01.html":
case "33980-01.html": case "33980-01.html":
case "33980-02.html": case "33980-02.html":
@ -140,17 +138,94 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
if (world.isStatus(0)) if (world.isStatus(0))
{ {
htmltext = "33979-01.html"; htmltext = "31639-01.html";
break; break;
} }
htmltext = "33979-02.html"; htmltext = "31639-02.html";
break; break;
} }
case "teleport": case "teleport":
{ {
player.teleToLocation(FIRST_ROOM_LOC); world.getNpc(FERIN).deleteMe();
world.spawnGroup("q10753_16_instance_halter_1_1"); world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1"); 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())
{
case 0:
{
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;
}
case 1:
{
if (world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
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; break;
} }
case "ATTACK": case "ATTACK":
@ -160,7 +235,7 @@ public final class ChamberOfProphecies extends AbstractInstance
npc.setIsRunning(true); npc.setIsRunning(true);
((L2Attackable) npc).setCanReturnToSpawnPoint(false); ((L2Attackable) npc).setCanReturnToSpawnPoint(false);
((L2Attackable) npc).setCanStopAttackByTime(false); ((L2Attackable) npc).setCanStopAttackByTime(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(ATTACABLE_MONSTERS).isEmpty()) if (npc.isScriptValue(0) && world.getAliveNpcs(L2MonsterInstance.class).isEmpty())
{ {
npc.setTarget(player); npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
@ -169,13 +244,10 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{ {
L2World.getInstance().forEachVisibleObjectInRange(npc, L2Npc.class, 3000, chars -> L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 3000, chars ->
{
if (CommonUtil.contains(ATTACABLE_MONSTERS, chars.getId()))
{ {
addAttackDesire(npc, chars); addAttackDesire(npc, chars);
return; return;
}
}); });
} }
} }
@ -185,19 +257,18 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
cancelQuestTimers("ATTACK"); cancelQuestTimers("ATTACK");
world.setStatus(1); world.setStatus(1);
world.openCloseDoor(17230102, true); world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2"); world.spawnGroup("wof_room2");
break; break;
} }
case "OPEN_DOOR2": case "OPEN_DOOR2":
{ {
cancelQuestTimers("ATTACK1"); cancelQuestTimers("ATTACK1");
final int halter = world.getTemplateParameters().getInt("vanhalter"); final L2Npc halter = world.getNpc(VAN_HALTER);
final L2Npc npcss = world.getNpc(halter); startQuestTimer("ATTACK2", 200, halter, player, true);
startQuestTimer("ATTACK2", 200, npcss, player, true);
world.setStatus(3); world.setStatus(3);
world.spawnGroup("wof_room3"); world.spawnGroup("wof_room3");
world.openCloseDoor(17230103, true); world.openCloseDoor(DOOR_3, true);
break; break;
} }
case "BROADCAST_TEXT": case "BROADCAST_TEXT":
@ -289,17 +360,24 @@ public final class ChamberOfProphecies extends AbstractInstance
world.setStatus(5); world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail"); world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000); showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(17230104, true); world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2"); cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, npc, player); startQuestTimer("CLOSE", 15000, null, player);
break; break;
} }
case "CLOSE": case "CLOSE":
{ {
world.openCloseDoor(17230104, false); if (player.calculateDistance(world.getNpc(GRAIL), false, false) < 390)
{
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");
}
else
{
startQuestTimer("CLOSE", 3000, null, player);
}
break; break;
} }
case "DESPAWN_WIZARD": case "DESPAWN_WIZARD":
@ -311,7 +389,11 @@ public final class ChamberOfProphecies extends AbstractInstance
{ {
startQuestTimer("finish", 3000, npc, player); 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)); 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)
{
qs.setCond(17, true); qs.setCond(17, true);
}
break; break;
} }
case "finish": case "finish":
@ -321,85 +403,9 @@ public final class ChamberOfProphecies extends AbstractInstance
} }
} }
} }
}
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" />