This commit is contained in:
mobius
2015-01-01 20:02:50 +00:00
parent eeae660458
commit a6a3718849
17894 changed files with 2818932 additions and 0 deletions

View File

@@ -0,0 +1,592 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.CavernOfThePirateCaptain;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.L2Party;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.PcCondOverride;
import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.Instance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
/**
* Cavern Of The Pirate Captain (Day Dream) instance Zone.
* @author St3eT
*/
public class CavernOfThePirateCaptain extends AbstractNpcAI
{
protected class CavernOfThePirateCaptainWorld extends InstanceWorld
{
List<L2PcInstance> playersInside = new ArrayList<>();
L2Attackable _zaken;
long storeTime = 0;
boolean _is83;
int _zakenRoom;
int _blueFounded;
}
// NPCs
private static final int PATHFINDER = 32713; // Pathfinder Worker
private static final int ZAKEN_60 = 29176; // Zaken
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_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_83 = 135;
private static final int HOURS = 6;
private static final int MINUTES = 30;
private static final int DAY_A = Calendar.MONDAY;
private static final int DAY_B = Calendar.WEDNESDAY;
private static final int DAY_C = Calendar.FRIDAY;
//@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
private CavernOfThePirateCaptain()
{
super(CavernOfThePirateCaptain.class.getSimpleName(), "instances");
addStartNpc(PATHFINDER);
addTalkId(PATHFINDER);
addKillId(ZAKEN_60, ZAKEN_83);
addFirstTalkId(CANDLE);
}
private void enterInstance(L2PcInstance player, String template, boolean is83)
{
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world != null)
{
if (world instanceof CavernOfThePirateCaptainWorld)
{
teleportPlayer(player, ENTER_LOC[getRandom(ENTER_LOC.length)], world.getInstanceId(), false);
return;
}
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return;
}
if (checkConditions(player, is83))
{
world = new CavernOfThePirateCaptainWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(is83 ? TEMPLATE_ID_83 : TEMPLATE_ID_60);
world.setStatus(0);
InstanceManager.getInstance().addWorld(world);
final CavernOfThePirateCaptainWorld curworld = (CavernOfThePirateCaptainWorld) world;
curworld._is83 = is83;
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);
}
}
private void managePlayerEnter(L2PcInstance player, CavernOfThePirateCaptainWorld world)
{
if (!world._is83)
{
player.stopAllEffectsExceptThoseThatLastThroughDeath();
if (player.hasSummon())
{
player.getSummon().stopAllEffectsExceptThoseThatLastThroughDeath();
}
}
world.playersInside.add(player);
world.addAllowed(player.getObjectId());
teleportPlayer(player, ENTER_LOC[getRandom(ENTER_LOC.length)], world.getInstanceId(), false);
}
private boolean checkConditions(L2PcInstance player, boolean is83)
{
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 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 : PLAYERS_60_MIN)) || (members.size() > (is83 ? PLAYERS_83_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 : 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, "CavernOfThePirateCaptainWorldDay60.xml", false);
}
else if (event.equals("enter83"))
{
enterInstance(player, "CavernOfThePirateCaptainWorldDay83.xml", true);
}
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;
final Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
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);
}
}
}
}
}
saveReenterForPlayers(world);
inst.setDuration(300000);
inst.setEmptyDestroyTime(0);
}
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());
addAttackPlayerDesire(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 : ZAKEN_60, world._zakenRoom, null, world);
world._zaken.setInvisible(true);
world._zaken.setIsParalyzed(true);
}
private void saveReenterForPlayers(InstanceWorld world)
{
final Calendar reenter = Calendar.getInstance();
reenter.set(Calendar.MINUTE, MINUTES);
reenter.set(Calendar.HOUR_OF_DAY, HOURS);
if (reenter.getTimeInMillis() <= System.currentTimeMillis())
{
reenter.add(Calendar.DAY_OF_MONTH, 1);
}
if ((reenter.get(Calendar.DAY_OF_WEEK) <= DAY_A) || (reenter.get(Calendar.DAY_OF_WEEK) > DAY_C))
{
while (reenter.get(Calendar.DAY_OF_WEEK) != DAY_A)
{
reenter.add(Calendar.DAY_OF_MONTH, 1);
}
}
else if (reenter.get(Calendar.DAY_OF_WEEK) <= DAY_B)
{
while (reenter.get(Calendar.DAY_OF_WEEK) != DAY_B)
{
reenter.add(Calendar.DAY_OF_MONTH, 1);
}
}
else
{
while (reenter.get(Calendar.DAY_OF_WEEK) != DAY_C)
{
reenter.add(Calendar.DAY_OF_MONTH, 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()));
for (int objectId : world.getAllowed())
{
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
InstanceManager.getInstance().setInstanceTime(objectId, world.getTemplateId(), reenter.getTimeInMillis());
if ((player != null) && player.isOnline())
{
player.sendPacket(sm);
}
}
}
public static void main(String[] args)
{
new CavernOfThePirateCaptain();
}
}

View File

@@ -0,0 +1,674 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.ChambersOfDelusion;
import java.util.Calendar;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import com.l2jserver.Config;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.L2Party;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.Instance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.skills.Skill;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.Earthquake;
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.util.Util;
/**
* Chambers of Delusion superclass.
* @author GKR
*/
public abstract class Chamber extends Quest
{
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;
protected Chamber(int questId, String name, String descr, int instanceId, String instanceTemplateName, int entranceGKId, int roomGKFirstId, int roomGKLastId, int aenkinelId, int boxId)
{
super(questId, 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));
}
private 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);
partyMember.teleToLocation(ROOM_ENTER_POINTS[newRoom], true);
}
}
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(), Say2.NPC_ALL, npc.getId(), NpcStringId.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())
{
final QuestState st = getQuestState(partyMember, true);
if (st.hasQuestItems(DELUSION_MARK))
{
st.takeItems(DELUSION_MARK, -1);
}
if (party.isLeader(partyMember))
{
st.giveItems(DELUSION_MARK, 1);
}
// Save location for teleport back into main hall
st.set("return_point", 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));
}
}
}
protected int enterInstance(L2PcInstance player)
{
int instanceId = 0;
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
{
if (!(world instanceof CDWorld))
{
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON));
return 0;
}
final CDWorld currentWorld = (CDWorld) world;
teleportPlayer(player, ROOM_ENTER_POINTS[currentWorld.currentRoom], world.getInstanceId());
return instanceId;
}
// New instance
if (!checkConditions(player))
{
return 0;
}
final L2Party party = player.getParty();
instanceId = InstanceManager.getInstance().createDynamicInstance(INSTANCE_TEMPLATE);
world = new CDWorld(party);
world.setInstanceId(instanceId);
world.setTemplateId(INSTANCEID);
world.setStatus(0);
InstanceManager.getInstance().addWorld(world);
_log.info("Chamber Of Delusion started " + INSTANCE_TEMPLATE + " Instance: " + instanceId + " created by player: " + player.getName());
enter((CDWorld) world);
return instanceId;
}
protected void exitInstance(L2PcInstance player)
{
if ((player == null) || !player.isOnline() || (player.getInstanceId() == 0))
{
return;
}
final Instance inst = InstanceManager.getInstance().getInstance(player.getInstanceId());
Location ret = inst.getSpawnLoc();
final QuestState st = getQuestState(player, false);
if (st != null)
{
String return_point = st.get("return_point");
if (return_point != null)
{
String[] coords = return_point.split(";");
if (coords.length == 3)
{
try
{
int x = Integer.parseInt(coords[0]);
int y = Integer.parseInt(coords[1]);
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;
QuestState st = getQuestState(player, false);
if (st == null)
{
st = newQuestState(player);
}
// Change room from dialog
else 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))
{
st.takeItems(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()))
{
player.teleToLocation(ROOM_ENTER_POINTS[world.currentRoom], false);
}
}
}
return htmltext;
}
@Override
public String onAttack(final L2Npc npc, final L2PcInstance attacker, final int damage, final boolean isPet, final 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)
{
int npcId = npc.getId();
QuestState st = getQuestState(player, false);
if (st == null)
{
st = newQuestState(player);
}
if (npcId == ENTRANCE_GATEKEEPER)
{
enterInstance(player);
}
return "";
}
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.ChambersOfDelusion;
import com.l2jserver.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";
private ChamberOfDelusionEast()
{
super(-1, ChamberOfDelusionEast.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
public static void main(String[] args)
{
new ChamberOfDelusionEast();
}
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.ChambersOfDelusion;
import com.l2jserver.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";
private ChamberOfDelusionNorth()
{
super(-1, ChamberOfDelusionNorth.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
public static void main(String[] args)
{
new ChamberOfDelusionNorth();
}
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.ChambersOfDelusion;
import com.l2jserver.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";
private ChamberOfDelusionSouth()
{
super(-1, ChamberOfDelusionSouth.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
public static void main(String[] args)
{
new ChamberOfDelusionSouth();
}
}

View File

@@ -0,0 +1,62 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.ChambersOfDelusion;
import com.l2jserver.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";
private ChamberOfDelusionSquare()
{
super(-1, ChamberOfDelusionSquare.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
public static void main(String[] args)
{
new ChamberOfDelusionSquare();
}
}

View File

@@ -0,0 +1,62 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.ChambersOfDelusion;
import com.l2jserver.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";
private ChamberOfDelusionTower()
{
super(-1, ChamberOfDelusionTower.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
public static void main(String[] args)
{
new ChamberOfDelusionTower();
}
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.ChambersOfDelusion;
import com.l2jserver.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";
private ChamberOfDelusionWest()
{
super(-1, ChamberOfDelusionWest.class.getSimpleName(), "instances", INSTANCEID, INSTANCE_TEMPLATE, ENTRANCE_GATEKEEPER, ROOM_GATEKEEPER_FIRST, ROOM_GATEKEEPER_LAST, AENKINEL, BOX);
ROOM_ENTER_POINTS = ENTER_POINTS;
}
public static void main(String[] args)
{
new ChamberOfDelusionWest();
}
}

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,525 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.DisciplesNecropolisPast;
import java.util.HashMap;
import java.util.Map;
import javolution.util.FastList;
import quests.Q00196_SevenSignsSealOfTheEmperor.Q00196_SevenSignsSealOfTheEmperor;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
import com.l2jserver.gameserver.util.Util;
/**
* Disciple's Necropolis Past instance zone.
* @author Adry_85
*/
public final class DisciplesNecropolisPast extends Quest
{
protected class DNPWorld extends InstanceWorld
{
protected final FastList<L2Npc> anakimGroup = new FastList<>();
protected final FastList<L2Npc> lilithGroup = new FastList<>();
protected long storeTime = 0;
protected int countKill = 0;
}
// Instance
private static final int TEMPLATE_ID = 112;
// 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;
// Doors
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;
// Items
private static final int SACRED_SWORD_OF_EINHASAD = 15310;
private static final int SEAL_OF_BINDING = 13846;
// 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);
// Monsters
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;
// 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_SHILEN_I_WILL_CUT_YOUR_THROAT,
NpcStringId.YOU_CANNOT_BE_THE_MATCH_OF_LILITH_I_LL_TEACH_YOU_A_LESSON
};
// Bosses Spawn
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));
}
// 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
}
private DisciplesNecropolisPast()
{
super(-1, DisciplesNecropolisPast.class.getSimpleName(), "instances");
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())
{
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())
{
L2Npc enpc = addSpawn(entry.getKey(), entry.getValue(), false, 0, false, world.getInstanceId());
world.anakimGroup.add(enpc);
}
}
private synchronized void checkDoors(L2Npc npc, DNPWorld world)
{
if (world.countKill == 4)
{
openDoor(DOOR_1, world.getInstanceId());
}
else if (world.countKill == 10)
{
openDoor(DOOR_2, world.getInstanceId());
}
else if (world.countKill == 18)
{
openDoor(DOOR_3, world.getInstanceId());
}
else if (world.countKill == 28)
{
openDoor(DOOR_4, world.getInstanceId());
}
else if (world.countKill == 40)
{
openDoor(DOOR_5, world.getInstanceId());
}
}
protected int enterInstance(L2PcInstance player, String template, Location loc)
{
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
{
if (!(world instanceof DNPWorld))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return 0;
}
teleportPlayer(player, loc, world.getInstanceId());
removeBuffs(player);
return world.getInstanceId();
}
// New instance
world = new DNPWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
world.setStatus(0);
((DNPWorld) world).storeTime = System.currentTimeMillis();
InstanceManager.getInstance().addWorld(world);
_log.info("Disciple's Necropolis Past started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// teleport players
teleportPlayer(player, loc, world.getInstanceId());
spawnNPC((DNPWorld) world);
world.addAllowed(player.getObjectId());
return world.getInstanceId();
}
private void makeCast(L2Npc npc, FastList<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)
{
InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if (tmpworld instanceof DNPWorld)
{
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(), Say2.NPC_SHOUT, caster.getId(), NpcStringId.YOU_SUCH_A_FOOL_THE_VICTORY_OVER_THIS_WAR_BELONGS_TO_SHILEN));
caster.setScriptValue(1);
}
else if (getRandom(100) < 10)
{
caster.broadcastPacket(new NpcSay(caster.getObjectId(), Say2.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(), Say2.NPC_SHOUT, caster.getId(), NpcStringId.FOR_THE_ETERNITY_OF_EINHASAD));
if (Util.checkIfInRange(2000, caster, player, true))
{
player.sendPacket(new NpcSay(caster.getObjectId(), Say2.TELL, 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(), Say2.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(), Say2.TELL, caster.getId(), NpcStringId.ALL_4_SEALING_DEVICES_MUST_BE_TURNED_ON));
}
break;
}
case 1:
{
caster.broadcastPacket(new NpcSay(caster.getObjectId(), Say2.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(), Say2.TELL, caster.getId(), NpcStringId.LILITH_ATTACK_IS_GETTING_STRONGER_GO_AHEAD_AND_TURN_IT_ON));
}
break;
}
case 2:
{
caster.broadcastPacket(new NpcSay(caster.getObjectId(), Say2.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(), Say2.TELL, 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(), Say2.NPC_ALL, 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(), Say2.NPC_ALL, 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(), Say2.NPC_ALL, 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(), Say2.NPC_ALL, 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)
{
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)
{
switch (npc.getId())
{
case SHUNAIMAN:
{
return "32586.htm";
}
case LEON:
{
return "32587.htm";
}
case DISCIPLES_GATEKEEPER:
{
return "32657.htm";
}
}
return super.onFirstTalk(npc, player);
}
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if (tmpworld instanceof DNPWorld)
{
DNPWorld world = (DNPWorld) tmpworld;
world.countKill++;
checkDoors(npc, world);
}
switch (npc.getId())
{
case LILIM_MAGUS:
case LILIM_GREAT_MAGUS:
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), Say2.NPC_ALL, 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(), Say2.NPC_ALL, npc.getId(), NpcStringId.WHY_ARE_YOU_GETTING_IN_OUR_WAY));
break;
}
case LILIM_SLAYER:
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), Say2.NPC_ALL, 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, "DisciplesNecropolisPast.xml", ENTER);
return "";
}
break;
}
case LEON:
{
if (qs.getCond() >= 3)
{
takeItems(talker, SACRED_SWORD_OF_EINHASAD, -1);
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)
{
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (tmpworld instanceof DNPWorld)
{
DNPWorld world = (DNPWorld) tmpworld;
openDoor(DISCIPLES_NECROPOLIS_DOOR, world.getInstanceId());
talker.showQuestMovie(12);
startQuestTimer("FIGHT", 1000, null, talker);
}
}
break;
}
}
return htmltext;
}
private static final void removeBuffs(L2Character ch)
{
ch.stopAllEffectsExceptThoseThatLastThroughDeath();
if (ch.hasSummon())
{
ch.getSummon().stopAllEffectsExceptThoseThatLastThroughDeath();
}
}
public static void main(String[] args)
{
new DisciplesNecropolisPast();
}
}

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,124 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.ElcadiasTent;
import quests.Q10292_SevenSignsGirlOfDoubt.Q10292_SevenSignsGirlOfDoubt;
import quests.Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom.Q10293_SevenSignsForbiddenBookOfTheElmoreAdenKingdom;
import quests.Q10294_SevenSignsToTheMonasteryOfSilence.Q10294_SevenSignsToTheMonasteryOfSilence;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
* Elcadia's Tent instance zone.
* @author Adry_85
*/
public final class ElcadiasTent extends AbstractNpcAI
{
protected class ETWorld extends InstanceWorld
{
}
private static final int TEMPLATE_ID = 158;
// NPCs
private static final int ELCADIA = 32784;
private static final int GRUFF_LOOKING_MAN = 32862;
// Locations
private static final Location START_LOC = new Location(89706, -238074, -9632, 0, 0);
private static final Location EXIT_LOC = new Location(43316, -87986, -2832, 0, 0);
private ElcadiasTent()
{
super(ElcadiasTent.class.getSimpleName(), "instances");
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());
if (((GirlOfDoubt != null) && GirlOfDoubt.isStarted()) //
|| ((GirlOfDoubt != null) && GirlOfDoubt.isCompleted() && (ForbiddenBook == null)) //
|| ((ForbiddenBook != null) && ForbiddenBook.isStarted()) //
|| ((ForbiddenBook != null) && ForbiddenBook.isCompleted() && (Monastery == null)))
{
enterInstance(talker, "ElcadiasTent.xml", START_LOC);
}
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);
}
private void enterInstance(L2PcInstance player, String template, Location loc)
{
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world != null)
{
if (!(world instanceof ETWorld))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
}
else
{
teleportPlayer(player, loc, world.getInstanceId(), false);
}
}
else
{
// New instance.
world = new ETWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
world.setStatus(0);
InstanceManager.getInstance().addWorld(world);
_log.info("Elcadia's Tent started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// Teleport players.
teleportPlayer(player, loc, world.getInstanceId(), false);
world.addAllowed(player.getObjectId());
}
}
public static void main(String[] args)
{
new ElcadiasTent();
}
}

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,123 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.HideoutOfTheDawn;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
* Hideout of the Dawn instance zone.
* @author Adry_85
*/
public final class HideoutOfTheDawn extends Quest
{
protected class HotDWorld extends InstanceWorld
{
long storeTime = 0;
}
private static final int TEMPLATE_ID = 113;
// 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);
private HideoutOfTheDawn()
{
super(-1, HideoutOfTheDawn.class.getSimpleName(), "instances");
addStartNpc(WOOD);
addTalkId(WOOD, JAINA);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
switch (npc.getId())
{
case WOOD:
{
enterInstance(talker, "HideoutOfTheDawn.xml", WOOD_LOC);
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);
}
protected int enterInstance(L2PcInstance player, String template, Location loc)
{
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
{
if (!(world instanceof HotDWorld))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return 0;
}
teleportPlayer(player, loc, world.getInstanceId(), false);
removeBuffs(player);
return 0;
}
// New instance
world = new HotDWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
world.setStatus(0);
((HotDWorld) world).storeTime = System.currentTimeMillis();
InstanceManager.getInstance().addWorld(world);
_log.info("Hideout of the Dawn started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// teleport players
teleportPlayer(player, loc, world.getInstanceId(), false);
removeBuffs(player);
world.addAllowed(player.getObjectId());
return world.getInstanceId();
}
private static final void removeBuffs(L2Character ch)
{
ch.stopAllEffectsExceptThoseThatLastThroughDeath();
if (ch.hasSummon())
{
ch.getSummon().stopAllEffectsExceptThoseThatLastThroughDeath();
}
}
public static void main(String[] args)
{
new HideoutOfTheDawn();
}
}

View File

@@ -0,0 +1,238 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.IceQueensCastle;
import quests.Q10285_MeetingSirra.Q10285_MeetingSirra;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.skills.Skill;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Ice Queen's Castle instance zone.
* @author Adry_85
*/
public final class IceQueensCastle extends AbstractNpcAI
{
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;
private IceQueensCastle()
{
super(IceQueensCastle.class.getSimpleName(), "instances");
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, Say2.NPC_ALL, 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, Say2.NPC_ALL, 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, "IceQueensCastle.xml");
return super.onTalk(npc, talker);
}
private void enterInstance(L2PcInstance player, String template)
{
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world != null)
{
if (world instanceof IQCWorld)
{
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
return;
}
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return;
}
if (checkConditions(player))
{
world = new IQCWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
world.setStatus(0);
InstanceManager.getInstance().addWorld(world);
_log.info("Ice Queen's Castle started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
world.addAllowed(player.getObjectId());
((IQCWorld) world).player = player;
openDoor(ICE_QUEEN_DOOR, world.getInstanceId());
}
}
private 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;
}
public static void main(String[] args)
{
new IceQueensCastle();
}
}

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,100 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.JiniaGuildHideout1;
import quests.Q10284_AcquisitionOfDivineSword.Q10284_AcquisitionOfDivineSword;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
* Jinia Guild Hideout instance zone.
* @author Adry_85
*/
public final class JiniaGuildHideout1 extends Quest
{
protected class JGH1World extends InstanceWorld
{
long storeTime = 0;
}
private static final int INSTANCEID = 140;
// NPC
private static final int RAFFORTY = 32020;
// Location
private static final Location START_LOC = new Location(-23530, -8963, -5413);
private JiniaGuildHideout1()
{
super(-1, JiniaGuildHideout1.class.getSimpleName(), "instances");
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, "JiniaGuildHideout1.xml");
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
}
protected void enterInstance(L2PcInstance player, String template)
{
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
{
if (!(world instanceof JGH1World))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return;
}
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
return;
}
// New instance
world = new JGH1World();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(INSTANCEID);
world.setStatus(0);
((JGH1World) world).storeTime = System.currentTimeMillis();
InstanceManager.getInstance().addWorld(world);
_log.info("Jinia Guild Hideout started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// teleport players
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
world.addAllowed(player.getObjectId());
}
public static void main(String[] args)
{
new JiniaGuildHideout1();
}
}

View File

@@ -0,0 +1,101 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.JiniaGuildHideout2;
import quests.Q10285_MeetingSirra.Q10285_MeetingSirra;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
* Jinia Guild Hideout instance zone.
* @author Adry_85
*/
public final class JiniaGuildHideout2 extends Quest
{
protected class JGH2World extends InstanceWorld
{
long storeTime = 0;
}
private static final int TEMPLATE_ID = 141;
// NPC
private static final int RAFFORTY = 32020;
// Location
private static final Location START_LOC = new Location(-23530, -8963, -5413, 0, 0);
private JiniaGuildHideout2()
{
super(-1, JiniaGuildHideout2.class.getSimpleName(), "instances");
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, "JiniaGuildHideout2.xml", START_LOC);
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
}
protected int enterInstance(L2PcInstance player, String template, Location loc)
{
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
{
if (!(world instanceof JGH2World))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return 0;
}
teleportPlayer(player, loc, world.getInstanceId(), false);
return 0;
}
// New instance
world = new JGH2World();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
world.setStatus(0);
((JGH2World) world).storeTime = System.currentTimeMillis();
InstanceManager.getInstance().addWorld(world);
_log.info("Jinia Guild Hideout started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// teleport players
teleportPlayer(player, loc, world.getInstanceId(), false);
world.addAllowed(player.getObjectId());
return world.getInstanceId();
}
public static void main(String[] args)
{
new JiniaGuildHideout2();
}
}

View File

@@ -0,0 +1,101 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.JiniaGuildHideout3;
import quests.Q10286_ReunionWithSirra.Q10286_ReunionWithSirra;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
* Jinia Guild Hideout instance zone.
* @author Adry_85
*/
public final class JiniaGuildHideout3 extends Quest
{
protected class JGH2World extends InstanceWorld
{
long storeTime = 0;
}
private static final int TEMPLATE_ID = 145;
// NPC
private static final int RAFFORTY = 32020;
// Location
private static final Location START_LOC = new Location(-23530, -8963, -5413, 0, 0);
private JiniaGuildHideout3()
{
super(-1, JiniaGuildHideout3.class.getSimpleName(), "instances");
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, "JiniaGuildHideout3.xml", START_LOC);
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
}
protected int enterInstance(L2PcInstance player, String template, Location loc)
{
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
{
if (!(world instanceof JGH2World))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return 0;
}
teleportPlayer(player, loc, world.getInstanceId(), false);
return 0;
}
// New instance
world = new JGH2World();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
world.setStatus(0);
((JGH2World) world).storeTime = System.currentTimeMillis();
InstanceManager.getInstance().addWorld(world);
_log.info("Jinia Guild Hideout started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// teleport players
teleportPlayer(player, loc, world.getInstanceId(), false);
world.addAllowed(player.getObjectId());
return world.getInstanceId();
}
public static void main(String[] args)
{
new JiniaGuildHideout3();
}
}

View File

@@ -0,0 +1,101 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.JiniaGuildHideout4;
import quests.Q10287_StoryOfThoseLeft.Q10287_StoryOfThoseLeft;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
* Jinia Guild Hideout instance zone.
* @author Adry_85
*/
public final class JiniaGuildHideout4 extends Quest
{
protected class JGH2World extends InstanceWorld
{
long storeTime = 0;
}
private static final int TEMPLATE_ID = 146;
// NPC
private static final int RAFFORTY = 32020;
// Location
private static final Location START_LOC = new Location(-23530, -8963, -5413, 0, 0);
private JiniaGuildHideout4()
{
super(-1, JiniaGuildHideout4.class.getSimpleName(), "instances");
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, "JiniaGuildHideout4.xml", START_LOC);
qs.setCond(2, true);
}
return super.onTalk(npc, talker);
}
protected int enterInstance(L2PcInstance player, String template, Location loc)
{
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
{
if (!(world instanceof JGH2World))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return 0;
}
teleportPlayer(player, loc, world.getInstanceId(), false);
return 0;
}
// New instance
world = new JGH2World();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
world.setStatus(0);
((JGH2World) world).storeTime = System.currentTimeMillis();
InstanceManager.getInstance().addWorld(world);
_log.info("Jinia Guild Hideout started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// teleport players
teleportPlayer(player, loc, world.getInstanceId(), false);
world.addAllowed(player.getObjectId());
return world.getInstanceId();
}
public static void main(String[] args)
{
new JiniaGuildHideout4();
}
}

View File

@@ -0,0 +1,7 @@
<html><body>Captain Lucas:<br>
What? You want to enter Kamaloka?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Kamaloka 3">"I want to enter Kamaloka (Hall of the Abyss) (Lv. 33)."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Kamaloka 4">"I want to enter Kamaloka (Hall of the Abyss) (Lv. 36)."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Kamaloka">"I want to enter Near Kamaloka (Hall of the Abyss) (Lv. 36) (250 PC points required)."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Kamaloka 5">"I want to enter Kamaloka (Labyrinth of the Abyss) (Lv. 39)."</Button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Captain Mouen:<br>
What? You want to enter Kamaloka?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Kamaloka 9">"I want to enter Kamaloka (Hall of the Abyss) (Lv. 53)."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Kamaloka 10">"I want to enter Kamaloka (Hall of the Abyss) (Lv. 56)."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Kamaloka">"I want to enter Near Kamaloka (Hall of the Abyss) (Lv. 56) (250 PC points required)."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Kamaloka 11">"I want to enter Kamaloka (Labyrinth of the Abyss) (Lv. 59)."</Button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Captain Bathis:<br>
What? You want to enter Kamaloka?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bbypass -h Quest Kamaloka 0">"I want to enter Kamaloka (Hall of the Abyss) (Lv. 23)."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Kamaloka 1">"I want to enter Kamaloka (Hall of the Abyss) (Lv. 26)."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Kamaloka">"I want to enter Near Kamaloka (Hall of the Abyss) (Lv. 26) (250 PC points required)."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Kamaloka 2">"I want to enter Kamaloka (Labyrinth of the Abyss) (Lv. 29)."</Button>
</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,169 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.LibraryOfSages;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Library of Sages instance zone.
* @author Adry_85
*/
public final class LibraryOfSages extends AbstractNpcAI
{
protected class LoSWorld extends InstanceWorld
{
protected L2Npc elcadia = null;
protected long storeTime = 0;
}
private static final int TEMPLATE_ID = 156;
// NPCs
private static final int SOPHIA1 = 32596;
private static final int PILE_OF_BOOKS1 = 32809;
private static final int PILE_OF_BOOKS2 = 32810;
private static final int PILE_OF_BOOKS3 = 32811;
private static final int PILE_OF_BOOKS4 = 32812;
private static final int PILE_OF_BOOKS5 = 32813;
private static final int SOPHIA2 = 32861;
private static final int SOPHIA3 = 32863;
private static final int ELCADIA_INSTANCE = 32785;
// Locations
private static final Location START_LOC = new Location(37063, -49813, -1128);
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
};
private LibraryOfSages()
{
super(LibraryOfSages.class.getSimpleName(), "instances");
addFirstTalkId(SOPHIA2, ELCADIA_INSTANCE, PILE_OF_BOOKS1, PILE_OF_BOOKS2, PILE_OF_BOOKS3, PILE_OF_BOOKS4, PILE_OF_BOOKS5);
addStartNpc(SOPHIA1, SOPHIA2, SOPHIA3);
addTalkId(SOPHIA1, SOPHIA2, SOPHIA3);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if (!(tmpworld instanceof LoSWorld))
{
return null;
}
LoSWorld world = (LoSWorld) tmpworld;
switch (event)
{
case "TELEPORT2":
{
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, Say2.NPC_ALL, 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, "LibraryOfSages.xml");
return super.onTalk(npc, talker);
}
protected int enterInstance(L2PcInstance player, String template)
{
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
{
if (!(world instanceof LoSWorld))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return 0;
}
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
spawnNPC(player, (LoSWorld) world);
return 0;
}
// New instance
world = new LoSWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
world.setStatus(0);
((LoSWorld) world).storeTime = System.currentTimeMillis();
InstanceManager.getInstance().addWorld(world);
_log.info("Library of Sages started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// teleport players
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
world.addAllowed(player.getObjectId());
spawnNPC(player, (LoSWorld) world);
return world.getInstanceId();
}
protected void spawnNPC(L2PcInstance player, LoSWorld world)
{
final L2Npc npc = addSpawn(ELCADIA_INSTANCE, player.getX(), player.getY(), player.getZ(), 0, false, 0, false, player.getInstanceId());
world.elcadia = npc;
startQuestTimer("FOLLOW", 3000, npc, player);
}
public static void main(String[] args)
{
new LibraryOfSages();
}
}

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,263 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.MithrilMine;
import quests.Q10284_AcquisitionOfDivineSword.Q10284_AcquisitionOfDivineSword;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Mithril Mine instance zone.
* @author Adry_85
*/
public final class MithrilMine extends AbstractNpcAI
{
protected class MMWorld extends InstanceWorld
{
long storeTime = 0;
int _count = 0;
}
private static final int TEMPLATE_ID = 138;
// 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)
};
private 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, Say2.NPC_ALL, 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);
qs.giveAdena(296425, true);
qs.addExpAndSp(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, Say2.NPC_ALL, 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 (!qs.hasQuestItems(COLD_RESISTANCE_POTION))
{
qs.giveItems(COLD_RESISTANCE_POTION, 1);
}
qs.setCond(4, true);
enterInstance(talker, "MithrilMine.xml", START_LOC);
}
break;
}
case KEGOR:
{
final QuestState qs = talker.getQuestState(Q10284_AcquisitionOfDivineSword.class.getSimpleName());
if ((qs != null) && qs.isMemoState(2) && qs.hasQuestItems(COLD_RESISTANCE_POTION) && npc.isScriptValue(0))
{
qs.takeItems(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);
}
protected int enterInstance(L2PcInstance player, String template, Location loc)
{
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
{
if (!(world instanceof MMWorld))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return 0;
}
teleportPlayer(player, loc, world.getInstanceId(), false);
return 0;
}
// New instance
world = new MMWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
world.setStatus(0);
((MMWorld) world).storeTime = System.currentTimeMillis();
InstanceManager.getInstance().addWorld(world);
_log.info("Mithril Mine started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// teleport players
teleportPlayer(player, loc, world.getInstanceId(), false);
world.addAllowed(player.getObjectId());
return world.getInstanceId();
}
public static void main(String[] args)
{
new MithrilMine();
}
}

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,243 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.MonasteryOfSilence1;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Monastery of Silence instance zone.
* @author Adry_85
*/
public final class MonasteryOfSilence1 extends AbstractNpcAI
{
protected static final class MoSWorld extends InstanceWorld
{
protected L2Npc elcadia = null;
}
private static final int TEMPLATE_ID = 151;
// 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;
// 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
};
// Buffs
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
};
private MonasteryOfSilence1()
{
super(MonasteryOfSilence1.class.getSimpleName(), "instances");
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);
}
private void enterInstance(L2PcInstance player, String template)
{
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world != null)
{
if (!(world instanceof MoSWorld))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
}
else
{
// Teleport player.
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
spawnNPC(player, (MoSWorld) world);
removeBuffs(player);
}
}
else
{
// New instance.
world = new MoSWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
world.setStatus(0);
InstanceManager.getInstance().addWorld(world);
_log.info("Monastery of Silence started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// Teleport players.
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
spawnNPC(player, (MoSWorld) world);
removeBuffs(player);
world.addAllowed(player.getObjectId());
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if (!(tmpworld instanceof MoSWorld))
{
return null;
}
MoSWorld world = (MoSWorld) tmpworld;
switch (event)
{
case "TELE2":
{
teleportPlayer(player, CENTRAL_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(CENTRAL_ROOM_LOC.getX(), CENTRAL_ROOM_LOC.getY(), CENTRAL_ROOM_LOC.getZ(), 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.getX(), BACK_LOC.getY(), BACK_LOC.getZ(), 0, world.getInstanceId());
break;
}
case "EAST":
{
teleportPlayer(player, EAST_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(EAST_WATCHERS_ROOM_LOC.getX(), EAST_WATCHERS_ROOM_LOC.getY(), EAST_WATCHERS_ROOM_LOC.getZ(), 0, world.getInstanceId());
break;
}
case "WEST":
{
teleportPlayer(player, WEST_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(WEST_WATCHERS_ROOM_LOC.getX(), WEST_WATCHERS_ROOM_LOC.getY(), WEST_WATCHERS_ROOM_LOC.getZ(), 0, world.getInstanceId());
break;
}
case "NORTH":
{
teleportPlayer(player, NORTH_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(NORTH_WATCHERS_ROOM_LOC.getX(), NORTH_WATCHERS_ROOM_LOC.getY(), NORTH_WATCHERS_ROOM_LOC.getZ(), 0, world.getInstanceId());
break;
}
case "SOUTH":
{
teleportPlayer(player, SOUTH_WATCHERS_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(SOUTH_WATCHERS_ROOM_LOC.getX(), SOUTH_WATCHERS_ROOM_LOC.getY(), SOUTH_WATCHERS_ROOM_LOC.getZ(), 0, world.getInstanceId());
break;
}
case "CENTER":
{
teleportPlayer(player, CENTRAL_ROOM_LOC, world.getInstanceId());
world.elcadia.teleToLocation(CENTRAL_ROOM_LOC.getX(), CENTRAL_ROOM_LOC.getY(), CENTRAL_ROOM_LOC.getZ(), 0, world.getInstanceId());
break;
}
case "FOLLOW":
{
npc.setIsRunning(true);
npc.getAI().startFollow(player);
if (player.isInCombat())
{
broadcastNpcSay(npc, Say2.NPC_ALL, 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, Say2.NPC_ALL, 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, "MonasteryOfSilence.xml");
}
return super.onTalk(npc, talker);
}
private static final void removeBuffs(L2Character ch)
{
ch.stopAllEffectsExceptThoseThatLastThroughDeath();
if (ch.hasSummon())
{
ch.getSummon().stopAllEffectsExceptThoseThatLastThroughDeath();
}
}
protected void spawnNPC(L2PcInstance player, MoSWorld world)
{
final L2Npc npc = addSpawn(ELCADIA_INSTANCE, player.getX(), player.getY(), player.getZ(), 0, false, 0, false, player.getInstanceId());
world.elcadia = npc;
startQuestTimer("FOLLOW", 3000, npc, player);
}
public static void main(String[] args)
{
new MonasteryOfSilence1();
}
}

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 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.NornilsGarden;
import com.l2jserver.gameserver.datatables.SkillData;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.L2Party;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.Instance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.skills.Skill;
import com.l2jserver.gameserver.model.zone.L2ZoneType;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.util.Util;
/**
* Nornil's Garden instance zone.
* @author Gnacik
* @version 2010-10-15 Based on official server Naia
*/
public final class NornilsGarden extends Quest
{
protected class NornilsWorld extends InstanceWorld
{
public L2Npc first_npc = null;
public boolean spawned_1 = false;
public boolean spawned_2 = false;
public boolean spawned_3 = false;
public boolean spawned_4 = false;
}
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 _garden_guard = 32330;
private static final int[] _final_gates =
{
32260,
32261,
32262
};
private static final Location SPAWN_PPL = new Location(-111184, 74540, -12430);
private static final Location EXIT_PPL = new Location(-74058, 52040, -3680);
private static final int[][] _auto_gates =
{
// Warriors gate
{
20110,
16200001
},
// Midway gate
{
20111,
16200004
},
// Gate
{
20112,
16200013
}
};
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);
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 removeBuffs(L2Character ch)
{
ch.stopAllEffectsExceptThoseThatLastThroughDeath();
}
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);
}
}
private NornilsGarden()
{
super(-1, NornilsGarden.class.getSimpleName(), "instances");
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)
{
removeBuffs(player);
giveBuffs(player);
if (player.hasSummon())
{
removeBuffs(player.getSummon());
giveBuffs(player.getSummon());
}
super.teleportPlayer(player, loc, instanceId);
}
private void exitInstance(L2PcInstance player)
{
InstanceWorld inst = InstanceManager.getInstance().getWorld(player.getInstanceId());
if (inst instanceof NornilsWorld)
{
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_INSTANT_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))
{
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
Instance inst = InstanceManager.getInstance().getInstance(world.getInstanceId());
if (inst != null)
{
teleportPlayer(player, SPAWN_PPL, world.getInstanceId());
}
return null;
}
// Creating new instance
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.setSpawnLoc(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)
{
InstanceWorld inst = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (inst instanceof NornilsWorld)
{
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)
{
InstanceWorld inst = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if (inst instanceof NornilsWorld)
{
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)
{
InstanceWorld inst = InstanceManager.getInstance().getWorld(cha.getInstanceId());
if (inst instanceof NornilsWorld)
{
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)
{
InstanceWorld inst = InstanceManager.getInstance().getWorld(cha.getInstanceId());
if (inst instanceof NornilsWorld)
{
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");
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)
{
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)
{
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)
{
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))
{
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)
{
_kamael = true;
}
}
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())
{
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;
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"))
{
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()))
{
return npc.getId() + "-01.html";
}
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)
{
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);
}
public static void main(String[] args)
{
new NornilsGarden();
}
}

View File

@@ -0,0 +1,3 @@
<html><body>Devil's Isle Survivor:<br>
Keep your eyes open for someone who can help you there. Good luck -- we're all counting on you!<br>
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Devil's Isle Survivor:<br>
Remember what needs to be done!<br>
</body></html>

View File

@@ -0,0 +1,335 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.PailakaDevilsLegacy;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import quests.Q00129_PailakaDevilsLegacy.Q00129_PailakaDevilsLegacy;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.zone.L2ZoneType;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
* Pailaka Devil's Legacy Instance zone.
* @author St3eT
*/
public final class PailakaDevilsLegacy extends AbstractNpcAI
{
protected class DIWorld extends InstanceWorld
{
L2Attackable _lematanNpc = null;
List<L2Attackable> _followerslist = new CopyOnWriteArrayList<>();
}
// NPCs
private static final int LEMATAN = 18633; // Lematan
private static final int SURVIVOR = 32498; // Devil's Isle Survivor
private static final int FOLLOWERS = 18634; // Lematan's Follower
private static final int POWDER_KEG = 18622; // Powder Keg
private static final int TREASURE_BOX = 32495; // Treasure Chest
private static final int ADVENTURER2 = 32511; // Dwarf Adventurer
// Items
private static final int ANTIDOTE_POTION = 13048; // Pailaka Antidote
private static final int DIVINE_POTION = 13049; // Divine Soul
private static final int PAILAKA_KEY = 13150; // Pailaka All-Purpose Key
private static final int SHIELD = 13032; // Pailaka Instant Shield
private static final int DEFENCE_POTION = 13059; // Long-Range Defense Increasing Potion
private static final int HEALING_POTION = 13033; // Quick Healing Potion
// Skills
private static final SkillHolder ENERGY = new SkillHolder(5712, 1); // Energy Ditch
private static final SkillHolder BOOM = new SkillHolder(5714, 1); // Boom Up
private static final SkillHolder AV_TELEPORT = new SkillHolder(4671, 1); // AV - Teleport
// Locations
private static final Location TELEPORT = new Location(76427, -219045, -3780);
private static final Location LEMATAN_SPAWN = new Location(88108, -209252, -3744, 6425);
private static final Location LEMATAN_PORT_POINT = new Location(86116, -209117, -3774);
private static final Location LEMATAN_PORT = new Location(85000, -208699, -3336);
private static final Location ADVENTURER_LOC = new Location(84983, -208736, -3336, 49915);
private static final Location[] FOLLOWERS_LOC =
{
new Location(85067, -208943, -3336, 20106),
new Location(84904, -208944, -3336, 10904),
new Location(85062, -208538, -3336, 44884),
new Location(84897, -208542, -3336, 52973),
new Location(84808, -208633, -3339, 65039),
new Location(84808, -208856, -3339, 0),
new Location(85144, -208855, -3341, 33380),
new Location(85139, -208630, -3339, 31777),
};
// Misc
private static final int TEMPLATE_ID = 44;
private static final int ZONE = 20109;
private PailakaDevilsLegacy()
{
super(PailakaDevilsLegacy.class.getSimpleName(), "instances");
addTalkId(SURVIVOR);
addAttackId(POWDER_KEG, TREASURE_BOX, LEMATAN);
addKillId(LEMATAN);
addSpawnId(FOLLOWERS);
addEnterZoneId(ZONE);
addMoveFinishedId(LEMATAN);
}
@Override
public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
String htmltext = null;
if (event.equals("enter"))
{
final QuestState qs = player.getQuestState(Q00129_PailakaDevilsLegacy.class.getSimpleName());
enterInstance(player, "PailakaDevilsLegacy.xml");
if (qs.isCond(1))
{
qs.setCond(2, true);
htmltext = "32498-01.htm";
}
else
{
htmltext = "32498-02.htm";
}
}
else if ((tmpworld != null) && (tmpworld instanceof DIWorld))
{
final DIWorld world = (DIWorld) tmpworld;
switch (event)
{
case "FOLLOWER_CAST":
{
if ((world._lematanNpc != null) && !world._lematanNpc.isDead())
{
for (L2Attackable follower : world._followerslist)
{
follower.setTarget(world._lematanNpc);
follower.doCast(ENERGY.getSkill());
}
startQuestTimer("FOLLOWER_CAST", 15000, world._lematanNpc, null);
}
break;
}
case "LEMATAN_TELEPORT":
{
((L2Attackable) npc).clearAggroList();
npc.disableCoreAI(false);
npc.teleToLocation(LEMATAN_PORT);
npc.getVariables().set("ON_SHIP", 1);
npc.getSpawn().setLocation(LEMATAN_PORT);
for (Location loc : FOLLOWERS_LOC)
{
final L2Attackable follower = (L2Attackable) addSpawn(FOLLOWERS, loc, false, 0, false, world.getInstanceId());
follower.disableCoreAI(true);
follower.setIsImmobilized(true);
world._followerslist.add(follower);
}
startQuestTimer("FOLLOWER_CAST", 4000, world._lematanNpc, null);
break;
}
case "TELEPORT":
{
player.teleToLocation(TELEPORT);
break;
}
case "DELETE":
{
npc.deleteMe();
break;
}
}
}
return htmltext;
}
@Override
public final String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if ((tmpworld != null) && (tmpworld instanceof DIWorld))
{
switch (npc.getId())
{
case POWDER_KEG:
{
if ((damage > 0) && npc.isScriptValue(0))
{
for (L2Character characters : npc.getKnownList().getKnownCharactersInRadius(600))
{
if ((characters != null) && characters.isMonster())
{
final L2Attackable monster = (L2Attackable) characters;
monster.addDamageHate(npc, 0, 999);
monster.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
monster.reduceCurrentHp(500 + getRandom(0, 200), npc, BOOM.getSkill());
}
}
npc.doCast(BOOM.getSkill());
npc.setScriptValue(1);
startQuestTimer("DELETE", 2000, npc, null);
}
break;
}
case LEMATAN:
{
if (npc.isScriptValue(0) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.5)))
{
npc.disableCoreAI(true);
npc.setScriptValue(1);
npc.setIsRunning(true);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, LEMATAN_PORT_POINT);
}
break;
}
case TREASURE_BOX:
{
if (npc.isScriptValue(0))
{
switch (getRandom(7))
{
case 0:
case 1:
{
npc.dropItem(attacker, ANTIDOTE_POTION, getRandom(1, 10));
break;
}
case 2:
{
npc.dropItem(attacker, DIVINE_POTION, getRandom(1, 5));
break;
}
case 3:
{
npc.dropItem(attacker, PAILAKA_KEY, getRandom(1, 2));
break;
}
case 4:
{
npc.dropItem(attacker, DEFENCE_POTION, getRandom(1, 7));
break;
}
case 5:
{
npc.dropItem(attacker, SHIELD, getRandom(1, 10));
break;
}
case 6:
{
npc.dropItem(attacker, HEALING_POTION, getRandom(1, 10));
break;
}
}
npc.setScriptValue(1);
startQuestTimer("DELETE", 3000, npc, attacker);
}
break;
}
}
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@Override
public final String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
if ((tmpworld != null) && (tmpworld instanceof DIWorld))
{
final DIWorld world = (DIWorld) tmpworld;
if (world._followerslist != null)
{
for (L2Npc _follower : world._followerslist)
{
_follower.deleteMe();
}
world._followerslist.clear();
}
addSpawn(ADVENTURER2, ADVENTURER_LOC, false, 0, false, npc.getInstanceId());
}
return super.onKill(npc, player, isSummon);
}
@Override
public String onEnterZone(L2Character character, L2ZoneType zone)
{
if ((character.isPlayer()) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
{
final InstanceWorld world = InstanceManager.getInstance().getWorld(character.getInstanceId());
if ((world != null) && (world.getTemplateId() == TEMPLATE_ID))
{
startQuestTimer("TELEPORT", 1000, ((DIWorld) world)._lematanNpc, (L2PcInstance) character);
}
}
return super.onEnterZone(character, zone);
}
@Override
public void onMoveFinished(L2Npc npc)
{
if (npc.getLocation() == LEMATAN_PORT_POINT)
{
npc.doCast(AV_TELEPORT.getSkill());
startQuestTimer("LEMATAN_TELEPORT", 2000, npc, null);
}
}
private void enterInstance(L2PcInstance player, String template)
{
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world != null)
{
if (world instanceof DIWorld)
{
teleportPlayer(player, TELEPORT, world.getInstanceId());
return;
}
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return;
}
world = new DIWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
InstanceManager.getInstance().addWorld(world);
world.addAllowed(player.getObjectId());
teleportPlayer(player, TELEPORT, world.getInstanceId());
((DIWorld) world)._lematanNpc = (L2Attackable) addSpawn(LEMATAN, LEMATAN_SPAWN, false, 0, false, world.getInstanceId());
_log.info("Pailaka Devils Legacy" + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
}
public static void main(String[] args)
{
new PailakaDevilsLegacy();
}
}

View File

@@ -0,0 +1,226 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package instances.PailakaSongOfIceAndFire;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.zone.L2ZoneType;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Pailaka Song of Ice and Fire Instance zone.
* @author Gnacik, St3eT
*/
public final class PailakaSongOfIceAndFire extends AbstractNpcAI
{
protected class PSoIWorld extends InstanceWorld
{
}
// NPCs
private static final int ADLER1 = 32497;
private static final int GARGOS = 18607;
private static final int BLOOM = 18616;
private static final int BOTTLE = 32492;
private static final int BRAZIER = 32493;
// Items
private static final int FIRE_ENHANCER = 13040;
private static final int WATER_ENHANCER = 13041;
private static final int SHIELD_POTION = 13032;
private static final int HEAL_POTION = 13033;
// Location
private static final Location TELEPORT = new Location(-52875, 188232, -4696);
// Misc
private static final int TEMPLATE_ID = 43;
private static final int ZONE = 20108;
private PailakaSongOfIceAndFire()
{
super(PailakaSongOfIceAndFire.class.getSimpleName(), "instances");
addStartNpc(ADLER1);
addTalkId(ADLER1);
addAttackId(BOTTLE, BRAZIER);
addExitZoneId(ZONE);
addSeeCreatureId(GARGOS);
addSpawnId(BLOOM);
addKillId(BLOOM);
}
private void enterInstance(L2PcInstance player, String template)
{
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (world != null)
{
if (world instanceof PSoIWorld)
{
teleportPlayer(player, TELEPORT, world.getInstanceId());
return;
}
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return;
}
world = new PSoIWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
InstanceManager.getInstance().addWorld(world);
world.addAllowed(player.getObjectId());
teleportPlayer(player, TELEPORT, world.getInstanceId());
_log.info("Pailaka Song of Ice and Fire" + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
}
@Override
public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
switch (event)
{
case "enter":
{
enterInstance(player, "PailakaSongOfIceAndFire.xml");
break;
}
case "GARGOS_LAUGH":
{
broadcastNpcSay(npc, Say2.NPC_SHOUT, NpcStringId.OHH_OH_OH);
break;
}
case "TELEPORT":
{
teleportPlayer(player, TELEPORT, player.getInstanceId());
break;
}
case "DELETE":
{
if (npc != null)
{
npc.deleteMe();
}
break;
}
case "BLOOM_TIMER":
{
startQuestTimer("BLOOM_TIMER2", getRandom(2, 4) * 60 * 1000, npc, null);
break;
}
case "BLOOM_TIMER2":
{
npc.setInvisible(!npc.isInvisible());
startQuestTimer("BLOOM_TIMER", 5000, npc, null);
break;
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public final String onAttack(L2Npc npc, L2PcInstance player, int damage, boolean isSummon)
{
if ((damage > 0) && npc.isScriptValue(0))
{
switch (getRandom(6))
{
case 0:
{
if (npc.getId() == BOTTLE)
{
npc.dropItem(player, WATER_ENHANCER, getRandom(1, 6));
}
break;
}
case 1:
{
if (npc.getId() == BRAZIER)
{
npc.dropItem(player, FIRE_ENHANCER, getRandom(1, 6));
}
break;
}
case 2:
case 3:
{
npc.dropItem(player, SHIELD_POTION, getRandom(1, 10));
break;
}
case 4:
case 5:
{
npc.dropItem(player, HEAL_POTION, getRandom(1, 10));
break;
}
}
npc.setScriptValue(1);
startQuestTimer("DELETE", 3000, npc, null);
}
return super.onAttack(npc, player, damage, isSummon);
}
@Override
public final String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
npc.dropItem(player, getRandomBoolean() ? SHIELD_POTION : HEAL_POTION, getRandom(1, 7));
return super.onKill(npc, player, isSummon);
}
@Override
public String onExitZone(L2Character character, L2ZoneType zone)
{
if ((character.isPlayer()) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
{
final InstanceWorld world = InstanceManager.getInstance().getWorld(character.getInstanceId());
if ((world != null) && (world.getTemplateId() == TEMPLATE_ID))
{
startQuestTimer("TELEPORT", 1000, null, (L2PcInstance) character);
}
}
return super.onExitZone(character, zone);
}
@Override
public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon)
{
if (npc.isScriptValue(0) && creature.isPlayer())
{
npc.setScriptValue(1);
startQuestTimer("GARGOS_LAUGH", 1000, npc, creature.getActingPlayer());
}
return super.onSeeCreature(npc, creature, isSummon);
}
@Override
public String onSpawn(L2Npc npc)
{
npc.setInvisible(true);
startQuestTimer("BLOOM_TIMER", 1000, npc, null);
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new PailakaSongOfIceAndFire();
}
}

View File

@@ -0,0 +1,3 @@
<html><body>Teleporter Light of Dawn:<br>
"Confirmed. Teleportation initiated."
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Teleporter Light of Dawn:<br>
"Entry is only permitted to those carrying <font color="LEVEL">valid ID cards</font>."
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Code Input Device:<br>
You have entered the code correctly.<br>
The door opens.
</body></html>

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