Addition of Kastia Extreme and Exceptional instances.
This commit is contained in:
181
L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExceptional/KastiaExceptional.java
vendored
Normal file
181
L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExceptional/KastiaExceptional.java
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package instances.KastiaExceptional;
|
||||
|
||||
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.serverpackets.ExShowScreenMessage;
|
||||
|
||||
import instances.AbstractInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class KastiaExceptional extends AbstractInstance
|
||||
{
|
||||
// NPC
|
||||
private static final int KARINIA = 34541;
|
||||
// Monsters
|
||||
private static final int[] MONSTERS =
|
||||
{
|
||||
24588, // Kastia's Keeper
|
||||
24589, // Kastia's Overseer
|
||||
24590, // Kastia's Warder
|
||||
24591, // Vishes
|
||||
};
|
||||
// Item
|
||||
private static final ItemHolder KASTIAS_LV4_PACK = new ItemHolder(81465, 1);
|
||||
// Misc
|
||||
private static final int TEMPLATE_ID = 305;
|
||||
|
||||
public KastiaExceptional()
|
||||
{
|
||||
super(TEMPLATE_ID);
|
||||
addStartNpc(KARINIA);
|
||||
addTalkId(KARINIA);
|
||||
addKillId(MONSTERS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "enterInstance":
|
||||
{
|
||||
/*
|
||||
* Cannot enter if player finished another Kastia instance. if ((System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (System.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; }
|
||||
*/
|
||||
enterInstance(player, npc, TEMPLATE_ID);
|
||||
if (player.getInstanceWorld() != null)
|
||||
{
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
case "check_status":
|
||||
{
|
||||
final Instance world = player.getInstanceWorld();
|
||||
if (!isInInstance(world))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
switch (world.getStatus())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_1, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(1);
|
||||
world.spawnGroup("wave_1");
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_2, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(2);
|
||||
world.spawnGroup("wave_2");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_3, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(3);
|
||||
world.spawnGroup("wave_3");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_4, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(4);
|
||||
world.spawnGroup("wave_4");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_5, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(5);
|
||||
world.spawnGroup("wave_5");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_6, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(6);
|
||||
world.spawnGroup("wave_6");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_7, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(7);
|
||||
world.spawnGroup("wave_7");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
giveItems(player, KASTIAS_LV4_PACK);
|
||||
world.finishInstance();
|
||||
}
|
||||
else
|
||||
{
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new KastiaExceptional();
|
||||
}
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
<html><body>Karinia:<br>
|
||||
You are too weak. I won't let you enter.<br>
|
||||
(Only players of at least level 115 may participate.)
|
||||
</body></html>
|
@@ -0,0 +1,4 @@
|
||||
<html><body>Karinia:<br>
|
||||
You are powerful. I won't let you enter.<br>
|
||||
(Only players under level 120 may participate.)
|
||||
</body></html>
|
181
L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExtreme/KastiaExtreme.java
vendored
Normal file
181
L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExtreme/KastiaExtreme.java
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package instances.KastiaExtreme;
|
||||
|
||||
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.serverpackets.ExShowScreenMessage;
|
||||
|
||||
import instances.AbstractInstance;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class KastiaExtreme extends AbstractInstance
|
||||
{
|
||||
// NPC
|
||||
private static final int KARINIA = 34541;
|
||||
// Monsters
|
||||
private static final int[] MONSTERS =
|
||||
{
|
||||
24592, // Kastia's Keeper
|
||||
24593, // Kastia's Overseer
|
||||
24594, // Kastia's Warder
|
||||
24595, // Tykan
|
||||
};
|
||||
// Item
|
||||
private static final ItemHolder KASTIAS_LV5_PACK = new ItemHolder(81466, 1);
|
||||
// Misc
|
||||
private static final int TEMPLATE_ID = 306;
|
||||
|
||||
public KastiaExtreme()
|
||||
{
|
||||
super(TEMPLATE_ID);
|
||||
addStartNpc(KARINIA);
|
||||
addTalkId(KARINIA);
|
||||
addKillId(MONSTERS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case "enterInstance":
|
||||
{
|
||||
/*
|
||||
* Cannot enter if player finished another Kastia instance. if ((System.currentTimeMillis() > InstanceManager.getInstance().getInstanceTime(player, 299)) || (System.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; }
|
||||
*/
|
||||
enterInstance(player, npc, TEMPLATE_ID);
|
||||
if (player.getInstanceWorld() != null)
|
||||
{
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
case "check_status":
|
||||
{
|
||||
final Instance world = player.getInstanceWorld();
|
||||
if (!isInInstance(world))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
switch (world.getStatus())
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_1, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(1);
|
||||
world.spawnGroup("wave_1");
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_2, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(2);
|
||||
world.spawnGroup("wave_2");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_3, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(3);
|
||||
world.spawnGroup("wave_3");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_4, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(4);
|
||||
world.spawnGroup("wave_4");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_5, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(5);
|
||||
world.spawnGroup("wave_5");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_6, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(6);
|
||||
world.spawnGroup("wave_6");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
showOnScreenMsg(world, NpcStringId.STAGE_7, ExShowScreenMessage.TOP_CENTER, 10000, true);
|
||||
world.setStatus(7);
|
||||
world.spawnGroup("wave_7");
|
||||
}
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
if (world.getAliveNpcs().isEmpty())
|
||||
{
|
||||
giveItems(player, KASTIAS_LV5_PACK);
|
||||
world.finishInstance();
|
||||
}
|
||||
else
|
||||
{
|
||||
startQuestTimer("check_status", 10000, null, player);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new KastiaExtreme();
|
||||
}
|
||||
}
|
4
L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExtreme/condNoLevel.html
vendored
Normal file
4
L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExtreme/condNoLevel.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Karinia:<br>
|
||||
You are too weak. I won't let you enter.<br>
|
||||
(Only players of at least level 120 may participate.)
|
||||
</body></html>
|
4
L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExtreme/condOverLevel.html
vendored
Normal file
4
L2J_Mobius_8.0_Homunculus/dist/game/data/scripts/instances/KastiaExtreme/condOverLevel.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Karinia:<br>
|
||||
You are powerful. I won't let you enter.<br>
|
||||
(Only players under level 120 may participate.)
|
||||
</body></html>
|
Reference in New Issue
Block a user