This commit is contained in:
MobiusDev
2016-10-21 21:26:21 +00:00
parent 4247fae039
commit 34fc592ced
25699 changed files with 2534454 additions and 0 deletions

View File

@@ -0,0 +1,299 @@
/*
* 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;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.enums.InstanceReenterType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.L2Summon;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Instance;
import com.l2jmobius.gameserver.model.holders.InstanceReenterTimeHolder;
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.model.skills.BuffInfo;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import ai.npc.AbstractNpcAI;
/**
* Abstract class for Instances.
* @author FallenAngel
*/
public abstract class AbstractInstance extends AbstractNpcAI
{
public AbstractInstance(String name, String desc)
{
super(name, desc);
}
public AbstractInstance(String name)
{
super(name, "instances");
}
protected void enterInstance(L2PcInstance player, InstanceWorld instance, String template, int templateId)
{
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world != null)
{
if (world.getTemplateId() == templateId)
{
onEnterInstance(player, world, false);
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
if (inst.isRemoveBuffEnabled())
{
handleRemoveBuffs(player, world);
}
return;
}
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return;
}
if (checkConditions(player, templateId))
{
instance.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
instance.setTemplateId(templateId);
instance.setStatus(0);
InstanceManager.getInstance().addWorld(instance);
onEnterInstance(player, instance, true);
final Instance inst = InstanceManager.getInstance().getInstance(instance.getInstanceId());
if (inst.getReenterType() == InstanceReenterType.ON_INSTANCE_ENTER)
{
handleReenterTime(instance);
}
if (inst.isRemoveBuffEnabled())
{
handleRemoveBuffs(instance);
}
if (Config.DEBUG_INSTANCES)
{
_log.info("Instance " + inst.getName() + " (" + instance.getTemplateId() + ") has been created by player " + player.getName());
}
}
}
protected void finishInstance(InstanceWorld world)
{
finishInstance(world, Config.INSTANCE_FINISH_TIME);
}
protected void finishInstance(InstanceWorld world, int duration)
{
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
if (inst.getReenterType() == InstanceReenterType.ON_INSTANCE_FINISH)
{
handleReenterTime(world);
}
if (duration == 0)
{
InstanceManager.getInstance().destroyInstance(inst.getId());
}
else if (duration > 0)
{
inst.setDuration(duration);
inst.setEmptyDestroyTime(0);
}
}
protected void handleReenterTime(InstanceWorld world)
{
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
final List<InstanceReenterTimeHolder> reenterData = inst.getReenterData();
long time = -1;
for (InstanceReenterTimeHolder data : reenterData)
{
if (data.getTime() > 0)
{
time = System.currentTimeMillis() + data.getTime();
break;
}
final Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.AM_PM, data.getHour() >= 12 ? 1 : 0);
calendar.set(Calendar.HOUR, data.getHour());
calendar.set(Calendar.MINUTE, data.getMinute());
calendar.set(Calendar.SECOND, 0);
if (calendar.getTimeInMillis() <= System.currentTimeMillis())
{
calendar.add(Calendar.DAY_OF_MONTH, 1);
}
if (data.getDay() != null)
{
while (calendar.get(Calendar.DAY_OF_WEEK) != (data.getDay().getValue() + 1))
{
calendar.add(Calendar.DAY_OF_MONTH, 1);
}
}
if (time == -1)
{
time = calendar.getTimeInMillis();
}
else if (calendar.getTimeInMillis() < time)
{
time = calendar.getTimeInMillis();
}
}
if (time > 0)
{
setReenterTime(world, time);
}
}
protected void handleRemoveBuffs(InstanceWorld world)
{
for (int objId : world.getAllowed())
{
final L2PcInstance player = L2World.getInstance().getPlayer(objId);
if (player != null)
{
handleRemoveBuffs(player, world);
}
}
}
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;
}
/**
* Spawns group of instance NPC's
* @param groupName the name of group from XML definition to spawn
* @param instanceId the instance ID
* @return list of spawned NPC's
*/
protected List<L2Npc> spawnGroup(String groupName, int instanceId)
{
return InstanceManager.getInstance().getInstance(instanceId).spawnGroup(groupName);
}
/**
* Sets reenter time for every player in the instance.
* @param world the instance
* @param time the time in milliseconds
*/
protected void setReenterTime(InstanceWorld world, long time)
{
for (int objectId : world.getAllowed())
{
InstanceManager.getInstance().setInstanceTime(objectId, world.getTemplateId(), time);
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
if ((player != null) && player.isOnline())
{
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE).addString(InstanceManager.getInstance().getInstance(world.getInstanceId()).getName()));
}
}
if (Config.DEBUG_INSTANCES)
{
_log.info("Time restrictions has been set for player in instance ID: " + world.getInstanceId() + " (" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(time) + ")");
}
}
private void handleRemoveBuffs(L2PcInstance player, InstanceWorld world)
{
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
switch (inst.getRemoveBuffType())
{
case ALL:
{
player.stopAllEffectsExceptThoseThatLastThroughDeath();
final L2Summon summon = player.getSummon();
if (summon != null)
{
summon.stopAllEffectsExceptThoseThatLastThroughDeath();
}
break;
}
case WHITELIST:
{
for (BuffInfo info : player.getEffectList().getBuffs())
{
if (!inst.getBuffExceptionList().contains(info.getSkill().getId()))
{
info.getEffected().getEffectList().stopSkillEffects(true, info.getSkill());
}
}
final L2Summon summon = player.getSummon();
if (summon != null)
{
for (BuffInfo info : summon.getEffectList().getBuffs())
{
if (!inst.getBuffExceptionList().contains(info.getSkill().getId()))
{
info.getEffected().getEffectList().stopSkillEffects(true, info.getSkill());
}
}
}
break;
}
case BLACKLIST:
{
for (BuffInfo info : player.getEffectList().getBuffs())
{
if (inst.getBuffExceptionList().contains(info.getSkill().getId()))
{
info.getEffected().getEffectList().stopSkillEffects(true, info.getSkill());
}
}
final L2Summon summon = player.getSummon();
if (summon != null)
{
for (BuffInfo info : summon.getEffectList().getBuffs())
{
if (inst.getBuffExceptionList().contains(info.getSkill().getId()))
{
info.getEffected().getEffectList().stopSkillEffects(true, info.getSkill());
}
}
}
break;
}
}
}
}

View File

@@ -0,0 +1,519 @@
/*
* 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.CavernOfThePirateCaptain;
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.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
/**
* Cavern Of The Pirate Captain (Day Dream) instance Zone.
* @author St3eT
*/
public final class CavernOfThePirateCaptain extends AbstractInstance
{
protected class CavernOfThePirateCaptainWorld extends InstanceWorld
{
protected List<L2PcInstance> playersInside = new ArrayList<>();
protected L2Attackable _zaken;
protected long storeTime = 0;
protected boolean _is83;
protected boolean _isNight;
protected int _zakenRoom;
protected int _blueFounded;
}
// NPCs
private static final int PATHFINDER = 32713; // Pathfinder Worker
private static final int ZAKEN_60 = 29176; // Zaken
private static final int ZAKEN_60_NIGHT = 29022; // Zaken Night
private static final int ZAKEN_83 = 29181; // Zaken
private static final int CANDLE = 32705; // Zaken's Candle
private static final int DOLL_BLADER_60 = 29023; // Doll Blader
private static final int DOLL_BLADER_83 = 29182; // Doll Blader
private static final int VALE_MASTER_60 = 29024; // Veil Master
private static final int VALE_MASTER_83 = 29183; // Veil Master
private static final int PIRATES_ZOMBIE_60 = 29027; // Pirate Zombie
private static final int PIRATES_ZOMBIE_83 = 29185; // Pirate Zombie
private static final int PIRATES_ZOMBIE_CAPTAIN_60 = 29026; // Pirate Zombie Captain
private static final int PIRATES_ZOMBIE_CAPTAIN_83 = 29184; // Pirate Zombie Captain
// Items
private static final int VORPAL_RING = 15763; // Sealed Vorpal Ring
private static final int VORPAL_EARRING = 15764; // Sealed Vorpal Earring
private static final int FIRE = 15280; // Transparent 1HS (for NPC)
private static final int RED = 15281; // Transparent 1HS (for NPC)
private static final int BLUE = 15302; // Transparent Bow (for NPC)
// Locations
private static final Location[] ENTER_LOC =
{
new Location(52684, 219989, -3496),
new Location(52669, 219120, -3224),
new Location(52672, 219439, -3312),
};
private static final Location[] CANDLE_LOC =
{
// Floor 1
new Location(53313, 220133, -3498),
new Location(53313, 218079, -3498),
new Location(54240, 221045, -3498),
new Location(54325, 219095, -3498),
new Location(54240, 217155, -3498),
new Location(55257, 220028, -3498),
new Location(55257, 218172, -3498),
new Location(56280, 221045, -3498),
new Location(56195, 219095, -3498),
new Location(56280, 217155, -3498),
new Location(57215, 220133, -3498),
new Location(57215, 218079, -3498),
// Floor 2
new Location(53313, 220133, -3226),
new Location(53313, 218079, -3226),
new Location(54240, 221045, -3226),
new Location(54325, 219095, -3226),
new Location(54240, 217155, -3226),
new Location(55257, 220028, -3226),
new Location(55257, 218172, -3226),
new Location(56280, 221045, -3226),
new Location(56195, 219095, -3226),
new Location(56280, 217155, -3226),
new Location(57215, 220133, -3226),
new Location(57215, 218079, -3226),
// Floor 3
new Location(53313, 220133, -2954),
new Location(53313, 218079, -2954),
new Location(54240, 221045, -2954),
new Location(54325, 219095, -2954),
new Location(54240, 217155, -2954),
new Location(55257, 220028, -2954),
new Location(55257, 218172, -2954),
new Location(56280, 221045, -2954),
new Location(56195, 219095, -2954),
new Location(56280, 217155, -2954),
new Location(57215, 220133, -2954),
new Location(57215, 218079, -2954),
};
// Misc
private static final int MIN_LV_60 = 55;
private static final int MIN_LV_83 = 78;
private static final int PLAYERS_60_MIN = 9;
private static final int PLAYERS_60_MAX = 27;
private static final int PLAYERS_60_NIGHT_MIN = 72;
private static final int PLAYERS_60_NIGHT_MAX = 450;
private static final int PLAYERS_83_MIN = 9;
private static final int PLAYERS_83_MAX = 27;
private static final int TEMPLATE_ID_60 = 133;
private static final int TEMPLATE_ID_60_NIGHT = 114;
private static final int TEMPLATE_ID_83 = 135;
//@formatter:off
private static final int[][] ROOM_DATA =
{
// Floor 1
{54240, 220133, -3498, 1, 3, 4, 6},
{54240, 218073, -3498, 2, 5, 4, 7},
{55265, 219095, -3498, 4, 9, 6, 7},
{56289, 220133, -3498, 8, 11, 6, 9},
{56289, 218073, -3498, 10, 12, 7, 9},
// Floor 2
{54240, 220133, -3226, 13, 15, 16, 18},
{54240, 218073, -3226, 14, 17, 16, 19},
{55265, 219095, -3226, 21, 16, 19, 18},
{56289, 220133, -3226, 20, 23, 21, 18},
{56289, 218073, -3226, 22, 24, 19, 21},
// Floor 3
{54240, 220133, -2954, 25, 27, 28, 30},
{54240, 218073, -2954, 26, 29, 28, 31},
{55265, 219095, -2954, 33, 28, 31, 30},
{56289, 220133, -2954, 32, 35, 30, 33},
{56289, 218073, -2954, 34, 36, 31, 33}
};
//@formatter:on
public CavernOfThePirateCaptain()
{
super(CavernOfThePirateCaptain.class.getSimpleName());
addStartNpc(PATHFINDER);
addTalkId(PATHFINDER);
addKillId(ZAKEN_60, ZAKEN_60_NIGHT, ZAKEN_83);
addFirstTalkId(CANDLE);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
final CavernOfThePirateCaptainWorld curworld = (CavernOfThePirateCaptainWorld) world;
curworld._is83 = curworld.getTemplateId() == TEMPLATE_ID_83;
curworld._isNight = curworld.getTemplateId() == TEMPLATE_ID_60_NIGHT;
curworld.storeTime = System.currentTimeMillis();
if (!player.isInParty())
{
managePlayerEnter(player, curworld);
}
else if (player.getParty().isInCommandChannel())
{
for (L2PcInstance players : player.getParty().getCommandChannel().getMembers())
{
managePlayerEnter(players, curworld);
}
}
else
{
for (L2PcInstance players : player.getParty().getMembers())
{
managePlayerEnter(players, curworld);
}
}
manageNpcSpawn(curworld);
}
else
{
teleportPlayer(player, ENTER_LOC[getRandom(ENTER_LOC.length)], world.getInstanceId(), false);
}
}
private void managePlayerEnter(L2PcInstance player, CavernOfThePirateCaptainWorld world)
{
world.playersInside.add(player);
world.addAllowed(player.getObjectId());
teleportPlayer(player, ENTER_LOC[getRandom(ENTER_LOC.length)], world.getInstanceId(), false);
}
@Override
protected boolean checkConditions(L2PcInstance player, int templateId)
{
if (player.canOverrideCond(PcCondOverride.INSTANCE_CONDITIONS))
{
return true;
}
if (!player.isInParty())
{
broadcastSystemMessage(player, null, SystemMessageId.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER, false);
return false;
}
final boolean is83 = templateId == TEMPLATE_ID_83;
final boolean isNight = templateId == TEMPLATE_ID_60_NIGHT;
final L2Party party = player.getParty();
final boolean isInCC = party.isInCommandChannel();
final List<L2PcInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
final boolean isPartyLeader = (isInCC) ? party.getCommandChannel().isLeader(player) : party.isLeader(player);
if (!isPartyLeader)
{
broadcastSystemMessage(player, null, SystemMessageId.ONLY_A_PARTY_LEADER_CAN_MAKE_THE_REQUEST_TO_ENTER, false);
return false;
}
if ((members.size() < (is83 ? PLAYERS_83_MIN : isNight ? PLAYERS_60_NIGHT_MIN : PLAYERS_60_MIN)) || (members.size() > (is83 ? PLAYERS_83_MAX : isNight ? PLAYERS_60_NIGHT_MAX : PLAYERS_60_MAX)))
{
broadcastSystemMessage(player, null, SystemMessageId.YOU_CANNOT_ENTER_DUE_TO_THE_PARTY_HAVING_EXCEEDED_THE_LIMIT, false);
return false;
}
for (L2PcInstance groupMembers : members)
{
if (groupMembers.getLevel() < (is83 ? MIN_LV_83 : MIN_LV_60))
{
broadcastSystemMessage(player, groupMembers, SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY, true);
return false;
}
if (!player.isInsideRadius(groupMembers, 1000, true, true))
{
broadcastSystemMessage(player, groupMembers, SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED, true);
return false;
}
final Long reentertime = InstanceManager.getInstance().getInstanceTime(groupMembers.getObjectId(), (is83 ? TEMPLATE_ID_83 : isNight ? TEMPLATE_ID_60_NIGHT : TEMPLATE_ID_60));
if (System.currentTimeMillis() < reentertime)
{
broadcastSystemMessage(player, groupMembers, SystemMessageId.C1_MAY_NOT_RE_ENTER_YET, true);
return false;
}
}
return true;
}
private void broadcastSystemMessage(L2PcInstance player, L2PcInstance member, SystemMessageId msgId, boolean toGroup)
{
final SystemMessage sm = SystemMessage.getSystemMessage(msgId);
if (toGroup)
{
sm.addPcName(member);
if (player.getParty().isInCommandChannel())
{
player.getParty().getCommandChannel().broadcastPacket(sm);
}
else
{
player.getParty().broadcastPacket(sm);
}
}
else
{
player.broadcastPacket(sm);
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("enter60"))
{
enterInstance(player, new CavernOfThePirateCaptainWorld(), "CavernOfThePirateCaptainWorldDay60.xml", TEMPLATE_ID_60);
}
else if (event.equals("enter60night"))
{
enterInstance(player, new CavernOfThePirateCaptainWorld(), "CavernOfThePirateCaptainWorldNight60.xml", TEMPLATE_ID_60_NIGHT);
}
else if (event.equals("enter83"))
{
enterInstance(player, new CavernOfThePirateCaptainWorld(), "CavernOfThePirateCaptainWorldDay83.xml", TEMPLATE_ID_83);
}
else
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if ((tmpworld != null) && (tmpworld instanceof CavernOfThePirateCaptainWorld))
{
final CavernOfThePirateCaptainWorld world = (CavernOfThePirateCaptainWorld) tmpworld;
switch (event)
{
case "BURN_BLUE":
{
if (npc.getRightHandItem() == 0)
{
npc.setRHandId(FIRE);
startQuestTimer("BURN_BLUE2", 3000, npc, player);
if (world._blueFounded == 4)
{
startQuestTimer("SHOW_ZAKEN", 5000, npc, player);
}
}
break;
}
case "BURN_BLUE2":
{
if (npc.getRightHandItem() == FIRE)
{
npc.setRHandId(BLUE);
}
break;
}
case "BURN_RED":
{
if (npc.getRightHandItem() == 0)
{
npc.setRHandId(FIRE);
startQuestTimer("BURN_RED2", 3000, npc, player);
}
break;
}
case "BURN_RED2":
{
if (npc.getRightHandItem() == FIRE)
{
final int room = getRoomByCandle(npc);
npc.setRHandId(RED);
manageScreenMsg(world, NpcStringId.THE_CANDLES_CAN_LEAD_YOU_TO_ZAKEN_DESTROY_HIM);
spawnNpc(world._is83 ? DOLL_BLADER_83 : DOLL_BLADER_60, room, player, world);
spawnNpc(world._is83 ? VALE_MASTER_83 : VALE_MASTER_60, room, player, world);
spawnNpc(world._is83 ? PIRATES_ZOMBIE_83 : PIRATES_ZOMBIE_60, room, player, world);
spawnNpc(world._is83 ? PIRATES_ZOMBIE_CAPTAIN_83 : PIRATES_ZOMBIE_CAPTAIN_60, room, player, world);
}
break;
}
case "SHOW_ZAKEN":
{
if (world._is83)
{
manageScreenMsg(world, NpcStringId.WHO_DARES_AWAKEN_THE_MIGHTY_ZAKEN);
}
world._zaken.setInvisible(false);
world._zaken.setIsParalyzed(false);
spawnNpc(world._is83 ? DOLL_BLADER_83 : DOLL_BLADER_60, world._zakenRoom, player, world);
spawnNpc(world._is83 ? PIRATES_ZOMBIE_83 : PIRATES_ZOMBIE_60, world._zakenRoom, player, world);
spawnNpc(world._is83 ? PIRATES_ZOMBIE_CAPTAIN_83 : PIRATES_ZOMBIE_CAPTAIN_60, world._zakenRoom, player, world);
break;
}
}
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if ((tmpworld != null) && (tmpworld instanceof CavernOfThePirateCaptainWorld))
{
final CavernOfThePirateCaptainWorld world = (CavernOfThePirateCaptainWorld) tmpworld;
if (npc.getId() == ZAKEN_83)
{
for (L2PcInstance playersInside : world.playersInside)
{
if ((playersInside != null) && ((playersInside.getInstanceId() == world.getInstanceId()) && playersInside.isInsideRadius(npc, 1500, true, true)))
{
final long time = System.currentTimeMillis() - world.storeTime;
if (time <= 300000) // 5 minutes
{
if (getRandomBoolean())
{
giveItems(playersInside, VORPAL_RING, 1);
}
}
else if (time <= 600000) // 10 minutes
{
if (getRandom(100) < 30)
{
giveItems(playersInside, VORPAL_EARRING, 1);
}
}
else if (time <= 900000) // 15 minutes
{
if (getRandom(100) < 25)
{
giveItems(playersInside, VORPAL_RING, 1);
}
}
}
}
}
finishInstance(world);
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if ((tmpworld != null) && (tmpworld instanceof CavernOfThePirateCaptainWorld))
{
final CavernOfThePirateCaptainWorld world = (CavernOfThePirateCaptainWorld) tmpworld;
final boolean isBlue = npc.getVariables().getInt("isBlue", 0) == 1;
if (npc.isScriptValue(0))
{
if (isBlue)
{
world._blueFounded++;
startQuestTimer("BURN_BLUE", 500, npc, player);
}
else
{
startQuestTimer("BURN_RED", 500, npc, player);
}
npc.setScriptValue(1);
}
}
return null;
}
private int getRoomByCandle(L2Npc npc)
{
final int candleId = npc.getVariables().getInt("candleId", 0);
for (int i = 0; i < 15; i++)
{
if ((ROOM_DATA[i][3] == candleId) || (ROOM_DATA[i][4] == candleId))
{
return i + 1;
}
}
if ((candleId == 6) || (candleId == 7))
{
return 3;
}
else if ((candleId == 18) || (candleId == 19))
{
return 8;
}
else if ((candleId == 30) || (candleId == 31))
{
return 13;
}
return 0;
}
private void manageScreenMsg(CavernOfThePirateCaptainWorld world, NpcStringId stringId)
{
for (L2PcInstance players : world.playersInside)
{
if ((players != null) && (players.getInstanceId() == world.getInstanceId()))
{
showOnScreenMsg(players, stringId, 2, 6000);
}
}
}
private L2Attackable spawnNpc(int npcId, int roomId, L2PcInstance player, CavernOfThePirateCaptainWorld world)
{
if ((player != null) && (npcId != ZAKEN_60) && (npcId != ZAKEN_83))
{
final L2Attackable mob = (L2Attackable) addSpawn(npcId, ROOM_DATA[roomId - 1][0] + getRandom(350), ROOM_DATA[roomId - 1][1] + getRandom(350), ROOM_DATA[roomId - 1][2], 0, false, 0, false, world.getInstanceId());
addAttackDesire(mob, player);
return mob;
}
return (L2Attackable) addSpawn(npcId, ROOM_DATA[roomId - 1][0], ROOM_DATA[roomId - 1][1], ROOM_DATA[roomId - 1][2], 0, false, 0, false, world.getInstanceId());
}
private void manageNpcSpawn(CavernOfThePirateCaptainWorld world)
{
final List<L2Npc> candles = new ArrayList<>();
world._zakenRoom = getRandom(1, 15);
for (int i = 0; i < 36; i++)
{
final L2Npc candle = addSpawn(CANDLE, CANDLE_LOC[i], false, 0, false, world.getInstanceId());
candle.getVariables().set("candleId", i + 1);
candles.add(candle);
}
for (int i = 3; i < 7; i++)
{
candles.get(ROOM_DATA[world._zakenRoom - 1][i] - 1).getVariables().set("isBlue", 1);
}
world._zaken = spawnNpc(world._is83 ? ZAKEN_83 : world._isNight ? ZAKEN_60_NIGHT : ZAKEN_60, world._zakenRoom, null, world);
world._zaken.setInvisible(true);
world._zaken.setIsParalyzed(true);
}
}

View File

@@ -0,0 +1,642 @@
/*
* 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.ChambersOfDelusion;
import java.util.Calendar;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.L2World;
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.Instance;
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.model.skills.Skill;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.Earthquake;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.Util;
import instances.AbstractInstance;
/**
* Chambers of Delusion superclass.
* @author GKR
*/
public abstract class Chamber extends AbstractInstance
{
protected class CDWorld extends InstanceWorld
{
protected int currentRoom;
protected final L2Party partyInside;
protected final ScheduledFuture<?> _banishTask;
protected ScheduledFuture<?> _roomChangeTask;
protected CDWorld(L2Party party)
{
currentRoom = 0;
partyInside = party;
_banishTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new BanishTask(), 60000, 60000);
}
protected L2Party getPartyInside()
{
return partyInside;
}
protected void scheduleRoomChange(boolean bossRoom)
{
final Instance inst = InstanceManager.getInstance().getInstance(getInstanceId());
final long nextInterval = bossRoom ? 60000L : (ROOM_CHANGE_INTERVAL + getRandom(ROOM_CHANGE_RANDOM_TIME)) * 1000L;
// Schedule next room change only if remaining time is enough
if ((inst.getInstanceEndTime() - System.currentTimeMillis()) > nextInterval)
{
_roomChangeTask = ThreadPoolManager.getInstance().scheduleGeneral(new ChangeRoomTask(), nextInterval - 5000);
}
}
protected void stopBanishTask()
{
_banishTask.cancel(true);
}
protected void stopRoomChangeTask()
{
_roomChangeTask.cancel(true);
}
protected class BanishTask implements Runnable
{
@Override
public void run()
{
final Instance inst = InstanceManager.getInstance().getInstance(getInstanceId());
if ((inst == null) || ((inst.getInstanceEndTime() - System.currentTimeMillis()) < 60000))
{
_banishTask.cancel(false);
}
else
{
for (int objId : inst.getPlayers())
{
final L2PcInstance pl = L2World.getInstance().getPlayer(objId);
if ((pl != null) && pl.isOnline())
{
if ((partyInside == null) || !pl.isInParty() || (partyInside != pl.getParty()))
{
exitInstance(pl);
}
}
}
}
}
}
protected class ChangeRoomTask implements Runnable
{
@Override
public void run()
{
try
{
earthQuake(CDWorld.this);
Thread.sleep(5000);
changeRoom(CDWorld.this);
}
catch (Exception e)
{
_log.log(Level.WARNING, getClass().getSimpleName() + " ChangeRoomTask exception : " + e.getMessage(), e);
}
}
}
}
// Items
private static final int ENRIA = 4042;
private static final int ASOFE = 4043;
private static final int THONS = 4044;
private static final int LEONARD = 9628;
private static final int DELUSION_MARK = 15311;
// NPCs
private final int ENTRANCE_GATEKEEPER;
private final int ROOM_GATEKEEPER_FIRST;
private final int ROOM_GATEKEEPER_LAST;
private final int AENKINEL;
private final int BOX;
// Skills
private static final SkillHolder SUCCESS_SKILL = new SkillHolder(5758, 1);
private static final SkillHolder FAIL_SKILL = new SkillHolder(5376, 4);
private static final int ROOM_CHANGE_INTERVAL = 480; // 8 min
private static final int ROOM_CHANGE_RANDOM_TIME = 120; // 2 min
// Instance restart time
private static final int RESET_HOUR = 6;
private static final int RESET_MIN = 30;
// Following values vary between scripts
private final int INSTANCEID;
private final String INSTANCE_TEMPLATE;
protected Location[] ROOM_ENTER_POINTS;
// Misc
private static final String RETURN = Chamber.class.getSimpleName() + "_return";
protected Chamber(String name, String descr, int instanceId, String instanceTemplateName, int entranceGKId, int roomGKFirstId, int roomGKLastId, int aenkinelId, int boxId)
{
super(name, descr);
INSTANCEID = instanceId;
INSTANCE_TEMPLATE = instanceTemplateName;
ENTRANCE_GATEKEEPER = entranceGKId;
ROOM_GATEKEEPER_FIRST = roomGKFirstId;
ROOM_GATEKEEPER_LAST = roomGKLastId;
AENKINEL = aenkinelId;
BOX = boxId;
addStartNpc(ENTRANCE_GATEKEEPER);
addTalkId(ENTRANCE_GATEKEEPER);
for (int i = ROOM_GATEKEEPER_FIRST; i <= ROOM_GATEKEEPER_LAST; i++)
{
addStartNpc(i);
addTalkId(i);
}
addKillId(AENKINEL);
addAttackId(BOX);
addSpellFinishedId(BOX);
addEventReceivedId(BOX);
}
private boolean isBigChamber()
{
return ((INSTANCEID == 131) || (INSTANCEID == 132));
}
private boolean isBossRoom(CDWorld world)
{
return (world.currentRoom == (ROOM_ENTER_POINTS.length - 1));
}
@Override
protected boolean checkConditions(L2PcInstance player)
{
final L2Party party = player.getParty();
if (party == null)
{
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER));
return false;
}
if (party.getLeader() != player)
{
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_A_PARTY_LEADER_CAN_MAKE_THE_REQUEST_TO_ENTER));
return false;
}
for (L2PcInstance partyMember : party.getMembers())
{
if (partyMember.getLevel() < 80)
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
sm.addPcName(partyMember);
party.broadcastPacket(sm);
return false;
}
if (!Util.checkIfInRange(1000, player, partyMember, true))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
sm.addPcName(partyMember);
party.broadcastPacket(sm);
return false;
}
if (isBigChamber())
{
final long reentertime = InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), INSTANCEID);
if (System.currentTimeMillis() < reentertime)
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
sm.addPcName(partyMember);
party.broadcastPacket(sm);
return false;
}
}
}
return true;
}
private void markRestriction(InstanceWorld world)
{
if (world instanceof CDWorld)
{
final Calendar reenter = Calendar.getInstance();
final Calendar now = Calendar.getInstance();
reenter.set(Calendar.MINUTE, RESET_MIN);
reenter.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
if (reenter.before(now))
{
reenter.add(Calendar.DAY_OF_WEEK, 1);
}
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE);
sm.addString(InstanceManager.getInstance().getInstanceIdName(world.getTemplateId()));
// set instance reenter time for all allowed players
for (int objectId : world.getAllowed())
{
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
if ((player != null) && player.isOnline())
{
InstanceManager.getInstance().setInstanceTime(objectId, world.getTemplateId(), reenter.getTimeInMillis());
player.sendPacket(sm);
}
}
}
}
protected void changeRoom(CDWorld world)
{
final L2Party party = world.getPartyInside();
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
if ((party == null) || (inst == null))
{
return;
}
int newRoom = world.currentRoom;
// Do nothing, if there are raid room of Sqare or Tower Chamber
if (isBigChamber() && isBossRoom(world))
{
return;
}
// Teleport to raid room 10 min or lesser before instance end time for Tower and Square Chambers
else if (isBigChamber() && ((inst.getInstanceEndTime() - System.currentTimeMillis()) < 600000))
{
newRoom = ROOM_ENTER_POINTS.length - 1;
}
// 10% chance for teleport to raid room if not here already for Northern, Southern, Western and Eastern Chambers
else if (!isBigChamber() && !isBossRoom(world) && (getRandom(100) < 10))
{
newRoom = ROOM_ENTER_POINTS.length - 1;
}
else
{
while (newRoom == world.currentRoom) // otherwise teleport to another room, except current
{
newRoom = getRandom(ROOM_ENTER_POINTS.length - 1);
}
}
for (L2PcInstance partyMember : party.getMembers())
{
if (world.getInstanceId() == partyMember.getInstanceId())
{
partyMember.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
teleportPlayer(partyMember, ROOM_ENTER_POINTS[newRoom], world.getInstanceId());
}
}
world.currentRoom = newRoom;
// Do not schedule room change for Square and Tower Chambers, if raid room is reached
if (isBigChamber() && isBossRoom(world))
{
inst.setDuration((int) ((inst.getInstanceEndTime() - System.currentTimeMillis()) + 1200000)); // Add 20 min to instance time if raid room is reached
for (L2Npc npc : inst.getNpcs())
{
if (npc.getId() == ROOM_GATEKEEPER_LAST)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.TWENTY_MINUTES_ARE_ADDED_TO_THE_REMAINING_TIME_IN_THE_INSTANT_ZONE));
}
}
}
else
{
world.scheduleRoomChange(false);
}
}
private void enter(CDWorld world)
{
final L2Party party = world.getPartyInside();
if (party == null)
{
return;
}
for (L2PcInstance partyMember : party.getMembers())
{
if (hasQuestItems(partyMember, DELUSION_MARK))
{
takeItems(partyMember, DELUSION_MARK, -1);
}
if (party.isLeader(partyMember))
{
giveItems(partyMember, DELUSION_MARK, 1);
}
// Save location for teleport back into main hall
partyMember.getVariables().set(RETURN, Integer.toString(partyMember.getX()) + ";" + Integer.toString(partyMember.getY()) + ";" + Integer.toString(partyMember.getZ()));
partyMember.setInstanceId(world.getInstanceId());
world.addAllowed(partyMember.getObjectId());
}
changeRoom(world);
}
protected void earthQuake(CDWorld world)
{
final L2Party party = world.getPartyInside();
if (party == null)
{
return;
}
for (L2PcInstance partyMember : party.getMembers())
{
if (world.getInstanceId() == partyMember.getInstanceId())
{
partyMember.sendPacket(new Earthquake(partyMember.getX(), partyMember.getY(), partyMember.getZ(), 20, 10));
}
}
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
enter((CDWorld) world);
}
else
{
final CDWorld currentWorld = (CDWorld) world;
teleportPlayer(player, ROOM_ENTER_POINTS[currentWorld.currentRoom], world.getInstanceId());
}
}
protected void exitInstance(L2PcInstance player)
{
if ((player == null) || !player.isOnline() || (player.getInstanceId() == 0))
{
return;
}
final Instance inst = InstanceManager.getInstance().getInstance(player.getInstanceId());
final Location ret = inst.getExitLoc();
final String return_point = player.getVariables().getString(RETURN, null);
if (return_point != null)
{
final String[] coords = return_point.split(";");
if (coords.length == 3)
{
try
{
final int x = Integer.parseInt(coords[0]);
final int y = Integer.parseInt(coords[1]);
final int z = Integer.parseInt(coords[2]);
ret.setLocation(new Location(x, y, z));
}
catch (Exception e)
{
}
}
}
teleportPlayer(player, ret, 0);
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world != null)
{
world.removeAllowed((player.getObjectId()));
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = "";
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if ((player != null) && (tmpworld != null) && (tmpworld instanceof CDWorld) && (npc.getId() >= ROOM_GATEKEEPER_FIRST) && (npc.getId() <= ROOM_GATEKEEPER_LAST))
{
final CDWorld world = (CDWorld) tmpworld;
// Change room from dialog
if (event.equals("next_room"))
{
if (player.getParty() == null)
{
htmltext = getHtm(player.getHtmlPrefix(), "data/scripts/instances/ChambersOfDelusion/no_party.html");
}
else if (player.getParty().getLeaderObjectId() != player.getObjectId())
{
htmltext = getHtm(player.getHtmlPrefix(), "data/scripts/instances/ChambersOfDelusion/no_leader.html");
}
else if (hasQuestItems(player, DELUSION_MARK))
{
takeItems(player, DELUSION_MARK, 1);
world.stopRoomChangeTask();
changeRoom(world);
}
else
{
htmltext = getHtm(player.getHtmlPrefix(), "data/scripts/instances/ChambersOfDelusion/no_item.html");
}
}
else if (event.equals("go_out"))
{
if (player.getParty() == null)
{
htmltext = getHtm(player.getHtmlPrefix(), "data/scripts/instances/ChambersOfDelusion/no_party.html");
}
else if (player.getParty().getLeaderObjectId() != player.getObjectId())
{
htmltext = getHtm(player.getHtmlPrefix(), "data/scripts/instances/ChambersOfDelusion/no_leader.html");
}
else
{
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
world.stopRoomChangeTask();
world.stopBanishTask();
for (L2PcInstance partyMember : player.getParty().getMembers())
{
exitInstance(partyMember);
}
inst.setEmptyDestroyTime(0);
}
}
else if (event.equals("look_party"))
{
if ((player.getParty() != null) && (player.getParty() == world.getPartyInside()))
{
teleportPlayer(player, ROOM_ENTER_POINTS[world.currentRoom], world.getInstanceId(), false);
}
}
}
return htmltext;
}
@Override
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet, Skill skill)
{
if (!npc.isBusy() && (npc.getCurrentHp() < (npc.getMaxHp() / 10)))
{
npc.setBusy(true);
if (getRandom(100) < 25) // 25% chance to reward
{
if (getRandom(100) < 33)
{
npc.dropItem(attacker, ENRIA, (int) (3 * Config.RATE_QUEST_DROP));
}
if (getRandom(100) < 50)
{
npc.dropItem(attacker, THONS, (int) (4 * Config.RATE_QUEST_DROP));
}
if (getRandom(100) < 50)
{
npc.dropItem(attacker, ASOFE, (int) (4 * Config.RATE_QUEST_DROP));
}
if (getRandom(100) < 16)
{
npc.dropItem(attacker, LEONARD, (int) (2 * Config.RATE_QUEST_DROP));
}
npc.broadcastEvent("SCE_LUCKY", 2000, null);
npc.doCast(SUCCESS_SKILL.getSkill());
}
else
{
npc.broadcastEvent("SCE_DREAM_FIRE_IN_THE_HOLE", 2000, null);
}
}
return super.onAttack(npc, attacker, damage, isPet, skill);
}
@Override
public String onEventReceived(String eventName, L2Npc sender, L2Npc receiver, L2Object reference)
{
switch (eventName)
{
case "SCE_LUCKY":
receiver.setBusy(true);
receiver.doCast(SUCCESS_SKILL.getSkill());
break;
case "SCE_DREAM_FIRE_IN_THE_HOLE":
receiver.setBusy(true);
receiver.doCast(FAIL_SKILL.getSkill());
break;
}
return null;
}
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if ((tmpworld != null) && (tmpworld instanceof CDWorld))
{
final CDWorld world = (CDWorld) tmpworld;
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
if (isBigChamber())
{
markRestriction(world); // Set reenter restriction
if ((inst.getInstanceEndTime() - System.currentTimeMillis()) > 300000)
{
inst.setDuration(300000); // Finish instance in 5 minutes
}
}
else
{
world.stopRoomChangeTask();
world.scheduleRoomChange(true);
}
inst.spawnGroup("boxes");
}
return super.onKill(npc, player, isPet);
}
@Override
public String onSpellFinished(L2Npc npc, L2PcInstance player, Skill skill)
{
if ((npc.getId() == BOX) && ((skill.getId() == 5376) || (skill.getId() == 5758)) && !npc.isDead())
{
npc.doDie(player);
}
return super.onSpellFinished(npc, player, skill);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final int npcId = npc.getId();
QuestState st = getQuestState(player, false);
if (st == null)
{
st = newQuestState(player);
}
if (npcId == ENTRANCE_GATEKEEPER)
{
if (checkConditions(player))
{
final L2Party party = player.getParty();
enterInstance(player, new CDWorld(party), INSTANCE_TEMPLATE, INSTANCEID);
}
}
return "";
}
}

View File

@@ -0,0 +1,51 @@
/*
* 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.ChambersOfDelusion;
import com.l2jmobius.gameserver.model.Location;
/**
* Chamber of Delusion East.
* @author GKR
*/
public final class ChamberOfDelusionEast extends Chamber
{
// NPCs
private static final int ENTRANCE_GATEKEEPER = 32658;
private static final int ROOM_GATEKEEPER_FIRST = 32664;
private static final int ROOM_GATEKEEPER_LAST = 32668;
private static final int AENKINEL = 25690;
private static final int BOX = 18838;
// Misc
private static final Location[] ENTER_POINTS = new Location[]
{
new Location(-122368, -218972, -6720),
new Location(-122352, -218044, -6720),
new Location(-122368, -220220, -6720),
new Location(-121440, -218444, -6720),
new Location(-121424, -220124, -6720), // Raid room
};
private static final int INSTANCEID = 127;
private static final String INSTANCE_TEMPLATE = "ChamberOfDelusionEast.xml";
public ChamberOfDelusionEast()
{
super(ChamberOfDelusionEast.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
}

View File

@@ -0,0 +1,51 @@
/*
* 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.ChambersOfDelusion;
import com.l2jmobius.gameserver.model.Location;
/**
* Chamber of Delusion North.
* @author GKR
*/
public final class ChamberOfDelusionNorth extends Chamber
{
// NPC's
private static final int ENTRANCE_GATEKEEPER = 32661;
private static final int ROOM_GATEKEEPER_FIRST = 32679;
private static final int ROOM_GATEKEEPER_LAST = 32683;
private static final int AENKINEL = 25693;
private static final int BOX = 18838;
// Misc
private static final Location[] ENTER_POINTS = new Location[]
{
new Location(-108976, -207772, -6720),
new Location(-108976, -206972, -6720),
new Location(-108960, -209164, -6720),
new Location(-108048, -207340, -6720),
new Location(-108048, -209020, -6720), // Raid room
};
private static final int INSTANCEID = 130; // this is the client number
private static final String INSTANCE_TEMPLATE = "ChamberOfDelusionNorth.xml";
public ChamberOfDelusionNorth()
{
super(ChamberOfDelusionNorth.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
}

View File

@@ -0,0 +1,51 @@
/*
* 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.ChambersOfDelusion;
import com.l2jmobius.gameserver.model.Location;
/**
* Chamber of Delusion South.
* @author GKR
*/
public final class ChamberOfDelusionSouth extends Chamber
{
// NPC's
private static final int ENTRANCE_GATEKEEPER = 32660;
private static final int ROOM_GATEKEEPER_FIRST = 32674;
private static final int ROOM_GATEKEEPER_LAST = 32678;
private static final int AENKINEL = 25692;
private static final int BOX = 18838;
// Misc
private static final Location[] ENTER_POINTS = new Location[]
{
new Location(-122368, -207820, -6720),
new Location(-122368, -206940, -6720),
new Location(-122368, -209116, -6720),
new Location(-121456, -207356, -6720),
new Location(-121440, -209004, -6720), // Raid room
};
private static final int INSTANCEID = 129; // this is the client number
private static final String INSTANCE_TEMPLATE = "ChamberOfDelusionSouth.xml";
public ChamberOfDelusionSouth()
{
super(ChamberOfDelusionSouth.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
}

View File

@@ -0,0 +1,55 @@
/*
* 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.ChambersOfDelusion;
import com.l2jmobius.gameserver.model.Location;
/**
* Chamber of Delusion Square.
* @author GKR
*/
public final class ChamberOfDelusionSquare extends Chamber
{
// NPC's
private static final int ENTRANCE_GATEKEEPER = 32662;
private static final int ROOM_GATEKEEPER_FIRST = 32684;
private static final int ROOM_GATEKEEPER_LAST = 32692;
private static final int AENKINEL = 25694;
private static final int BOX = 18820;
// Misc
private static final Location[] ENTER_POINTS = new Location[]
{
new Location(-122368, -153388, -6688),
new Location(-122368, -152524, -6688),
new Location(-120480, -155116, -6688),
new Location(-120480, -154236, -6688),
new Location(-121440, -151212, -6688),
new Location(-120464, -152908, -6688),
new Location(-122368, -154700, -6688),
new Location(-121440, -152908, -6688),
new Location(-121440, -154572, -6688), // Raid room
};
private static final int INSTANCEID = 131;
private static final String INSTANCE_TEMPLATE = "ChamberOfDelusionSquare.xml";
public ChamberOfDelusionSquare()
{
super(ChamberOfDelusionSquare.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
}

View File

@@ -0,0 +1,55 @@
/*
* 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.ChambersOfDelusion;
import com.l2jmobius.gameserver.model.Location;
/**
* Chamber of Delusion Tower.
* @author GKR
*/
public final class ChamberOfDelusionTower extends Chamber
{
// NPC's
private static final int ENTRANCE_GATEKEEPER = 32663;
private static final int ROOM_GATEKEEPER_FIRST = 32693;
private static final int ROOM_GATEKEEPER_LAST = 32701;
private static final int AENKINEL = 25695;
private static final int BOX = 18823;
// Misc
private static final Location[] ENTER_POINTS = new Location[]
{
new Location(-108976, -153372, -6688),
new Location(-108960, -152524, -6688),
new Location(-107088, -155052, -6688),
new Location(-107104, -154236, -6688),
new Location(-108048, -151244, -6688),
new Location(-107088, -152956, -6688),
new Location(-108992, -154604, -6688),
new Location(-108032, -152892, -6688),
new Location(-108048, -154572, -6688), // Raid room
};
private static final int INSTANCEID = 132; // this is the client number
private static final String INSTANCE_TEMPLATE = "ChamberOfDelusionTower.xml";
public ChamberOfDelusionTower()
{
super(ChamberOfDelusionTower.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
}

View File

@@ -0,0 +1,51 @@
/*
* 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.ChambersOfDelusion;
import com.l2jmobius.gameserver.model.Location;
/**
* Chamber of Delusion West.
* @author GKR
*/
public final class ChamberOfDelusionWest extends Chamber
{
// NPC's
private static final int ENTRANCE_GATEKEEPER = 32659;
private static final int ROOM_GATEKEEPER_FIRST = 32669;
private static final int ROOM_GATEKEEPER_LAST = 32673;
private static final int AENKINEL = 25691;
private static final int BOX = 18838;
// Misc
private static final Location[] ENTER_POINTS = new Location[]
{
new Location(-108960, -218892, -6720),
new Location(-108976, -218028, -6720),
new Location(-108960, -220204, -6720),
new Location(-108032, -218428, -6720),
new Location(-108032, -220140, -6720), // Raid room
};
private static final int INSTANCEID = 128; // this is the client number
private static final String INSTANCE_TEMPLATE = "ChamberOfDelusionWest.xml";
public ChamberOfDelusionWest()
{
super(ChamberOfDelusionWest.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
}

View File

@@ -0,0 +1,3 @@
<html><body>Manager:<br>
You have already used an opportunity. There are no more.
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Manager:<br>
You're not a party leader. Please bring the party leader here.
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Manager:<br>
You're not a member of a party. Please join one quickly.
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Oracle Guide:<br>
Brilliant five-colored light shines forth from an aquamarine sphere. You hear a loud, dear voice:<br>
Welcome, you who have accomplished the test of the Oracle. Your contributions have led to the downfall of the Demon Balor.<br>
I am the last child of the Oracle, whose mission it is to escort you safely to the place where Parme is being kept. She is still under an evil influence, but the object you carry has the power to heal her.<br>
If you are ready to meet the priests of the Water Dragon, give me your hand.<br>
<a action="bypass -h Quest CrystalCaverns TeleportParme">Go to meet Parme.</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Oracle Guide:<br>
Baylor is dead!<br>
<a action="bypass -h Quest CrystalCaverns TeleportOut">Let me out!</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>[You feel a chill and hear a voice...]<br>
<a action="bypass -h Quest CrystalCaverns CoralGarden">Run Coral Garden.</a><br>
<a action="bypass -h Quest CrystalCaverns EmeraldSteam">Run Emerald Square/Steam Corridor</a>
</body></html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
<html><body>Oracle Guide:<br>
I can't speak with you, while bleeding.
</body></html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
<html><body>Emperor Shunaiman:<br>
Shilen's forces gain ground with each passing day.<br>
We were stumbling backwards, but now... now I am staring down into a great chasm. What am I to do?<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Emperor's Guard Leon:<br>
Thank you saving Emperor Shunaiman from this crisis! <br>May the blessin's of Einhasad always go with you.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Emperor's Guard Leon:<br>
Einhasad's blessin's, friend!<br>S'not everyone who gets to go time-travelin' to go and save the old Emperor, eh? Must be made of tougher stuff than us lot... probably the food.<br>Anyways, I understand you're lookin' to get back to your time?<br>
<a action="bypass -h npc_%objectId%_Quest DisciplesNecropolisPast">"That's right."</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Disciple's Gatekeeper:<br>
You are now at the place where Shunaiman Emperor's Seal Device is installed. You hear the sounds of Anakim and Lilith grappling violently from within.<br>
<a action="bypass -h npc_%objectId%_Quest DisciplesNecropolisPast">Open the door.</a>
</body></html>

View File

@@ -0,0 +1,466 @@
/*
* 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.DisciplesNecropolisPast;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
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.holders.SkillHolder;
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.util.Util;
import instances.AbstractInstance;
import quests.Q00196_SevenSignsSealOfTheEmperor.Q00196_SevenSignsSealOfTheEmperor;
/**
* Disciple's Necropolis Past instance zone.
* @author Adry_85
*/
public final class DisciplesNecropolisPast extends AbstractInstance
{
protected class DNPWorld extends InstanceWorld
{
protected final List<L2Npc> anakimGroup = new ArrayList<>();
protected final List<L2Npc> lilithGroup = new ArrayList<>();
protected int countKill = 0;
}
// NPCs
private static final int SEAL_DEVICE = 27384;
private static final int PROMISE_OF_MAMMON = 32585;
private static final int SHUNAIMAN = 32586;
private static final int LEON = 32587;
private static final int DISCIPLES_GATEKEEPER = 32657;
private static final int LILITH = 32715;
private static final int LILITHS_STEWARD = 32716;
private static final int LILITHS_ELITE = 32717;
private static final int ANAKIM = 32718;
private static final int ANAKIMS_GUARDIAN = 32719;
private static final int ANAKIMS_GUARD = 32720;
private static final int ANAKIMS_EXECUTOR = 32721;
private static final int LILIM_BUTCHER = 27371;
private static final int LILIM_MAGUS = 27372;
private static final int LILIM_KNIGHT_ERRANT = 27373;
private static final int SHILENS_EVIL_THOUGHTS1 = 27374;
private static final int SHILENS_EVIL_THOUGHTS2 = 27375;
private static final int LILIM_KNIGHT = 27376;
private static final int LILIM_SLAYER = 27377;
private static final int LILIM_GREAT_MAGUS = 27378;
private static final int LILIM_GUARD_KNIGHT = 27379;
// Items
private static final int SACRED_SWORD_OF_EINHASAD = 15310;
private static final int SEAL_OF_BINDING = 13846;
// Skills
private static final SkillHolder SEAL_ISOLATION = new SkillHolder(5980, 3);
private static final Map<Integer, SkillHolder> SKILLS = new HashMap<>();
static
{
SKILLS.put(32715, new SkillHolder(6187, 1)); // Presentation - Lilith Battle
SKILLS.put(32716, new SkillHolder(6188, 1)); // Presentation - Lilith's Steward Battle1
SKILLS.put(32717, new SkillHolder(6190, 1)); // Presentation - Lilith's Bodyguards Battle1
SKILLS.put(32718, new SkillHolder(6191, 1)); // Presentation - Anakim Battle
SKILLS.put(32719, new SkillHolder(6192, 1)); // Presentation - Anakim's Guardian Battle1
SKILLS.put(32720, new SkillHolder(6194, 1)); // Presentation - Anakim's Guard Battle
SKILLS.put(32721, new SkillHolder(6195, 1)); // Presentation - Anakim's Executor Battle
}
// Locations
private static final Location ENTER = new Location(-89554, 216078, -7488, 0, 0);
private static final Location EXIT = new Location(171895, -17501, -4903, 0, 0);
// NpcStringId
private static final NpcStringId[] LILITH_SHOUT =
{
NpcStringId.HOW_DARE_YOU_TRY_TO_CONTEND_AGAINST_ME_IN_STRENGTH_RIDICULOUS,
NpcStringId.ANAKIM_IN_THE_NAME_OF_GREAT_SHILIEN_I_WILL_CUT_YOUR_THROAT,
NpcStringId.YOU_CANNOT_BE_THE_MATCH_OF_LILITH_I_LL_TEACH_YOU_A_LESSON
};
// Misc
private static final int TEMPLATE_ID = 112;
private static final int DOOR_1 = 17240102;
private static final int DOOR_2 = 17240104;
private static final int DOOR_3 = 17240106;
private static final int DOOR_4 = 17240108;
private static final int DOOR_5 = 17240110;
private static final int DISCIPLES_NECROPOLIS_DOOR = 17240111;
private static final Map<Integer, Location> LILITH_SPAWN = new HashMap<>();
private static final Map<Integer, Location> ANAKIM_SPAWN = new HashMap<>();
static
{
LILITH_SPAWN.put(LILITH, new Location(-83175, 217021, -7504, 49151));
LILITH_SPAWN.put(LILITHS_STEWARD, new Location(-83327, 216938, -7492, 50768));
LILITH_SPAWN.put(LILITHS_ELITE, new Location(-83003, 216909, -7492, 4827));
ANAKIM_SPAWN.put(ANAKIM, new Location(-83179, 216479, -7504, 16384));
ANAKIM_SPAWN.put(ANAKIMS_GUARDIAN, new Location(-83321, 216507, -7492, 16166));
ANAKIM_SPAWN.put(ANAKIMS_GUARD, new Location(-83086, 216519, -7495, 15910));
ANAKIM_SPAWN.put(ANAKIMS_EXECUTOR, new Location(-83031, 216604, -7492, 17071));
}
public DisciplesNecropolisPast()
{
super(DisciplesNecropolisPast.class.getSimpleName());
addAttackId(SEAL_DEVICE);
addFirstTalkId(SHUNAIMAN, LEON, DISCIPLES_GATEKEEPER);
addKillId(LILIM_BUTCHER, LILIM_MAGUS, LILIM_KNIGHT_ERRANT, LILIM_KNIGHT, SHILENS_EVIL_THOUGHTS1, SHILENS_EVIL_THOUGHTS2, LILIM_SLAYER, LILIM_GREAT_MAGUS, LILIM_GUARD_KNIGHT);
addAggroRangeEnterId(LILIM_BUTCHER, LILIM_MAGUS, LILIM_KNIGHT_ERRANT, LILIM_KNIGHT, SHILENS_EVIL_THOUGHTS1, SHILENS_EVIL_THOUGHTS2, LILIM_SLAYER, LILIM_GREAT_MAGUS, LILIM_GUARD_KNIGHT);
addSpawnId(SEAL_DEVICE);
addStartNpc(PROMISE_OF_MAMMON);
addTalkId(PROMISE_OF_MAMMON, SHUNAIMAN, LEON, DISCIPLES_GATEKEEPER);
}
protected void spawnNPC(DNPWorld world)
{
for (Map.Entry<Integer, Location> entry : LILITH_SPAWN.entrySet())
{
final L2Npc npc = addSpawn(entry.getKey(), entry.getValue(), false, 0, false, world.getInstanceId());
world.lilithGroup.add(npc);
}
for (Map.Entry<Integer, Location> entry : ANAKIM_SPAWN.entrySet())
{
final L2Npc enpc = addSpawn(entry.getKey(), entry.getValue(), false, 0, false, world.getInstanceId());
world.anakimGroup.add(enpc);
}
}
private synchronized void checkDoors(L2Npc npc, DNPWorld world)
{
world.countKill++;
switch (world.countKill)
{
case 4:
openDoor(DOOR_1, world.getInstanceId());
break;
case 10:
openDoor(DOOR_2, world.getInstanceId());
break;
case 18:
openDoor(DOOR_3, world.getInstanceId());
break;
case 28:
openDoor(DOOR_4, world.getInstanceId());
break;
case 40:
openDoor(DOOR_5, world.getInstanceId());
break;
}
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
spawnNPC((DNPWorld) world);
world.addAllowed(player.getObjectId());
}
teleportPlayer(player, ENTER, world.getInstanceId());
}
private void makeCast(L2Npc npc, List<L2Npc> targets)
{
npc.setTarget(targets.get(getRandom(targets.size())));
if (SKILLS.containsKey(npc.getId()))
{
npc.doCast(SKILLS.get(npc.getId()).getSkill());
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if (tmpworld instanceof DNPWorld)
{
final DNPWorld world = (DNPWorld) tmpworld;
switch (event)
{
case "FINISH":
{
if (getQuestItemsCount(player, SEAL_OF_BINDING) >= 4)
{
player.showQuestMovie(13);
startQuestTimer("TELEPORT", 27000, null, player);
}
break;
}
case "TELEPORT":
{
player.teleToLocation(ENTER, 0);
break;
}
case "FIGHT":
{
for (L2Npc caster : world.anakimGroup)
{
if ((caster != null) && !caster.isCastingNow())
{
makeCast(caster, world.lilithGroup);
}
if ((caster != null) && (caster.getId() == ANAKIM))
{
if (caster.isScriptValue(0))
{
caster.broadcastPacket(new NpcSay(caster.getObjectId(), ChatType.NPC_SHOUT, caster.getId(), NpcStringId.YOU_SUCH_A_FOOL_THE_VICTORY_OVER_THIS_WAR_BELONGS_TO_SHILIEN));
caster.setScriptValue(1);
}
else if (getRandom(100) < 10)
{
caster.broadcastPacket(new NpcSay(caster.getObjectId(), ChatType.NPC_SHOUT, caster.getId(), LILITH_SHOUT[getRandom(3)]));
}
}
}
for (L2Npc caster : world.lilithGroup)
{
if ((caster != null) && !caster.isCastingNow())
{
makeCast(caster, world.anakimGroup);
}
if ((caster != null) && (caster.getId() == 32715))
{
if (caster.isScriptValue(0))
{
caster.broadcastPacket(new NpcSay(caster.getObjectId(), ChatType.NPC_SHOUT, caster.getId(), NpcStringId.FOR_THE_ETERNITY_OF_EINHASAD));
if (Util.checkIfInRange(2000, caster, player, true))
{
player.sendPacket(new NpcSay(caster.getObjectId(), ChatType.WHISPER, caster.getId(), NpcStringId.MY_POWER_S_WEAKENING_HURRY_AND_TURN_ON_THE_SEALING_DEVICE));
}
caster.setScriptValue(1);
}
else if (getRandom(100) < 10)
{
switch (getRandom(3))
{
case 0:
{
caster.broadcastPacket(new NpcSay(caster.getObjectId(), ChatType.NPC_SHOUT, caster.getId(), NpcStringId.DEAR_SHILLIEN_S_OFFSPRINGS_YOU_ARE_NOT_CAPABLE_OF_CONFRONTING_US));
if (Util.checkIfInRange(2000, caster, player, true))
{
player.sendPacket(new NpcSay(caster.getObjectId(), ChatType.WHISPER, caster.getId(), NpcStringId.ALL_4_SEALING_DEVICES_MUST_BE_TURNED_ON));
}
break;
}
case 1:
{
caster.broadcastPacket(new NpcSay(caster.getObjectId(), ChatType.NPC_SHOUT, caster.getId(), NpcStringId.I_LL_SHOW_YOU_THE_REAL_POWER_OF_EINHASAD));
if (Util.checkIfInRange(2000, caster, player, true))
{
player.sendPacket(new NpcSay(caster.getObjectId(), ChatType.WHISPER, caster.getId(), NpcStringId.LILITH_S_ATTACK_IS_GETTING_STRONGER_GO_AHEAD_AND_TURN_IT_ON));
}
break;
}
case 2:
{
caster.broadcastPacket(new NpcSay(caster.getObjectId(), ChatType.NPC_SHOUT, caster.getId(), NpcStringId.DEAR_MILITARY_FORCE_OF_LIGHT_GO_DESTROY_THE_OFFSPRINGS_OF_SHILLIEN));
if (Util.checkIfInRange(2000, caster, player, true))
{
player.sendPacket(new NpcSay(caster.getObjectId(), ChatType.WHISPER, caster.getId(), NpcStringId.DEAR_S1_GIVE_ME_MORE_STRENGTH).addStringParameter(player.getName()));
}
break;
}
}
}
}
startQuestTimer("FIGHT", 1000, null, player);
}
break;
}
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isSummon)
{
switch (npc.getId())
{
case LILIM_BUTCHER:
case LILIM_GUARD_KNIGHT:
{
if (npc.isScriptValue(0))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THIS_PLACE_ONCE_BELONGED_TO_LORD_SHILEN));
npc.setScriptValue(1);
}
break;
}
case LILIM_MAGUS:
case LILIM_GREAT_MAGUS:
{
if (npc.isScriptValue(0))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.WHO_DARES_ENTER_THIS_PLACE));
npc.setScriptValue(1);
}
break;
}
case LILIM_KNIGHT_ERRANT:
case LILIM_KNIGHT:
{
if (npc.isScriptValue(0))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THOSE_WHO_ARE_AFRAID_SHOULD_GET_AWAY_AND_THOSE_WHO_ARE_BRAVE_SHOULD_FIGHT));
npc.setScriptValue(1);
}
break;
}
case LILIM_SLAYER:
{
if (npc.isScriptValue(0))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_NOW));
npc.setScriptValue(1);
}
break;
}
}
return super.onAggroRangeEnter(npc, player, isSummon);
}
@Override
public String onAttack(L2Npc npc, L2PcInstance player, int damage, boolean isSummon)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if (tmpworld instanceof DNPWorld)
{
if (npc.isScriptValue(0))
{
if (npc.getCurrentHp() < (npc.getMaxHp() * 0.1))
{
giveItems(player, SEAL_OF_BINDING, 1);
player.sendPacket(SystemMessageId.THE_SEALING_DEVICE_GLITTERS_AND_MOVES_ACTIVATION_COMPLETE_NORMALLY);
npc.setScriptValue(1);
startQuestTimer("FINISH", 1000, npc, player);
cancelQuestTimer("FIGHT", npc, player);
}
}
if (getRandom(100) < 50)
{
npc.doCast(SEAL_ISOLATION.getSkill());
}
}
return super.onAttack(npc, player, damage, isSummon);
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return npc.getId() + ".htm";
}
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if (tmpworld instanceof DNPWorld)
{
final DNPWorld world = (DNPWorld) tmpworld;
checkDoors(npc, world);
}
switch (npc.getId())
{
case LILIM_MAGUS:
case LILIM_GREAT_MAGUS:
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LORD_SHILEN_SOME_DAY_YOU_WILL_ACCOMPLISH_THIS_MISSION));
break;
}
case LILIM_KNIGHT_ERRANT:
case LILIM_KNIGHT:
case LILIM_GUARD_KNIGHT:
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.WHY_ARE_YOU_GETTING_IN_OUR_WAY));
break;
}
case LILIM_SLAYER:
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.FOR_SHILEN));
break;
}
}
return super.onKill(npc, player, isSummon);
}
@Override
public final String onSpawn(L2Npc npc)
{
npc.setIsMortal(false);
return super.onSpawn(npc);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
final QuestState qs = talker.getQuestState(Q00196_SevenSignsSealOfTheEmperor.class.getSimpleName());
String htmltext = getNoQuestMsg(talker);
if (qs == null)
{
return htmltext;
}
switch (npc.getId())
{
case PROMISE_OF_MAMMON:
{
if (qs.isCond(3) || qs.isCond(4))
{
enterInstance(talker, new DNPWorld(), "DisciplesNecropolisPast.xml", TEMPLATE_ID);
return "";
}
break;
}
case LEON:
{
if (qs.getCond() >= 3)
{
takeItems(talker, SACRED_SWORD_OF_EINHASAD, -1);
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(talker);
world.removeAllowed(talker.getObjectId());
talker.teleToLocation(EXIT, 0);
htmltext = "32587-01.html";
}
break;
}
case DISCIPLES_GATEKEEPER:
{
if (qs.getCond() >= 3)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (tmpworld instanceof DNPWorld)
{
final DNPWorld world = (DNPWorld) tmpworld;
openDoor(DISCIPLES_NECROPOLIS_DOOR, world.getInstanceId());
talker.showQuestMovie(12);
startQuestTimer("FIGHT", 1000, null, talker);
}
}
break;
}
}
return htmltext;
}
}

View File

@@ -0,0 +1,5 @@
<html><body>Abyssal Saintess Elcadia:<br>
Ugh. I'm already bored... How hard is it to find a competent adventurer?<br>
<a action="bypass -h Quest ElcadiasTent">I like to go outside.</a><br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Gruff-looking Man:<br>
I thought long and hard, but nothing comes to mind that you should be here for. Go back. Look around for something else that you should do now.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Gruff-looking Man:<br>
Maybe you should just leave now. Before you bother me...<br>
<a action="bypass -h npc_%objectId%_Quest ElcadiasTent">I'm here on business.</a>
</body></html>

View File

@@ -0,0 +1,100 @@
/*
* 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.ElcadiasTent;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
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.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.model.quest.QuestState;
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;
/**
* Elcadia's Tent instance zone.
* @author Adry_85
*/
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);
// Misc
private static final int TEMPLATE_ID = 158;
public ElcadiasTent()
{
super(ElcadiasTent.class.getSimpleName());
addFirstTalkId(GRUFF_LOOKING_MAN, ELCADIA);
addStartNpc(GRUFF_LOOKING_MAN, ELCADIA);
addTalkId(GRUFF_LOOKING_MAN, ELCADIA);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
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()))
{
enterInstance(talker, new ETWorld(), "ElcadiasTent.xml", TEMPLATE_ID);
}
else
{
return "32862-01.html";
}
}
else
{
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(talker);
world.removeAllowed(talker.getObjectId());
talker.setInstanceId(0);
talker.teleToLocation(EXIT_LOC);
}
return super.onTalk(npc, talker);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
world.addAllowed(player.getObjectId());
}
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
<html><body>Priest Wood:<br>
Spare no detail when you recount your story! The smallest unturned stone can still hide the greatest of treasures!
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Priestess Jeina:<br>
May Einhasad's blessing go with you....
</body></html>

View File

@@ -0,0 +1,85 @@
/*
* 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.HideoutOfTheDawn;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
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.instancezone.InstanceWorld;
import instances.AbstractInstance;
/**
* Hideout of the Dawn instance zone.
* @author Adry_85
*/
public final class HideoutOfTheDawn extends AbstractInstance
{
protected class HotDWorld extends InstanceWorld
{
}
// NPCs
private static final int WOOD = 32593;
private static final int JAINA = 32617;
// Location
private static final Location WOOD_LOC = new Location(-23758, -8959, -5384, 0, 0);
private static final Location JAINA_LOC = new Location(147072, 23743, -1984, 0);
// Misc
private static final int TEMPLATE_ID = 113;
public HideoutOfTheDawn()
{
super(HideoutOfTheDawn.class.getSimpleName());
addStartNpc(WOOD);
addTalkId(WOOD, JAINA);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
switch (npc.getId())
{
case WOOD:
{
enterInstance(talker, new HotDWorld(), "HideoutOfTheDawn.xml", TEMPLATE_ID);
return "32593-01.htm";
}
case JAINA:
{
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(talker);
world.removeAllowed(talker.getObjectId());
talker.setInstanceId(0);
talker.teleToLocation(JAINA_LOC);
return "32617-01.htm";
}
}
return super.onTalk(npc, talker);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
world.addAllowed(player.getObjectId());
}
teleportPlayer(player, WOOD_LOC, world.getInstanceId(), false);
}
}

View File

@@ -0,0 +1,214 @@
/*
* 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.IceQueensCastle;
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.L2Character;
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.model.skills.Skill;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.SystemMessageId;
import instances.AbstractInstance;
import quests.Q10285_MeetingSirra.Q10285_MeetingSirra;
/**
* Ice Queen's Castle instance zone.
* @author Adry_85
*/
public final class IceQueensCastle extends AbstractInstance
{
protected class IQCWorld extends InstanceWorld
{
L2PcInstance player = null;
}
// NPCs
private static final int FREYA = 18847;
private static final int BATTALION_LEADER = 18848;
private static final int LEGIONNAIRE = 18849;
private static final int MERCENARY_ARCHER = 18926;
private static final int ARCHERY_KNIGHT = 22767;
private static final int JINIA = 32781;
// Locations
private static final Location START_LOC = new Location(114000, -112357, -11200, 0, 0);
private static final Location EXIT_LOC = new Location(113883, -108777, -848, 0, 0);
private static final Location FREYA_LOC = new Location(114730, -114805, -11200, 50, 0);
// Skill
private static SkillHolder ETHERNAL_BLIZZARD = new SkillHolder(6276, 1);
// Misc
private static final int TEMPLATE_ID = 137;
private static final int ICE_QUEEN_DOOR = 23140101;
private static final int MIN_LV = 82;
public IceQueensCastle()
{
super(IceQueensCastle.class.getSimpleName());
addStartNpc(JINIA);
addTalkId(JINIA);
addSeeCreatureId(BATTALION_LEADER, LEGIONNAIRE, MERCENARY_ARCHER);
addSpawnId(FREYA);
addSpellFinishedId(FREYA);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
switch (event)
{
case "ATTACK_KNIGHT":
{
for (L2Character character : npc.getKnownList().getKnownCharacters())
{
if ((character.getId() == ARCHERY_KNIGHT) && !character.isDead() && !((L2Attackable) character).isDecayed())
{
npc.setIsRunning(true);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character);
((L2Attackable) npc).addDamageHate(character, 0, 999999);
}
}
startQuestTimer("ATTACK_KNIGHT", 3000, npc, null);
break;
}
case "TIMER_MOVING":
{
if (npc != null)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, FREYA_LOC);
}
break;
}
case "TIMER_BLIZZARD":
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.I_CAN_NO_LONGER_STAND_BY);
npc.stopMove(null);
npc.setTarget(player);
npc.doCast(ETHERNAL_BLIZZARD.getSkill());
break;
}
case "TIMER_SCENE_21":
{
if (npc != null)
{
player.showQuestMovie(21);
npc.deleteMe();
startQuestTimer("TIMER_PC_LEAVE", 24000, npc, player);
}
break;
}
case "TIMER_PC_LEAVE":
{
final QuestState qs = player.getQuestState(Q10285_MeetingSirra.class.getSimpleName());
if ((qs != null))
{
qs.setMemoState(3);
qs.setCond(10, true);
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
world.removeAllowed(player.getObjectId());
player.setInstanceId(0);
player.teleToLocation(EXIT_LOC, 0);
}
break;
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon)
{
if (creature.isPlayer() && npc.isScriptValue(0))
{
for (L2Character character : npc.getKnownList().getKnownCharacters())
{
if ((character.getId() == ARCHERY_KNIGHT) && !character.isDead() && !((L2Attackable) character).isDecayed())
{
npc.setIsRunning(true);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character);
((L2Attackable) npc).addDamageHate(character, 0, 999999);
npc.setScriptValue(1);
startQuestTimer("ATTACK_KNIGHT", 5000, npc, null);
}
}
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.S1_MAY_THE_PROTECTION_OF_THE_GODS_BE_UPON_YOU, creature.getName());
}
return super.onSeeCreature(npc, creature, isSummon);
}
@Override
public final String onSpawn(L2Npc npc)
{
startQuestTimer("TIMER_MOVING", 60000, npc, null);
startQuestTimer("TIMER_BLIZZARD", 180000, npc, null);
return super.onSpawn(npc);
}
@Override
public String onSpellFinished(L2Npc npc, L2PcInstance player, Skill skill)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if ((tmpworld != null) && (tmpworld instanceof IQCWorld))
{
final IQCWorld world = (IQCWorld) tmpworld;
if ((skill == ETHERNAL_BLIZZARD.getSkill()) && (world.player != null))
{
startQuestTimer("TIMER_SCENE_21", 1000, npc, world.player);
}
}
return super.onSpellFinished(npc, player, skill);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
enterInstance(talker, new IQCWorld(), "IceQueensCastle.xml", TEMPLATE_ID);
return super.onTalk(npc, talker);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
world.addAllowed(player.getObjectId());
((IQCWorld) world).player = player;
openDoor(ICE_QUEEN_DOOR, world.getInstanceId());
}
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
}
@Override
protected boolean checkConditions(L2PcInstance player)
{
if (player.getLevel() < MIN_LV)
{
player.sendPacket(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
return false;
}
return true;
}
}

View File

@@ -0,0 +1,3 @@
<html><body>Kegor:<br>
I'd entrust your associate with this mission, but..
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Kegor:<br>
Without you, we would have failed. I can't thank you enough.<br>
Freya's last breath will flutter against your blade, I can feel it!<br>
<a action="bypass -h Quest IceQueensCastleNormalBattle killFreya">Rest in peace!</a><br>
<a action="bypass -h Quest IceQueensCastleNormalBattle 18851-01.html">Can I have a second with you?</a>
</body></html>

View File

@@ -0,0 +1,110 @@
/*
* 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;
import java.util.logging.Level;
import java.util.logging.Logger;
import instances.CavernOfThePirateCaptain.CavernOfThePirateCaptain;
import instances.ChambersOfDelusion.ChamberOfDelusionEast;
import instances.ChambersOfDelusion.ChamberOfDelusionNorth;
import instances.ChambersOfDelusion.ChamberOfDelusionSouth;
import instances.ChambersOfDelusion.ChamberOfDelusionSquare;
import instances.ChambersOfDelusion.ChamberOfDelusionTower;
import instances.ChambersOfDelusion.ChamberOfDelusionWest;
import instances.CrystalCaverns.CrystalCaverns;
import instances.DarkCloudMansion.DarkCloudMansion;
import instances.DisciplesNecropolisPast.DisciplesNecropolisPast;
import instances.ElcadiasTent.ElcadiasTent;
import instances.FinalEmperialTomb.FinalEmperialTomb;
import instances.HideoutOfTheDawn.HideoutOfTheDawn;
import instances.IceQueensCastle.IceQueensCastle;
import instances.IceQueensCastleNormalBattle.IceQueensCastleNormalBattle;
import instances.JiniaGuildHideout1.JiniaGuildHideout1;
import instances.JiniaGuildHideout2.JiniaGuildHideout2;
import instances.JiniaGuildHideout3.JiniaGuildHideout3;
import instances.JiniaGuildHideout4.JiniaGuildHideout4;
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;
/**
* Instance class-loader.
* @author FallenAngel
*/
public final class InstanceLoader
{
private static final Logger _log = Logger.getLogger(InstanceLoader.class.getName());
private static final Class<?>[] SCRIPTS =
{
CavernOfThePirateCaptain.class,
CrystalCaverns.class,
DarkCloudMansion.class,
DisciplesNecropolisPast.class,
ElcadiasTent.class,
FinalEmperialTomb.class,
HideoutOfTheDawn.class,
ChamberOfDelusionEast.class,
ChamberOfDelusionNorth.class,
ChamberOfDelusionSouth.class,
ChamberOfDelusionSquare.class,
ChamberOfDelusionTower.class,
ChamberOfDelusionWest.class,
IceQueensCastle.class,
IceQueensCastleNormalBattle.class,
JiniaGuildHideout1.class,
JiniaGuildHideout2.class,
JiniaGuildHideout3.class,
JiniaGuildHideout4.class,
Kamaloka.class,
LibraryOfSages.class,
MithrilMine.class,
MonasteryOfSilence1.class,
MonasteryOfSilence2.class,
NornilsGarden.class,
NornilsGardenQuest.class,
PailakaDevilsLegacy.class,
PailakaSongOfIceAndFire.class,
RimKamaloka.class,
SanctumOftheLordsOfDawn.class,
};
public static void main(String[] args)
{
_log.info(InstanceLoader.class.getSimpleName() + ": Loading Instances scripts.");
for (Class<?> script : SCRIPTS)
{
try
{
script.newInstance();
}
catch (Exception e)
{
_log.log(Level.SEVERE, InstanceLoader.class.getSimpleName() + ": Failed loading " + script.getSimpleName() + ":", e);
}
}
}
}

View File

@@ -0,0 +1,74 @@
/*
* 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.JiniaGuildHideout1;
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.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.model.quest.QuestState;
import instances.AbstractInstance;
import quests.Q10284_AcquisitionOfDivineSword.Q10284_AcquisitionOfDivineSword;
/**
* Jinia Guild Hideout instance zone.
* @author Adry_85
*/
public final class JiniaGuildHideout1 extends AbstractInstance
{
protected class JGH1World extends InstanceWorld
{
}
// NPC
private static final int RAFFORTY = 32020;
// Location
private static final Location START_LOC = new Location(-23530, -8963, -5413);
// Misc
private static final int TEMPLATE_ID = 140;
public JiniaGuildHideout1()
{
super(JiniaGuildHideout1.class.getSimpleName());
addStartNpc(RAFFORTY);
addTalkId(RAFFORTY);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
final QuestState qs = talker.getQuestState(Q10284_AcquisitionOfDivineSword.class.getSimpleName());
if ((qs != null) && qs.isCond(1))
{
enterInstance(talker, new JGH1World(), "JiniaGuildHideout1.xml", TEMPLATE_ID);
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
world.addAllowed(player.getObjectId());
}
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
}
}

View File

@@ -0,0 +1,74 @@
/*
* 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.JiniaGuildHideout2;
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.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.model.quest.QuestState;
import instances.AbstractInstance;
import quests.Q10285_MeetingSirra.Q10285_MeetingSirra;
/**
* Jinia Guild Hideout instance zone.
* @author Adry_85
*/
public final class JiniaGuildHideout2 extends AbstractInstance
{
protected class JGH2World extends InstanceWorld
{
}
// NPC
private static final int RAFFORTY = 32020;
// Location
private static final Location START_LOC = new Location(-23530, -8963, -5413, 0, 0);
// Misc
private static final int TEMPLATE_ID = 141;
public JiniaGuildHideout2()
{
super(JiniaGuildHideout2.class.getSimpleName());
addStartNpc(RAFFORTY);
addTalkId(RAFFORTY);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
final QuestState qs = talker.getQuestState(Q10285_MeetingSirra.class.getSimpleName());
if ((qs != null) && qs.isMemoState(1))
{
enterInstance(talker, new JGH2World(), "JiniaGuildHideout2.xml", TEMPLATE_ID);
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
world.addAllowed(player.getObjectId());
}
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
}
}

View File

@@ -0,0 +1,74 @@
/*
* 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.JiniaGuildHideout3;
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.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.model.quest.QuestState;
import instances.AbstractInstance;
import quests.Q10286_ReunionWithSirra.Q10286_ReunionWithSirra;
/**
* Jinia Guild Hideout instance zone.
* @author Adry_85
*/
public final class JiniaGuildHideout3 extends AbstractInstance
{
protected class JGH3World extends InstanceWorld
{
}
// NPC
private static final int RAFFORTY = 32020;
// Location
private static final Location START_LOC = new Location(-23530, -8963, -5413, 0, 0);
// Misc
private static final int TEMPLATE_ID = 145;
public JiniaGuildHideout3()
{
super(JiniaGuildHideout3.class.getSimpleName());
addStartNpc(RAFFORTY);
addTalkId(RAFFORTY);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
final QuestState qs = talker.getQuestState(Q10286_ReunionWithSirra.class.getSimpleName());
if ((qs != null) && qs.isMemoState(1))
{
enterInstance(talker, new JGH3World(), "JiniaGuildHideout3.xml", TEMPLATE_ID);
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
world.addAllowed(player.getObjectId());
}
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
}
}

View File

@@ -0,0 +1,74 @@
/*
* 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.JiniaGuildHideout4;
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.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.model.quest.QuestState;
import instances.AbstractInstance;
import quests.Q10287_StoryOfThoseLeft.Q10287_StoryOfThoseLeft;
/**
* Jinia Guild Hideout instance zone.
* @author Adry_85
*/
public final class JiniaGuildHideout4 extends AbstractInstance
{
protected class JGH4World extends InstanceWorld
{
}
// NPC
private static final int RAFFORTY = 32020;
// Location
private static final Location START_LOC = new Location(-23530, -8963, -5413, 0, 0);
// Misc
private static final int TEMPLATE_ID = 146;
public JiniaGuildHideout4()
{
super(JiniaGuildHideout4.class.getSimpleName());
addStartNpc(RAFFORTY);
addTalkId(RAFFORTY);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
final QuestState qs = talker.getQuestState(Q10287_StoryOfThoseLeft.class.getSimpleName());
if ((qs != null) && qs.isMemoState(1))
{
enterInstance(talker, new JGH4World(), "JiniaGuildHideout4.xml", TEMPLATE_ID);
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
world.addAllowed(player.getObjectId());
}
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
}
}

View File

@@ -0,0 +1,6 @@
<html><body>Captain Lucas:<br>
What? You want to enter Kamaloka?<br>
<a action="bypass -h Quest Kamaloka 3">Enter Kamaloka, Hall of the Abyss (level 33).</a><br>
<a action="bypass -h Quest Kamaloka 4">Enter Kamaloka, Hall of the Abyss (level 36).</a><br>
<a action="bypass -h Quest Kamaloka 5">Enter Kamaloka, Labyrinth of the Abyss (level 39).</a>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Captain Mouen:<br>
Hmm? Do you wish to enter Kamaloka?<br>
<a action="bypass -h Quest Kamaloka 9">Enter Kamaloka, Hall of the Abyss (level 53).</a><br>
<a action="bypass -h Quest Kamaloka 10">Enter Kamaloka, Hall of the Abyss (level 56).</a><br>
<a action="bypass -h Quest Kamaloka 11">Enter Kamaloka, Labyrinth of the Abyss (level 59).</a>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Captain Bathis:<br>
Hmm? Do you wish to enter Kamaloka?<br>
<a action="bypass -h Quest Kamaloka 0">Enter Kamaloka, Hall of the Abyss (level 23).</a><br>
<a action="bypass -h Quest Kamaloka 1">Enter Kamaloka, Hall of the Abyss (level 26).</a><br>
<a action="bypass -h Quest Kamaloka 2">Enter Kamaloka, Labyrinth of the Abyss (level 29).</a>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Captain Gosta:<br>
What? You want to enter Kamaloka?<br>
<a action="bypass -h Quest Kamaloka 6">Enter Kamaloka, Hall of the Abyss (level 43).</a><br>
<a action="bypass -h Quest Kamaloka 7">Enter Kamaloka, Hall of the Abyss (level 46).</a><br>
<a action="bypass -h Quest Kamaloka 8">Enter Kamaloka, Labyrinth of the Abyss (level 49).</a>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Captain Mathias:<br>
What? You want to enter Kamaloka?<br>
<a action="bypass -h Quest Kamaloka 15">Enter Kamaloka, Hall of the Abyss (level 73).</a><br>
<a action="bypass -h Quest Kamaloka 16">Enter Kamaloka, Labyrinth of the Abyss (level 78).</a><br>
<a action="bypass -h Quest Kamaloka 17">Enter Kamaloka, Labyrinth of the Abyss (level 81).</a><br>
<a action="bypass -h Quest Kamaloka 18">Enter Kamaloka, Labyrinth of the Abyss (level 83).</a>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Captain Vishotsky:<br>
Hmm? Do you wish to enter Kamaloka? Know that by doing so, you will be risking your life!<br>
<a action="bypass -h Quest Kamaloka 12">Enter Kamaloka, Hall of the Abyss (level 63).</a><br>
<a action="bypass -h Quest Kamaloka 13">Enter Kamaloka, Hall of the Abyss (level 66).</a><br>
<a action="bypass -h Quest Kamaloka 14">Enter Kamaloka, Labyrinth of the Abyss (level 69).</a>
</body></html>

View File

@@ -0,0 +1 @@
<html><body>Gatekeeper:<br>You are not a party leader.</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Gatekeeper:<br>
Would you like to leave Kamaloka - Labyrinth of the Abyss?<br>
<a action="bypass -h npc_%objectId%_Quest Kamaloka">Leave</a>
</body></html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
<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>

View File

@@ -0,0 +1,3 @@
<HTML><BODY>A book called "Saintess Solina's Biography" stands out.<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>

View File

@@ -0,0 +1,3 @@
<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>

View File

@@ -0,0 +1,3 @@
<HTML><BODY>A book called "Continents and Cosmology" stands out.<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>

View File

@@ -0,0 +1,3 @@
<HTML><BODY>A book called "Religions of the Aden Kingdom" stands out.<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>

View File

@@ -0,0 +1,3 @@
<HTML><BODY>A book called "The Genesis of Dwarves" stands out.<br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>

View File

@@ -0,0 +1,5 @@
<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>

View File

@@ -0,0 +1,142 @@
/*
* 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.LibraryOfSages;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
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.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.network.NpcStringId;
import instances.AbstractInstance;
/**
* Library of Sages instance zone.
* @author Adry_85
*/
public final class LibraryOfSages extends AbstractInstance
{
protected class LoSWorld extends InstanceWorld
{
protected L2Npc elcadia = null;
}
// 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);
private static final Location EXIT_LOC = new Location(37063, -49813, -1128, 0, 0);
private static final Location LIBRARY_LOC = new Location(37355, -50065, -1127);
// NpcString
private static final NpcStringId[] ELCADIA_DIALOGS =
{
NpcStringId.I_MUST_ASK_LIBRARIAN_SOPHIA_ABOUT_THE_BOOK,
NpcStringId.THIS_LIBRARY_IT_S_HUGE_BUT_THERE_AREN_T_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
};
// Misc
private static final int TEMPLATE_ID = 156;
public LibraryOfSages()
{
super(LibraryOfSages.class.getSimpleName());
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)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if (tmpworld instanceof LoSWorld)
{
final LoSWorld world = (LoSWorld) tmpworld;
switch (event)
{
case "TELEPORT2":
{
teleportPlayer(player, LIBRARY_LOC, world.getInstanceId());
world.elcadia.teleToLocation(LIBRARY_LOC.getX(), LIBRARY_LOC.getY(), LIBRARY_LOC.getZ(), 0, world.getInstanceId());
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, ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]);
startQuestTimer("FOLLOW", 10000, npc, player);
break;
}
case "ENTER":
{
cancelQuestTimer("FOLLOW", npc, player);
teleportPlayer(player, START_LOC, world.getInstanceId());
world.elcadia.teleToLocation(START_LOC.getX(), START_LOC.getY(), START_LOC.getZ(), 0, world.getInstanceId());
break;
}
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
enterInstance(talker, new LoSWorld(), "LibraryOfSages.xml", TEMPLATE_ID);
return super.onTalk(npc, talker);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
world.addAllowed(player.getObjectId());
}
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
spawnElcadia(player, (LoSWorld) world);
}
private void spawnElcadia(L2PcInstance player, LoSWorld world)
{
if (world.elcadia != null)
{
world.elcadia.deleteMe();
}
world.elcadia = addSpawn(ELCADIA_INSTANCE, player, false, 0, false, player.getInstanceId());
startQuestTimer("FOLLOW", 3000, world.elcadia, player);
}
}

View File

@@ -0,0 +1,3 @@
<html><body>Kegor:<br>
The battle's not over yet! The monsters, they yet come!
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Kegor:<br>
... we're not... done here. The monsters, they're coming. Help while I get my bearings.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Kegor:<br>
You saved my life, I owe you a debt of gratitude. Rafforty mentioned you to me, it seems you've been a great help to the guild.<br>I'm not much for words however... we still have important things to do. Meet me at the Guild's Hideout to discuss the matter with Jinia.<br>
<a action="bypass -h npc_%objectId%_Quest MithrilMine">Agree.</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Kegor:<br>
Let's meet at the Jinia Guild hideout.<br>
<a action="bypass -h npc_%objectId%_Quest MithrilMine">Okay.</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Kegor:<br>
(A man in red armor lays on the ground. From what Rafforty and Jinia said, this must be Kegor.)<br>
<a action="bypass -h npc_%objectId%_Quest MithrilMine">Feed him the antidote.</a>
</body></html>

View File

@@ -0,0 +1,236 @@
/*
* 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.MithrilMine;
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.L2Character;
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.Q10284_AcquisitionOfDivineSword.Q10284_AcquisitionOfDivineSword;
/**
* Mithril Mine instance zone.
* @author Adry_85
*/
public final class MithrilMine extends AbstractInstance
{
protected class MMWorld extends InstanceWorld
{
protected int _count = 0;
}
// NPCs
private static final int KEGOR = 18846;
private static final int MITHRIL_MILLIPEDE = 22766;
private static final int KRUN = 32653;
private static final int TARUN = 32654;
// Item
private static final int COLD_RESISTANCE_POTION = 15514;
// Skill
private static SkillHolder BLESS_OF_SWORD = new SkillHolder(6286, 1);
// Location
private static final Location START_LOC = new Location(186852, -173492, -3763, 0, 0);
private static final Location EXIT_LOC = new Location(178823, -184303, -347, 0, 0);
private static final Location[] MOB_SPAWNS = new Location[]
{
new Location(185216, -184112, -3308, -15396),
new Location(185456, -184240, -3308, -19668),
new Location(185712, -184384, -3308, -26696),
new Location(185920, -184544, -3308, -32544),
new Location(185664, -184720, -3308, 27892)
};
// Misc
private static final int TEMPLATE_ID = 138;
public MithrilMine()
{
super(MithrilMine.class.getSimpleName(), "instances");
addFirstTalkId(KEGOR);
addKillId(KEGOR, MITHRIL_MILLIPEDE);
addStartNpc(TARUN, KRUN);
addTalkId(TARUN, KRUN, KEGOR);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final InstanceWorld world = InstanceManager.getInstance().getWorld(npc.getInstanceId());
switch (event)
{
case "BUFF":
{
if ((player != null) && npc.isInsideRadius(player, 1000, true, false) && npc.isScriptValue(1) && !player.isDead())
{
npc.setTarget(player);
npc.doCast(BLESS_OF_SWORD.getSkill());
}
startQuestTimer("BUFF", 30000, npc, player);
break;
}
case "TIMER":
{
if (world instanceof MMWorld)
{
for (Location loc : MOB_SPAWNS)
{
final L2Attackable spawnedMob = (L2Attackable) addSpawn(MITHRIL_MILLIPEDE, loc, false, 0, false, world.getInstanceId());
spawnedMob.setScriptValue(1);
spawnedMob.setIsRunning(true);
spawnedMob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
spawnedMob.addDamageHate(npc, 0, 999999);
}
}
break;
}
case "FINISH":
{
for (L2Character knownChar : npc.getKnownList().getKnownCharacters())
{
if ((knownChar != null) && (knownChar.getId() == KEGOR))
{
final L2Npc kegor = (L2Npc) knownChar;
kegor.setScriptValue(2);
kegor.setWalking();
kegor.setTarget(player);
kegor.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
broadcastNpcSay(kegor, ChatType.NPC_GENERAL, NpcStringId.I_CAN_FINALLY_TAKE_A_BREATHER_BY_THE_WAY_WHO_ARE_YOU_HMM_I_THINK_I_KNOW_WHO_SENT_YOU);
}
}
InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(3000);
break;
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
final QuestState qs = player.getQuestState(Q10284_AcquisitionOfDivineSword.class.getSimpleName());
if ((qs != null))
{
if (qs.isMemoState(2))
{
return npc.isScriptValue(0) ? "18846.html" : "18846-01.html";
}
else if (qs.isMemoState(3))
{
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
world.removeAllowed(player.getObjectId());
player.setInstanceId(0);
player.teleToLocation(EXIT_LOC, 0);
giveAdena(player, 296425, true);
addExpAndSp(player, 921805, 82230);
qs.exitQuest(false, true);
return "18846-03.html";
}
}
return super.onFirstTalk(npc, player);
}
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
final InstanceWorld world = InstanceManager.getInstance().getWorld(npc.getInstanceId());
final MMWorld _world = ((MMWorld) world);
if (npc.getId() == KEGOR)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HOW_COULD_I_FALL_IN_A_PLACE_LIKE_THIS);
InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(1000);
}
else
{
if (npc.isScriptValue(1))
{
_world._count++;
}
if (_world._count >= 5)
{
final QuestState qs = player.getQuestState(Q10284_AcquisitionOfDivineSword.class.getSimpleName());
if ((qs != null) && qs.isMemoState(2))
{
cancelQuestTimer("BUFF", npc, player);
qs.setMemoState(3);
qs.setCond(6, true);
startQuestTimer("FINISH", 3000, npc, player);
}
}
}
return super.onKill(npc, player, isSummon);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
switch (npc.getId())
{
case TARUN:
case KRUN:
{
final QuestState qs = talker.getQuestState(Q10284_AcquisitionOfDivineSword.class.getSimpleName());
if ((qs != null) && qs.isMemoState(2))
{
if (!hasQuestItems(talker, COLD_RESISTANCE_POTION))
{
giveItems(talker, COLD_RESISTANCE_POTION, 1);
}
qs.setCond(4, true);
enterInstance(talker, new MMWorld(), "MithrilMine.xml", TEMPLATE_ID);
}
break;
}
case KEGOR:
{
final QuestState qs = talker.getQuestState(Q10284_AcquisitionOfDivineSword.class.getSimpleName());
if ((qs != null) && qs.isMemoState(2) && hasQuestItems(talker, COLD_RESISTANCE_POTION) && npc.isScriptValue(0))
{
takeItems(talker, COLD_RESISTANCE_POTION, -1);
qs.setCond(5, true);
npc.setScriptValue(1);
startQuestTimer("TIMER", 3000, npc, talker);
startQuestTimer("BUFF", 3500, npc, talker);
return "18846-02.html";
}
break;
}
}
return super.onTalk(npc, talker);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
world.addAllowed(player.getObjectId());
}
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
}
}

View File

@@ -0,0 +1,5 @@
<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

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,206 @@
/*
* 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.MonasteryOfSilence1;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
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.holders.SkillHolder;
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.network.NpcStringId;
import instances.AbstractInstance;
/**
* Monastery of Silence instance zone.
* @author Adry_85
*/
public final class MonasteryOfSilence1 extends AbstractInstance
{
protected static final class MoSWorld extends InstanceWorld
{
protected L2Npc elcadia = null;
}
// NPCs
private static final int ELCADIA_INSTANCE = 32787;
private static final int ERIS_EVIL_THOUGHTS = 32792;
private static final int RELIC_GUARDIAN = 32803;
private static final int RELIC_WATCHER1 = 32804;
private static final int RELIC_WATCHER2 = 32805;
private static final int RELIC_WATCHER3 = 32806;
private static final int RELIC_WATCHER4 = 32807;
private static final int ODD_GLOBE = 32815;
private static final int TELEPORT_CONTROL_DEVICE1 = 32817;
private static final int TELEPORT_CONTROL_DEVICE2 = 32818;
private static final int TELEPORT_CONTROL_DEVICE3 = 32819;
private static final int TELEPORT_CONTROL_DEVICE4 = 32820;
// Skills
private static final SkillHolder[] BUFFS =
{
new SkillHolder(6725, 1), // Bless the Blood of Elcadia
new SkillHolder(6728, 1), // Recharge of Elcadia
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 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 =
{
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
};
// Misc
private static final int TEMPLATE_ID = 151;
public MonasteryOfSilence1()
{
super(MonasteryOfSilence1.class.getSimpleName());
addFirstTalkId(TELEPORT_CONTROL_DEVICE1, TELEPORT_CONTROL_DEVICE2, TELEPORT_CONTROL_DEVICE3, TELEPORT_CONTROL_DEVICE4, ERIS_EVIL_THOUGHTS);
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);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
if (firstEntrance)
{
world.addAllowed(player.getObjectId());
}
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
spawnElcadia(player, (MoSWorld) world);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if (!(tmpworld instanceof MoSWorld))
{
return null;
}
final MoSWorld world = (MoSWorld) tmpworld;
switch (event)
{
case "TELE2":
{
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())
{
broadcastNpcSay(npc, 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());
}
else
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]);
}
startQuestTimer("FOLLOW", 10000, npc, player);
break;
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
if (npc.getId() == ODD_GLOBE)
{
enterInstance(talker, new MoSWorld(), "MonasteryOfSilence.xml", TEMPLATE_ID);
}
return super.onTalk(npc, talker);
}
protected void spawnElcadia(L2PcInstance player, MoSWorld world)
{
if (world.elcadia != null)
{
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);
}
}

View File

@@ -0,0 +1,535 @@
/*
* 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.npc.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

@@ -0,0 +1,4 @@
<html><body>Past Door Control Device:<br>
You failed to enter the correct password.<br>
<a action="bypass -h Quest NornilsGarden 32260-02.html">Enter the password again.</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Past Door Control Unit:<br>
Hmm... So... The password is supposed to be the same as the one for the Goddess of the Past Statue, right?<br>
<a action="bypass -h Quest NornilsGarden 32260-02.html">Enter the password.</a>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Past Door Control Unit:<br>
So the first letter of the password must be...<br>
<a action="bypass -h Quest NornilsGarden 32260-03.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-03.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 1">C</a><br>
<a action="bypass -h Quest NornilsGarden 32260-03.html">H</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-03.html">I</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-03.html">J</a><br>
<a action="bypass -h Quest NornilsGarden 32260-03.html">R</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-03.html">S</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-03.html">T</a>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Past Door Control Device:<br>
The second letter of the password is...<br>
<a action="bypass -h Quest NornilsGarden 32260-04.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-04.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-04.html">C</a><br>
<a action="bypass -h Quest NornilsGarden 32260-04.html">H</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-04.html">I</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-04.html">J</a><br>
<a action="bypass -h Quest NornilsGarden 2">R</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-04.html">S</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-04.html">T</a>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Past Door Control Device:<br>
The third letter of the password is...<br>
<a action="bypass -h Quest NornilsGarden 32260-05.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-05.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-05.html">C</a><br>
<a action="bypass -h Quest NornilsGarden 32260-05.html">H</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-05.html">I</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-05.html">J</a><br>
<a action="bypass -h Quest NornilsGarden 32260-05.html">R</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-05.html">S</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 3">T</a>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Past Door Control Device:<br>
The final letter of the password is...<br>
<a action="bypass -h Quest NornilsGarden 32260-00.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-00.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-00.html">C</a><br>
<a action="bypass -h Quest NornilsGarden 32260-00.html">H</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-00.html">I</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-00.html">J</a><br>
<a action="bypass -h Quest NornilsGarden check">R</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-00.html">S</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32260-00.html">T</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Present Door Control Device:<br>
You have entered an incorrect password.<br>
<a action="bypass -h Quest NornilsGarden 32261-02.html">Enter the password again.</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Present Door Control Unit:<br>
Hmm... So the password is supposed to be the same as the one for the Goddess of the Present Statue, right?<br>
<a action="bypass -h Quest NornilsGarden 32261-02.html">Enter the password.</a>
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Present Door Control Unit:<br>Eh, so the first letter of the password must be...<br>
<a action="bypass -h Quest NornilsGarden 32261-03.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-03.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 1">C</a><br>
<a action="bypass -h Quest NornilsGarden 32261-03.html">L</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-03.html">M</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-03.html">N</a><br>
<a action="bypass -h Quest NornilsGarden 32261-03.html">X</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-03.html">Y</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-03.html">Z</a>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Present Door Control Device:<br>
The second letter of the password is...<br>
<a action="bypass -h Quest NornilsGarden 32261-04.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-04.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-04.html">C</a><br>
<a action="bypass -h Quest NornilsGarden 32261-04.html">L</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-04.html">M</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 2">N</a><br>
<a action="bypass -h Quest NornilsGarden 32261-04.html">X</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-04.html">Y</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-04.html">Z</a>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Present Door Control Device:<br>
The third letter of the password is...<br>
<a action="bypass -h Quest NornilsGarden 32261-05.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-05.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 3">C</a><br>
<a action="bypass -h Quest NornilsGarden 32261-05.html">L</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-05.html">M</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-05.html">N</a><br>
<a action="bypass -h Quest NornilsGarden 32261-05.html">X</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-05.html">Y</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-05.html">Z</a>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Present Door Control Device:<br>
The final letter of the password is...<br>
<a action="bypass -h Quest NornilsGarden 32261-00.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-00.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-00.html">C</a><br>
<a action="bypass -h Quest NornilsGarden check">L</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-00.html">M</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-00.html">N</a><br>
<a action="bypass -h Quest NornilsGarden 32261-00.html">X</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-00.html">Y</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32261-00.html">Z</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Gate of Future Control Device:<br>
You failed to enter the correct password.<br>
<a action="bypass -h Quest NornilsGarden 32262-02.html">Enter the password again.</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Gate of Future Control Device:<br>
Umm...so... you're saying...the password is the same as that used to communicate with the Statue of Future?<br>
<a action="bypass -h Quest NornilsGarden 32262-02.html">Enter Password.</a>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Gate of Future Control Device:<br>
Uhhh... I remember the first letter of the password was...<br>
<a action="bypass -h Quest NornilsGarden 32262-03.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-03.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 1">C</a><br>
<a action="bypass -h Quest NornilsGarden 32262-03.html">H</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-03.html">I</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-03.html">J</a><br>
<a action="bypass -h Quest NornilsGarden 32262-03.html">O</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-03.html">P</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-03.html">Q</a><br>
<a action="bypass -h Quest NornilsGarden 32262-03.html">R</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-03.html">S</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-03.html">T</a>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Gate of Future Control Device:<br>
The second letter of the password is...<br>
<a action="bypass -h Quest NornilsGarden 32262-04.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-04.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-04.html">C</a><br>
<a action="bypass -h Quest NornilsGarden 2">H</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-04.html">I</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-04.html">J</a><br>
<a action="bypass -h Quest NornilsGarden 32262-04.html">O</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-04.html">P</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-04.html">Q</a><br>
<a action="bypass -h Quest NornilsGarden 32262-04.html">R</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-04.html">S</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-04.html">T</a>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Gate of Future Control Device:<br>
The third letter of the password is...<br>
<a action="bypass -h Quest NornilsGarden 3">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-05.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-05.html">C</a><br>
<a action="bypass -h Quest NornilsGarden 32262-05.html">H</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-05.html">I</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-05.html">J</a><br>
<a action="bypass -h Quest NornilsGarden 32262-05.html">O</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-05.html">P</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-05.html">Q</a><br>
<a action="bypass -h Quest NornilsGarden 32262-05.html">R</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-05.html">S</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-05.html">T</a>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Gate of Future Control Device:<br>
The fourth letter of the password is...<br>
<a action="bypass -h Quest NornilsGarden 32262-06.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-06.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-06.html">C</a><br>
<a action="bypass -h Quest NornilsGarden 32262-06.html">H</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-06.html">I</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-06.html">J</a><br>
<a action="bypass -h Quest NornilsGarden 4">O</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-06.html">P</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-06.html">Q</a><br>
<a action="bypass -h Quest NornilsGarden 32262-06.html">R</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-06.html">S</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-06.html">T</a>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Gate of Future Control Device:<br>
The final letter of the password is...<br>
<a action="bypass -h Quest NornilsGarden 32262-00.html">A</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-00.html">B</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-00.html">C</a><br>
<a action="bypass -h Quest NornilsGarden 32262-00.html">H</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-00.html">I</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-00.html">J</a><br>
<a action="bypass -h Quest NornilsGarden 32262-00.html">O</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-00.html">P</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-00.html">Q</a><br>
<a action="bypass -h Quest NornilsGarden 32262-00.html">R</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden check">S</a>&nbsp;&nbsp;&nbsp;<a action="bypass -h Quest NornilsGarden 32262-00.html">T</a>
</body></html>

View File

@@ -0,0 +1,9 @@
<html><body>Garden Guard:<br>
Firstly, no one can enter unless accompanied by a Kamael.<br1>
Secondly, you must be at least two in number.<br1>
Thirdly, you must be sufficiently skilled to undertake this test, but not so overqualified as to make this test meaningless.<br1>
Last -- but certainly not least -- any Kamael who wishes to take the test must first obtain permission from the Hierarch.<br1>
Have you met all these requirements?<br>
(In order to challenge, you must be pursuing a quest or belong to a party with at least one Kamael member, and all party members must be between levels 15-22 and not have completed the 1st class transfer.)<br>
<a action="bypass -h Quest NornilsGarden enter_instance">Say that you are qualified.</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Garden Guard:<br>
Before you may enter, you must recruit comrades whose strengths compensate for your areas of weakness.<br>
You can overcome the trials here only if they are with you.
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Garden Guard:<br>
The power of you and your comrades has already exceeded the capacities of this test. For a more suitable challenge, you should leave this island and travel to the Human kingdoms on the mainland. Go!
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Garden Guard:<br>
You are not yet ready for this test. Return here when you are.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Garden Guard:<br>
Now is not the right time for you to face this challenge.<br>
(You are unable to enter the instance zone.)
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Garden Guard:<br>
Welcome! This final test will judge whether you are truly ready to leave the safety of your island and travel to the outer world. It is a difficult challenge, so I will only administer it to those who meet the necessary requirements. Do you think that you are ready?<br>
<a action="bypass -h Quest NornilsGarden 32330-01.html">Ask about the requirements.</a><br>
<a action="bypass -h Quest NornilsGarden enter_instance">Tell her you are ready to take the test.</a>
</body></html>

View File

@@ -0,0 +1,644 @@
/*
* 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.NornilsGarden;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
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.model.skills.Skill;
import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import com.l2jmobius.gameserver.util.Util;
import instances.AbstractInstance;
import quests.Q00179_IntoTheLargeCavern.Q00179_IntoTheLargeCavern;
/**
* Nornil's Garden instance zone.
* @author Gnacik
* @version 2010-10-15 Based on official server Naia
*/
public final class NornilsGarden extends AbstractInstance
{
protected class NornilsWorld extends InstanceWorld
{
protected L2Npc first_npc = null;
protected boolean spawned_1 = false;
protected boolean spawned_2 = false;
protected boolean spawned_3 = false;
protected boolean spawned_4 = false;
}
// NPCs
private static final int _garden_guard = 32330;
private static final int[] _final_gates =
{
32260,
32261,
32262
};
// Skills
private static final Skill skill1 = SkillData.getInstance().getSkill(4322, 1);
private static final Skill skill2 = SkillData.getInstance().getSkill(4327, 1);
private static final Skill skill3 = SkillData.getInstance().getSkill(4329, 1);
private static final Skill skill4 = SkillData.getInstance().getSkill(4324, 1);
// Locations
private static final Location SPAWN_PPL = new Location(-111184, 74540, -12430);
private static final Location EXIT_PPL = new Location(-74058, 52040, -3680);
// Misc
private static final int TEMPLATE_ID = 11;
private static final int DURATION_TIME = 70;
private static final int EMPTY_DESTROY_TIME = 5;
private static final int INSTANCE_LVL_MIN = 18;
private static final int INSTANCE_LVL_MAX = 22;
private static final int[][] _auto_gates =
{
// Warriors gate
{
20110,
16200001
},
// Midway gate
{
20111,
16200004
},
// Gate
{
20112,
16200013
}
};
private static final int _herb_jar = 18478;
// @formatter:off
private static final int[][] _gatekeepers =
{
{ 18352, 9703, 0 }, // Kamael Guard
{ 18353, 9704, 0 }, // Guardian of Records
{ 18354, 9705, 0 }, // Guardian of Observation
{ 18355, 9706, 0 }, // Spicula's Guard
{ 18356, 9707, 16200024 }, // Harkilgamed's Gatekeeper
{ 18357, 9708, 16200025 }, // Rodenpicula's Gatekeeper
{ 18358, 9713, 0 }, // Guardian of Secrets
{ 18359, 9709, 16200023 }, // Arviterre's Guardian
{ 18360, 9710, 0 }, // Katenar's Gatekeeper
{ 18361, 9711, 0 }, // Guardian of Prediction
{ 25528, 9712, 0 } // Tiberias
};
private static final int[][] HP_HERBS_DROPLIST =
{
// itemId, count, chance
{ 8602, 1, 10 },
{ 8601, 2, 40 },
{ 8600, 3, 70 }
};
private static final int[][] _group_1 =
{
{ 18363, -109899, 74431, -12528, 16488 },
{ 18483, -109701, 74501, -12528, 24576 },
{ 18483, -109892, 74886, -12528, 0 },
{ 18363, -109703, 74879, -12528, 49336 }
};
private static final int[][] _group_2 =
{
{ 18363, -110393, 78276, -12848, 49152 },
{ 18363, -110561, 78276, -12848, 49152 },
{ 18362, -110414, 78495, -12905, 48112 },
{ 18362, -110545, 78489, -12903, 48939 },
{ 18483, -110474, 78601, -12915, 49488 },
{ 18362, -110474, 78884, -12915, 49338 },
{ 18483, -110389, 79131, -12915, 48539 },
{ 18483, -110551, 79134, -12915, 49151 }
};
private static final int[][] _group_3 =
{
{ 18483, -107798, 80721, -12912, 0 },
{ 18483, -107798, 80546, -12912, 0 },
{ 18347, -108033, 80644, -12912, 0 },
{ 18363, -108520, 80647, -12912, 0 },
{ 18483, -108740, 80752, -12912, 0 },
{ 18363, -109016, 80642, -12912, 0 },
{ 18483, -108740, 80546, -12912, 0 }
};
private static final int[][] _group_4 =
{
{ 18362, -110082, 83998, -12928, 0 },
{ 18362, -110082, 84210, -12928, 0 },
{ 18363, -109963, 84102, -12896, 0 },
{ 18347, -109322, 84102, -12880, 0 },
{ 18362, -109131, 84097, -12880, 0 },
{ 18483, -108932, 84101, -12880, 0 },
{ 18483, -109313, 84488, -12880, 0 },
{ 18362, -109122, 84490, -12880, 0 },
{ 18347, -108939, 84489, -12880, 0 }
};
private static final int[][] MP_HERBS_DROPLIST =
{
// itemId, count, chance
{ 8605, 1, 10 },
{ 8604, 2, 40 },
{ 8603, 3, 70 }
};
// @formatter:on
private static final void dropHerb(L2Npc mob, L2PcInstance player, int[][] drop)
{
final int chance = getRandom(100);
for (int[] element : drop)
{
if (chance < element[2])
{
mob.dropItem(player, element[0], element[1]);
}
}
}
private static final void giveBuffs(L2Character ch)
{
if (skill1 != null)
{
skill1.applyEffects(ch, ch);
}
if (skill2 != null)
{
skill2.applyEffects(ch, ch);
}
if (skill3 != null)
{
skill3.applyEffects(ch, ch);
}
if (skill4 != null)
{
skill4.applyEffects(ch, ch);
}
}
public NornilsGarden()
{
super(NornilsGarden.class.getSimpleName());
addStartNpc(_garden_guard);
addFirstTalkId(_garden_guard);
addTalkId(_garden_guard);
for (int i[] : _gatekeepers)
{
addKillId(i[0]);
}
for (int i[] : _auto_gates)
{
addEnterZoneId(i[0]);
}
addTalkId(_final_gates);
addAttackId(_herb_jar);
addAttackId(18362); // first garden guard
}
@Override
public final void teleportPlayer(L2PcInstance player, Location loc, int instanceId)
{
giveBuffs(player);
if (player.hasSummon())
{
giveBuffs(player.getSummon());
}
super.teleportPlayer(player, loc, instanceId);
}
private void exitInstance(L2PcInstance player)
{
final InstanceWorld inst = InstanceManager.getInstance().getWorld(player.getInstanceId());
if (inst instanceof NornilsWorld)
{
final NornilsWorld world = ((NornilsWorld) inst);
world.removeAllowed(player.getObjectId());
teleportPlayer(player, EXIT_PPL, 0);
}
}
private final synchronized String enterInstance(L2Npc npc, L2PcInstance player)
{
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world != null)
{
if (!(world instanceof NornilsWorld) || (world.getTemplateId() != TEMPLATE_ID))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return null;
}
// check for level difference again on reenter
if ((player.getLevel() > INSTANCE_LVL_MAX) || (player.getLevel() < INSTANCE_LVL_MIN))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
sm.addPcName(player);
player.sendPacket(sm);
return null;
}
// check what instance still exist
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
if (inst != null)
{
teleportPlayer(player, SPAWN_PPL, world.getInstanceId());
}
return null;
}
// Creating new instance
final String result = checkConditions(npc, player);
if (!(result.equalsIgnoreCase("ok")))
{
return result;
}
final int instanceId = InstanceManager.getInstance().createDynamicInstance("NornilsGarden.xml");
final Instance inst = InstanceManager.getInstance().getInstance(instanceId);
inst.setName(InstanceManager.getInstance().getInstanceIdName(TEMPLATE_ID));
inst.setExitLoc(new Location(player));
inst.setAllowSummon(false);
inst.setDuration(DURATION_TIME * 60000);
inst.setEmptyDestroyTime(EMPTY_DESTROY_TIME * 60000);
world = new NornilsWorld();
world.setInstanceId(instanceId);
world.setTemplateId(TEMPLATE_ID);
InstanceManager.getInstance().addWorld(world);
_log.info("Nornils Garden: started, Instance: " + instanceId + " created by player: " + player.getName());
prepareInstance((NornilsWorld) world);
// and finally teleport party into instance
final L2Party party = player.getParty();
if (party != null)
{
for (L2PcInstance partyMember : party.getMembers())
{
world.addAllowed(partyMember.getObjectId());
teleportPlayer(partyMember, SPAWN_PPL, instanceId);
}
}
return null;
}
private void prepareInstance(NornilsWorld world)
{
world.first_npc = addSpawn(18362, -109702, 74696, -12528, 49568, false, 0, false, world.getInstanceId());
final L2DoorInstance door = getDoor(16200010, world.getInstanceId());
if (door != null)
{
door.setTargetable(false);
door.setMeshIndex(2);
}
}
private void spawn1(L2Npc npc)
{
final InstanceWorld inst = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (inst instanceof NornilsWorld)
{
final NornilsWorld world = ((NornilsWorld) inst);
if (npc.equals(world.first_npc) && !world.spawned_1)
{
world.spawned_1 = true;
for (int mob[] : _group_1)
{
addSpawn(mob[0], mob[1], mob[2], mob[3], mob[4], false, 0, false, world.getInstanceId());
}
}
}
}
private void spawn2(L2Npc npc)
{
final InstanceWorld inst = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (inst instanceof NornilsWorld)
{
final NornilsWorld world = ((NornilsWorld) inst);
if (!world.spawned_2)
{
world.spawned_2 = true;
for (int mob[] : _group_2)
{
addSpawn(mob[0], mob[1], mob[2], mob[3], mob[4], false, 0, false, world.getInstanceId());
}
}
}
}
private void spawn3(L2Character cha)
{
final InstanceWorld inst = InstanceManager.getInstance().getWorld(cha.getInstanceId());
if (inst instanceof NornilsWorld)
{
final NornilsWorld world = ((NornilsWorld) inst);
if (!world.spawned_3)
{
world.spawned_3 = true;
for (int mob[] : _group_3)
{
addSpawn(mob[0], mob[1], mob[2], mob[3], mob[4], false, 0, false, world.getInstanceId());
}
}
}
}
private void spawn4(L2Character cha)
{
final InstanceWorld inst = InstanceManager.getInstance().getWorld(cha.getInstanceId());
if (inst instanceof NornilsWorld)
{
final NornilsWorld world = ((NornilsWorld) inst);
if (!world.spawned_4)
{
world.spawned_4 = true;
for (int mob[] : _group_4)
{
addSpawn(mob[0], mob[1], mob[2], mob[3], mob[4], false, 0, false, world.getInstanceId());
}
}
}
}
public void openDoor(QuestState st, L2PcInstance player, int doorId)
{
st.unset("correct");
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
if (tmpworld instanceof NornilsWorld)
{
openDoor(doorId, tmpworld.getInstanceId());
}
}
private static final String checkConditions(L2Npc npc, L2PcInstance player)
{
final L2Party party = player.getParty();
// player must be in party
if (party == null)
{
player.sendPacket(SystemMessageId.YOU_ARE_NOT_CURRENTLY_IN_A_PARTY_SO_YOU_CANNOT_ENTER);
return "32330-05.html";
}
// ...and be party leader
if (party.getLeader() != player)
{
player.sendPacket(SystemMessageId.ONLY_A_PARTY_LEADER_CAN_MAKE_THE_REQUEST_TO_ENTER);
return "32330-08.html";
}
boolean _kamael = false;
// for each party member
for (L2PcInstance partyMember : party.getMembers())
{
// player level must be in range
if (partyMember.getLevel() > INSTANCE_LVL_MAX)
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
sm.addPcName(partyMember);
player.sendPacket(sm);
return "32330-06.html";
}
if (partyMember.getLevel() < INSTANCE_LVL_MIN)
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
sm.addPcName(partyMember);
player.sendPacket(sm);
return "32330-07.html";
}
if (partyMember.getClassId().level() != 0)
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
sm.addPcName(partyMember);
player.sendPacket(sm);
return "32330-06.html";
}
// player must be near party leader
if (!partyMember.isInsideRadius(player, 500, true, true))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
sm.addPcName(partyMember);
player.sendPacket(sm);
return "32330-08.html";
}
if (partyMember.getRace().ordinal() == 5)
{
final QuestState checkst = partyMember.getQuestState(Q00179_IntoTheLargeCavern.class.getSimpleName());
if ((checkst != null) && (checkst.getState() == State.STARTED))
{
_kamael = true;
}
else
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_QUEST_REQUIREMENT_IS_NOT_SUFFICIENT_AND_CANNOT_BE_ENTERED);
sm.addPcName(partyMember);
player.sendPacket(sm);
return "32330-08.html";
}
}
}
if (!_kamael)
{
return "32330-08.html";
}
return "ok";
}
@Override
public String onEnterZone(L2Character character, L2ZoneType zone)
{
if ((character instanceof L2PcInstance) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(character.getInstanceId());
if (tmpworld instanceof NornilsWorld)
{
for (int _auto[] : _auto_gates)
{
if (zone.getId() == _auto[0])
{
openDoor(_auto[1], tmpworld.getInstanceId());
}
if (zone.getId() == 20111)
{
spawn3(character);
}
else if (zone.getId() == 20112)
{
spawn4(character);
}
}
}
}
return super.onEnterZone(character, zone);
}
@Override
public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = event;
final QuestState st = getQuestState(player, false);
if (st == null)
{
return getNoQuestMsg(player);
}
if ((npc.getId() == _garden_guard) && event.equalsIgnoreCase("enter_instance"))
{
try
{
htmltext = enterInstance(npc, player);
}
catch (Exception e)
{
}
}
else if ((npc.getId() == 32258) && event.equalsIgnoreCase("exit"))
{
try
{
exitInstance(player);
}
catch (Exception e)
{
}
}
else if (Util.contains(_final_gates, npc.getId()))
{
if (event.equalsIgnoreCase("32260-02.html") || event.equalsIgnoreCase("32261-02.html") || event.equalsIgnoreCase("32262-02.html"))
{
st.unset("correct");
}
else if (Util.isDigit(event))
{
int correct = st.getInt("correct");
correct++;
st.set("correct", String.valueOf(correct));
htmltext = npc.getId() + "-0" + String.valueOf(correct + 2) + ".html";
}
else if (event.equalsIgnoreCase("check"))
{
final int correct = st.getInt("correct");
if ((npc.getId() == 32260) && (correct == 3))
{
openDoor(st, player, 16200014);
}
else if ((npc.getId() == 32261) && (correct == 3))
{
openDoor(st, player, 16200015);
}
else if ((npc.getId() == 32262) && (correct == 4))
{
openDoor(st, player, 16200016);
}
else
{
return npc.getId() + "-00.html";
}
}
}
return htmltext;
}
@Override
public final String onTalk(L2Npc npc, L2PcInstance player)
{
if (Util.contains(_final_gates, npc.getId()))
{
final QuestState cst = player.getQuestState(Q00179_IntoTheLargeCavern.class.getSimpleName());
if ((cst != null) && (cst.getState() == State.STARTED))
{
return npc.getId() + "-01.html";
}
return getNoQuestMsg(player);
}
return null;
}
@Override
public final String onFirstTalk(L2Npc npc, L2PcInstance player)
{
getQuestState(player, true);
return npc.getId() + ".html";
}
@Override
public final String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
{
if ((npc.getId() == _herb_jar) && !npc.isDead())
{
dropHerb(npc, attacker, HP_HERBS_DROPLIST);
dropHerb(npc, attacker, MP_HERBS_DROPLIST);
npc.doDie(attacker);
}
else if ((npc.getId() == 18362) && (npc.getInstanceId() > 0))
{
spawn1(npc);
}
return null;
}
@Override
public final String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
final QuestState st = getQuestState(player, false);
if (st == null)
{
return null;
}
for (int _gk[] : _gatekeepers)
{
if (npc.getId() == _gk[0])
{
// Drop key
npc.dropItem(player, _gk[1], 1);
// Check if gatekeeper should open bridge, and open it
if (_gk[2] > 0)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
if (tmpworld instanceof NornilsWorld)
{
openDoor(_gk[2], tmpworld.getInstanceId());
}
}
}
if (npc.getId() == 18355)
{
spawn2(npc);
}
}
return super.onKill(npc, player, isSummon);
}
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
}
}

View File

@@ -0,0 +1,3 @@
<html><body>Vice Heirarch Mao:<br>
I have never seen a case like this before... Good luck!
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Vice Hierarch Mao:<br>
Wait a moment...<br>
Eh? Oh, it seems that we cannot contact Mother Nornil at this time. Come back later.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Rodenpicula:<br>
I have been waiting for you, Kamael.<br>
<a action="bypass -h npc_%objectId%_Quest">Quest.</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Rodenpicula:<br>
Speak with Mother Nornil about how to depart this place.<br>
She will tell you how.
</body></html>

Some files were not shown because too many files have changed in this diff Show More