Skip to content
Snippets Groups Projects
Commit 5b691381 authored by Adry_85's avatar Adry_85
Browse files

BETA: Implementing quest '''Seven Signs, Forbidden Book of the Elmore-Aden Kingdom''' (10293).

	Reviewed by: jurchiks
	Thanks to: lion
parent 79a395ee
No related branches found
No related tags found
No related merge requests found
Showing
with 255 additions and 4 deletions
<?xml version="1.0" encoding="UTF-8"?>
<instance name="Library of Sages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<activityTime val="30" />
<allowSummon val="false" />
<emptyDestroyTime val="1" />
<spawnPoint spawnX="37063" spawnY="-49813" spawnZ="-1128" />
<spawnlist>
<group name="general">
<!-- Sophia2 -->
<spawn npcId="32861" x="37377" y="-49777" z="-1128" heading="16752" respawn="0" />
<!-- Sophia3 -->
<spawn npcId="32863" x="37360" y="-50912" z="-1176" heading="16500" respawn="0" />
<!-- Pile of Books -->
<spawn npcId="32809" x="37525" y="-50465" z="-1176" heading="1805" respawn="0" />
<spawn npcId="32810" x="37109" y="-50640" z="-1176" heading="25337" respawn="0" />
<spawn npcId="32811" x="37232" y="-51007" z="-1176" heading="16624" respawn="0" />
<spawn npcId="32812" x="37440" y="-50986" z="-1176" heading="6094" respawn="0" />
<spawn npcId="32813" x="37623" y="-50882" z="-1157" heading="33304" respawn="0" />
</group>
</spawnlist>
</instance>
\ No newline at end of file
......@@ -195,6 +195,7 @@ instances/JiniaGuildHideout1/JiniaGuildHideout1.java
instances/JiniaGuildHideout2/JiniaGuildHideout2.java
instances/JiniaGuildHideout3/JiniaGuildHideout3.java
instances/JiniaGuildHideout4/JiniaGuildHideout4.java
instances/LibraryOfSages/LibraryOfSages.java
instances/Kamaloka/Kamaloka.java
instances/MithrilMine/MithrilMine.java
instances/NornilsGarden/NornilsGarden.java
......@@ -672,7 +673,7 @@ quests/Q10289_FadeToBlack/Q10289_FadeToBlack.java
quests/Q10290_LandDragonConqueror/Q10290_LandDragonConqueror.java
quests/Q10291_FireDragonDestroyer/Q10291_FireDragonDestroyer.java
quests/Q10292_SevenSignsGirlOfDoubt/Q10292_SevenSignsGirlOfDoubt.java
#quests/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.java
quests/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom/Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.java
#quests/Q10294_SevenSignsToTheMonasteryOfSilence/Q10294_SevenSignsToTheMonasteryOfSilence.java
#quests/Q10295_SevenSignsSolinasTomb/Q10295_SevenSignsSolinasTomb.java
#quests/Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal/Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal.java
......
......@@ -19,6 +19,7 @@
package instances.ElcadiasTent;
import quests.Q10292_SevenSignsGirlOfDoubt.Q10292_SevenSignsGirlOfDoubt;
import quests.Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
......@@ -26,7 +27,6 @@ import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
......@@ -76,8 +76,9 @@ public final class ElcadiasTent extends Quest
{
if (npc.getId() == GRUFF_LOOKING_MAN)
{
final QuestState qs = talker.getQuestState(Q10292_SevenSignsGirlOfDoubt.class.getSimpleName());
if ((qs != null) && qs.isStarted())
if (((talker.getQuestState(Q10292_SevenSignsGirlOfDoubt.class.getSimpleName()) != null) && talker.getQuestState(Q10292_SevenSignsGirlOfDoubt.class.getSimpleName()).isStarted()) //
|| ((talker.getQuestState(Q10292_SevenSignsGirlOfDoubt.class.getSimpleName()) != null) && talker.getQuestState(Q10292_SevenSignsGirlOfDoubt.class.getSimpleName()).isCompleted() && (talker.getQuestState(Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.class.getSimpleName()) == null)) //
|| ((talker.getQuestState(Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.class.getSimpleName()) != null) && talker.getQuestState(Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.class.getSimpleName()).isStarted()))
{
enterInstance(talker, "ElcadiasTent.xml", START_LOC);
}
......
<html><body>Abyssal Saintess Elcadia:<br>
Oh.. Now I understand why this library is called the Pride of Rune. This is...<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>
\ No newline at end of file
<HTML><BODY>A book called "Saintess Solina's Biography" stands out.<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>
\ No newline at end of file
<HTML><BODY>A book called "The Investigation of the Cave of Giants" stands out.<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>
\ No newline at end of file
<HTML><BODY>A book called "Continents and Cosmology" stands out.<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>
\ No newline at end of file
<HTML><BODY>A book called "Religions of the Aden Kingdom" stands out.<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>
\ No newline at end of file
<HTML><BODY>A book called "The Genesis of Dwarves" stands out.<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>
\ No newline at end of file
<html><body>Library of Sages Director Sophia:<br>
Hello. What brings you to Library of Sages?<br>
<a action="bypass -h Quest LibraryOfSages EXIT">"I wish to leave."</a><br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>
\ No newline at end of file
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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.
*
* L2J DataPack 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.LibraryOfSages;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Library of Sages instance zone.
* @author Adry_85
*/
public final class LibraryOfSages extends AbstractNpcAI
{
protected class LoSWorld extends InstanceWorld
{
protected L2Npc elcadia = null;
protected long storeTime = 0;
}
private static final int INSTANCEID = 156;
// NPCs
private static final int SOPHIA1 = 32596;
private static final int PILE_OF_BOOKS1 = 32809;
private static final int PILE_OF_BOOKS2 = 32810;
private static final int PILE_OF_BOOKS3 = 32811;
private static final int PILE_OF_BOOKS4 = 32812;
private static final int PILE_OF_BOOKS5 = 32813;
private static final int SOPHIA2 = 32861;
private static final int SOPHIA3 = 32863;
private static final int ELCADIA_INSTANCE = 32785;
// Locations
private static final Location START_LOC = new Location(37063, -49813, -1128, 0, INSTANCEID);
private static final Location EXIT_LOC = new Location(37063, -49813, -1128, 0, 0);
private static final Location LIBRARY_LOC = new Location(37355, -50065, -1127, 0, INSTANCEID);
// NpcString
private static final NpcStringId[] ELCADIA_DIALOGS =
{
NpcStringId.I_MUST_ASK_LIBRARIAN_SOPHIA_ABOUT_THE_BOOK,
NpcStringId.THIS_LIBRARY_ITS_HUGE_BUT_THERE_ARENT_MANY_USEFUL_BOOKS_RIGHT,
NpcStringId.AN_UNDERGROUND_LIBRARY_I_HATE_DAMP_AND_SMELLY_PLACES,
NpcStringId.THE_BOOK_THAT_WE_SEEK_IS_CERTAINLY_HERE_SEARCH_INCH_BY_INCH
};
private LibraryOfSages()
{
super(LibraryOfSages.class.getSimpleName(), "instances");
addFirstTalkId(SOPHIA2, ELCADIA_INSTANCE, PILE_OF_BOOKS1, PILE_OF_BOOKS2, PILE_OF_BOOKS3, PILE_OF_BOOKS4, PILE_OF_BOOKS5);
addStartNpc(SOPHIA1, SOPHIA2, SOPHIA3);
addTalkId(SOPHIA1, SOPHIA2, SOPHIA3);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if (!(tmpworld instanceof LoSWorld))
{
return null;
}
LoSWorld world = (LoSWorld) tmpworld;
switch (event)
{
case "TELEPORT2":
{
player.teleToLocation(LIBRARY_LOC);
world.elcadia.teleToLocation(LIBRARY_LOC);
break;
}
case "EXIT":
{
cancelQuestTimer("FOLLOW", npc, player);
player.teleToLocation(EXIT_LOC);
world.elcadia.deleteMe();
break;
}
case "FOLLOW":
{
npc.setIsRunning(true);
npc.getAI().startFollow(player);
broadcastNpcSay(npc, Say2.NPC_ALL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]);
startQuestTimer("FOLLOW", 10000, npc, player);
break;
}
case "ENTER":
{
cancelQuestTimer("FOLLOW", npc, player);
player.teleToLocation(START_LOC);
world.elcadia.teleToLocation(START_LOC);
break;
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
enterInstance(talker, "LibraryOfSages.xml", START_LOC);
return super.onTalk(npc, talker);
}
protected int enterInstance(L2PcInstance player, String template, Location loc)
{
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
{
if (!(world instanceof LoSWorld))
{
player.sendPacket(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER);
return 0;
}
teleportPlayer(player, loc, world.getInstanceId(), false);
spawnNPC(player, (LoSWorld) world);
return 0;
}
// New instance
world = new LoSWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(INSTANCEID);
world.setStatus(0);
((LoSWorld) world).storeTime = System.currentTimeMillis();
InstanceManager.getInstance().addWorld(world);
_log.info("Library of Sages started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// teleport players
teleportPlayer(player, loc, world.getInstanceId(), false);
world.addAllowed(player.getObjectId());
spawnNPC(player, (LoSWorld) world);
return world.getInstanceId();
}
protected void spawnNPC(L2PcInstance player, LoSWorld world)
{
final L2Npc npc = addSpawn(ELCADIA_INSTANCE, player.getX(), player.getY(), player.getZ(), 0, false, 0, false, player.getInstanceId());
world.elcadia = npc;
startQuestTimer("FOLLOW", 3000, npc, player);
}
public static void main(String[] args)
{
new LibraryOfSages();
}
}
<html><body>Library of Sages Director Sophia:<br>
Do you need any guidance in the Saints Library, or do you have any other business here?<br>
<a action="bypass -h Quest Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom 32596-03.html">"Have you seen the word Embryo?"</a>
</body></html>
\ No newline at end of file
<html><body>Library of Sages Director Sophia:<br>
Do you need any guidance in the Saints Library, or do you have any other business here?<br>
<a action="bypass -h menu_select?ask=10293&reply=1">"I have a question regarding the Embryo."</a>
</body></html>
\ No newline at end of file
<html><body>Library of Sages Director Sophia:<br>
Seems like I should hear more about this story. We should move to somewhere inside the library - this place is too crowded. What do you think?<br>
<a action="bypass -h Quest Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom 32596-04.html">"Yes, let's go inside the library."</a>
</body></html>
\ No newline at end of file
<html><body>Library of Sages Director Sophia:<br>
Are you ready to enter?<br>
<a action="bypass -h Quest LibraryOfSages">"I am ready."</a>
</body></html>
\ No newline at end of file
<html><body>Library of Sages Director Sophia:<br>
I believe your business is done here. Seems like I can no longer help you. All the best, friend.
</body></html>
\ No newline at end of file
<html><body>Abyssal Saintess Elcadia:<br>
I need your help now. Things just got complicated.<br>
<a action="bypass -h Quest Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom 32784-03.htm">Ask what you should do.</a>
</body></html>
\ No newline at end of file
<html><body>Abyssal Saintess Elcadia:<br>
From where I'm standing it looks like you've completed everything for now...<br>
(You have already completed this quest.)
</body></html>
\ No newline at end of file
<html><body>Abyssal Saintess Elcadia:<br>
We've researched the information you brought from Hardin. It seems the book we're looking for is in the Rune's Main Library. You should come with me to the library and search for this book. I'll have to get ready, so why don't we meet at Rune's Main Library?<br>
<a action="bypass -h Quest Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom 32784-04.html">Plan to meet at the Rune's Library.</a><br>
<a action="bypass -h Quest Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom 32784-05.html">Not quite ready yet, I need to make preparations.</a>
</body></html>
\ No newline at end of file
<html><body>Abyssal Saintess Elcadia:<br>
Alright. Then, let's meet up at Rune's Library. Library Director Sophia can help you with any questions. I'll catch up with you soon.
</body></html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment