Removed instance getter from InstanceWorld.
This commit is contained in:
@@ -45,11 +45,11 @@ public final class Sirra extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
final InstanceWorld world = InstanceManager.getInstance().getWorld(npc);
|
final InstanceWorld world = InstanceManager.getInstance().getWorld(npc);
|
||||||
|
|
||||||
if ((world != null) && (world.getInstance().getTemplateId() == FREYA_INSTID))
|
if ((world != null) && (world.getTemplateId() == FREYA_INSTID))
|
||||||
{
|
{
|
||||||
return (world.isStatus(0)) ? "32762-easy.html" : "32762-easyfight.html";
|
return (world.isStatus(0)) ? "32762-easy.html" : "32762-easyfight.html";
|
||||||
}
|
}
|
||||||
else if ((world != null) && (world.getInstance().getTemplateId() == FREYA_HARD_INSTID))
|
else if ((world != null) && (world.getTemplateId() == FREYA_HARD_INSTID))
|
||||||
{
|
{
|
||||||
return (world.isStatus(0)) ? "32762-hard.html" : "32762-hardfight.html";
|
return (world.isStatus(0)) ? "32762-hard.html" : "32762-hardfight.html";
|
||||||
}
|
}
|
||||||
|
@@ -87,7 +87,7 @@ public class AdminInstance implements IAdminCommandHandler
|
|||||||
if (world != null)
|
if (world != null)
|
||||||
{
|
{
|
||||||
counter++;
|
counter++;
|
||||||
activeChar.sendMessage("Id: " + instance.getId() + " Name: " + InstanceManager.getInstance().getInstanceIdName(world.getInstance().getTemplateId()));
|
activeChar.sendMessage("Id: " + instance.getId() + " Name: " + InstanceManager.getInstance().getInstanceIdName(world.getTemplateId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (counter == 0)
|
if (counter == 0)
|
||||||
|
@@ -51,10 +51,10 @@ public class InstanceZone implements IUserCommandHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(activeChar);
|
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(activeChar);
|
||||||
if ((world != null) && (world.getInstance().getTemplateId() >= 0))
|
if ((world != null) && (world.getTemplateId() >= 0))
|
||||||
{
|
{
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_CURRENTLY_IN_USE_S1);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_CURRENTLY_IN_USE_S1);
|
||||||
sm.addInstanceName(world.getInstance().getTemplateId());
|
sm.addInstanceName(world.getTemplateId());
|
||||||
activeChar.sendPacket(sm);
|
activeChar.sendPacket(sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
|
|||||||
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||||
if (world != null)
|
if (world != null)
|
||||||
{
|
{
|
||||||
if (world.getInstance().getTemplateId() == templateId)
|
if (world.getTemplateId() == templateId)
|
||||||
{
|
{
|
||||||
onEnterInstance(player, world, false);
|
onEnterInstance(player, world, false);
|
||||||
|
|
||||||
@@ -191,11 +191,11 @@ public abstract class AbstractInstance extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (int objectId : world.getAllowed())
|
for (int objectId : world.getAllowed())
|
||||||
{
|
{
|
||||||
InstanceManager.getInstance().setInstanceTime(objectId, world.getInstance().getTemplateId(), time);
|
InstanceManager.getInstance().setInstanceTime(objectId, world.getTemplateId(), time);
|
||||||
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
||||||
if ((player != null) && player.isOnline())
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE).addString(InstanceManager.getInstance().getInstanceIdName(world.getInstance().getTemplateId())));
|
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE).addString(InstanceManager.getInstance().getInstanceIdName(world.getTemplateId())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -157,8 +157,8 @@ public final class CavernOfThePirateCaptain extends AbstractInstance
|
|||||||
{
|
{
|
||||||
if (firstEntrance)
|
if (firstEntrance)
|
||||||
{
|
{
|
||||||
world.setParameter("is83", world.getInstance().getTemplateId() == TEMPLATE_ID_83);
|
world.setParameter("is83", world.getTemplateId() == TEMPLATE_ID_83);
|
||||||
world.setParameter("isNight", world.getInstance().getTemplateId() == TEMPLATE_ID_60_NIGHT);
|
world.setParameter("isNight", world.getTemplateId() == TEMPLATE_ID_60_NIGHT);
|
||||||
world.setParameter("storeTime", System.currentTimeMillis());
|
world.setParameter("storeTime", System.currentTimeMillis());
|
||||||
|
|
||||||
final List<L2PcInstance> playersInside = new ArrayList<>();
|
final List<L2PcInstance> playersInside = new ArrayList<>();
|
||||||
|
@@ -178,14 +178,14 @@ public abstract class Chamber extends AbstractInstance
|
|||||||
reenter.add(Calendar.DAY_OF_WEEK, 1);
|
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);
|
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.getInstance().getTemplateId()));
|
sm.addString(InstanceManager.getInstance().getInstanceIdName(world.getTemplateId()));
|
||||||
// set instance reenter time for all allowed players
|
// set instance reenter time for all allowed players
|
||||||
for (int objectId : world.getAllowed())
|
for (int objectId : world.getAllowed())
|
||||||
{
|
{
|
||||||
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
||||||
if ((player != null) && player.isOnline())
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
InstanceManager.getInstance().setInstanceTime(objectId, world.getInstance().getTemplateId(), reenter.getTimeInMillis());
|
InstanceManager.getInstance().setInstanceTime(objectId, world.getTemplateId(), reenter.getTimeInMillis());
|
||||||
player.sendPacket(sm);
|
player.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1768,7 +1768,7 @@ public final class CrystalCaverns extends AbstractInstance
|
|||||||
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||||
if (world != null)
|
if (world != null)
|
||||||
{
|
{
|
||||||
if (world.getInstance().getTemplateId() == TEMPLATE_ID)
|
if (world.getTemplateId() == TEMPLATE_ID)
|
||||||
{
|
{
|
||||||
onEnterInstance(player, world, false);
|
onEnterInstance(player, world, false);
|
||||||
return "";
|
return "";
|
||||||
|
@@ -1195,7 +1195,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
|
|||||||
{
|
{
|
||||||
if (firstEntrance)
|
if (firstEntrance)
|
||||||
{
|
{
|
||||||
world.setParameter("isHardCore", world.getInstance().getTemplateId() == TEMPLATE_ID_HARD);
|
world.setParameter("isHardCore", world.getTemplateId() == TEMPLATE_ID_HARD);
|
||||||
|
|
||||||
final List<L2PcInstance> playersInside = new ArrayList<>();
|
final List<L2PcInstance> playersInside = new ArrayList<>();
|
||||||
if (!player.isInParty())
|
if (!player.isInParty())
|
||||||
|
@@ -551,7 +551,7 @@ public final class Kamaloka extends AbstractInstance
|
|||||||
if (world != null)
|
if (world != null)
|
||||||
{
|
{
|
||||||
// but not in kamaloka
|
// but not in kamaloka
|
||||||
if (!(world instanceof KamaWorld) || (world.getInstance().getTemplateId() != templateId))
|
if (!(world instanceof KamaWorld) || (world.getTemplateId() != templateId))
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
|
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
|
||||||
return;
|
return;
|
||||||
@@ -581,15 +581,16 @@ public final class Kamaloka extends AbstractInstance
|
|||||||
|
|
||||||
// Creating new instanceWorld, using our instanceId and templateId
|
// Creating new instanceWorld, using our instanceId and templateId
|
||||||
world = new KamaWorld();
|
world = new KamaWorld();
|
||||||
world.setInstance(InstanceManager.getInstance().createDynamicInstance(templateId));
|
final Instance instance = InstanceManager.getInstance().createDynamicInstance(templateId);
|
||||||
|
world.setInstance(instance);
|
||||||
|
|
||||||
// set return location
|
// set return location
|
||||||
world.getInstance().setExitLoc(new Location(player));
|
instance.setExitLoc(new Location(player));
|
||||||
// disable summon friend into instance
|
// disable summon friend into instance
|
||||||
world.getInstance().setAllowSummon(false);
|
instance.setAllowSummon(false);
|
||||||
// set duration and empty destroy time
|
// set duration and empty destroy time
|
||||||
world.getInstance().setDuration(DURATION[index] * 60000);
|
instance.setDuration(DURATION[index] * 60000);
|
||||||
world.getInstance().setEmptyDestroyTime(EMPTY_DESTROY_TIME * 60000);
|
instance.setEmptyDestroyTime(EMPTY_DESTROY_TIME * 60000);
|
||||||
|
|
||||||
// set index for easy access to the arrays
|
// set index for easy access to the arrays
|
||||||
((KamaWorld) world).index = index;
|
((KamaWorld) world).index = index;
|
||||||
@@ -627,7 +628,7 @@ public final class Kamaloka extends AbstractInstance
|
|||||||
reenter.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
|
reenter.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
|
||||||
|
|
||||||
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);
|
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.addInstanceName(world.getInstance().getTemplateId());
|
sm.addInstanceName(world.getTemplateId());
|
||||||
|
|
||||||
// set instance reenter time for all allowed players
|
// set instance reenter time for all allowed players
|
||||||
for (int objectId : world.getAllowed())
|
for (int objectId : world.getAllowed())
|
||||||
@@ -635,7 +636,7 @@ public final class Kamaloka extends AbstractInstance
|
|||||||
final L2PcInstance obj = L2World.getInstance().getPlayer(objectId);
|
final L2PcInstance obj = L2World.getInstance().getPlayer(objectId);
|
||||||
if ((obj != null) && obj.isOnline())
|
if ((obj != null) && obj.isOnline())
|
||||||
{
|
{
|
||||||
InstanceManager.getInstance().setInstanceTime(objectId, world.getInstance().getTemplateId(), reenter.getTimeInMillis());
|
InstanceManager.getInstance().setInstanceTime(objectId, world.getTemplateId(), reenter.getTimeInMillis());
|
||||||
obj.sendPacket(sm);
|
obj.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -240,10 +240,10 @@ public final class NornilsGarden extends AbstractInstance
|
|||||||
|
|
||||||
private final synchronized String enterInstance(L2Npc npc, L2PcInstance player)
|
private final synchronized String enterInstance(L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||||
if (world != null)
|
if (world != null)
|
||||||
{
|
{
|
||||||
if (!(world instanceof NornilsWorld) || (world.getInstance().getTemplateId() != TEMPLATE_ID))
|
if (!(world instanceof NornilsWorld) || (world.getTemplateId() != TEMPLATE_ID))
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
|
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
|
||||||
return null;
|
return null;
|
||||||
@@ -271,17 +271,24 @@ public final class NornilsGarden extends AbstractInstance
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
world = new NornilsWorld();
|
final NornilsWorld newWorld = new NornilsWorld();
|
||||||
world.setInstance(InstanceManager.getInstance().createDynamicInstance(TEMPLATE_ID));
|
final Instance instance = InstanceManager.getInstance().createDynamicInstance(TEMPLATE_ID);
|
||||||
|
newWorld.setInstance(instance);
|
||||||
InstanceManager.getInstance().addWorld(world);
|
InstanceManager.getInstance().addWorld(world);
|
||||||
world.getInstance().setExitLoc(new Location(player));
|
instance.setExitLoc(new Location(player));
|
||||||
world.getInstance().setAllowSummon(false);
|
instance.setAllowSummon(false);
|
||||||
world.getInstance().setDuration(DURATION_TIME * 60000);
|
instance.setDuration(DURATION_TIME * 60000);
|
||||||
world.getInstance().setEmptyDestroyTime(EMPTY_DESTROY_TIME * 60000);
|
instance.setEmptyDestroyTime(EMPTY_DESTROY_TIME * 60000);
|
||||||
final int instanceId = world.getInstanceId();
|
final int instanceId = newWorld.getInstanceId();
|
||||||
LOGGER.info("Nornils Garden: started, Instance: " + instanceId + " created by player: " + player.getName());
|
LOGGER.info("Nornils Garden: started, Instance: " + instanceId + " created by player: " + player.getName());
|
||||||
|
|
||||||
prepareInstance((NornilsWorld) world);
|
newWorld.first_npc = addSpawn(18362, -109702, 74696, -12528, 49568, false, 0, false, newWorld.getInstanceId());
|
||||||
|
final L2DoorInstance door = instance.getDoor(16200010);
|
||||||
|
if (door != null)
|
||||||
|
{
|
||||||
|
door.setTargetable(false);
|
||||||
|
door.setMeshIndex(2);
|
||||||
|
}
|
||||||
|
|
||||||
// and finally teleport party into instance
|
// and finally teleport party into instance
|
||||||
final L2Party party = player.getParty();
|
final L2Party party = player.getParty();
|
||||||
@@ -289,25 +296,13 @@ public final class NornilsGarden extends AbstractInstance
|
|||||||
{
|
{
|
||||||
for (L2PcInstance partyMember : party.getMembers())
|
for (L2PcInstance partyMember : party.getMembers())
|
||||||
{
|
{
|
||||||
world.addAllowed(partyMember.getObjectId());
|
newWorld.addAllowed(partyMember.getObjectId());
|
||||||
teleportPlayer(partyMember, SPAWN_PPL, instanceId);
|
teleportPlayer(partyMember, SPAWN_PPL, instanceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prepareInstance(NornilsWorld world)
|
|
||||||
{
|
|
||||||
world.first_npc = addSpawn(18362, -109702, 74696, -12528, 49568, false, 0, false, world.getInstanceId());
|
|
||||||
|
|
||||||
final L2DoorInstance door = world.getInstance().getDoor(16200010);
|
|
||||||
if (door != null)
|
|
||||||
{
|
|
||||||
door.setTargetable(false);
|
|
||||||
door.setMeshIndex(2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void spawn1(L2Npc npc)
|
private void spawn1(L2Npc npc)
|
||||||
{
|
{
|
||||||
final InstanceWorld inst = InstanceManager.getInstance().getWorld(npc);
|
final InstanceWorld inst = InstanceManager.getInstance().getWorld(npc);
|
||||||
|
@@ -273,7 +273,7 @@ public final class PailakaDevilsLegacy extends AbstractInstance
|
|||||||
if ((character.isPlayer()) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
|
if ((character.isPlayer()) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
|
||||||
{
|
{
|
||||||
final InstanceWorld world = InstanceManager.getInstance().getWorld(character);
|
final InstanceWorld world = InstanceManager.getInstance().getWorld(character);
|
||||||
if ((world != null) && (world.getInstance().getTemplateId() == TEMPLATE_ID))
|
if ((world != null) && (world.getTemplateId() == TEMPLATE_ID))
|
||||||
{
|
{
|
||||||
startQuestTimer("TELEPORT", 1000, world.getParameters().getObject("lematanNpc", L2Npc.class), (L2PcInstance) character);
|
startQuestTimer("TELEPORT", 1000, world.getParameters().getObject("lematanNpc", L2Npc.class), (L2PcInstance) character);
|
||||||
}
|
}
|
||||||
|
@@ -170,7 +170,7 @@ public final class PailakaSongOfIceAndFire extends AbstractInstance
|
|||||||
if ((character.isPlayer()) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
|
if ((character.isPlayer()) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
|
||||||
{
|
{
|
||||||
final InstanceWorld world = InstanceManager.getInstance().getWorld(character);
|
final InstanceWorld world = InstanceManager.getInstance().getWorld(character);
|
||||||
if ((world != null) && (world.getInstance().getTemplateId() == TEMPLATE_ID))
|
if ((world != null) && (world.getTemplateId() == TEMPLATE_ID))
|
||||||
{
|
{
|
||||||
startQuestTimer("TELEPORT", 1000, null, (L2PcInstance) character);
|
startQuestTimer("TELEPORT", 1000, null, (L2PcInstance) character);
|
||||||
}
|
}
|
||||||
|
@@ -871,7 +871,7 @@ public class Q00144_PailakaInjuredDragon extends Quest
|
|||||||
if ((character instanceof L2PcInstance) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
|
if ((character instanceof L2PcInstance) && !character.isDead() && !character.isTeleporting() && ((L2PcInstance) character).isOnline())
|
||||||
{
|
{
|
||||||
final InstanceWorld world = InstanceManager.getInstance().getWorld(character);
|
final InstanceWorld world = InstanceManager.getInstance().getWorld(character);
|
||||||
if ((world != null) && (world.getInstance().getTemplateId() == INSTANCE_ID))
|
if ((world != null) && (world.getTemplateId() == INSTANCE_ID))
|
||||||
{
|
{
|
||||||
// If a player wants to go by a mob wall without kill it, he will be returned back to a spawn point.
|
// If a player wants to go by a mob wall without kill it, he will be returned back to a spawn point.
|
||||||
final int[] zoneTeleport = NOEXIT_ZONES.get(zone.getId());
|
final int[] zoneTeleport = NOEXIT_ZONES.get(zone.getId());
|
||||||
@@ -939,7 +939,7 @@ public class Q00144_PailakaInjuredDragon extends Quest
|
|||||||
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||||
if (world != null)
|
if (world != null)
|
||||||
{
|
{
|
||||||
if (world.getInstance().getTemplateId() != INSTANCE_ID)
|
if (world.getTemplateId() != INSTANCE_ID)
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
|
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
|
||||||
return;
|
return;
|
||||||
|
@@ -287,8 +287,9 @@ public final class Q00511_AwlUnderFoot extends Quest
|
|||||||
}
|
}
|
||||||
final L2Party party = player.getParty();
|
final L2Party party = player.getParty();
|
||||||
world = new FAUWorld();
|
world = new FAUWorld();
|
||||||
world.setInstance(InstanceManager.getInstance().createDynamicInstance(dungeon.getInstanceId()));
|
final Instance instance = InstanceManager.getInstance().createDynamicInstance(dungeon.getInstanceId());
|
||||||
world.getInstance().setExitLoc(new Location(player));
|
world.setInstance(instance);
|
||||||
|
instance.setExitLoc(new Location(player));
|
||||||
dungeon.setReEnterTime(System.currentTimeMillis() + REENTERTIME);
|
dungeon.setReEnterTime(System.currentTimeMillis() + REENTERTIME);
|
||||||
InstanceManager.getInstance().addWorld(world);
|
InstanceManager.getInstance().addWorld(world);
|
||||||
final int instanceId = world.getInstanceId();
|
final int instanceId = world.getInstanceId();
|
||||||
|
@@ -98,7 +98,7 @@ public final class Q00694_BreakThroughTheHallOfSuffering extends Quest
|
|||||||
case TEPIOS2:
|
case TEPIOS2:
|
||||||
{
|
{
|
||||||
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||||
if ((world != null) && (world.getInstance().getTemplateId() == TEMPLATE_ID))
|
if ((world != null) && (world.getTemplateId() == TEMPLATE_ID))
|
||||||
{
|
{
|
||||||
final int tag = world.getParameters().getInt("tag", -1);
|
final int tag = world.getParameters().getInt("tag", -1);
|
||||||
if (tag == -1)
|
if (tag == -1)
|
||||||
|
@@ -107,7 +107,7 @@ public final class Q00695_DefendTheHallOfSuffering extends Quest
|
|||||||
{
|
{
|
||||||
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||||
|
|
||||||
if ((world != null) && (world.getInstance().getTemplateId() == TEMPLATE_ID))
|
if ((world != null) && (world.getTemplateId() == TEMPLATE_ID))
|
||||||
{
|
{
|
||||||
final int tag = world.getParameters().getInt("tag", -1);
|
final int tag = world.getParameters().getInt("tag", -1);
|
||||||
if (tag == -1)
|
if (tag == -1)
|
||||||
|
@@ -273,8 +273,9 @@ public class Q00726_LightWithinTheDarkness extends Quest
|
|||||||
}
|
}
|
||||||
final L2Party party = player.getParty();
|
final L2Party party = player.getParty();
|
||||||
world = new PAWORLD();
|
world = new PAWORLD();
|
||||||
world.setInstance(InstanceManager.getInstance().createDynamicInstance(dungeon.getInstanceId()));
|
final Instance instance = InstanceManager.getInstance().createDynamicInstance(dungeon.getInstanceId());
|
||||||
world.getInstance().setExitLoc(new Location(player));
|
world.setInstance(instance);
|
||||||
|
instance.setExitLoc(new Location(player));
|
||||||
dungeon.setReEnterTime(System.currentTimeMillis() + 14400000);
|
dungeon.setReEnterTime(System.currentTimeMillis() + 14400000);
|
||||||
InstanceManager.getInstance().addWorld(world);
|
InstanceManager.getInstance().addWorld(world);
|
||||||
ThreadPool.schedule(new spawnNpcs((PAWORLD) world), 10000);
|
ThreadPool.schedule(new spawnNpcs((PAWORLD) world), 10000);
|
||||||
|
@@ -625,8 +625,9 @@ public class Q00727_HopeWithinTheDarkness extends Quest
|
|||||||
|
|
||||||
final L2Party party = player.getParty();
|
final L2Party party = player.getParty();
|
||||||
world = new CAUWorld();
|
world = new CAUWorld();
|
||||||
world.setInstance(InstanceManager.getInstance().createDynamicInstance(dungeon.getInstanceId()));
|
final Instance instance = InstanceManager.getInstance().createDynamicInstance(dungeon.getInstanceId());
|
||||||
world.getInstance().setExitLoc(new Location(player));
|
world.setInstance(instance);
|
||||||
|
instance.setExitLoc(new Location(player));
|
||||||
final int instanceId = world.getInstanceId();
|
final int instanceId = world.getInstanceId();
|
||||||
dungeon.setReEnterTime(System.currentTimeMillis() + REENTER_INTERVAL);
|
dungeon.setReEnterTime(System.currentTimeMillis() + REENTER_INTERVAL);
|
||||||
InstanceManager.getInstance().addWorld(world);
|
InstanceManager.getInstance().addWorld(world);
|
||||||
|
@@ -55,6 +55,6 @@ public class ConditionPlayerInstanceId extends Condition
|
|||||||
}
|
}
|
||||||
|
|
||||||
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(effector.getActingPlayer());
|
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(effector.getActingPlayer());
|
||||||
return (world != null) && (world.getInstanceId() == instanceId) && _instanceIds.contains(world.getInstance().getTemplateId());
|
return (world != null) && (world.getInstanceId() == instanceId) && _instanceIds.contains(world.getTemplateId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -47,15 +47,6 @@ public class InstanceWorld
|
|||||||
_instance = instance;
|
_instance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the instance.
|
|
||||||
* @return the instance
|
|
||||||
*/
|
|
||||||
public Instance getInstance()
|
|
||||||
{
|
|
||||||
return _instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the dynamically generated instance ID.
|
* Gets the dynamically generated instance ID.
|
||||||
* @return the instance ID
|
* @return the instance ID
|
||||||
@@ -65,6 +56,15 @@ public class InstanceWorld
|
|||||||
return _instance.getId();
|
return _instance.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get template ID of instance world.
|
||||||
|
* @return instance template ID
|
||||||
|
*/
|
||||||
|
public int getTemplateId()
|
||||||
|
{
|
||||||
|
return _instance.getTemplateId();
|
||||||
|
}
|
||||||
|
|
||||||
public List<Integer> getAllowed()
|
public List<Integer> getAllowed()
|
||||||
{
|
{
|
||||||
return _allowed;
|
return _allowed;
|
||||||
|
@@ -202,7 +202,7 @@ public abstract class L2ZoneType extends ListenersContainer
|
|||||||
if (_instanceTemplateId > 0)
|
if (_instanceTemplateId > 0)
|
||||||
{
|
{
|
||||||
final InstanceWorld world = InstanceManager.getInstance().getWorld(character);
|
final InstanceWorld world = InstanceManager.getInstance().getWorld(character);
|
||||||
if ((world != null) && (world.getInstance().getTemplateId() != _instanceTemplateId))
|
if ((world != null) && (world.getTemplateId() != _instanceTemplateId))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user