Kastia instance reset checks and addition of teleporter.

Contributed by manax182.
This commit is contained in:
MobiusDevelopment 2021-06-27 22:54:34 +00:00
parent cabfc01be6
commit 732cce1219
24 changed files with 326 additions and 50 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kastia - Exceptional -->
<instance id="305" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<instance id="305" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/instance.xsd">
<time duration="15" empty="0" />
<locations>
<enter type="FIXED">
@ -26,6 +26,9 @@
<reset day="SUNDAY" hour="6" minute="30" />
</reenter>
<spawnlist>
<group name="NPC" spawnByDefault="false">
<npc id="34566" x="-111304" y="-15018" z="-11430" heading="48879" /> <!-- Kastia's Researcher -->
</group>
<group name="wave_1" spawnByDefault="false">
<npc id="24588" x="-111432" y="-14392" z="-11428" heading="16526" /> <!-- Kastia's Keeper -->
<npc id="24588" x="-111368" y="-14376" z="-11428" heading="2854" /> <!-- Kastia's Keeper -->

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kastia - Extreme -->
<instance id="306" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<instance id="306" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/instance.xsd">
<time duration="15" empty="0" />
<locations>
<enter type="FIXED">
@ -26,6 +26,9 @@
<reset day="SUNDAY" hour="6" minute="30" />
</reenter>
<spawnlist>
<group name="NPC" spawnByDefault="false">
<npc id="34566" x="-111304" y="-15018" z="-11430" heading="48879" /> <!-- Kastia's Researcher -->
</group>
<group name="wave_1" spawnByDefault="false">
<npc id="24592" x="-111432" y="-14392" z="-11428" heading="16526" /> <!-- Kastia's Keeper -->
<npc id="24592" x="-111368" y="-14376" z="-11428" heading="2854" /> <!-- Kastia's Keeper -->

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kastia - Hard -->
<instance id="300" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<instance id="300" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/instance.xsd">
<time duration="15" empty="0" />
<locations>
<enter type="FIXED">
@ -26,6 +26,9 @@
<reset day="SUNDAY" hour="6" minute="30" />
</reenter>
<spawnlist>
<group name="NPC" spawnByDefault="false">
<npc id="34566" x="-111304" y="-15018" z="-11430" heading="48879" /> <!-- Kastia's Researcher -->
</group>
<group name="wave_1" spawnByDefault="false">
<npc id="24543" x="-111432" y="-14392" z="-11428" heading="16526" /> <!-- Kastia's Keeper -->
<npc id="24543" x="-111368" y="-14376" z="-11428" heading="2854" /> <!-- Kastia's Keeper -->

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kastia - Low -->
<instance id="298" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<instance id="298" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/instance.xsd">
<time duration="15" empty="0" />
<locations>
<enter type="FIXED">
@ -26,6 +26,9 @@
<reset day="SUNDAY" hour="6" minute="30" />
</reenter>
<spawnlist>
<group name="NPC" spawnByDefault="false">
<npc id="34566" x="-111304" y="-15018" z="-11430" heading="48879" /> <!-- Kastia's Researcher -->
</group>
<group name="wave_1" spawnByDefault="false">
<npc id="24535" x="-111432" y="-14392" z="-11428" heading="16526" /> <!-- Kastia's Keeper -->
<npc id="24535" x="-111368" y="-14376" z="-11428" heading="2854" /> <!-- Kastia's Keeper -->

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kastia - Medium -->
<instance id="299" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<instance id="299" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/instance.xsd">
<time duration="15" empty="0" />
<locations>
<enter type="FIXED">
@ -26,6 +26,9 @@
<reset day="SUNDAY" hour="6" minute="30" />
</reenter>
<spawnlist>
<group name="NPC" spawnByDefault="false">
<npc id="34566" x="-111304" y="-15018" z="-11430" heading="48879" /> <!-- Kastia's Researcher -->
</group>
<group name="wave_1" spawnByDefault="false">
<npc id="24539" x="-111432" y="-14392" z="-11428" heading="16526" /> <!-- Kastia's Keeper -->
<npc id="24539" x="-111368" y="-14376" z="-11428" heading="2854" /> <!-- Kastia's Keeper -->

View File

@ -0,0 +1,5 @@
<html><body>Kastia's Researcher:<br>
I'm a researcher from the kingdom of Aden.<br>
I came here hoping to solve the mysteries of the Kastias's Labyrinth. Thanks to you I was finally able to make some progress. As a sign of my gratitude I will show you the exit.<br>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest KastiaResearcher exit">Go outside</Button>
</body></html>

View File

@ -0,0 +1,58 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ai.others.KastiaResearcher;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import ai.AbstractNpcAI;
/**
* @author Mobius
*/
public class KastiaResearcher extends AbstractNpcAI
{
// NPC
private static final int RESEARCHER = 34566;
public KastiaResearcher()
{
addStartNpc(RESEARCHER);
addTalkId(RESEARCHER);
addFirstTalkId(RESEARCHER);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
if (event.equals("exit"))
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
world.finishInstance(0);
}
}
return null;
}
public static void main(String[] args)
{
new KastiaResearcher();
}
}

View File

@ -16,12 +16,16 @@
*/
package instances.KastiaExceptional;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
@ -60,10 +64,17 @@ public class KastiaExceptional extends AbstractInstance
{
case "enterInstance":
{
/*
* Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
// Cannot enter if player finished another Kastia instance.
final long currentTime = Chronos.currentTimeMillis();
if ((currentTime < InstanceManager.getInstance().getInstanceTime(player, 298)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 299)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 300)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 306)))
{
player.sendPacket(new SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName()));
return null;
}
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
@ -158,6 +169,7 @@ public class KastiaExceptional extends AbstractInstance
{
if (world.getAliveNpcs().isEmpty())
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_LV4_PACK);
world.finishInstance();
}

View File

@ -16,12 +16,16 @@
*/
package instances.KastiaExtreme;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
@ -60,10 +64,17 @@ public class KastiaExtreme extends AbstractInstance
{
case "enterInstance":
{
/*
* Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
// Cannot enter if player finished another Kastia instance.
final long currentTime = Chronos.currentTimeMillis();
if ((currentTime < InstanceManager.getInstance().getInstanceTime(player, 298)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 299)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 300)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 305)))
{
player.sendPacket(new SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName()));
return null;
}
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
@ -158,6 +169,7 @@ public class KastiaExtreme extends AbstractInstance
{
if (world.getAliveNpcs().isEmpty())
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_LV5_PACK);
world.finishInstance();
}

View File

@ -16,12 +16,16 @@
*/
package instances.KastiaHard;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
@ -60,10 +64,17 @@ public class KastiaHard extends AbstractInstance
{
case "enterInstance":
{
/*
* Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
// Cannot enter if player finished another Kastia instance.
final long currentTime = Chronos.currentTimeMillis();
if ((currentTime < InstanceManager.getInstance().getInstanceTime(player, 298)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 299)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 305)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 306)))
{
player.sendPacket(new SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName()));
return null;
}
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
@ -158,6 +169,7 @@ public class KastiaHard extends AbstractInstance
{
if (world.getAliveNpcs().isEmpty())
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_LARGE_PACK);
world.finishInstance();
}

View File

@ -16,12 +16,16 @@
*/
package instances.KastiaLow;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
@ -60,10 +64,17 @@ public class KastiaLow extends AbstractInstance
{
case "enterInstance":
{
/*
* Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
// Cannot enter if player finished another Kastia instance.
final long currentTime = Chronos.currentTimeMillis();
if ((currentTime < InstanceManager.getInstance().getInstanceTime(player, 299)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 300)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 305)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 306)))
{
player.sendPacket(new SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName()));
return null;
}
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
@ -158,6 +169,7 @@ public class KastiaLow extends AbstractInstance
{
if (world.getAliveNpcs().isEmpty())
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_SMALL_PACK);
world.finishInstance();
}

View File

@ -16,12 +16,16 @@
*/
package instances.KastiaMedium;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
@ -60,10 +64,17 @@ public class KastiaMedium extends AbstractInstance
{
case "enterInstance":
{
/*
* Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
// Cannot enter if player finished another Kastia instance.
final long currentTime = Chronos.currentTimeMillis();
if ((currentTime < InstanceManager.getInstance().getInstanceTime(player, 298)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 300)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 305)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 306)))
{
player.sendPacket(new SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName()));
return null;
}
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
@ -158,6 +169,7 @@ public class KastiaMedium extends AbstractInstance
{
if (world.getAliveNpcs().isEmpty())
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_MEDIUM_PACK);
world.finishInstance();
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kastia - Exceptional -->
<instance id="305" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<instance id="305" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/instance.xsd">
<time duration="15" empty="0" />
<locations>
<enter type="FIXED">
@ -26,6 +26,9 @@
<reset day="SUNDAY" hour="6" minute="30" />
</reenter>
<spawnlist>
<group name="NPC" spawnByDefault="false">
<npc id="34566" x="-111304" y="-15018" z="-11430" heading="48879" /> <!-- Kastia's Researcher -->
</group>
<group name="wave_1" spawnByDefault="false">
<npc id="24588" x="-111432" y="-14392" z="-11428" heading="16526" /> <!-- Kastia's Keeper -->
<npc id="24588" x="-111368" y="-14376" z="-11428" heading="2854" /> <!-- Kastia's Keeper -->

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kastia - Extreme -->
<instance id="306" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<instance id="306" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/instance.xsd">
<time duration="15" empty="0" />
<locations>
<enter type="FIXED">
@ -26,6 +26,9 @@
<reset day="SUNDAY" hour="6" minute="30" />
</reenter>
<spawnlist>
<group name="NPC" spawnByDefault="false">
<npc id="34566" x="-111304" y="-15018" z="-11430" heading="48879" /> <!-- Kastia's Researcher -->
</group>
<group name="wave_1" spawnByDefault="false">
<npc id="24592" x="-111432" y="-14392" z="-11428" heading="16526" /> <!-- Kastia's Keeper -->
<npc id="24592" x="-111368" y="-14376" z="-11428" heading="2854" /> <!-- Kastia's Keeper -->

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kastia - Hard -->
<instance id="300" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<instance id="300" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/instance.xsd">
<time duration="15" empty="0" />
<locations>
<enter type="FIXED">
@ -26,6 +26,9 @@
<reset day="SUNDAY" hour="6" minute="30" />
</reenter>
<spawnlist>
<group name="NPC" spawnByDefault="false">
<npc id="34566" x="-111304" y="-15018" z="-11430" heading="48879" /> <!-- Kastia's Researcher -->
</group>
<group name="wave_1" spawnByDefault="false">
<npc id="24543" x="-111432" y="-14392" z="-11428" heading="16526" /> <!-- Kastia's Keeper -->
<npc id="24543" x="-111368" y="-14376" z="-11428" heading="2854" /> <!-- Kastia's Keeper -->

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kastia - Low -->
<instance id="298" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<instance id="298" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/instance.xsd">
<time duration="15" empty="0" />
<locations>
<enter type="FIXED">
@ -26,6 +26,9 @@
<reset day="SUNDAY" hour="6" minute="30" />
</reenter>
<spawnlist>
<group name="NPC" spawnByDefault="false">
<npc id="34566" x="-111304" y="-15018" z="-11430" heading="48879" /> <!-- Kastia's Researcher -->
</group>
<group name="wave_1" spawnByDefault="false">
<npc id="24535" x="-111432" y="-14392" z="-11428" heading="16526" /> <!-- Kastia's Keeper -->
<npc id="24535" x="-111368" y="-14376" z="-11428" heading="2854" /> <!-- Kastia's Keeper -->

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Kastia - Medium -->
<instance id="299" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<instance id="299" maxWorlds="50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/instance.xsd">
<time duration="15" empty="0" />
<locations>
<enter type="FIXED">
@ -26,6 +26,9 @@
<reset day="SUNDAY" hour="6" minute="30" />
</reenter>
<spawnlist>
<group name="NPC" spawnByDefault="false">
<npc id="34566" x="-111304" y="-15018" z="-11430" heading="48879" /> <!-- Kastia's Researcher -->
</group>
<group name="wave_1" spawnByDefault="false">
<npc id="24539" x="-111432" y="-14392" z="-11428" heading="16526" /> <!-- Kastia's Keeper -->
<npc id="24539" x="-111368" y="-14376" z="-11428" heading="2854" /> <!-- Kastia's Keeper -->

View File

@ -0,0 +1,5 @@
<html><body>Kastia's Researcher:<br>
I'm a researcher from the kingdom of Aden.<br>
I came here hoping to solve the mysteries of the Kastias's Labyrinth. Thanks to you I was finally able to make some progress. As a sign of my gratitude I will show you the exit.<br>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest KastiaResearcher exit">Go outside</Button>
</body></html>

View File

@ -0,0 +1,58 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ai.others.KastiaResearcher;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import ai.AbstractNpcAI;
/**
* @author Mobius
*/
public class KastiaResearcher extends AbstractNpcAI
{
// NPC
private static final int RESEARCHER = 34566;
public KastiaResearcher()
{
addStartNpc(RESEARCHER);
addTalkId(RESEARCHER);
addFirstTalkId(RESEARCHER);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
if (event.equals("exit"))
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
world.finishInstance(0);
}
}
return null;
}
public static void main(String[] args)
{
new KastiaResearcher();
}
}

View File

@ -16,12 +16,16 @@
*/
package instances.KastiaExceptional;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
@ -60,10 +64,17 @@ public class KastiaExceptional extends AbstractInstance
{
case "enterInstance":
{
/*
* Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
// Cannot enter if player finished another Kastia instance.
final long currentTime = Chronos.currentTimeMillis();
if ((currentTime < InstanceManager.getInstance().getInstanceTime(player, 298)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 299)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 300)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 306)))
{
player.sendPacket(new SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName()));
return null;
}
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
@ -158,6 +169,7 @@ public class KastiaExceptional extends AbstractInstance
{
if (world.getAliveNpcs().isEmpty())
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_LV4_PACK);
world.finishInstance();
}

View File

@ -16,12 +16,16 @@
*/
package instances.KastiaExtreme;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
@ -60,10 +64,17 @@ public class KastiaExtreme extends AbstractInstance
{
case "enterInstance":
{
/*
* Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
// Cannot enter if player finished another Kastia instance.
final long currentTime = Chronos.currentTimeMillis();
if ((currentTime < InstanceManager.getInstance().getInstanceTime(player, 298)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 299)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 300)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 305)))
{
player.sendPacket(new SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName()));
return null;
}
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
@ -158,6 +169,7 @@ public class KastiaExtreme extends AbstractInstance
{
if (world.getAliveNpcs().isEmpty())
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_LV5_PACK);
world.finishInstance();
}

View File

@ -16,12 +16,16 @@
*/
package instances.KastiaHard;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
@ -60,10 +64,17 @@ public class KastiaHard extends AbstractInstance
{
case "enterInstance":
{
/*
* Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
// Cannot enter if player finished another Kastia instance.
final long currentTime = Chronos.currentTimeMillis();
if ((currentTime < InstanceManager.getInstance().getInstanceTime(player, 298)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 299)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 305)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 306)))
{
player.sendPacket(new SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName()));
return null;
}
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
@ -158,6 +169,7 @@ public class KastiaHard extends AbstractInstance
{
if (world.getAliveNpcs().isEmpty())
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_LARGE_PACK);
world.finishInstance();
}

View File

@ -16,12 +16,16 @@
*/
package instances.KastiaLow;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
@ -60,10 +64,17 @@ public class KastiaLow extends AbstractInstance
{
case "enterInstance":
{
/*
* Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
// Cannot enter if player finished another Kastia instance.
final long currentTime = Chronos.currentTimeMillis();
if ((currentTime < InstanceManager.getInstance().getInstanceTime(player, 299)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 300)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 305)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 306)))
{
player.sendPacket(new SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName()));
return null;
}
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
@ -158,6 +169,7 @@ public class KastiaLow extends AbstractInstance
{
if (world.getAliveNpcs().isEmpty())
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_SMALL_PACK);
world.finishInstance();
}

View File

@ -16,12 +16,16 @@
*/
package instances.KastiaMedium;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
@ -60,10 +64,17 @@ public class KastiaMedium extends AbstractInstance
{
case "enterInstance":
{
/*
* Cannot enter if player finished another Kastia instance. if ((Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (Chronos.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 298))) { player.sendPacket(new
* SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName())); return null; }
*/
// Cannot enter if player finished another Kastia instance.
final long currentTime = Chronos.currentTimeMillis();
if ((currentTime < InstanceManager.getInstance().getInstanceTime(player, 298)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 300)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 305)) //
|| (currentTime < InstanceManager.getInstance().getInstanceTime(player, 306)))
{
player.sendPacket(new SystemMessage(SystemMessageId.SINCE_C1_ENTERED_ANOTHER_INSTANCE_ZONE_THEREFORE_YOU_CANNOT_ENTER_THIS_DUNGEON).addString(player.getName()));
return null;
}
enterInstance(player, npc, TEMPLATE_ID);
if (player.getInstanceWorld() != null)
{
@ -158,6 +169,7 @@ public class KastiaMedium extends AbstractInstance
{
if (world.getAliveNpcs().isEmpty())
{
world.spawnGroup("NPC");
giveItems(player, KASTIAS_MEDIUM_PACK);
world.finishInstance();
}