Some syncs with l2jserver.

Also QuestState cleanup.
This commit is contained in:
MobiusDev
2017-08-15 12:36:39 +00:00
parent 84f82612cf
commit c4f94bcc0f
652 changed files with 12410 additions and 4435 deletions

View File

@@ -196,6 +196,11 @@ public abstract class AbstractInstance extends AbstractNpcAI
protected abstract void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance);
protected boolean checkConditions(L2PcInstance player, int templateId)
{
return checkConditions(player);
}
protected boolean checkConditions(L2PcInstance player)
{
return true;

View File

@@ -0,0 +1,3 @@
<html><body>
To enter the dungeon, your party must include at least 2 people.
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>
One of your party members is not a member of the clan who owns the castle...
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>
It is already in use. Once training has begun, you must wait 4 hours before entering.
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>
You cannot enter the Prison 2 hours prior to a siege. Access will be granted once the siege ends. Also, you can't access the underground dungeon until a castle lord announces the siege after the battle.
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>
The threat to civic order in the territory is a great deal more pressing than a training session in the prison.<br> (You cannot enter the prison without a contract with the fortress.)
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Prison Manager:<br>
This is a dangerous place. Don't come around here unless you're ready for a fight!<br><br>
<a action="bypass -h npc_%objectId%_Chat 0">"I heard a rumor about Rim Pailaka."</a><br>
<a action="bypass -h Quest CastleDungeon">"I want to enter the prison."</a><br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>

View File

@@ -0,0 +1,233 @@
/*
* 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.CastleDungeon;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.l2jmobius.gameserver.instancemanager.FortManager;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Castle;
import com.l2jmobius.gameserver.model.entity.Fort;
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.util.Util;
import instances.AbstractInstance;
/**
* Castle Dungeon instance zone.
* @author Adry_85
* @since 2.6.0.0
*/
public final class CastleDungeon extends AbstractInstance
{
protected class CDWorld extends InstanceWorld
{
}
// Locations
private static final Location[] ENTER_LOC =
{
new Location(12188, -48770, -3008),
new Location(12218, -48770, -3008),
new Location(12248, -48770, -3008),
};
private static final Location RAIDS_LOC = new Location(11793, -49190, -3008, 0);
// Misc
private static final Map<Integer, Integer> CASTLE_DUNGEON = new HashMap<>();
private static final Map<Integer, List<Integer>> FORTRESS = new HashMap<>();
static
{
CASTLE_DUNGEON.put(36403, 13); // Gludio
CASTLE_DUNGEON.put(36404, 14); // Dion
CASTLE_DUNGEON.put(36405, 15); // Giran
CASTLE_DUNGEON.put(36406, 16); // Oren
CASTLE_DUNGEON.put(36407, 17); // Aden
CASTLE_DUNGEON.put(36408, 18); // Innadril
CASTLE_DUNGEON.put(36409, 19); // Goddard
CASTLE_DUNGEON.put(36410, 20); // Rune
CASTLE_DUNGEON.put(36411, 21); // Schuttgart
FORTRESS.put(1, Arrays.asList(101, 102, 112, 113)); // Gludio Castle
FORTRESS.put(2, Arrays.asList(103, 112, 114, 115)); // Dion Castle
FORTRESS.put(3, Arrays.asList(104, 114, 116, 118, 119)); // Giran Castle
FORTRESS.put(4, Arrays.asList(105, 113, 115, 116, 117)); // Oren Castle
FORTRESS.put(5, Arrays.asList(106, 107, 117, 118)); // Aden Castle
FORTRESS.put(6, Arrays.asList(108, 119)); // Innadril Castle
FORTRESS.put(7, Arrays.asList(109, 117, 120)); // Goddard Castle
FORTRESS.put(8, Arrays.asList(110, 120, 121)); // Rune Castle
FORTRESS.put(9, Arrays.asList(111, 121)); // Schuttgart Castle
}
// Raid Bosses
protected static final int[] RAIDS1 =
{
25546, // Rhianna the Traitor
25549, // Tesla the Deceiver
25552, // Soul Hunter Chakundel
};
protected static final int[] RAIDS2 =
{
25553, // Durango the Crusher
25554, // Brutus the Obstinate
25557, // Ranger Karankawa
25560, // Sargon the Mad
};
protected static final int[] RAIDS3 =
{
25563, // Beautiful Atrielle
25566, // Nagen the Tomboy
25569, // Jax the Destroyer
};
public CastleDungeon()
{
super(CastleDungeon.class.getSimpleName());
addFirstTalkId(CASTLE_DUNGEON.keySet());
addStartNpc(CASTLE_DUNGEON.keySet());
addTalkId(CASTLE_DUNGEON.keySet());
addKillId(RAIDS1);
addKillId(RAIDS2);
addKillId(RAIDS3);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
if (player.getParty() == null)
{
teleportPlayer(player, ENTER_LOC[getRandom(ENTER_LOC.length)], world.getInstanceId());
world.addAllowed(player.getObjectId());
}
else
{
for (L2PcInstance partyMember : player.getParty().getMembers())
{
teleportPlayer(partyMember, ENTER_LOC[getRandom(ENTER_LOC.length)], world.getInstanceId());
world.addAllowed(partyMember.getObjectId());
}
}
world.setStatus(0);
spawnRaid((CDWorld) world);
}
else
{
teleportPlayer(player, ENTER_LOC[getRandom(ENTER_LOC.length)], world.getInstanceId());
}
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return "36403.html";
}
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (tmpworld instanceof CDWorld)
{
CDWorld world = (CDWorld) tmpworld;
if (Util.contains(RAIDS3, npc.getId()))
{
finishInstance(world);
}
else
{
world.incStatus();
spawnRaid(world);
}
}
return null;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final L2Party party = player.getParty();
if (party == null)
{
return "36403-01.html";
}
final Castle castle = npc.getCastle();
if (castle.getSiege().isInProgress())
{
return "36403-04.html";
}
if ((npc.isMyLord(player) || ((player.getClan() != null) && (npc.getCastle().getResidenceId() == player.getClan().getCastleId()) && (player.getClan().getCastleId() > 0))))
{
final int numFort = ((castle.getResidenceId() == 1) || (castle.getResidenceId() == 5)) ? 2 : 1;
final List<Integer> fort = FORTRESS.get(castle.getResidenceId());
for (int i = 0; i < numFort; i++)
{
final Fort fortress = FortManager.getInstance().getFortById(fort.get(i));
if (fortress.getFortState() == 0)
{
return "36403-05.html";
}
}
}
for (L2PcInstance partyMember : party.getMembers())
{
if ((partyMember.getClan() == null) || (partyMember.getClan().getCastleId() != castle.getResidenceId()))
{
return "36403-02.html";
}
if (System.currentTimeMillis() < InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), CASTLE_DUNGEON.get(npc.getId())))
{
return "36403-03.html";
}
}
enterInstance(player, new CDWorld(), "CastleDungeon.xml", CASTLE_DUNGEON.get(npc.getId()));
return super.onTalk(npc, player);
}
protected void spawnRaid(CDWorld world)
{
int spawnId;
if (world.getStatus() == 0)
{
spawnId = RAIDS1[getRandom(RAIDS1.length)];
}
else if (world.getStatus() == 1)
{
spawnId = RAIDS2[getRandom(RAIDS2.length)];
}
else
{
spawnId = RAIDS3[getRandom(RAIDS3.length)];
}
addSpawn(spawnId, RAIDS_LOC, false, 0, false, world.getInstanceId());
}
}

View File

@@ -27,7 +27,7 @@ import instances.AbstractInstance;
import quests.Q10292_SevenSignsGirlOfDoubt.Q10292_SevenSignsGirlOfDoubt;
import quests.Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom;
import quests.Q10294_SevenSignsToTheMonasteryOfSilence.Q10294_SevenSignsToTheMonasteryOfSilence;
import quests.Q10296_SevenSignsPowerOfTheSeal.Q10296_SevenSignsPowerOfTheSeal;
import quests.Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal.Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal;
/**
* Elcadia's Tent instance zone.
@@ -35,12 +35,17 @@ import quests.Q10296_SevenSignsPowerOfTheSeal.Q10296_SevenSignsPowerOfTheSeal;
*/
public final class ElcadiasTent extends AbstractInstance
{
protected class ETWorld extends InstanceWorld
{
}
// NPCs
private static final int ELCADIA = 32784;
private static final int GRUFF_LOOKING_MAN = 32862;
// Locations
private static final Location START_LOC = new Location(89706, -238074, -9632, 0, 0);
private static final Location EXIT_LOC = new Location(43316, -87986, -2832, 0, 0);
private static final Location START_LOC = new Location(89797, -238081, -9632);
private static final Location EXIT_LOC = new Location(43347, -87923, -2820);
// Misc
private static final int TEMPLATE_ID = 158;
@@ -57,17 +62,17 @@ public final class ElcadiasTent extends AbstractInstance
{
if (npc.getId() == GRUFF_LOOKING_MAN)
{
final QuestState GirlOfDoubt = talker.getQuestState(Q10292_SevenSignsGirlOfDoubt.class.getSimpleName());
final QuestState ForbiddenBook = talker.getQuestState(Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.class.getSimpleName());
final QuestState Monastery = talker.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName());
final QuestState PowerOfSeal = talker.getQuestState(Q10296_SevenSignsPowerOfTheSeal.class.getSimpleName());
if (((GirlOfDoubt != null) && GirlOfDoubt.isStarted()) //
|| ((GirlOfDoubt != null) && GirlOfDoubt.isCompleted() && (ForbiddenBook == null)) //
|| ((ForbiddenBook != null) && ForbiddenBook.isStarted()) //
|| ((ForbiddenBook != null) && ForbiddenBook.isCompleted() && (Monastery == null)) //
|| ((PowerOfSeal != null) && PowerOfSeal.isStarted()))
final QuestState Q10292 = talker.getQuestState(Q10292_SevenSignsGirlOfDoubt.class.getSimpleName());
final QuestState Q10293 = talker.getQuestState(Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.class.getSimpleName());
final QuestState Q10294 = talker.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName());
final QuestState Q10296 = talker.getQuestState(Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal.class.getSimpleName());
if (((Q10292 != null) && Q10292.isStarted()) //
|| ((Q10292 != null) && Q10292.isCompleted() && (Q10293 == null)) //
|| ((Q10293 != null) && Q10293.isStarted()) //
|| ((Q10293 != null) && Q10293.isCompleted() && (Q10294 == null)) //
|| ((Q10296 != null) && (Q10296.getMemoState() > 2) && (Q10296.getMemoState() < 4)))
{
enterInstance(talker, "ElcadiasTent.xml", TEMPLATE_ID);
enterInstance(talker, new ETWorld(), "ElcadiasTent.xml", TEMPLATE_ID);
}
else
{

View File

@@ -19,6 +19,7 @@ package instances;
import java.util.logging.Level;
import java.util.logging.Logger;
import instances.CastleDungeon.CastleDungeon;
import instances.CavernOfThePirateCaptain.CavernOfThePirateCaptain;
import instances.ChambersOfDelusion.ChamberOfDelusionEast;
import instances.ChambersOfDelusion.ChamberOfDelusionNorth;
@@ -42,12 +43,10 @@ import instances.Kamaloka.Kamaloka;
import instances.LibraryOfSages.LibraryOfSages;
import instances.MithrilMine.MithrilMine;
import instances.MonasteryOfSilence1.MonasteryOfSilence1;
import instances.MonasteryOfSilence2.MonasteryOfSilence2;
import instances.NornilsGarden.NornilsGarden;
import instances.NornilsGardenQuest.NornilsGardenQuest;
import instances.PailakaDevilsLegacy.PailakaDevilsLegacy;
import instances.PailakaSongOfIceAndFire.PailakaSongOfIceAndFire;
import instances.RimKamaloka.RimKamaloka;
import instances.SanctumOftheLordsOfDawn.SanctumOftheLordsOfDawn;
/**
@@ -60,6 +59,7 @@ public final class InstanceLoader
private static final Class<?>[] SCRIPTS =
{
CastleDungeon.class,
CavernOfThePirateCaptain.class,
CrystalCaverns.class,
DarkCloudMansion.class,
@@ -83,12 +83,10 @@ public final class InstanceLoader
LibraryOfSages.class,
MithrilMine.class,
MonasteryOfSilence1.class,
MonasteryOfSilence2.class,
NornilsGarden.class,
NornilsGardenQuest.class,
PailakaDevilsLegacy.class,
PailakaSongOfIceAndFire.class,
RimKamaloka.class,
SanctumOftheLordsOfDawn.class,
};

View File

@@ -1,5 +0,0 @@
<html><html>Sister of Silence Eris:<br>
Finally we meet, Successors of Fate. In the end, the endless Bridle of Eternity will be back where it belongs.<br>
<a action="bypass -h Quest MonasteryOfSilence1 EXIT">"I'd like to go outside."</a><br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>

View File

@@ -1,3 +1,3 @@
<html><body>Teleportation Device: Move to East Watcher's Room.<br><br>
<html><body>Teleportation Device: Move to East Watcher's Room.<br>
<a action="bypass -h Quest MonasteryOfSilence1 EAST">Move to East Watcher's Room</a>
</body></html>

View File

@@ -1,3 +1,3 @@
<html><body>Teleportation Device: Move to West Watcher's Room.<br><br>
<html><body>Teleportation Device: Move to West Watcher's Room.<br>
<a action="bypass -h Quest MonasteryOfSilence1 WEST">Move to West Watcher's Room</a>
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Tomb of Saintess:<br>
You look at the tomb, and see these words.<br>
"For the Saintess Solina, who devoted all her life to serve Einhasad and the Elmoreden Kingdom...to be remembered forever by those she saved and those who loved her...may punishing find the feet of those who ignored Solina's teachings."<br>
This is not Solina's real tomb.
</body></html>

View File

@@ -16,16 +16,22 @@
*/
package instances.MonasteryOfSilence1;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.network.NpcStringId;
import instances.AbstractInstance;
import quests.Q10294_SevenSignsToTheMonasteryOfSilence.Q10294_SevenSignsToTheMonasteryOfSilence;
import quests.Q10295_SevenSignsSolinasTomb.Q10295_SevenSignsSolinasTomb;
import quests.Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal.Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal;
/**
* Monastery of Silence instance zone.
@@ -36,6 +42,8 @@ public final class MonasteryOfSilence1 extends AbstractInstance
protected static final class MoSWorld extends InstanceWorld
{
protected L2Npc elcadia = null;
protected int deadTombGuardianCount = 0;
protected int deadSolinaGuardianCount = 0;
}
// NPCs
@@ -51,6 +59,24 @@ public final class MonasteryOfSilence1 extends AbstractInstance
private static final int TELEPORT_CONTROL_DEVICE2 = 32818;
private static final int TELEPORT_CONTROL_DEVICE3 = 32819;
private static final int TELEPORT_CONTROL_DEVICE4 = 32820;
private static final int TOMB_OF_THE_SAINTESS = 32843;
// Monsters
private static final int TRAINEE_OF_REST = 27403;
private static final int SUPPLICANT_OF_REST = 27404;
private static final int ETIS_VAN_ETINA = 18949;
private static final int SOLINAS_GUARDIAN_1 = 18952;
private static final int SOLINAS_GUARDIAN_2 = 18953;
private static final int SOLINAS_GUARDIAN_3 = 18954;
private static final int SOLINAS_GUARDIAN_4 = 18955;
private static final int GUARDIAN_OF_THE_TOMB_1 = 18956;
private static final int GUARDIAN_OF_THE_TOMB_2 = 18957;
private static final int GUARDIAN_OF_THE_TOMB_3 = 18958;
private static final int GUARDIAN_OF_THE_TOMB_4 = 18959;
// Items
private static final int SCROLL_OF_ABSTINENCE = 17228;
private static final int SHIELD_OF_SACRIFICE = 17229;
private static final int SWORD_OF_HOLY_SPIRIT = 17230;
private static final int STAFF_OF_BLESSING = 17231;
// Skills
private static final SkillHolder[] BUFFS =
{
@@ -59,28 +85,109 @@ public final class MonasteryOfSilence1 extends AbstractInstance
new SkillHolder(6730, 1), // Greater Battle Heal of Elcadia
};
// Locations
private static final Location START_LOC = new Location(120710, -86971, -3392);
private static final Location EXIT_LOC = new Location(115983, -87351, -3397, 0, 0);
private static final Location START_LOC = new Location(120717, -86879, -3424);
private static final Location EXIT_LOC = new Location(115983, -87351, -3397);
private static final Location CENTRAL_ROOM_LOC = new Location(85794, -249788, -8320);
private static final Location SOUTH_WATCHERS_ROOM_LOC = new Location(85798, -246566, -8320);
private static final Location WEST_WATCHERS_ROOM_LOC = new Location(82531, -249405, -8320);
private static final Location EAST_WATCHERS_ROOM_LOC = new Location(88665, -249784, -8320);
private static final Location NORTH_WATCHERS_ROOM_LOC = new Location(85792, -252336, -8320);
private static final Location BACK_LOC = new Location(120710, -86971, -3392);
// NpcString
private static final NpcStringId[] ELCADIA_DIALOGS =
private static final Location START_LOC_Q10295 = new Location(45545, -249423, -6788);
private static final Location CASKET_ROOM_LOC = new Location(56033, -252944, -6792);
private static final Location SOLINAS_RESTING_PLACE_LOC = new Location(55955, -250394, -6792);
private static final Location DIRECTORS_ROOM_LOC = new Location(120717, -86879, -3424);
private static final Location GUARDIAN_OF_THE_TOMB_1_LOC = new Location(55498, -252781, -6752, 0);
private static final Location GUARDIAN_OF_THE_TOMB_2_LOC = new Location(55520, -252160, -6752, 0);
private static final Location GUARDIAN_OF_THE_TOMB_3_LOC = new Location(56635, -252776, -6752, -32180);
private static final Location GUARDIAN_OF_THE_TOMB_4_LOC = new Location(56672, -252156, -6754, 32252);
private static final Location SOLINAS_GUARDIAN_1_LOC = new Location(45399, -253051, -6765, 16584);
private static final Location SOLINAS_GUARDIAN_2_LOC = new Location(48736, -249632, -6768, -32628);
private static final Location SOLINAS_GUARDIAN_3_LOC = new Location(45392, -246303, -6768, -16268);
private static final Location SOLINAS_GUARDIAN_4_LOC = new Location(42016, -249648, -6764, 0);
private static final Location ELCADIA_LOC = new Location(115927, -87005, -3392);
private static final Location SPACE_LOC = new Location(76736, -241021, -10780);
private static final Location ETIS_VAN_ETINA_LOC = new Location(76625, -240824, -10832, 0);
private static final Location[] SLAVE_SPAWN_1_LOC =
{
new Location(55680, -252832, -6752),
new Location(55825, -252792, -6752),
new Location(55687, -252718, -6752),
new Location(55824, -252679, -6752),
};
private static final Location[] SLAVE_SPAWN_2_LOC =
{
new Location(55672, -252099, -6751),
new Location(55810, -252262, -6752),
new Location(55824, -252112, -6752),
new Location(55669, -252227, -6752),
};
private static final Location[] SLAVE_SPAWN_3_LOC =
{
new Location(56480, -252833, -6751),
new Location(56481, -252725, -6752),
new Location(56368, -252787, -6752),
new Location(56368, -252669, -6752),
};
private static final Location[] SLAVE_SPAWN_4_LOC =
{
new Location(56463, -252225, -6751),
new Location(56469, -252108, -6752),
new Location(56336, -252168, -6752),
new Location(56336, -252288, -6752),
};
// NpcString
private static final NpcStringId[] ELCADIA_DIALOGS_Q010294 =
{
NpcStringId.IT_SEEMS_THAT_YOU_CANNOT_REMEMBER_TO_THE_ROOM_OF_THE_WATCHER_WHO_FOUND_THE_BOOK,
NpcStringId.WE_MUST_SEARCH_HIGH_AND_LOW_IN_EVERY_ROOM_FOR_THE_READING_DESK_THAT_CONTAINS_THE_BOOK_WE_SEEK,
NpcStringId.REMEMBER_THE_CONTENT_OF_THE_BOOKS_THAT_YOU_FOUND_YOU_CAN_T_TAKE_THEM_OUT_WITH_YOU
NpcStringId.REMEMBER_THE_CONTENT_OF_THE_BOOKS_THAT_YOU_FOUND_YOU_CAN_T_TAKE_THEM_OUT_WITH_YOU,
NpcStringId.IT_SEEMS_THAT_YOU_CANNOT_REMEMBER_TO_THE_ROOM_OF_THE_WATCHER_WHO_FOUND_THE_BOOK
};
private static final NpcStringId[] ELCADIA_DIALOGS_Q010295 =
{
NpcStringId.THE_GUARDIAN_OF_THE_SEAL_DOESN_T_SEEM_TO_GET_INJURED_AT_ALL_UNTIL_THE_BARRIER_IS_DESTROYED,
NpcStringId.THE_DEVICE_LOCATED_IN_THE_ROOM_IN_FRONT_OF_THE_GUARDIAN_OF_THE_SEAL_IS_DEFINITELY_THE_BARRIER_THAT_CONTROLS_THE_GUARDIAN_S_POWER,
NpcStringId.TO_REMOVE_THE_BARRIER_YOU_MUST_FIND_THE_RELICS_THAT_FIT_THE_BARRIER_AND_ACTIVATE_THE_DEVICE
};
// Misc
private static final int TEMPLATE_ID = 151;
// Doors
private static final int TOMB_DOOR = 21100018;
private static final int[] DOORS =
{
21100014,
21100001,
21100006,
21100010,
21100003,
21100008,
21100012,
21100016,
21100002,
21100015,
21100005,
21100004,
21100009,
21100007,
21100013,
21100011
};
private static final int[] FAKE_TOMB_DOORS =
{
21100101,
21100102,
21100103,
21100104
};
public MonasteryOfSilence1()
{
super(MonasteryOfSilence1.class.getSimpleName());
addFirstTalkId(TELEPORT_CONTROL_DEVICE1, TELEPORT_CONTROL_DEVICE2, TELEPORT_CONTROL_DEVICE3, TELEPORT_CONTROL_DEVICE4, ERIS_EVIL_THOUGHTS);
addFirstTalkId(TELEPORT_CONTROL_DEVICE1, TELEPORT_CONTROL_DEVICE2, TELEPORT_CONTROL_DEVICE3, TELEPORT_CONTROL_DEVICE4);
addKillId(SOLINAS_GUARDIAN_1, SOLINAS_GUARDIAN_2, SOLINAS_GUARDIAN_3, SOLINAS_GUARDIAN_4, GUARDIAN_OF_THE_TOMB_1, GUARDIAN_OF_THE_TOMB_2, GUARDIAN_OF_THE_TOMB_3, GUARDIAN_OF_THE_TOMB_4, ETIS_VAN_ETINA);
addSpawnId(ERIS_EVIL_THOUGHTS, TOMB_OF_THE_SAINTESS);
addStartNpc(ODD_GLOBE, TELEPORT_CONTROL_DEVICE1, TELEPORT_CONTROL_DEVICE2, TELEPORT_CONTROL_DEVICE3, TELEPORT_CONTROL_DEVICE4, ERIS_EVIL_THOUGHTS);
addTalkId(ODD_GLOBE, ERIS_EVIL_THOUGHTS, RELIC_GUARDIAN, RELIC_WATCHER1, RELIC_WATCHER2, RELIC_WATCHER3, RELIC_WATCHER4, TELEPORT_CONTROL_DEVICE1, TELEPORT_CONTROL_DEVICE2, TELEPORT_CONTROL_DEVICE3, TELEPORT_CONTROL_DEVICE4, ERIS_EVIL_THOUGHTS);
}
@@ -99,91 +206,338 @@ public final class MonasteryOfSilence1 extends AbstractInstance
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if (!(tmpworld instanceof MoSWorld))
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (tmpworld instanceof MoSWorld)
{
return null;
}
final MoSWorld world = (MoSWorld) tmpworld;
switch (event)
{
case "TELE2":
final MoSWorld world = (MoSWorld) tmpworld;
switch (event)
{
teleportPlayer(player, CENTRAL_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(CENTRAL_ROOM_LOC, 0, world.getInstanceId());
startQuestTimer("START_MOVIE", 2000, npc, player);
break;
}
case "EXIT":
{
cancelQuestTimer("FOLLOW", npc, player);
teleportPlayer(player, EXIT_LOC, 0);
world.elcadia.deleteMe();
break;
}
case "START_MOVIE":
{
player.showQuestMovie(24);
break;
}
case "BACK":
{
teleportPlayer(player, BACK_LOC, world.getInstanceId());
world.elcadia.teleToLocation(BACK_LOC, 0, world.getInstanceId());
break;
}
case "EAST":
{
teleportPlayer(player, EAST_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(EAST_WATCHERS_ROOM_LOC, 0, world.getInstanceId());
break;
}
case "WEST":
{
teleportPlayer(player, WEST_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(WEST_WATCHERS_ROOM_LOC, 0, world.getInstanceId());
break;
}
case "NORTH":
{
teleportPlayer(player, NORTH_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(NORTH_WATCHERS_ROOM_LOC, 0, world.getInstanceId());
break;
}
case "SOUTH":
{
teleportPlayer(player, SOUTH_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(SOUTH_WATCHERS_ROOM_LOC, 0, world.getInstanceId());
break;
}
case "CENTER":
{
teleportPlayer(player, CENTRAL_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(CENTRAL_ROOM_LOC, 0, world.getInstanceId());
break;
}
case "FOLLOW":
{
npc.setIsRunning(true);
npc.getAI().startFollow(player);
if (player.isInCombat())
case "TELE2":
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOUR_WORK_HERE_IS_DONE_SO_RETURN_TO_THE_CENTRAL_GUARDIAN);
npc.setTarget(player);
npc.doCast(BUFFS[getRandom(BUFFS.length)].getSkill());
teleportPlayer(player, CENTRAL_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(CENTRAL_ROOM_LOC, world.getInstanceId(), 0);
startQuestTimer("START_MOVIE", 2000, npc, player);
break;
}
else
case "EXIT":
{
npc.broadcastSay(ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]);
cancelQuestTimer("FOLLOW", npc, player);
cancelQuestTimer("DIALOG", npc, player);
teleportPlayer(player, EXIT_LOC, 0);
world.elcadia.deleteMe();
break;
}
case "START_MOVIE":
{
player.showQuestMovie(24);
break;
}
case "BACK":
{
teleportPlayer(player, BACK_LOC, world.getInstanceId());
world.elcadia.teleToLocation(BACK_LOC, world.getInstanceId(), 0);
break;
}
case "EAST":
{
teleportPlayer(player, EAST_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(EAST_WATCHERS_ROOM_LOC, world.getInstanceId(), 0);
break;
}
case "WEST":
{
teleportPlayer(player, WEST_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(WEST_WATCHERS_ROOM_LOC, world.getInstanceId(), 0);
break;
}
case "NORTH":
{
teleportPlayer(player, NORTH_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(NORTH_WATCHERS_ROOM_LOC, world.getInstanceId(), 0);
break;
}
case "SOUTH":
{
teleportPlayer(player, SOUTH_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(SOUTH_WATCHERS_ROOM_LOC, world.getInstanceId(), 0);
break;
}
case "CENTER":
{
teleportPlayer(player, CENTRAL_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(CENTRAL_ROOM_LOC, world.getInstanceId(), 0);
break;
}
case "FOLLOW":
{
npc.setIsRunning(true);
npc.getAI().startFollow(player);
if (player.isInCombat())
{
npc.doCast(BUFFS[getRandom(BUFFS.length)].getSkill());
}
startQuestTimer("FOLLOW", 5000, npc, player);
break;
}
case "DIALOG":
{
final QuestState st_Q10294 = player.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName());
final QuestState st_Q10295 = player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName());
if ((st_Q10294 != null) && st_Q10294.isStarted())
{
npc.broadcastSay(ChatType.NPC_GENERAL, ELCADIA_DIALOGS_Q010294[getRandom(ELCADIA_DIALOGS_Q010294.length)]);
}
if ((st_Q10295 != null) && st_Q10295.isMemoState(1))
{
npc.broadcastSay(ChatType.NPC_GENERAL, ELCADIA_DIALOGS_Q010295[getRandom(ELCADIA_DIALOGS_Q010295.length)]);
}
startQuestTimer("DIALOG", 10000, npc, player);
break;
}
case "ENTER_Q10295":
{
teleportPlayer(player, START_LOC_Q10295, world.getInstanceId());
world.elcadia.teleToLocation(START_LOC_Q10295, world.getInstanceId(), 0);
startQuestTimer("START_MOVIE_Q10295", 2000, npc, player);
break;
}
case "START_MOVIE_Q10295":
{
player.showQuestMovie(26);
break;
}
case "CASKET_ROOM":
{
teleportPlayer(player, CASKET_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(CASKET_ROOM_LOC, world.getInstanceId(), 0);
break;
}
case "SOLINAS_RESTING_PLACE":
{
teleportPlayer(player, SOLINAS_RESTING_PLACE_LOC, world.getInstanceId());
world.elcadia.teleToLocation(SOLINAS_RESTING_PLACE_LOC, world.getInstanceId(), 0);
break;
}
case "ERIS_OFFICE":
{
teleportPlayer(player, START_LOC, world.getInstanceId());
world.elcadia.teleToLocation(START_LOC, world.getInstanceId(), 0);
break;
}
case "OPEN_DOORS":
{
for (int doorId : DOORS)
{
openDoor(doorId, world.getInstanceId());
}
break;
}
case "DIRECTORS_ROOM":
{
teleportPlayer(player, DIRECTORS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(DIRECTORS_ROOM_LOC, world.getInstanceId(), 0);
break;
}
case "USE_SCROLL":
{
// TODO (Adry_85): Missing area debuff
if (hasQuestItems(player, SCROLL_OF_ABSTINENCE))
{
takeItems(player, SCROLL_OF_ABSTINENCE, 1);
addSpawn(SOLINAS_GUARDIAN_1, SOLINAS_GUARDIAN_1_LOC, false, 0, false, world.getInstanceId());
}
break;
}
case "USE_SHIELD":
{
// TODO (Adry_85): Missing area debuff
if (hasQuestItems(player, SHIELD_OF_SACRIFICE))
{
takeItems(player, SHIELD_OF_SACRIFICE, 1);
addSpawn(SOLINAS_GUARDIAN_2, SOLINAS_GUARDIAN_2_LOC, false, 0, false, world.getInstanceId());
}
break;
}
case "USE_SWORD":
{
// TODO (Adry_85): Missing area debuff
if (hasQuestItems(player, SWORD_OF_HOLY_SPIRIT))
{
takeItems(player, SWORD_OF_HOLY_SPIRIT, 1);
addSpawn(SOLINAS_GUARDIAN_3, SOLINAS_GUARDIAN_3_LOC, false, 0, false, world.getInstanceId());
}
break;
}
case "USE_STAFF":
{
// TODO (Adry_85): Missing area debuff
if (hasQuestItems(player, STAFF_OF_BLESSING))
{
takeItems(player, STAFF_OF_BLESSING, 1);
addSpawn(SOLINAS_GUARDIAN_4, SOLINAS_GUARDIAN_4_LOC, false, 0, false, world.getInstanceId());
}
break;
}
case "CLOSE_TOMB_DOORS":
{
for (int doorId : FAKE_TOMB_DOORS)
{
closeDoor(doorId, world.getInstanceId());
}
break;
}
case "TOMB_GUARDIAN_SPAWN":
{
for (int doorId : FAKE_TOMB_DOORS)
{
openDoor(doorId, world.getInstanceId());
}
addSpawn(GUARDIAN_OF_THE_TOMB_1, GUARDIAN_OF_THE_TOMB_1_LOC, false, 0, false, world.getInstanceId());
for (Location LOC : SLAVE_SPAWN_1_LOC)
{
L2Attackable mob = (L2Attackable) addSpawn(TRAINEE_OF_REST, LOC, false, 0, false, world.getInstanceId());
mob.setIsRunning(true);
mob.addDamageHate(player, 0, 999);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
}
addSpawn(GUARDIAN_OF_THE_TOMB_2, GUARDIAN_OF_THE_TOMB_2_LOC, false, 0, false, world.getInstanceId());
for (Location LOC : SLAVE_SPAWN_2_LOC)
{
L2Attackable mob = (L2Attackable) addSpawn(TRAINEE_OF_REST, LOC, false, 0, false, world.getInstanceId());
mob.setIsRunning(true);
mob.addDamageHate(player, 0, 999);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
}
addSpawn(GUARDIAN_OF_THE_TOMB_3, GUARDIAN_OF_THE_TOMB_3_LOC, false, 0, false, world.getInstanceId());
for (Location LOC : SLAVE_SPAWN_3_LOC)
{
L2Attackable mob = (L2Attackable) addSpawn(SUPPLICANT_OF_REST, LOC, false, 0, false, world.getInstanceId());
mob.setIsRunning(true);
mob.addDamageHate(player, 0, 999);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
}
addSpawn(GUARDIAN_OF_THE_TOMB_4, GUARDIAN_OF_THE_TOMB_4_LOC, false, 0, false, world.getInstanceId());
for (Location LOC : SLAVE_SPAWN_4_LOC)
{
L2Attackable mob = (L2Attackable) addSpawn(SUPPLICANT_OF_REST, LOC, false, 0, false, world.getInstanceId());
mob.setIsRunning(true);
mob.addDamageHate(player, 0, 999);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
}
return "32843-01.html";
}
case "START_MOVIE_Q10296":
{
player.showQuestMovie(29);
startQuestTimer("TELEPORT_SPACE", 60000, npc, player);
world.elcadia.teleToLocation(ELCADIA_LOC, world.getInstanceId(), 0);
break;
}
case "TELEPORT_SPACE":
{
teleportPlayer(player, SPACE_LOC, world.getInstanceId());
world.elcadia.teleToLocation(SPACE_LOC, world.getInstanceId(), 0);
addSpawn(ETIS_VAN_ETINA, ETIS_VAN_ETINA_LOC, false, 0, false, world.getInstanceId());
break;
}
case "TELEPORT_TO_PLAYER":
{
world.elcadia.teleToLocation(player.getX(), player.getY(), player.getZ(), 0, world.getInstanceId());
break;
}
startQuestTimer("FOLLOW", 10000, npc, player);
break;
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (tmpworld instanceof MoSWorld)
{
MoSWorld world = (MoSWorld) tmpworld;
switch (npc.getId())
{
case GUARDIAN_OF_THE_TOMB_1:
case GUARDIAN_OF_THE_TOMB_2:
case GUARDIAN_OF_THE_TOMB_3:
case GUARDIAN_OF_THE_TOMB_4:
{
world.deadTombGuardianCount++;
if (world.deadTombGuardianCount == 4)
{
openDoor(TOMB_DOOR, world.getInstanceId());
final QuestState st = player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName());
if ((st != null) && st.isMemoState(2))
{
st.setMemoState(3);
}
}
break;
}
case SOLINAS_GUARDIAN_1:
case SOLINAS_GUARDIAN_2:
case SOLINAS_GUARDIAN_3:
case SOLINAS_GUARDIAN_4:
{
world.deadSolinaGuardianCount++;
if (world.deadSolinaGuardianCount == 4)
{
player.showQuestMovie(27);
final QuestState st = player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName());
if ((st != null) && st.isMemoState(1))
{
st.setMemoState(2);
}
}
break;
}
case ETIS_VAN_ETINA:
{
player.showQuestMovie(30);
world.elcadia.teleToLocation(ELCADIA_LOC, world.getInstanceId(), 0);
startQuestTimer("TELEPORT_TO_PLAYER", 63000, npc, player);
final QuestState st = player.getQuestState(Q10296_SevenSignsOneWhoSeeksThePowerOfTheSeal.class.getSimpleName());
if ((st != null) && st.isMemoState(2))
{
st.setMemoState(3);
}
break;
}
}
}
return null;
}
@Override
public String onSpawn(L2Npc npc)
{
switch (npc.getId())
{
case ERIS_EVIL_THOUGHTS:
{
startQuestTimer("OPEN_DOORS", 1000, npc, null);
break;
}
case TOMB_OF_THE_SAINTESS:
{
startQuestTimer("CLOSE_TOMB_DOORS", 1000, npc, null);
break;
}
}
return super.onSpawn(npc);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
@@ -200,7 +554,8 @@ public final class MonasteryOfSilence1 extends AbstractInstance
{
world.elcadia.deleteMe();
}
world.elcadia = addSpawn(ELCADIA_INSTANCE, player.getX(), player.getY(), player.getZ(), 0, false, 0, false, player.getInstanceId());
startQuestTimer("FOLLOW", 3000, world.elcadia, player);
world.elcadia = addSpawn(ELCADIA_INSTANCE, player.getX(), player.getY(), player.getZ(), 0, false, 0, false, world.getInstanceId());
startQuestTimer("FOLLOW", 5000, world.elcadia, player);
startQuestTimer("DIALOG", 10000, world.elcadia, player);
}
}

View File

@@ -1,535 +0,0 @@
/*
* 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.MonasteryOfSilence2;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Instance;
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.NpcStringId;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import ai.AbstractNpcAI;
import quests.Q10294_SevenSignsToTheMonasteryOfSilence.Q10294_SevenSignsToTheMonasteryOfSilence;
import quests.Q10295_SevenSignsSolinasTomb.Q10295_SevenSignsSolinasTomb;
import quests.Q10296_SevenSignsPowerOfTheSeal.Q10296_SevenSignsPowerOfTheSeal;
public class MonasteryOfSilence2 extends AbstractNpcAI
{
// Values
private static final int INSTANCE_ID = 151;
// NPC's
private static final int OddGlobe = 32815;
private static final int Elcadia_First_Room = 32787;
private static final int Elcadia_Support = 32785;
private static final int ErissEvilThoughts = 32792;
private static final int SolinasEvilThoughts = 32793;
private static final int RelicGuardian = 32803;
private static final int WestRelicWatcher = 32804;
private static final int NorthRelicWatcher = 32805;
private static final int EastRelicWatcher = 32806;
private static final int SouthRelicWatcher = 32807;
private static final int EtisVanEtina = 32808;
private static final int WestTeleportControlDevice = 32816;
private static final int NorthTeleportControlDevice = 32817;
private static final int EastTeleportControlDevice = 32818;
private static final int SouthTeleportControlDevice = 32819;
private static final int JudeVanEtinasEvilThoughts = 32888;
private static final int TeleportControlDevice1 = 32837;
private static final int TeleportControlDevice2 = 32842;
private static final int TombOfTheSaintess = 32843;
private static final int AltarOfHallows_Staff = 32857;
private static final int AltarOfHallows_Sword = 32858;
private static final int AltarOfHallows_Scroll = 32859;
private static final int AltarOfHallows_Shield = 32860;
// Teleport's
private static final int ENTER = 0;
private static final int HOLYGRAL = 1;
private static final int EXIT = 2;
private static final int TW = 3;
private static final int TN = 4;
private static final int TE = 5;
private static final int TS = 6;
private static final int RTE = 7;
private static final int RTG = 8;
private static final int ENTER1 = 9;
private static final int MTS = 10;
private static final int MTS2 = 11;
private static final int EE = 12;
private static final int[][] TELEPORTS =
{
{
120664,
-86968,
-3392
}, // Enter
{
85937,
-249618,
-8320
}, // HolyBurailOpen
{
115944,
-86952,
-3392
}, // ExitInstance
{
82434,
-249546,
-8320
}, // TeleWest
{
85691,
-252426,
-8320
}, // TeleNorth
{
88573,
-249556,
-8320
}, // TeleEast
{
85675,
-246630,
-8320
}, // TeleSouth
{
120727,
-86868,
-3392
}, // ReturnToEris
{
85937,
-249618,
-8320
}, // ReturnToGuardian
{
45545,
-249423,
-6760
}, // Enter1
{
56033,
-252944,
-6760
}, // MoveToSaintness
{
55955,
-250394,
-6760
}, // MoveToSaintness2
{
76707,
-241022,
-10832
}
// EtisEtina
};
private static final int[] TALK =
{
OddGlobe,
Elcadia_Support,
WestTeleportControlDevice,
NorthTeleportControlDevice,
EastTeleportControlDevice,
SouthTeleportControlDevice,
RelicGuardian,
WestRelicWatcher,
NorthRelicWatcher,
EastRelicWatcher,
SouthRelicWatcher,
ErissEvilThoughts,
EtisVanEtina,
JudeVanEtinasEvilThoughts,
SolinasEvilThoughts,
TeleportControlDevice1,
TeleportControlDevice2,
TombOfTheSaintess,
AltarOfHallows_Staff,
AltarOfHallows_Sword,
AltarOfHallows_Scroll,
AltarOfHallows_Shield
};
private static final int[] MageBuff =
{
6725,
6721,
6722,
6717
};
private static final int[] FighterBuff =
{
6714,
6715,
6716,
6717
};
private final HashMap<Integer, InstanceHolder> instanceWorlds = new HashMap<>();
public static class InstanceHolder
{
List<L2Npc> mobs = new ArrayList<>();
}
private class MoSWorld2 extends InstanceWorld
{
public MoSWorld2()
{
}
}
public MonasteryOfSilence2()
{
super(MonasteryOfSilence2.class.getSimpleName(), "instances");
addStartNpc(OddGlobe);
addStartNpc(WestTeleportControlDevice);
addStartNpc(NorthTeleportControlDevice);
addStartNpc(EastTeleportControlDevice);
addStartNpc(SouthTeleportControlDevice);
for (int NPC : TALK)
{
addTalkId(NPC);
}
}
private void teleportPlayer(L2Npc npc, L2PcInstance player, int[] coords, int instanceId)
{
for (L2Character cha : player.getKnownList().getKnownCharacters())
{
if (cha.isNpc() && ((((L2Npc) cha).getId() == Elcadia_Support) || (((L2Npc) cha).getId() == Elcadia_First_Room)))
{
cha.deleteMe();
}
}
InstanceHolder holder = instanceWorlds.get(instanceId);
if ((holder == null) && (instanceId > 0))
{
holder = new InstanceHolder();
instanceWorlds.put(Integer.valueOf(instanceId), holder);
}
player.stopAllEffectsExceptThoseThatLastThroughDeath();
player.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
player.setInstanceId(instanceId);
player.teleToLocation(coords[0], coords[1], coords[2], false);
cancelQuestTimer("check_follow", npc, player);
if (holder != null)
{
for (L2Npc h : holder.mobs)
{
h.deleteMe();
}
holder.mobs.clear();
}
if ((holder != null) && (instanceId > 0))
{
final L2Npc support = addSpawn(Elcadia_Support, player.getX(), player.getY(), player.getZ(), 0, false, 0L, false, player.getInstanceId());
holder.mobs.add(support);
startQuestTimer("check_follow", 3000, support, player);
}
}
protected void enterInstance(L2Npc npc, L2PcInstance player)
{
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world != null)
{
if (!(world instanceof MoSWorld2))
{
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON));
return;
}
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
if (inst != null)
{
teleportPlayer(npc, player, TELEPORTS[ENTER], world.getInstanceId());
}
return;
}
final int instanceId = InstanceManager.getInstance().createDynamicInstance("MonasteryOfSilence.xml");
world = new MoSWorld2();
world.setInstanceId(instanceId);
world.setTemplateId(INSTANCE_ID);
world.setStatus(0);
InstanceManager.getInstance().addWorld(world);
world.addAllowed(player.getObjectId());
teleportPlayer(npc, player, TELEPORTS[ENTER], instanceId);
return;
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final String htmltext = getNoQuestMsg(player);
QuestState st = player.getQuestState(MonasteryOfSilence2.class.getSimpleName());
final QuestState qs = player.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName());
final QuestState qs1 = player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName());
if (st == null)
{
st = newQuestState(player);
}
if ("check_follow".equals(event))
{
cancelQuestTimer("check_follow", npc, player);
npc.getAI().stopFollow();
npc.setIsRunning(true);
npc.getAI().startFollow(player);
if ((qs != null) && (qs.getCond() == 2))
{
if (getRandom(10) < 1)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.GENERAL, npc.getId(), NpcStringId.IT_SEEMS_THAT_YOU_CANNOT_REMEMBER_TO_THE_ROOM_OF_THE_WATCHER_WHO_FOUND_THE_BOOK));
}
else
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.GENERAL, npc.getId(), NpcStringId.REMEMBER_THE_CONTENT_OF_THE_BOOKS_THAT_YOU_FOUND_YOU_CAN_T_TAKE_THEM_OUT_WITH_YOU));
}
}
if ((qs != null) && (qs.getCond() == 3))
{
if (getRandom(8) < 1)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.GENERAL, npc.getId(), NpcStringId.YOUR_WORK_HERE_IS_DONE_SO_RETURN_TO_THE_CENTRAL_GUARDIAN));
}
}
if ((qs1 != null) && (qs1.getCond() == 1))
{
if (getRandom(5) < 1)
{
if (getRandom(10) < 1)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.GENERAL, npc.getId(), NpcStringId.TO_REMOVE_THE_BARRIER_YOU_MUST_FIND_THE_RELICS_THAT_FIT_THE_BARRIER_AND_ACTIVATE_THE_DEVICE));
}
else if (getRandom(15) < 1)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.GENERAL, npc.getId(), NpcStringId.THE_GUARDIAN_OF_THE_SEAL_DOESN_T_SEEM_TO_GET_INJURED_AT_ALL_UNTIL_THE_BARRIER_IS_DESTROYED));
}
else
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.GENERAL, npc.getId(), NpcStringId.THE_DEVICE_LOCATED_IN_THE_ROOM_IN_FRONT_OF_THE_GUARDIAN_OF_THE_SEAL_IS_DEFINITELY_THE_BARRIER_THAT_CONTROLS_THE_GUARDIAN_S_POWER));
}
}
}
if (player.getCurrentHp() < (player.getMaxHp() * 0.8D))
{
npc.setTarget(player);
npc.doSimultaneousCast(SkillData.getInstance().getSkill(6724, 1));
}
if (player.getCurrentMp() < (player.getMaxMp() * 0.5D))
{
npc.setTarget(player);
npc.doSimultaneousCast(SkillData.getInstance().getSkill(6728, 1));
}
startQuestTimer("check_follow", 20000, npc, player);
return "";
}
else if ("enter".equals(event))
{
enterInstance(npc, player);
return null;
}
if (npc.getId() == ErissEvilThoughts)
{
if ("Enter1".equals(event))
{
if (qs1.getInt("seal_removed") != 1)
{
qs1.startQuestTimer("StartMovie", 1000);
teleportPlayer(npc, player, TELEPORTS[ENTER1], player.getInstanceId());
}
else
{
teleportPlayer(npc, player, TELEPORTS[MTS2], player.getInstanceId());
}
return null;
}
if ("Enter3".equals(event))
{
if ((qs.getInt("book_" + 32821) + qs.getInt("book_" + 32828) + qs.getInt("book_" + 32831) + qs.getInt("book_" + 32834)) != 4)
{
qs.startQuestTimer("OpenMovie", 4000);
}
teleportPlayer(npc, player, TELEPORTS[HOLYGRAL], player.getInstanceId());
return null;
}
else if ("video".equals(event))
{
player.showQuestMovie(29);
startQuestTimer("teleport", 60000, npc, player);
cancelQuestTimer("check_follow", npc, player);
final InstanceHolder holder = instanceWorlds.get(player.getInstanceId());
if (holder != null)
{
for (L2Npc h : holder.mobs)
{
h.deleteMe();
}
holder.mobs.clear();
}
return null;
}
else if ("teleport".equals(event))
{
teleportPlayer(npc, player, TELEPORTS[EE], player.getInstanceId());
return null;
}
}
else if ("buff".equals(event))
{
if (player.isMageClass())
{
for (int h : MageBuff)
{
npc.setTarget(player);
npc.doSimultaneousCast(SkillData.getInstance().getSkill(h, 1));
}
}
else
{
for (int h : FighterBuff)
{
npc.setTarget(player);
npc.doSimultaneousCast(SkillData.getInstance().getSkill(h, 1));
}
}
return null;
}
else if ("Exit".equals(event))
{
cancelQuestTimer("check_follow", npc, player);
final InstanceHolder holder = instanceWorlds.get(player.getInstanceId());
if (holder != null)
{
for (L2Npc h : holder.mobs)
{
h.deleteMe();
}
holder.mobs.clear();
}
teleportPlayer(npc, player, TELEPORTS[EXIT], 0);
return null;
}
else if ("TeleWest".equals(event))
{
teleportPlayer(npc, player, TELEPORTS[TW], player.getInstanceId());
return null;
}
else if (event.equalsIgnoreCase("TeleNorth"))
{
teleportPlayer(npc, player, TELEPORTS[TN], player.getInstanceId());
return null;
}
else if ("TeleEast".equals(event))
{
teleportPlayer(npc, player, TELEPORTS[TE], player.getInstanceId());
return null;
}
else if ("TeleSouth".equals(event))
{
teleportPlayer(npc, player, TELEPORTS[TS], player.getInstanceId());
return null;
}
else if ("ReturnToEris".equals(event))
{
teleportPlayer(npc, player, TELEPORTS[RTE], player.getInstanceId());
return null;
}
else if ("ReturnToGuardian".equals(event))
{
teleportPlayer(npc, player, TELEPORTS[RTG], player.getInstanceId());
return null;
}
else if ("MoveToSaintess".equals(event))
{
teleportPlayer(npc, player, TELEPORTS[MTS], player.getInstanceId());
return null;
}
else if ("MoveToSaintess2".equals(event))
{
teleportPlayer(npc, player, TELEPORTS[MTS2], player.getInstanceId());
return null;
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = getNoQuestMsg(player);
QuestState st = player.getQuestState(MonasteryOfSilence2.class.getSimpleName());
if (st == null)
{
st = newQuestState(player);
}
final int npcId = npc.getId();
if (npcId == OddGlobe)
{
if ((player.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName()) != null) && (player.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName()).getState() == State.STARTED))
{
enterInstance(npc, player);
return null;
}
if ((player.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName()) != null) && (player.getQuestState(Q10294_SevenSignsToTheMonasteryOfSilence.class.getSimpleName()).getState() == State.COMPLETED) && (player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName()) == null))
{
enterInstance(npc, player);
return null;
}
if ((player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName()) != null) && (player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName()).getState() != State.COMPLETED))
{
enterInstance(npc, player);
return null;
}
if ((player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName()) != null) && (player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName()).getState() == State.COMPLETED) && (player.getQuestState(Q10296_SevenSignsPowerOfTheSeal.class.getSimpleName()) == null))
{
enterInstance(npc, player);
return null;
}
if ((player.getQuestState(Q10296_SevenSignsPowerOfTheSeal.class.getSimpleName()) != null) && (player.getQuestState(Q10296_SevenSignsPowerOfTheSeal.class.getSimpleName()).getState() != State.COMPLETED))
{
enterInstance(npc, player);
return null;
}
htmltext = "<html><body>Odd Globe:<br>The huge mechanism in the form of the globe. Around silent cottons are heard and in air presence of any unknown energy, which which in a way doesn't come under to your influence is felt.</body></html>";
}
return htmltext;
}
public static void main(String[] args)
{
new MonasteryOfSilence2();
}
}

View File

@@ -1,9 +0,0 @@
<html><body>Pathfinder:<br>
First, I'll tell you about the enemies. <font color="LEVEL"> Kanabion </font> - not just a monster, a creature that appeared as a result of the connection of evil and darkness.<br>
Our goal - to destroy them and prevent the spread Kamaloki the territory of Aden.<br>
If you kill enough Kanabionov, then we'll give you some ammunition. In time we'll assign you a rank <font color="LEVEL"> from D to S </font> depending on your results.<br>
Or we can return collected by you from Kanabionov <font color="LEVEL"> Essences Kanabionov </font>. But in the real world there are no places where you can take advantage of them.<br>
Give them to us, if you think that you do not need. We offer appropriate compensation.<br>
And if you die around Kamaloki, no one can help you before time runs out or stay until the moment when all will be defeated. It's your dream.<br>
Thus, our technology will allow you to be around Kamaloki within <font color="LEVEL"> 20 minutes </font>. Do not forget about it.
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Pathfinder Agent:<br>
Once you enter the Chamber of Delusion, you will find managers for each area. There are 6 total, entry to which is regulated in the individual manager. Ask each manager for more details.<br>
If you've been to the Dimensional Rift, you will understand quickly.<br>
<a action="bypass -h npc_%objectId%_Quest DelusionTeleport">Challenge the Chamber of Delusion.</a>
</body></html>

View File

@@ -1,10 +0,0 @@
<html><body>Pathfinder:<br>
We trackers sent from the Ivory Tower to confront the invasion nightmare. We are waiting for a traveler like you, will challenge the Darkness around Kamaloki.<br>
Environs Kamaloki - it was an invasion of darkness through dreams. If we do not stop it, then people will die in my sleep.<br>
We have developed a way to counter. If you are brave enough challenge a outskirts Kamaloki!<br>
<a Action="bypass -h npc_%objectId%_Quest RimKamaloka"> Challenge outlying Kamaloka</a><br>
<a Action="bypass -h npc_%objectId%_Chat 1"> Ask about how to counter</a><br>
<a Action="bypass -h npc_%objectId%_multisell 324840001"> Make a contribution in the form Essences Kanabiona </a> <br>
<a Action="bypass -h npc_%objectId%_Quest 9011_KamalokaAch"> Check the list of the best achievements</a><br>
<a action="bypass -h npc_%objectId%_Quest DelusionTeleport">Go to Chamber of Delusion.</a>
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Pathfinder:<br>
Battle is finished!<br>
To you it seems strange that I appeared in you sleep? Don't warry! We, Pathfinders, are trained many skills, which heer occurs. I simply controlled your thoughts...<br>
I shall describe to you, what you reached, and I shall help to get out from here.<br>
With to know you results?<br>
<a action="bypass -h npc_%objectId%_Quest RimKamaloka">To look results.</a>
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Pathfinder Worker:<br>
They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
<a action="bypass -h Quest RimKamaloka 0">Enter Hall of Abyss (20~30 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 1">Enter Hall of Abyss (25~35 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 2">Enter Hall of Abyss (30~40 levels)</a>
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>Pathfinder Worker:<br>
They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
<a action="bypass -h Quest RimKamaloka 0">Enter Hall of Abyss (20~30 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 1">Enter Hall of Abyss (25~35 levels)</a>
</body></html>

View File

@@ -1,9 +0,0 @@
<html><body>Pathfinder:<br>
Your result:<br>
<center>Rank A</center><br>
It is magnificent. You strongly lowered the rate of the intrusion through Kamaloka.<br>
As in any other battle, the main thing to protect itself, when you inside the Environments of Kamaloka. We they must not attack rash.<br>
We, pathfinders, prepared reward for those, who it reached the impressive results, in order to in following time they could carry out task still better.<br>
You do want to obtain the reward, which corresponds to your level?<br>
<a action="bypass -h Quest RimKamaloka Reward">To obtain the reward.</a>
</body></html>

View File

@@ -1,9 +0,0 @@
<html><body>Pathfinder:<br>
Your result:<br>
<center>Rank B</center><br>
Very well. Your experience will help other to the finders of adventures.<br>
Battle with Kanabions is deliberately weaker you.. You they are assured, it is worthwhile to enter precisely thus? We, pathfinders, consider that this is the simply waste of time.<br>
We, pathfinders, prepared reward for those, who it reached the impressive results, in order to in following time they could carry out task still better.<br>
You do want to obtain the reward, which corresponds to your level?<br>
<a action="bypass -h Quest RimKamaloka Reward">To obtain the reward.</a>
</body></html>

View File

@@ -1,9 +0,0 @@
<html><body>Pathfinder:<br>
Your result:<br>
<center>Rank C</center><br>
Good work. If the remaining finders adventures will show such results, this it will return to us hope.<br>
It cannot be always rely on the aid of others. Sometimes for you it is necessary to act independently.<br>
We, pathfinders, prepared reward for those, who it reached the impressive results, in order to in following time they could carry out task still better.<br>
You do want to obtain the reward, which corresponds to your level?<br>
<a action="bypass -h Quest RimKamaloka Reward">To obtain the reward.</a>
</body></html>

View File

@@ -1,9 +0,0 @@
<html><body>Pathfinder:<br>
Your result:<br>
<center>Rank D</center><br>
This is poor result.<br>
Me you seemed you will be better.<br>
We, pathfinders, prepared reward for those, who it reached the impressive results, in order to in following time they could carry out task still better.<br>
Do you want to obtain the reward, which corresponds to your level?<br>
<a action="bypass -h Quest RimKamaloka Reward">To obtain the reward.</a>
</body></html>

View File

@@ -1,7 +0,0 @@
<html> <body>Pathfinder:<br>
Here's your reward. <br>
We were able to collect some essences Kanabionov. Here, hold. <br>
We are in the chronology of your activities. If you want, we will tell you how effective the activities around Kamaloka, and who made the biggest contribution to our common cause. <br>
First, leave the area. <br>
<a Action="bypass -h Quest RimKamaloka Exit"> Exit </a>
</body> </html>

View File

@@ -1,9 +0,0 @@
<html><body>Pathfinder:<br>
Your result:<br>
<center>Rank S</center><br>
This... These are the great reaching, is worthy of the heroes legends!<br>
I see, you understood the essence of our matter and it is wonderful they managed the task assigned to you.<br>
We, pathfinders, prepared reward for those, who it reached the impressive results, in order to in following time they could carry out task still better.<br>
You do want to obtain the reward, which corresponds to your level?<br>
<a action="bypass -h Quest RimKamaloka Reward">To obtain the reward.</a>
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Pathfinder Worker:<br>
They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
<a action="bypass -h Quest RimKamaloka 2">Enter Hall of Abyss (30~40 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 3">Enter Hall of Abyss (35~45 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 4">Enter Hall of Abyss (40~50 levels)</a>
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Pathfinder Worker:<br>
They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
<a action="bypass -h Quest RimKamaloka 2">Enter Hall of Abyss (30~40 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 3">Enter Hall of Abyss (35~45 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 4">Enter Hall of Abyss (40~50 levels)</a>
</body></html>

View File

@@ -1,8 +0,0 @@
<html><body>Pathfinder Worker:<br>
They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
<a action="bypass -h Quest RimKamaloka 3">Enter Hall of Abyss (35~45 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 4">Enter Hall of Abyss (40~50 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 5">Enter Hall of Abyss (45~55 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 6">Enter Hall of Abyss (50~60 levels)</a>
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Pathfinder:<br>
Here is your reward.<br>
We succeeded in gathering a little the essences devastated by you Kanabions. Here, you hold.<br>
We conduct the chronology of your activity. If you want, we will describe to you, to what extent is effective activity in the Environments of Kamaloka, and who made the largest contribution to our common work.<br>
First leave this place.<br>
<a action="bypass -h Quest RimKamaloka Exit">To leave Kamaloka.</a>
</body></html>

View File

@@ -1,8 +0,0 @@
<html><body>Pathfinder Worker:<br>
They are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
<a action="bypass -h Quest RimKamaloka 7">Enter Hall of Abyss (55~65 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 8">Enter Hall of Abyss (60~70 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 9">Enter Hall of Abyss (65~75 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 10">Enter Hall of Abyss (70~80 levels)</a>
</body></html>

View File

@@ -1,8 +0,0 @@
<html><body>Pathfinder Worker:<br>
hey are this is what the Environment of Kamaloka. After the visit of the peace of dreams you you will not be able again to enter into it to the complete the restoration of soul. Know this.<br>
(In the Environment of Kamaloka it is possible to enter <font color="LEVEL">only once a day</font>.)<br>
<a action="bypass -h Quest RimKamaloka 5">Enter Hall of Abyss (45~55 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 6">Enter Hall of Abyss (50~60 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 7">Enter Hall of Abyss (55~65 levels)</a><br>
<a action="bypass -h Quest RimKamaloka 8">Enter Hall of Abyss (60~70 levels)</a>
</body></html>