Nightmare Kamaloka.

Contributed by NviX.
This commit is contained in:
MobiusDev
2016-04-15 08:33:21 +00:00
parent b3cb70feb4
commit 9f649e00f2
27 changed files with 968 additions and 224 deletions

View File

@@ -357,6 +357,10 @@ final class MinionSpawnManager extends AbstractNpcAI
NPC.add(25794); // Kernon
NPC.add(25797); // Meanas Anor
NPC.add(25800); // Mammon Collector Talos
NPC.add(26094); // Sola
NPC.add(26096); // Ariarc
NPC.add(26099); // Sirra
NPC.add(26102); // Dark Rider
NPC.add(27036); // Calpico
NPC.add(27041); // Varangka's Messenger
NPC.add(27062); // Tanukia

View File

@@ -51,6 +51,7 @@ import instances.MithrilMine.MithrilMine;
import instances.MonasteryOfSilence1.MonasteryOfSilence1;
import instances.MonasteryOfSilence2.MonasteryOfSilence2;
import instances.MuseumDungeon.MuseumDungeon;
import instances.NightmareKamaloka.NightmareKamaloka;
import instances.NornilsGarden.NornilsGarden;
import instances.PailakaDevilsLegacy.PailakaDevilsLegacy;
import instances.PailakaSongOfIceAndFire.PailakaSongOfIceAndFire;
@@ -99,6 +100,7 @@ final class InstanceLoader
MonasteryOfSilence1.class,
MonasteryOfSilence2.class,
MuseumDungeon.class,
NightmareKamaloka.class,
NornilsGarden.class,
PailakaDevilsLegacy.class,
PailakaSongOfIceAndFire.class,

View File

@@ -0,0 +1,218 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.NightmareKamaloka;
import java.util.ArrayList;
import java.util.List;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.PcCondOverride;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2RaidBossInstance;
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.Util;
import instances.AbstractInstance;
import quests.Q00760_BlockTheExit.Q00760_BlockTheExit;
/**
* @author NviX
*/
public final class NightmareKamaloka extends AbstractInstance
{
class NKWorld extends InstanceWorld
{
L2RaidBossInstance sola = null;
L2RaidBossInstance ariarc = null;
L2RaidBossInstance sirra = null;
L2RaidBossInstance dark_rider = null;
final List<L2PcInstance> playersInside = new ArrayList<>();
}
// NPC
private static final int KURTIZ = 30870;
// Bosses & Monsters
private static final int MINO = 26093;
private static final int SOLA = 26094;
private static final int ARIARC = 26096;
private static final int SIRRA = 26099;
private static final int DARK_RIDER = 26102;
// Instance
private static final int TEMPLATE_ID = 258;
// Doors
private static final int DOOR_1 = 18170002;
private static final int DOOR_2 = 18170004;
private static final int DOOR_3 = 18170006;
private static final int DOOR_4 = 18170008;
// Locations
private static final Location START_LOC = new Location(-42921, -16243, -12212);
private static final Location SOLA_SPAWN_LOC = new Location(-45719, -16241, -11965);
private static final Location ARIARC_SPAWN_LOC = new Location(-48055, -16243, -11702);
private static final Location SIRRA_SPAWN_LOC = new Location(-50385, -16240, -11439);
private static final Location DARK_RIDER_SPAWN_LOC = new Location(-54172, -16241, -10995);
public NightmareKamaloka()
{
super(NightmareKamaloka.class.getSimpleName());
addStartNpc(KURTIZ);
addTalkId(KURTIZ);
addKillId(MINO);
addKillId(SOLA);
addKillId(ARIARC);
addKillId(SIRRA);
addKillId(DARK_RIDER);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
final NKWorld tmpworld = (NKWorld) world;
if (!player.isInParty())
{
tmpworld.addAllowed(player.getObjectId());
tmpworld.playersInside.add(player);
teleportPlayer(player, START_LOC, tmpworld.getInstanceId(), false);
}
else
{
for (L2PcInstance member : player.getParty().getMembers())
{
tmpworld.addAllowed(member.getObjectId());
tmpworld.playersInside.add(member);
teleportPlayer(member, START_LOC, tmpworld.getInstanceId(), false);
}
}
}
else
{
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("enter"))
{
enterInstance(player, new NKWorld(), "NightmareKamaloka.xml", TEMPLATE_ID);
}
return super.onAdvEvent(event, npc, player);
}
@Override
protected boolean checkConditions(L2PcInstance player)
{
if (player.canOverrideCond(PcCondOverride.INSTANCE_CONDITIONS))
{
return true;
}
final L2Party party = player.getParty();
if (party == null)
{
player.sendPacket(SystemMessageId.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER);
return false;
}
if (party.getLeader() != player)
{
player.sendPacket(SystemMessageId.ONLY_A_PARTY_LEADER_CAN_MAKE_THE_REQUEST_TO_ENTER);
return false;
}
for (L2PcInstance member : party.getMembers())
{
if (member.getLevel() < 99)
{
party.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY).addPcName(member));
return false;
}
if (!Util.checkIfInRange(1000, party.getLeader(), member, true))
{
party.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED).addPcName(member));
return false;
}
final Long reenterTime = InstanceManager.getInstance().getInstanceTime(member.getObjectId(), TEMPLATE_ID);
if (System.currentTimeMillis() < reenterTime)
{
party.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET));
return false;
}
}
return true;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final InstanceWorld tmpWorld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if ((tmpWorld != null) && (tmpWorld instanceof NKWorld))
{
final NKWorld world = (NKWorld) tmpWorld;
switch (npc.getId())
{
case MINO:
{
openDoor(DOOR_1, world.getInstanceId());
world.sola = (L2RaidBossInstance) addSpawn(SOLA, SOLA_SPAWN_LOC, false, 0, true, world.getInstanceId());
break;
}
case SOLA:
{
openDoor(DOOR_2, world.getInstanceId());
world.ariarc = (L2RaidBossInstance) addSpawn(ARIARC, ARIARC_SPAWN_LOC, false, 0, true, world.getInstanceId());
break;
}
case ARIARC:
{
openDoor(DOOR_3, world.getInstanceId());
world.sirra = (L2RaidBossInstance) addSpawn(SIRRA, SIRRA_SPAWN_LOC, false, 0, true, world.getInstanceId());
break;
}
case SIRRA:
{
openDoor(DOOR_4, world.getInstanceId());
world.dark_rider = (L2RaidBossInstance) addSpawn(DARK_RIDER, DARK_RIDER_SPAWN_LOC, false, 0, true, world.getInstanceId());
break;
}
case DARK_RIDER:
{
for (L2PcInstance plr : world.playersInside)
{
if ((plr != null) && (plr.getInstanceId() == world.getInstanceId()))
{
final QuestState qs = plr.getQuestState(Q00760_BlockTheExit.class.getSimpleName());
if ((qs != null) && (qs.getState() == State.STARTED) && qs.isCond(1))
{
qs.setCond(2);
}
}
}
finishInstance(world);
break;
}
}
}
return super.onKill(npc, killer, isSummon);
}
}

View File

@@ -0,0 +1,6 @@
<html><body>Captain Kurtiz:<br>
Do you know about <font color="LEVEL">Nightmare Kamaloka?</font> It's a place for those who had to leave their homes, waiting for the right moment to go back. <br>
The way to Nightmare Kamaloka is very dangerous and it changes every time, so it's not just for anyone. The reason why people still went though, is because it was a safe place.<br>
Most of those people were fugitives or those whose lives were threatened.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00760_BlockTheExit 30870-2.html">"I see."</button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Captain Kurtiz:<br>
Those creatures grew stonger there and whenever the gates opened, they were able to go to the places they wanted.<br>
However, when the <font color="LEVEL">Seal of Punishment</font> was released, it affected multiple dimensions. A lot of things were changed because of that impact, and even Nightmare Kamaloka was affected. I'm not sure about the details, but the various paths to Nightmare Kamaloka stopped working.<br>
The problem is that the dimensional door is linked to a place near Aden.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00760_BlockTheExit 30870-3.html">"I see."</button>
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Captain Kurtiz:<br>
Those creatures in Nightmare Kamaloka have been trying to come out to Aden. That's why we had to plan a battle there. The difference in the dimensions is making it difficult, though. It's because they keep appearing out from the other dimensions, even if we get rid of them.<br>
We have to defeat the creatures from each of the dimensions. In order to do that, we need the help of as many adventurers as possible. Thanks for listening to me.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00760_BlockTheExit 30870-7.html">"I'll help you."</button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Captain Kurtiz:<br>
<!--TODO: Find off text.-->
Are you here now? Collect army soldiers and battle finally Nightmare Kamaloka!
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Captain Kurtiz:<br>
<!--TODO: Find of text.-->
Oh, you're alive? I am very proud of you and your soldiers that you were able to slay the monsters.<br>
You deserve my reward.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00760_BlockTheExit 30870-8.html">Get reward!</button>
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Captain Kurtiz:<br>
<!--TODO: Find off text.-->
You already told me that you are a brave warrior and got my reward.<br>
(You already complete this quest today.)
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Captain Kurtiz:<br>
I'll tell you again. Please don't let them use Aden as an exit. Go to Nightmare Kamaloka and defeat <font color="LEVEL">Tracker Mino, Ill-fated Princess Sola, Fallen Angel Ariarc, and Confined Princess Sirra</font>, in that order. Lastly, defeat <font color="LEVEL">Betrayed Dark Rider</font>.<br>
The monsters in Nightmare Kamaloka won't be easy to defeat, so make sure to take your friends with you. I won't say thanks until you come back safe and sound.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Captain Kurtiz:<br>
<!--TODO: Find off text.-->
Keep reward. Now all the soldiers will know that you are a brave killer monsters!
</body></html>

View File

@@ -0,0 +1,117 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package quests.Q00760_BlockTheExit;
import com.l2jmobius.gameserver.enums.QuestType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
/**
* @author NviX
*/
public class Q00760_BlockTheExit extends Quest
{
// NPC
private static final int KURTIZ = 30870;
// Monsters
private static final int DARK_RIDER = 26102;
// Items
private static final int CURTIZ_REWARD_BOX = 46560;
// Misc
private static final int MIN_LEVEL = 99;
private static final int MAX_LEVEL = 105;
public Q00760_BlockTheExit()
{
super(760, Q00760_BlockTheExit.class.getSimpleName(), "Block the Exit");
addStartNpc(KURTIZ);
addTalkId(KURTIZ);
addKillId(DARK_RIDER);
addCondMinLevel(MIN_LEVEL, "no_level.html");
addCondMaxLevel(MAX_LEVEL, "no_level.html");
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final String htmltext = event;
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return getNoQuestMsg(player);
}
switch (event)
{
case "30870-7.html":
{
qs.startQuest();
break;
}
case "30870-8.html":
{
giveItems(player, CURTIZ_REWARD_BOX, 1);
qs.exitQuest(QuestType.DAILY, true);
break;
}
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
if (qs == null)
{
return htmltext;
}
if (qs.isCreated())
{
htmltext = "30870-1.html";
}
else if (qs.isStarted())
{
if (qs.isCond(1))
{
htmltext = "30870-4.html";
}
else if (qs.isCond(2))
{
htmltext = "30870-5.html";
}
}
else if (qs.isCompleted())
{
if (!qs.isNowAvailable())
{
htmltext = "30870-6.html";
}
else
{
qs.setState(State.CREATED);
htmltext = "30870-1.html";
}
}
return htmltext;
}
}

View File

@@ -0,0 +1,4 @@
<html><body>Kurtiz:<br>
Please, go away.<br>
(This quest is available for characters lvls 99-105.)
</body></html>

View File

@@ -182,6 +182,7 @@ import quests.Q00754_AssistingTheRebelForces.Q00754_AssistingTheRebelForces;
import quests.Q00755_InNeedOfPetras.Q00755_InNeedOfPetras;
import quests.Q00756_TopQualityPetra.Q00756_TopQualityPetra;
import quests.Q00757_TriolsMovement.Q00757_TriolsMovement;
import quests.Q00760_BlockTheExit.Q00760_BlockTheExit;
import quests.Q00901_HowLavasaurusesAreMade.Q00901_HowLavasaurusesAreMade;
import quests.Q00902_ReclaimOurEra.Q00902_ReclaimOurEra;
import quests.Q00903_TheCallOfAntharas.Q00903_TheCallOfAntharas;
@@ -479,6 +480,7 @@ final class QuestMasterHandler
Q00755_InNeedOfPetras.class,
Q00756_TopQualityPetra.class,
Q00757_TriolsMovement.class,
Q00760_BlockTheExit.class,
Q00901_HowLavasaurusesAreMade.class,
Q00902_ReclaimOurEra.class,
Q00903_TheCallOfAntharas.class,