Moved door methods from AbstractScript to InstanceWorld.
This commit is contained in:
@@ -1046,8 +1046,8 @@ public class SeedOfDestruction extends AbstractNpcAI
|
|||||||
spawn(world, ENTRANCE_GROUND_SPAWNS_1, true, false);
|
spawn(world, ENTRANCE_GROUND_SPAWNS_1, true, false);
|
||||||
spawn(world, ENTRANCE_GROUND_SPAWNS_2, false, false);
|
spawn(world, ENTRANCE_GROUND_SPAWNS_2, false, false);
|
||||||
spawn(world, ENTRANCE_UPPER_SPAWNS, false, true);
|
spawn(world, ENTRANCE_UPPER_SPAWNS, false, true);
|
||||||
closeDoor(SCOUTPASS_DOOR, world.getInstanceId());
|
world.closeDoor(SCOUTPASS_DOOR);
|
||||||
closeDoor(THRONE_DOOR, world.getInstanceId());
|
world.closeDoor(THRONE_DOOR);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
@@ -1056,7 +1056,7 @@ public class SeedOfDestruction extends AbstractNpcAI
|
|||||||
sendScreenMessage(world, message1);
|
sendScreenMessage(world, message1);
|
||||||
for (int i : ENTRANCE_ROOM_DOORS)
|
for (int i : ENTRANCE_ROOM_DOORS)
|
||||||
{
|
{
|
||||||
openDoor(i, world.getInstanceId());
|
world.openDoor(i);
|
||||||
}
|
}
|
||||||
spawn(world, SQUARE_SPAWNS_STATIC, false, true);
|
spawn(world, SQUARE_SPAWNS_STATIC, false, true);
|
||||||
spawn(world, SQUARE_SPAWNS_MAIN, true, false);
|
spawn(world, SQUARE_SPAWNS_MAIN, true, false);
|
||||||
@@ -1074,7 +1074,7 @@ public class SeedOfDestruction extends AbstractNpcAI
|
|||||||
sendScreenMessage(world, message2);
|
sendScreenMessage(world, message2);
|
||||||
for (int i : SQUARE_DOORS)
|
for (int i : SQUARE_DOORS)
|
||||||
{
|
{
|
||||||
openDoor(i, world.getInstanceId());
|
world.openDoor(i);
|
||||||
}
|
}
|
||||||
spawn(world, CORRIDOR_SPAWNS_UPPER, false, true);
|
spawn(world, CORRIDOR_SPAWNS_UPPER, false, true);
|
||||||
spawn(world, CORRIDOR_SPAWNS_GROUND, false, false);
|
spawn(world, CORRIDOR_SPAWNS_GROUND, false, false);
|
||||||
@@ -1083,7 +1083,7 @@ public class SeedOfDestruction extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
case 5:
|
case 5:
|
||||||
{
|
{
|
||||||
openDoor(SCOUTPASS_DOOR, world.getInstanceId());
|
world.openDoor(SCOUTPASS_DOOR);
|
||||||
spawn(world, SQUARE_SPAWNS_HALF, false, false);
|
spawn(world, SQUARE_SPAWNS_HALF, false, false);
|
||||||
spawn(world, SCOUTPASS_SPAWNS_UPPER, false, true);
|
spawn(world, SCOUTPASS_SPAWNS_UPPER, false, true);
|
||||||
spawn(world, SCOUTPASS_SPAWNS_GROUND, false, false);
|
spawn(world, SCOUTPASS_SPAWNS_GROUND, false, false);
|
||||||
@@ -1098,7 +1098,7 @@ public class SeedOfDestruction extends AbstractNpcAI
|
|||||||
case 6:
|
case 6:
|
||||||
{
|
{
|
||||||
runThrone(world);
|
runThrone(world);
|
||||||
openDoor(THRONE_DOOR, world.getInstanceId());
|
world.openDoor(THRONE_DOOR);
|
||||||
spawn(world, FORT_PORTALS, false, true);
|
spawn(world, FORT_PORTALS, false, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,7 @@ package ai.areas.PaganTemple.PaganTeleporters;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
|
||||||
import com.l2jmobius.gameserver.model.Location;
|
import com.l2jmobius.gameserver.model.Location;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
@@ -67,13 +68,13 @@ public final class PaganTeleporters extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
case "Close_Door1":
|
case "Close_Door1":
|
||||||
{
|
{
|
||||||
closeDoor(19160001, 0);
|
DoorData.getInstance().getDoor(19160001).closeMe();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "Close_Door2":
|
case "Close_Door2":
|
||||||
{
|
{
|
||||||
closeDoor(19160010, 0);
|
DoorData.getInstance().getDoor(19160010).closeMe();
|
||||||
closeDoor(19160011, 0);
|
DoorData.getInstance().getDoor(19160011).closeMe();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,13 +102,13 @@ public final class PaganTeleporters extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
return "noItem.htm";
|
return "noItem.htm";
|
||||||
}
|
}
|
||||||
openDoor(19160001, 0);
|
DoorData.getInstance().getDoor(19160001).openMe();
|
||||||
startQuestTimer("Close_Door1", 10000, null, null);
|
startQuestTimer("Close_Door1", 10000, null, null);
|
||||||
return "FadedMark.htm";
|
return "FadedMark.htm";
|
||||||
}
|
}
|
||||||
case 32035:
|
case 32035:
|
||||||
{
|
{
|
||||||
openDoor(19160001, 0);
|
DoorData.getInstance().getDoor(19160001).openMe();
|
||||||
startQuestTimer("Close_Door1", 10000, null, null);
|
startQuestTimer("Close_Door1", 10000, null, null);
|
||||||
return "FadedMark.htm";
|
return "FadedMark.htm";
|
||||||
}
|
}
|
||||||
@@ -117,15 +118,15 @@ public final class PaganTeleporters extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
return "noMark.htm";
|
return "noMark.htm";
|
||||||
}
|
}
|
||||||
|
DoorData.getInstance().getDoor(19160010).openMe();
|
||||||
|
DoorData.getInstance().getDoor(19160011).openMe();
|
||||||
startQuestTimer("Close_Door2", 10000, null, null);
|
startQuestTimer("Close_Door2", 10000, null, null);
|
||||||
openDoor(19160010, 0);
|
return "world.openDoor.htm";
|
||||||
openDoor(19160011, 0);
|
|
||||||
return "openDoor.htm";
|
|
||||||
}
|
}
|
||||||
case 32037:
|
case 32037:
|
||||||
{
|
{
|
||||||
openDoor(19160010, 0);
|
DoorData.getInstance().getDoor(19160010).openMe();
|
||||||
openDoor(19160011, 0);
|
DoorData.getInstance().getDoor(19160011).openMe();
|
||||||
startQuestTimer("Close_Door2", 10000, null, null);
|
startQuestTimer("Close_Door2", 10000, null, null);
|
||||||
return "FadedMark.htm";
|
return "FadedMark.htm";
|
||||||
}
|
}
|
||||||
|
@@ -751,15 +751,15 @@ public final class CrystalCaverns extends AbstractInstance
|
|||||||
{
|
{
|
||||||
world.setStatus(1);
|
world.setStatus(1);
|
||||||
runFirst(world);
|
runFirst(world);
|
||||||
openDoor(DOOR1, world.getInstanceId());
|
world.openDoor(DOOR1);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void runCoral(CCWorld world)
|
protected void runCoral(CCWorld world)
|
||||||
{
|
{
|
||||||
world.setStatus(1);
|
world.setStatus(1);
|
||||||
runHall(world);
|
runHall(world);
|
||||||
openDoor(DOOR2, world.getInstanceId());
|
world.openDoor(DOOR2);
|
||||||
openDoor(DOOR5, world.getInstanceId());
|
world.openDoor(DOOR5);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void runHall(CCWorld world)
|
protected void runHall(CCWorld world)
|
||||||
@@ -821,8 +821,8 @@ public final class CrystalCaverns extends AbstractInstance
|
|||||||
|
|
||||||
addSpawn(DARNEL, 152759, 145949, -12588, 21592, false, 0, false, world.getInstanceId());
|
addSpawn(DARNEL, 152759, 145949, -12588, 21592, false, 0, false, world.getInstanceId());
|
||||||
// TODO: missing traps
|
// TODO: missing traps
|
||||||
openDoor(24220005, world.getInstanceId());
|
world.openDoor(24220005);
|
||||||
openDoor(24220006, world.getInstanceId());
|
world.openDoor(24220006);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void runSteamRooms(CCWorld world, int[][] spawnList, int status)
|
protected void runSteamRooms(CCWorld world, int[][] spawnList, int status)
|
||||||
@@ -1161,8 +1161,8 @@ public final class CrystalCaverns extends AbstractInstance
|
|||||||
{
|
{
|
||||||
startQuestTimer("spawnGuards", SPAWN[0], npc, null);
|
startQuestTimer("spawnGuards", SPAWN[0], npc, null);
|
||||||
cancelQuestTimers("checkKechiAttack");
|
cancelQuestTimers("checkKechiAttack");
|
||||||
closeDoor(DOOR4, npc.getInstanceId());
|
world.closeDoor(DOOR4);
|
||||||
closeDoor(DOOR3, npc.getInstanceId());
|
world.closeDoor(DOOR3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1440,7 +1440,7 @@ public final class CrystalCaverns extends AbstractInstance
|
|||||||
world.correctGolems++;
|
world.correctGolems++;
|
||||||
if (world.correctGolems >= 2)
|
if (world.correctGolems >= 2)
|
||||||
{
|
{
|
||||||
openDoor(24220026, world.getInstanceId());
|
world.openDoor(24220026);
|
||||||
world.setStatus(4);
|
world.setStatus(4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1666,7 +1666,7 @@ public final class CrystalCaverns extends AbstractInstance
|
|||||||
{
|
{
|
||||||
case 22:
|
case 22:
|
||||||
{
|
{
|
||||||
closeDoor(DOOR6, npc.getInstanceId());
|
world.closeDoor(DOOR6);
|
||||||
oracleOrder = ordreOracle1;
|
oracleOrder = ordreOracle1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1693,8 +1693,8 @@ public final class CrystalCaverns extends AbstractInstance
|
|||||||
}
|
}
|
||||||
cancelQuestTimers("Timer5");
|
cancelQuestTimers("Timer5");
|
||||||
cancelQuestTimers("Timer51");
|
cancelQuestTimers("Timer51");
|
||||||
openDoor(DOOR3, npc.getInstanceId());
|
world.openDoor(DOOR3);
|
||||||
openDoor(DOOR4, npc.getInstanceId());
|
world.openDoor(DOOR4);
|
||||||
final L2Npc kechi = addSpawn(KECHI, 154069, 149525, -12158, 51165, false, 0, false, world.getInstanceId());
|
final L2Npc kechi = addSpawn(KECHI, 154069, 149525, -12158, 51165, false, 0, false, world.getInstanceId());
|
||||||
startQuestTimer("checkKechiAttack", 1000, kechi, null);
|
startQuestTimer("checkKechiAttack", 1000, kechi, null);
|
||||||
return "";
|
return "";
|
||||||
@@ -1999,7 +1999,7 @@ public final class CrystalCaverns extends AbstractInstance
|
|||||||
{
|
{
|
||||||
if (trap.getId() == DOOR_OPENING_TRAP[0])
|
if (trap.getId() == DOOR_OPENING_TRAP[0])
|
||||||
{
|
{
|
||||||
openDoor(24220001, world.getInstanceId());
|
world.openDoor(24220001);
|
||||||
runEmeraldRooms(world, ROOM1_SPAWNS, 1);
|
runEmeraldRooms(world, ROOM1_SPAWNS, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -394,7 +394,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
|||||||
{
|
{
|
||||||
spawnHall(world);
|
spawnHall(world);
|
||||||
world.setStatus(1);
|
world.setStatus(1);
|
||||||
openDoor(D1, world.getInstanceId());
|
world.openDoor(D1);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void runFirstRoom(InstanceWorld world)
|
protected void runFirstRoom(InstanceWorld world)
|
||||||
@@ -436,7 +436,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
|||||||
|
|
||||||
world.setParameter("FirstRoom", FirstRoom);
|
world.setParameter("FirstRoom", FirstRoom);
|
||||||
world.setStatus(2);
|
world.setStatus(2);
|
||||||
openDoor(D2, world.getInstanceId());
|
world.openDoor(D2);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void runHall2(InstanceWorld world)
|
protected void runHall2(InstanceWorld world)
|
||||||
@@ -493,7 +493,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
|||||||
|
|
||||||
world.setParameter("SecondRoom", SecondRoom);
|
world.setParameter("SecondRoom", SecondRoom);
|
||||||
world.setStatus(4);
|
world.setStatus(4);
|
||||||
openDoor(D3, world.getInstanceId());
|
world.openDoor(D3);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void runHall3(InstanceWorld world)
|
protected void runHall3(InstanceWorld world)
|
||||||
@@ -546,7 +546,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
|||||||
ThirdRoom.npcList.add(thisnpc);
|
ThirdRoom.npcList.add(thisnpc);
|
||||||
world.setParameter("ThirdRoom", ThirdRoom);
|
world.setParameter("ThirdRoom", ThirdRoom);
|
||||||
world.setStatus(6);
|
world.setStatus(6);
|
||||||
openDoor(D4, world.getInstanceId());
|
world.openDoor(D4);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void runThirdRoom2(InstanceWorld world)
|
protected void runThirdRoom2(InstanceWorld world)
|
||||||
@@ -639,14 +639,14 @@ public final class DarkCloudMansion extends AbstractInstance
|
|||||||
|
|
||||||
world.setParameter("ForthRoom", ForthRoom);
|
world.setParameter("ForthRoom", ForthRoom);
|
||||||
world.setStatus(7);
|
world.setStatus(7);
|
||||||
openDoor(D5, world.getInstanceId());
|
world.openDoor(D5);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void runFifthRoom(InstanceWorld world)
|
protected void runFifthRoom(InstanceWorld world)
|
||||||
{
|
{
|
||||||
spawnFifthRoom(world);
|
spawnFifthRoom(world);
|
||||||
world.setStatus(9);
|
world.setStatus(9);
|
||||||
openDoor(D6, world.getInstanceId());
|
world.openDoor(D6);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void spawnFifthRoom(InstanceWorld world)
|
private void spawnFifthRoom(InstanceWorld world)
|
||||||
@@ -876,7 +876,7 @@ public final class DarkCloudMansion extends AbstractInstance
|
|||||||
{
|
{
|
||||||
if ((mob.order == i) && (ForthRoom.counter == i))
|
if ((mob.order == i) && (ForthRoom.counter == i))
|
||||||
{
|
{
|
||||||
openDoor(W1 + i, world.getInstanceId());
|
world.openDoor(W1 + i);
|
||||||
ForthRoom.counter += 1;
|
ForthRoom.counter += 1;
|
||||||
if (ForthRoom.counter == 7)
|
if (ForthRoom.counter == 7)
|
||||||
{
|
{
|
||||||
|
@@ -581,7 +581,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IGameXm
|
|||||||
{
|
{
|
||||||
for (int doorId : FIRST_ROUTE_DOORS)
|
for (int doorId : FIRST_ROUTE_DOORS)
|
||||||
{
|
{
|
||||||
openDoor(doorId, world.getInstanceId());
|
world.openDoor(doorId);
|
||||||
}
|
}
|
||||||
spawnFlaggedNPCs(world, world.getStatus());
|
spawnFlaggedNPCs(world, world.getStatus());
|
||||||
break;
|
break;
|
||||||
@@ -590,7 +590,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IGameXm
|
|||||||
{
|
{
|
||||||
for (int doorId : SECOND_ROUTE_DOORS)
|
for (int doorId : SECOND_ROUTE_DOORS)
|
||||||
{
|
{
|
||||||
openDoor(doorId, world.getInstanceId());
|
world.openDoor(doorId);
|
||||||
}
|
}
|
||||||
ThreadPool.schedule(new IntroTask(world, 0), 600000);
|
ThreadPool.schedule(new IntroTask(world, 0), 600000);
|
||||||
break;
|
break;
|
||||||
@@ -652,19 +652,19 @@ public final class FinalEmperialTomb extends AbstractInstance implements IGameXm
|
|||||||
InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(300000);
|
InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(300000);
|
||||||
for (int doorId : FIRST_ROOM_DOORS)
|
for (int doorId : FIRST_ROOM_DOORS)
|
||||||
{
|
{
|
||||||
openDoor(doorId, world.getInstanceId());
|
world.openDoor(doorId);
|
||||||
}
|
}
|
||||||
for (int doorId : FIRST_ROUTE_DOORS)
|
for (int doorId : FIRST_ROUTE_DOORS)
|
||||||
{
|
{
|
||||||
openDoor(doorId, world.getInstanceId());
|
world.openDoor(doorId);
|
||||||
}
|
}
|
||||||
for (int doorId : SECOND_ROUTE_DOORS)
|
for (int doorId : SECOND_ROUTE_DOORS)
|
||||||
{
|
{
|
||||||
openDoor(doorId, world.getInstanceId());
|
world.openDoor(doorId);
|
||||||
}
|
}
|
||||||
for (int doorId : SECOND_ROOM_DOORS)
|
for (int doorId : SECOND_ROOM_DOORS)
|
||||||
{
|
{
|
||||||
closeDoor(doorId, world.getInstanceId());
|
world.closeDoor(doorId);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -892,19 +892,19 @@ public final class FinalEmperialTomb extends AbstractInstance implements IGameXm
|
|||||||
{
|
{
|
||||||
for (int doorId : FIRST_ROOM_DOORS)
|
for (int doorId : FIRST_ROOM_DOORS)
|
||||||
{
|
{
|
||||||
closeDoor(doorId, _world.getInstanceId());
|
_world.closeDoor(doorId);
|
||||||
}
|
}
|
||||||
for (int doorId : FIRST_ROUTE_DOORS)
|
for (int doorId : FIRST_ROUTE_DOORS)
|
||||||
{
|
{
|
||||||
closeDoor(doorId, _world.getInstanceId());
|
_world.closeDoor(doorId);
|
||||||
}
|
}
|
||||||
for (int doorId : SECOND_ROOM_DOORS)
|
for (int doorId : SECOND_ROOM_DOORS)
|
||||||
{
|
{
|
||||||
closeDoor(doorId, _world.getInstanceId());
|
_world.closeDoor(doorId);
|
||||||
}
|
}
|
||||||
for (int doorId : SECOND_ROUTE_DOORS)
|
for (int doorId : SECOND_ROUTE_DOORS)
|
||||||
{
|
{
|
||||||
closeDoor(doorId, _world.getInstanceId());
|
_world.closeDoor(doorId);
|
||||||
}
|
}
|
||||||
addSpawn(29061, -87904, -141296, -9168, 0, false, 0, false, _world.getInstanceId());
|
addSpawn(29061, -87904, -141296, -9168, 0, false, 0, false, _world.getInstanceId());
|
||||||
break;
|
break;
|
||||||
@@ -1353,7 +1353,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IGameXm
|
|||||||
ThreadPool.schedule(new StatusTask(_world, 1), 2000);
|
ThreadPool.schedule(new StatusTask(_world, 1), 2000);
|
||||||
for (int doorId : FIRST_ROOM_DOORS)
|
for (int doorId : FIRST_ROOM_DOORS)
|
||||||
{
|
{
|
||||||
openDoor(doorId, _world.getInstanceId());
|
_world.openDoor(doorId);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1367,7 +1367,7 @@ public final class FinalEmperialTomb extends AbstractInstance implements IGameXm
|
|||||||
ThreadPool.schedule(new StatusTask(_world, 3), 100);
|
ThreadPool.schedule(new StatusTask(_world, 3), 100);
|
||||||
for (int doorId : SECOND_ROOM_DOORS)
|
for (int doorId : SECOND_ROOM_DOORS)
|
||||||
{
|
{
|
||||||
openDoor(doorId, _world.getInstanceId());
|
_world.openDoor(doorId);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -189,7 +189,7 @@ public final class IceQueensCastle extends AbstractInstance
|
|||||||
{
|
{
|
||||||
world.addAllowed(player.getObjectId());
|
world.addAllowed(player.getObjectId());
|
||||||
world.setParameter("player", player);
|
world.setParameter("player", player);
|
||||||
openDoor(ICE_QUEEN_DOOR, world.getInstanceId());
|
world.openDoor(ICE_QUEEN_DOOR);
|
||||||
}
|
}
|
||||||
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
|
teleportPlayer(player, START_LOC, world.getInstanceId(), false);
|
||||||
}
|
}
|
||||||
|
@@ -196,12 +196,12 @@ public final class IceQueensCastleBattle extends AbstractInstance
|
|||||||
final L2Npc freya = params.getObject("freya", L2Npc.class);
|
final L2Npc freya = params.getObject("freya", L2Npc.class);
|
||||||
switch (event)
|
switch (event)
|
||||||
{
|
{
|
||||||
case "openDoor":
|
case "world.openDoor":
|
||||||
{
|
{
|
||||||
if (npc.isScriptValue(0))
|
if (npc.isScriptValue(0))
|
||||||
{
|
{
|
||||||
npc.setScriptValue(1);
|
npc.setScriptValue(1);
|
||||||
openDoor(DOOR_ID, world.getInstanceId());
|
world.openDoor(DOOR_ID);
|
||||||
final L2Npc control = addSpawn(INVISIBLE_NPC, CONTROLLER_LOC, false, 0, true, world.getInstanceId());
|
final L2Npc control = addSpawn(INVISIBLE_NPC, CONTROLLER_LOC, false, 0, true, world.getInstanceId());
|
||||||
for (Location loc : STATUES_LOC)
|
for (Location loc : STATUES_LOC)
|
||||||
{
|
{
|
||||||
@@ -256,7 +256,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "STAGE_1_MOVIE":
|
case "STAGE_1_MOVIE":
|
||||||
{
|
{
|
||||||
closeDoor(DOOR_ID, world.getInstanceId());
|
world.closeDoor(DOOR_ID);
|
||||||
world.setStatus(1);
|
world.setStatus(1);
|
||||||
manageMovie(world, 15);
|
manageMovie(world, 15);
|
||||||
startQuestTimer("STAGE_1_START", 53500, controller, null);
|
startQuestTimer("STAGE_1_START", 53500, controller, null);
|
||||||
|
@@ -300,7 +300,7 @@ public final class NornilsGarden extends AbstractInstance
|
|||||||
{
|
{
|
||||||
world.first_npc = addSpawn(18362, -109702, 74696, -12528, 49568, false, 0, false, world.getInstanceId());
|
world.first_npc = addSpawn(18362, -109702, 74696, -12528, 49568, false, 0, false, world.getInstanceId());
|
||||||
|
|
||||||
final L2DoorInstance door = getDoor(16200010, world.getInstanceId());
|
final L2DoorInstance door = world.getInstance().getDoor(16200010);
|
||||||
if (door != null)
|
if (door != null)
|
||||||
{
|
{
|
||||||
door.setTargetable(false);
|
door.setTargetable(false);
|
||||||
@@ -386,7 +386,7 @@ public final class NornilsGarden extends AbstractInstance
|
|||||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player);
|
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player);
|
||||||
if (tmpworld instanceof NornilsWorld)
|
if (tmpworld instanceof NornilsWorld)
|
||||||
{
|
{
|
||||||
openDoor(doorId, tmpworld.getInstanceId());
|
tmpworld.openDoor(doorId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,7 +474,7 @@ public final class NornilsGarden extends AbstractInstance
|
|||||||
{
|
{
|
||||||
if (zone.getId() == _auto[0])
|
if (zone.getId() == _auto[0])
|
||||||
{
|
{
|
||||||
openDoor(_auto[1], tmpworld.getInstanceId());
|
tmpworld.openDoor(_auto[1]);
|
||||||
}
|
}
|
||||||
if (zone.getId() == 20111)
|
if (zone.getId() == 20111)
|
||||||
{
|
{
|
||||||
@@ -619,7 +619,7 @@ public final class NornilsGarden extends AbstractInstance
|
|||||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player);
|
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player);
|
||||||
if (tmpworld instanceof NornilsWorld)
|
if (tmpworld instanceof NornilsWorld)
|
||||||
{
|
{
|
||||||
openDoor(_gk[2], tmpworld.getInstanceId());
|
tmpworld.openDoor(_gk[2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -147,27 +147,27 @@ public final class SSQDisciplesNecropolisPast extends AbstractInstance
|
|||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
openDoor(DOOR_1, world.getInstanceId());
|
world.openDoor(DOOR_1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 10:
|
case 10:
|
||||||
{
|
{
|
||||||
openDoor(DOOR_2, world.getInstanceId());
|
world.openDoor(DOOR_2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 18:
|
case 18:
|
||||||
{
|
{
|
||||||
openDoor(DOOR_3, world.getInstanceId());
|
world.openDoor(DOOR_3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 28:
|
case 28:
|
||||||
{
|
{
|
||||||
openDoor(DOOR_4, world.getInstanceId());
|
world.openDoor(DOOR_4);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 40:
|
case 40:
|
||||||
{
|
{
|
||||||
openDoor(DOOR_5, world.getInstanceId());
|
world.openDoor(DOOR_5);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -457,7 +457,7 @@ public final class SSQDisciplesNecropolisPast extends AbstractInstance
|
|||||||
final InstanceWorld world = InstanceManager.getInstance().getWorld(npc);
|
final InstanceWorld world = InstanceManager.getInstance().getWorld(npc);
|
||||||
if (world != null)
|
if (world != null)
|
||||||
{
|
{
|
||||||
openDoor(DISCIPLES_NECROPOLIS_DOOR, world.getInstanceId());
|
world.openDoor(DISCIPLES_NECROPOLIS_DOOR);
|
||||||
talker.showQuestMovie(12);
|
talker.showQuestMovie(12);
|
||||||
startQuestTimer("FIGHT", 1000, null, talker);
|
startQuestTimer("FIGHT", 1000, null, talker);
|
||||||
}
|
}
|
||||||
|
@@ -319,7 +319,7 @@ public final class SSQMonasteryOfSilence extends AbstractInstance
|
|||||||
{
|
{
|
||||||
for (int doorId : DOORS)
|
for (int doorId : DOORS)
|
||||||
{
|
{
|
||||||
openDoor(doorId, world.getInstanceId());
|
world.openDoor(doorId);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -373,7 +373,7 @@ public final class SSQMonasteryOfSilence extends AbstractInstance
|
|||||||
{
|
{
|
||||||
for (int doorId : FAKE_TOMB_DOORS)
|
for (int doorId : FAKE_TOMB_DOORS)
|
||||||
{
|
{
|
||||||
closeDoor(doorId, world.getInstanceId());
|
world.closeDoor(doorId);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -381,7 +381,7 @@ public final class SSQMonasteryOfSilence extends AbstractInstance
|
|||||||
{
|
{
|
||||||
for (int doorId : FAKE_TOMB_DOORS)
|
for (int doorId : FAKE_TOMB_DOORS)
|
||||||
{
|
{
|
||||||
openDoor(doorId, world.getInstanceId());
|
world.openDoor(doorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
addSpawn(GUARDIAN_OF_THE_TOMB_1, GUARDIAN_OF_THE_TOMB_1_LOC, false, 0, false, world.getInstanceId());
|
addSpawn(GUARDIAN_OF_THE_TOMB_1, GUARDIAN_OF_THE_TOMB_1_LOC, false, 0, false, world.getInstanceId());
|
||||||
@@ -466,7 +466,7 @@ public final class SSQMonasteryOfSilence extends AbstractInstance
|
|||||||
world.setParameter("deadTombGuardianCount", deadTombGuardianCount);
|
world.setParameter("deadTombGuardianCount", deadTombGuardianCount);
|
||||||
if (deadTombGuardianCount == 4)
|
if (deadTombGuardianCount == 4)
|
||||||
{
|
{
|
||||||
openDoor(TOMB_DOOR, world.getInstanceId());
|
world.openDoor(TOMB_DOOR);
|
||||||
final QuestState st = player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName());
|
final QuestState st = player.getQuestState(Q10295_SevenSignsSolinasTomb.class.getSimpleName());
|
||||||
if ((st != null) && st.isMemoState(2))
|
if ((st != null) && st.isMemoState(2))
|
||||||
{
|
{
|
||||||
|
@@ -203,7 +203,7 @@ public final class SSQSanctumOfTheLordsOfDawn extends AbstractInstance
|
|||||||
final int doorst = world.getParameters().getInt("doorst", 0);
|
final int doorst = world.getParameters().getInt("doorst", 0);
|
||||||
if (doorst == 0)
|
if (doorst == 0)
|
||||||
{
|
{
|
||||||
openDoor(DOOR_ONE, world.getInstanceId());
|
world.openDoor(DOOR_ONE);
|
||||||
talker.sendPacket(SystemMessageId.BY_USING_THE_INVISIBLE_SKILL_SNEAK_INTO_THE_DAWN_S_DOCUMENT_STORAGE);
|
talker.sendPacket(SystemMessageId.BY_USING_THE_INVISIBLE_SKILL_SNEAK_INTO_THE_DAWN_S_DOCUMENT_STORAGE);
|
||||||
talker.sendPacket(SystemMessageId.MALE_GUARDS_CAN_DETECT_THE_CONCEALMENT_BUT_THE_FEMALE_GUARDS_CANNOT);
|
talker.sendPacket(SystemMessageId.MALE_GUARDS_CAN_DETECT_THE_CONCEALMENT_BUT_THE_FEMALE_GUARDS_CANNOT);
|
||||||
talker.sendPacket(SystemMessageId.FEMALE_GUARDS_NOTICE_THE_DISGUISES_FROM_FAR_AWAY_BETTER_THAN_THE_MALE_GUARDS_DO_SO_BEWARE);
|
talker.sendPacket(SystemMessageId.FEMALE_GUARDS_NOTICE_THE_DISGUISES_FROM_FAR_AWAY_BETTER_THAN_THE_MALE_GUARDS_DO_SO_BEWARE);
|
||||||
@@ -212,7 +212,7 @@ public final class SSQSanctumOfTheLordsOfDawn extends AbstractInstance
|
|||||||
}
|
}
|
||||||
else if (doorst == 1)
|
else if (doorst == 1)
|
||||||
{
|
{
|
||||||
openDoor(DOOR_TWO, world.getInstanceId());
|
world.openDoor(DOOR_TWO);
|
||||||
world.setParameter("doorst", doorst + 1);
|
world.setParameter("doorst", doorst + 1);
|
||||||
npc.decayMe();
|
npc.decayMe();
|
||||||
for (int objId : world.getAllowed())
|
for (int objId : world.getAllowed())
|
||||||
@@ -236,7 +236,7 @@ public final class SSQSanctumOfTheLordsOfDawn extends AbstractInstance
|
|||||||
final InstanceWorld world = InstanceManager.getInstance().getWorld(npc);
|
final InstanceWorld world = InstanceManager.getInstance().getWorld(npc);
|
||||||
if (world != null)
|
if (world != null)
|
||||||
{
|
{
|
||||||
openDoor(DOOR_THREE, world.getInstanceId());
|
world.openDoor(DOOR_THREE);
|
||||||
return "32577-01.html";
|
return "32577-01.html";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -36,13 +36,11 @@ import com.l2jmobius.Config;
|
|||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
import com.l2jmobius.gameserver.GameTimeController;
|
import com.l2jmobius.gameserver.GameTimeController;
|
||||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
|
|
||||||
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
||||||
import com.l2jmobius.gameserver.datatables.ItemTable;
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
import com.l2jmobius.gameserver.enums.QuestSound;
|
import com.l2jmobius.gameserver.enums.QuestSound;
|
||||||
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
import com.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
||||||
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
|
|
||||||
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
|
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||||
import com.l2jmobius.gameserver.model.L2Spawn;
|
import com.l2jmobius.gameserver.model.L2Spawn;
|
||||||
import com.l2jmobius.gameserver.model.Location;
|
import com.l2jmobius.gameserver.model.Location;
|
||||||
@@ -50,7 +48,6 @@ import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
|
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2TrapInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2TrapInstance;
|
||||||
@@ -110,7 +107,6 @@ import com.l2jmobius.gameserver.model.events.returns.AbstractEventReturn;
|
|||||||
import com.l2jmobius.gameserver.model.events.returns.TerminateReturn;
|
import com.l2jmobius.gameserver.model.events.returns.TerminateReturn;
|
||||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||||
import com.l2jmobius.gameserver.model.instancezone.Instance;
|
|
||||||
import com.l2jmobius.gameserver.model.interfaces.IPositionable;
|
import com.l2jmobius.gameserver.model.interfaces.IPositionable;
|
||||||
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
import com.l2jmobius.gameserver.model.itemcontainer.PcInventory;
|
import com.l2jmobius.gameserver.model.itemcontainer.PcInventory;
|
||||||
@@ -2686,66 +2682,6 @@ public abstract class AbstractScript extends ManagedScript
|
|||||||
// To be overridden in quest scripts.
|
// To be overridden in quest scripts.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Open a door if it is present on the instance and its not open.
|
|
||||||
* @param doorId the ID of the door to open
|
|
||||||
* @param instanceId the ID of the instance the door is in (0 if the door is not not inside an instance)
|
|
||||||
*/
|
|
||||||
public void openDoor(int doorId, int instanceId)
|
|
||||||
{
|
|
||||||
final L2DoorInstance door = getDoor(doorId, instanceId);
|
|
||||||
if (door == null)
|
|
||||||
{
|
|
||||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": called openDoor(" + doorId + ", " + instanceId + "); but door wasnt found!", new NullPointerException());
|
|
||||||
}
|
|
||||||
else if (!door.isOpen())
|
|
||||||
{
|
|
||||||
door.openMe();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close a door if it is present in a specified the instance and its open.
|
|
||||||
* @param doorId the ID of the door to close
|
|
||||||
* @param instanceId the ID of the instance the door is in (0 if the door is not not inside an instance)
|
|
||||||
*/
|
|
||||||
public void closeDoor(int doorId, int instanceId)
|
|
||||||
{
|
|
||||||
final L2DoorInstance door = getDoor(doorId, instanceId);
|
|
||||||
if (door == null)
|
|
||||||
{
|
|
||||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": called closeDoor(" + doorId + ", " + instanceId + "); but door wasnt found!", new NullPointerException());
|
|
||||||
}
|
|
||||||
else if (door.isOpen())
|
|
||||||
{
|
|
||||||
door.closeMe();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve a door from an instance or the real world.
|
|
||||||
* @param doorId the ID of the door to get
|
|
||||||
* @param instanceId the ID of the instance the door is in (0 if the door is not not inside an instance)
|
|
||||||
* @return the found door or {@code null} if no door with that ID and instance ID was found
|
|
||||||
*/
|
|
||||||
public L2DoorInstance getDoor(int doorId, int instanceId)
|
|
||||||
{
|
|
||||||
L2DoorInstance door = null;
|
|
||||||
if (instanceId <= 0)
|
|
||||||
{
|
|
||||||
door = DoorData.getInstance().getDoor(doorId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
final Instance inst = InstanceManager.getInstance().getInstance(instanceId);
|
|
||||||
if (inst != null)
|
|
||||||
{
|
|
||||||
door = inst.getDoor(doorId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return door;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Teleport a player into/out of an instance.
|
* Teleport a player into/out of an instance.
|
||||||
* @param player the player to teleport
|
* @param player the player to teleport
|
||||||
|
@@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.instancemanager.InstanceManager;
|
|||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.instance.L2DoorInstance;
|
||||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
|
|
||||||
@@ -254,4 +255,30 @@ public class InstanceWorld
|
|||||||
{
|
{
|
||||||
return _instance.spawnGroup(groupName);
|
return _instance.spawnGroup(groupName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a door if it is present in the instance and its not open.
|
||||||
|
* @param doorId the ID of the door to open
|
||||||
|
*/
|
||||||
|
public void openDoor(int doorId)
|
||||||
|
{
|
||||||
|
final L2DoorInstance door = _instance.getDoor(doorId);
|
||||||
|
if ((door != null) && !door.isOpen())
|
||||||
|
{
|
||||||
|
door.openMe();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close a door if it is present in the instance and its open.
|
||||||
|
* @param doorId the ID of the door to close
|
||||||
|
*/
|
||||||
|
public void closeDoor(int doorId)
|
||||||
|
{
|
||||||
|
final L2DoorInstance door = _instance.getDoor(doorId);
|
||||||
|
if ((door != null) && door.isOpen())
|
||||||
|
{
|
||||||
|
door.closeMe();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user