Incubator of Evil initial commit.

This commit is contained in:
MobiusDev 2016-02-14 22:25:27 +00:00
parent 560576e2d4
commit 5d1e8973b1
23 changed files with 756 additions and 50 deletions

View File

@ -1,12 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<instance name="Incubator of Evil" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<allowSummon val="false" />
<emptyDestroyTime val="5" />
<emptyDestroyTime val="1" />
<exitPoint x="185798" y="20400" z="-3345" />
<doorlist>
<door doorId="16240001" />
<door doorId="16240002" />
</doorlist>
<spawnlist>
<group name="general">
<spawn npcId="33170" x="56168" y="-172664" z="-7980" heading="49151" respawn="0" />
@ -19,5 +15,124 @@
<spawn npcId="33416" x="56504" y="-176296" z="-7980" heading="16383" respawn="0" />
<spawn npcId="33416" x="55880" y="-176296" z="-7980" heading="16383" respawn="0" />
</group>
<group name="archers">
<spawn npcId="33414" x="56392" y="-176232" z="-7980" heading="49151" respawn="0" />
<spawn npcId="33414" x="56184" y="-176168" z="-7974" heading="49151" respawn="0" />
<spawn npcId="33414" x="55976" y="-176136" z="-7980" heading="49151" respawn="0" />
</group>
<group name="infantry">
<spawn npcId="33415" x="56168" y="-176712" z="-7973" heading="49151" respawn="0" />
<spawn npcId="33415" x="55960" y="-176696" z="-7973" heading="49151" respawn="0" />
<spawn npcId="33415" x="56376" y="-176712" z="-7973" heading="49151" respawn="0" />
</group>
<group name="wave1">
<spawn npcId="27431" x="56168" y="-177592" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27432" x="56248" y="-177576" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="56072" y="-177544" z="-7977" heading="16383" respawn="0" />
<spawn npcId="27434" x="56312" y="-177576" z="-7980" heading="16383" respawn="0" />
</group>
<group name="wave2">
<spawn npcId="27431" x="56808" y="-176680" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27432" x="56824" y="-176792" z="-7979" heading="16383" respawn="0" />
<spawn npcId="27434" x="56760" y="-176712" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="56824" y="-176584" z="-7980" heading="16383" respawn="0" />
</group>
<group name="wave3">
<spawn npcId="27431" x="56808" y="-176680" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27432" x="56824" y="-176792" z="-7979" heading="16383" respawn="0" />
<spawn npcId="27434" x="56760" y="-176712" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="56824" y="-176584" z="-7980" heading="16383" respawn="0" />
</group>
<group name="wave4">
<spawn npcId="27430" x="56216" y="-177624" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27430" x="56088" y="-177624" z="-7975" heading="16383" respawn="0" />
<spawn npcId="27432" x="56168" y="-177544" z="-7975" heading="16383" respawn="0" />
<spawn npcId="27432" x="56296" y="-177512" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27431" x="56376" y="-177512" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27431" x="55944" y="-177512" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27434" x="56296" y="-177448" z="-7979" heading="16383" respawn="0" />
<spawn npcId="27434" x="55992" y="-177384" z="-7980" heading="16383" respawn="0" />
</group>
<group name="wave5">
<spawn npcId="27430" x="55448" y="-176760" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27430" x="55464" y="-176664" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27430" x="55560" y="-176744" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27431" x="55512" y="-176824" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27434" x="55448" y="-176808" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27434" x="55400" y="-176776" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="55384" y="-176696" z="-7974" heading="16383" respawn="0" />
</group>
<group name="wave6">
<spawn npcId="27430" x="56840" y="-176712" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27430" x="56824" y="-176648" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27431" x="56824" y="-176584" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27431" x="56872" y="-176632" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="56904" y="-176696" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="56904" y="-176792" z="-7976" heading="16383" respawn="0" />
</group>
<group name="wave7">
<spawn npcId="27430" x="55432" y="-176680" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27430" x="55432" y="-176744" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27431" x="55432" y="-176648" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27432" x="55464" y="-176680" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="55416" y="-176776" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="55368" y="-176664" z="-7974" heading="16383" respawn="0" />
</group>
<group name="wave8">
<spawn npcId="27430" x="55432" y="-176680" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27430" x="55432" y="-176744" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27431" x="55432" y="-176648" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27431" x="55496" y="-176792" z="-7976" heading="16383" respawn="0" />
<spawn npcId="27432" x="55464" y="-176680" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27432" x="55576" y="-176584" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27434" x="55416" y="-176776" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="55368" y="-176664" z="-7974" heading="16383" respawn="0" />
</group>
<group name="wave9">
<spawn npcId="27430" x="56696" y="-176744" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27430" x="56712" y="-176664" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27431" x="56776" y="-176808" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27431" x="56696" y="-176808" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27432" x="56616" y="-176728" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27432" x="56600" y="-176648" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="56584" y="-176584" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27434" x="56712" y="-176552" z="-7980" heading="16383" respawn="0" />
</group>
<group name="wave10">
<spawn npcId="27430" x="56184" y="-177672" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27430" x="56088" y="-177704" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27433" x="56152" y="-177592" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27433" x="56264" y="-177496" z="-7978" heading="16383" respawn="0" />
<spawn npcId="27432" x="56184" y="-177464" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="56104" y="-177448" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="56024" y="-177448" z="-7980" heading="16383" respawn="0" />
</group>
<group name="wave11">
<spawn npcId="27430" x="55512" y="-176648" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27430" x="55512" y="-176712" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27433" x="55576" y="-176696" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27433" x="55544" y="-176776" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27432" x="55432" y="-176808" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27434" x="55432" y="-176680" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="55592" y="-176632" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="55640" y="-176712" z="-7974" heading="16383" respawn="0" />
</group>
<group name="wave12">
<spawn npcId="27430" x="56872" y="-176648" z="-7975" heading="16383" respawn="0" />
<spawn npcId="27430" x="56904" y="-176744" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27433" x="56824" y="-176728" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27433" x="56728" y="-176664" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27432" x="56680" y="-176776" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="56664" y="-176712" z="-7974" heading="16383" respawn="0" />
<spawn npcId="27434" x="56696" y="-176632" z="-7974" heading="16383" respawn="0" />
</group>
<group name="wave13">
<spawn npcId="27430" x="55976" y="-177544" z="-7980" heading="16383" respawn="0" />
<spawn npcId="27433" x="55864" y="-177544" z="-8320" heading="16383" respawn="0" />
<spawn npcId="27432" x="55768" y="-177544" z="-8320" heading="16383" respawn="0" />
<spawn npcId="27434" x="56376" y="-177544" z="-8320" heading="16383" respawn="0" />
<spawn npcId="27434" x="56336" y="-177544" z="-8320" heading="16383" respawn="0" />
<spawn npcId="27425" x="56168" y="-177544" z="-7974" heading="16383" respawn="0" />
</group>
</spawnlist>
</instance>

View File

@ -0,0 +1,4 @@
<html><body>Aden Vanguard Captain Adolph:<br>
As Shilen grows in power, more monsters will emerge from here. We can't just let this happen without fighting back!<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest IncubatorOfEvil">Quest</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Aden Vanguard Captain Adolph:<br>
You've caught me resting after a particularly tough battle. So, you're the soldier Orven has sent? Good! You can help my squad with that never-ending stream of monsters. Got any questions?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IncubatorOfEvil 33170-3.htm">"I'm ready."</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Aden Vanguard Captain Adolph:<br>
See my subordinates there? They are elite veterans who have known many victories. Two of them will wait here, while you, me, and the other two enter the enemy base.<br>
Go and talk to my squad and pick out two you'd like to have at your side.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Officer Barton:<br>
Not to brag, but a star soldier such as myself can make the difference between winning and losing.<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest IncubatorOfEvil 33170-5.htm">Quest</Button>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Aden Vanguard Captain Adolph:<br>
I see you've chosen strong allies.<br1>
This battle will be fierce, and if you see me go down, do not hesitate to run. We can't afford to lose any more people, and if that happens, you will need time to regroup.<br1>Now, I hope you're ready to take this fight to the enemy, because we're going into their base.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IncubatorOfEvil start_battle">"I'm ready."</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Priest Alice:<br>
Even the strongest soldier will fall if they cannot be healed in battle. My healing power will lead us to victory.<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest IncubatorOfEvil">Quest</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Priest Alice:<br>
Do you need my help? I can heal, and provide support in combat.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IncubatorOfEvil select_alice">Select</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Officer Barton:<br>
Not to brag, but a star soldier such as myself can make the difference between winning and losing.<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest IncubatorOfEvil">Quest</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Officer Barton:<br>
You need my help? Well, you look like a capable sort. I need someone like you to watch my back.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IncubatorOfEvil select_barton">Select</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Sniper Hayuk:<br>
If you can defeat your enemy before they get close, you can annihilate their forces without incurring any damage to your own team. Heh! That there is what's called strategy!<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest IncubatorOfEvil">Quest</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Sniper Hayuk:<br>
Do you need my help? Of course! I will cover your back! You can trust me.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IncubatorOfEvil select_hayuk">"Yes, I could use some help."</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Magus Eliyah:<br>
The Ivory Tower's magic is much too powerful for these monsters. We have no need to skulk on the sidelines!<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest IncubatorOfEvil">Quest</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Magus Eliyah:<br>
You need my help? Well, if you protect me from the monsters, I suppose I can help.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IncubatorOfEvil select_eliyah">Select</Button>
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Van Archer:<br>
We're the strong, the proud, the vanguard of Aden! We're accepting applications... we really could use a second trombone for the marching band.
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Van Infantry:<br>
We're the strong, the proud, the vanguard of Aden! We're accepting applications... we really could use a second trombone for the marching band.
</body></html>

View File

@ -16,12 +16,23 @@
*/
package instances.IncubatorOfEvil;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.npc.FighterAI;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
import com.l2jmobius.gameserver.model.instancezone.InstanceWorld;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import instances.AbstractInstance;
import quests.Q10341_DayOfDestinyHumansFate.Q10341_DayOfDestinyHumansFate;
@ -32,33 +43,57 @@ import quests.Q10345_DayOfDestinyDwarfsFate.Q10345_DayOfDestinyDwarfsFate;
import quests.Q10346_DayOfDestinyKamaelsFate.Q10346_DayOfDestinyKamaelsFate;
/**
* Incubator of Evil Instance Zone.<br>
* TODO: Implement this!
* Incubator of Evil Instance Zone.
* @author Mobius
*/
public final class IncubatorOfEvil extends AbstractInstance
{
// NPCs
private static final int OFFICER = 19155;
private static final int ADOLPH = 33170;
private static final int ALICE = 33171;
private static final int BARTON = 33172;
private static final int HAYUK = 33173;
private static final int ELIYAH = 33174;
private static final int ARCHER = 33414;
private static final int INFANTRY = 33415;
// Monsters
private static final int FINAL_BOSS = 27425;
private static final List<Integer> MONSTERS = new ArrayList<>();
static
{
MONSTERS.add(27430);
MONSTERS.add(27431);
MONSTERS.add(27432);
MONSTERS.add(27433);
MONSTERS.add(27434);
}
// Rewards
private static final int SOE = 736;
// Locations
private static final Location START_LOC = new Location(56180, -172898, -7952);
@SuppressWarnings("unused")
private static final Location FIGHT_LOC = new Location(56177, -175627, -7952);
@SuppressWarnings("unused")
private static final Location EXIT_LOC = new Location(185798, 20400, -3345);
// Misc
private static final int TEMPLATE_ID = 185;
protected class IOE extends InstanceWorld
class IOEWorld extends InstanceWorld
{
L2QuestGuardInstance adolph = null;
L2QuestGuardInstance alice = null;
L2QuestGuardInstance barton = null;
L2QuestGuardInstance hayuk = null;
L2QuestGuardInstance eliyah = null;
int selectionCount = 0;
final List<L2Npc> savedSpawns = new CopyOnWriteArrayList<>();
}
public IncubatorOfEvil()
{
super(IncubatorOfEvil.class.getSimpleName());
addStartNpc(OFFICER);
addTalkId(OFFICER);
addFirstTalkId(OFFICER);
addStartNpc(ADOLPH);
addTalkId(ADOLPH, BARTON, HAYUK, ELIYAH, ALICE);
addFirstTalkId(ADOLPH, BARTON, HAYUK, ELIYAH, ALICE, ARCHER, INFANTRY);
addKillId(MONSTERS);
addKillId(FINAL_BOSS);
}
@Override
@ -66,28 +101,460 @@ public final class IncubatorOfEvil extends AbstractInstance
{
if (event.equals("enter_instance"))
{
if (getPlayerQuestState(player) == null)
final QuestState qs = getPlayerQuestState(player);
if ((qs == null) || (qs.getCond() < 4) || qs.isCond(13))
{
return null;
}
enterInstance(player, new IOE(), "IncubatorOfEvil.xml", TEMPLATE_ID);
qs.setCond(5, true);
enterInstance(player, new IOEWorld(), "IncubatorOfEvil.xml", TEMPLATE_ID);
return null;
}
final InstanceWorld tmpworld = InstanceManager.getInstance().getPlayerWorld(player);
if ((tmpworld == null) || !(tmpworld instanceof IOE))
if ((tmpworld == null) || !(tmpworld instanceof IOEWorld))
{
return null;
}
@SuppressWarnings("unused")
final IOE world = (IOE) tmpworld;
final IOEWorld world = (IOEWorld) tmpworld;
String htmltext = null;
switch (event)
{
case "33170-5.htm":
{
htmltext = event;
break;
}
case "33170-3.htm":
{
final QuestState qs = getPlayerQuestState(player);
if ((qs != null) && qs.isCond(5))
{
qs.setCond(6, true);
htmltext = event;
}
break;
}
case "select_alice":
{
htmltext = addVanguard(player, ALICE);
break;
}
case "select_barton":
{
htmltext = addVanguard(player, BARTON);
break;
}
case "select_hayuk":
{
htmltext = addVanguard(player, HAYUK);
break;
}
case "select_eliyah":
{
htmltext = addVanguard(player, ELIYAH);
break;
}
case "start_battle":
{
if (world.selectionCount == 2)
{
final QuestState qs = getPlayerQuestState(player);
if ((qs != null) && qs.isCond(7))
{
world.setStatus(1);
qs.setCond(8, true);
teleportPlayer(player, FIGHT_LOC, world.getInstanceId(), false);
if (world.adolph != null)
{
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, world.adolph), 1000);
}
if (world.alice != null)
{
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, world.alice), 1000);
}
if (world.barton != null)
{
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, world.barton), 1000);
}
if (world.hayuk != null)
{
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, world.hayuk), 1000);
}
if (world.eliyah != null)
{
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, world.eliyah), 1000);
}
final List<L2Npc> archers = spawnGroup("archers", world.getInstanceId());
for (L2Npc spawn : archers)
{
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((L2QuestGuardInstance) spawn)), 1000);
}
final List<L2Npc> infantry = spawnGroup("infantry", world.getInstanceId());
for (L2Npc spawn : infantry)
{
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((L2QuestGuardInstance) spawn)), 1000);
}
world.savedSpawns.addAll(spawnGroup("wave1", world.getInstanceId()));
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
startQuestTimer("checkStatus", 5000, null, player, true);
}
}
break;
}
case "checkStatus":
{
// Check if finished.
if (world.getStatus() > 13)
{
final QuestState qs = getPlayerQuestState(player);
if (qs != null)
{
rewardItems(player, SOE, 1);
qs.setCond(13, true);
}
// 5 minute exit timer.
InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(Config.INSTANCE_FINISH_TIME);
InstanceManager.getInstance().getInstance(world.getInstanceId()).setEmptyDestroyTime(0);
// Stop quest timer.
cancelQuestTimers("checkStatus");
return null;
}
// Remove monsters killed by guards.
for (L2Npc spawn : world.savedSpawns)
{
if (spawn.isDead())
{
world.savedSpawns.remove(spawn);
if (spawn.getId() == FINAL_BOSS)
{
for (L2Npc monster : world.savedSpawns)
{
monster.deleteMe();
}
world.incStatus();
}
}
}
// Act according to world status.
switch (world.getStatus())
{
case 1:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave2", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 2:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave3", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 3:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave4", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 4:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave5", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 5:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave6", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 6:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave7", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 7:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave8", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 8:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave9", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 9:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave10", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 10:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave11", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 11:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave12", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 12:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
world.savedSpawns.addAll(spawnGroup("wave13", world.getInstanceId()));
showScreenMessage(player, NpcStringId.CREATURES_RESURRECTED_DEFEND_YOURSELF);
for (L2Npc spawn : world.savedSpawns)
{
addAttackDesire(spawn, player);
}
}
break;
}
case 13:
{
if (world.savedSpawns.isEmpty())
{
world.incStatus();
}
break;
}
}
break;
}
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final QuestState qs = getPlayerQuestState(player);
if (qs == null)
{
return null;
}
String htmltext = getNoQuestMsg(player);
switch (npc.getId())
{
case ADOLPH:
{
switch (qs.getCond())
{
case 5:
{
htmltext = "33170-2.htm";
break;
}
case 6:
{
htmltext = "33170-3.htm";
break;
}
}
break;
}
case ALICE:
case BARTON:
case HAYUK:
case ELIYAH:
{
switch (qs.getCond())
{
case 6:
{
htmltext = npc.getId() + "-2.htm";
break;
}
}
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
final QuestState qs = getPlayerQuestState(player);
if (qs == null)
{
return null;
}
return super.onAdvEvent(event, npc, player);
switch (npc.getId())
{
case ADOLPH:
{
switch (qs.getCond())
{
case 4:
case 5:
case 6:
{
return "33170-1.htm";
}
case 7:
{
return "33170-4.htm";
}
}
break;
}
case ALICE:
case BARTON:
case HAYUK:
case ELIYAH:
{
switch (qs.getCond())
{
case 4:
case 5:
case 6:
{
return npc.getId() + "-1.htm";
}
// case 8: ?
}
break;
}
case ARCHER:
case INFANTRY:
{
return npc.getId() + "-1.htm";
}
}
return null;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(killer);
if ((world == null) || !(world instanceof IOEWorld))
{
return null;
}
((IOEWorld) world).savedSpawns.remove(npc);
if (npc.getId() == FINAL_BOSS)
{
for (L2Npc monster : ((IOEWorld) world).savedSpawns)
{
monster.deleteMe();
}
((IOEWorld) world).incStatus();
}
return super.onKill(npc, killer, isSummon);
}
@Override
@ -95,7 +562,7 @@ public final class IncubatorOfEvil extends AbstractInstance
{
if (firstEntrance)
{
world.setStatus(1);
world.setStatus(0);
world.addAllowed(player.getObjectId());
}
teleportPlayer(player, START_LOC, world.getInstanceId());
@ -139,4 +606,69 @@ public final class IncubatorOfEvil extends AbstractInstance
}
return qs;
}
private String addVanguard(L2PcInstance player, int addedNpcId)
{
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if ((world == null) || !(world instanceof IOEWorld) || (world.getStatus() > 1) //
|| (player.getTarget() == null) || !player.getTarget().isNpc() || (((L2Npc) player.getTarget()).getId() != addedNpcId))
{
return null;
}
switch (addedNpcId)
{
case ALICE:
{
((L2Character) player.getTarget()).deleteMe();
((IOEWorld) world).selectionCount++;
((IOEWorld) world).alice = (L2QuestGuardInstance) addSpawn(ALICE, FIGHT_LOC, true, 0, false, world.getInstanceId());
break;
}
case BARTON:
{
((L2Character) player.getTarget()).deleteMe();
((IOEWorld) world).selectionCount++;
((IOEWorld) world).barton = (L2QuestGuardInstance) addSpawn(BARTON, FIGHT_LOC, true, 0, false, world.getInstanceId());
break;
}
case HAYUK:
{
((L2Character) player.getTarget()).deleteMe();
((IOEWorld) world).selectionCount++;
((IOEWorld) world).hayuk = (L2QuestGuardInstance) addSpawn(HAYUK, FIGHT_LOC, true, 0, false, world.getInstanceId());
break;
}
case ELIYAH:
{
((L2Character) player.getTarget()).deleteMe();
((IOEWorld) world).selectionCount++;
((IOEWorld) world).eliyah = (L2QuestGuardInstance) addSpawn(ELIYAH, FIGHT_LOC, true, 0, false, world.getInstanceId());
break;
}
}
if (((IOEWorld) world).selectionCount == 2)
{
((IOEWorld) world).adolph = (L2QuestGuardInstance) addSpawn(ADOLPH, FIGHT_LOC, true, 0, false, world.getInstanceId());
final QuestState qs = getPlayerQuestState(player);
if ((qs != null) && qs.isCond(6))
{
qs.setCond(7, true);
}
// Remove remaining vanguards.
for (L2Character ch : player.getKnownList().getKnownCharactersInRadius(500))
{
if (ch.isNpc() && (((L2Npc) ch).getId() != ADOLPH))
{
ch.deleteMe();
}
}
}
return null;
}
private void showScreenMessage(L2PcInstance player, NpcStringId stringId)
{
player.sendPacket(new ExShowScreenMessage(2, -1, 2, 0, 0, 0, 0, true, 10000, false, null, stringId, null));
}
}

View File

@ -23,6 +23,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.npc.FighterAI;
import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Character;
@ -38,7 +39,6 @@ import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jmobius.gameserver.util.Util;
import instances.AbstractInstance;
import instances.KartiasLabyrinth.AI.Fighter;
import quests.Q00494_IncarnationOfGreedZellakaGroup.Q00494_IncarnationOfGreedZellakaGroup;
import quests.Q00495_IncarnationOfJealousyPellineGroup.Q00495_IncarnationOfJealousyPellineGroup;
import quests.Q00496_IncarnationOfGluttonyKaliosGroup.Q00496_IncarnationOfGluttonyKaliosGroup;
@ -831,23 +831,23 @@ public final class KartiasLabyrinth extends AbstractInstance
}
if (((KartiaWorld) world).adolph != null)
{
ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(player, ((KartiaWorld) world).adolph), 1000);
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((KartiaWorld) world).adolph), 1000);
}
if (((KartiaWorld) world).barton != null)
{
ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(player, ((KartiaWorld) world).barton), 1000);
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((KartiaWorld) world).barton), 1000);
}
if (((KartiaWorld) world).hayuk != null)
{
ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(player, ((KartiaWorld) world).hayuk), 1000);
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((KartiaWorld) world).hayuk), 1000);
}
if (((KartiaWorld) world).eliyah != null)
{
ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(player, ((KartiaWorld) world).eliyah), 1000);
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((KartiaWorld) world).eliyah), 1000);
}
if (((KartiaWorld) world).elise != null)
{
ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(player, ((KartiaWorld) world).elise), 1000);
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(player, ((KartiaWorld) world).elise), 1000);
}
((KartiaWorld) world).savedSpawns.addAll(spawnGroup("wave1", world.getInstanceId()));
startQuestTimer("checkStatus", 5000, null, player, true);

View File

@ -660,7 +660,7 @@
<height normal="28" />
</collision>
</npc>
<npc id="27425" level="79" type="L2Npc" name="Death Wound" title="Shilen's Creation">
<npc id="27425" level="79" type="L2Monster" name="Death Wound" title="Shilen's Creation">
<!-- Source http://l2i-god.gaikotsu.ru/ (Lindvior) -->
<race>UNDEAD</race>
<stats>
@ -800,7 +800,7 @@
<height normal="40" />
</collision>
</npc>
<npc id="27430" level="76" type="L2Npc" name="Screaming Shaman" title="Resurrected">
<npc id="27430" level="76" type="L2Monster" name="Screaming Shaman" title="Resurrected">
<!-- Source http://l2i-god.gaikotsu.ru/ (Lindvior) -->
<race>UNDEAD</race>
<stats>
@ -827,7 +827,7 @@
<height normal="40.48" />
</collision>
</npc>
<npc id="27431" level="76" type="L2Npc" name="Slayer" title="Resurrected">
<npc id="27431" level="76" type="L2Monster" name="Slayer" title="Resurrected">
<!-- Source http://l2i-god.gaikotsu.ru/ (Lindvior) -->
<race>UNDEAD</race>
<stats>
@ -854,7 +854,7 @@
<height normal="32.5" />
</collision>
</npc>
<npc id="27432" level="76" type="L2Npc" name="Tracker" title="Resurrected">
<npc id="27432" level="76" type="L2Monster" name="Tracker" title="Resurrected">
<!-- Source http://l2i-god.gaikotsu.ru/ (Lindvior) -->
<race>UNDEAD</race>
<stats>
@ -881,7 +881,7 @@
<height normal="28.5" />
</collision>
</npc>
<npc id="27433" level="76" type="L2Npc" name="Priest of Darkness" title="Resurrected">
<npc id="27433" level="76" type="L2Monster" name="Priest of Darkness" title="Resurrected">
<!-- Source http://l2i-god.gaikotsu.ru/ (Lindvior) -->
<race>UNDEAD</race>
<stats>
@ -909,7 +909,7 @@
<height normal="42" />
</collision>
</npc>
<npc id="27434" level="76" type="L2Npc" name="Guardian of Darkness" title="Resurrected">
<npc id="27434" level="76" type="L2Monster" name="Guardian of Darkness" title="Resurrected">
<!-- Source http://l2i-god.gaikotsu.ru/ (Lindvior) -->
<race>UNDEAD</race>
<stats>

View File

@ -1670,7 +1670,7 @@
<height normal="23" />
</collision>
</npc>
<npc id="33170" level="85" type="L2Npc" name="Adolph" title="Aden Vanguard Captain">
<npc id="33170" level="85" type="L2QuestGuard" name="Adolph" title="Aden Vanguard Captain">
<!-- Source http://l2i-god.gaikotsu.ru/ (Lindvior) -->
<race>HUMAN</race>
<stats>
@ -1696,7 +1696,7 @@
<height normal="24.5" />
</collision>
</npc>
<npc id="33171" level="85" type="L2Npc" name="Priest Alice" title="Aden Vanguard">
<npc id="33171" level="85" type="L2QuestGuard" name="Priest Alice" title="Aden Vanguard">
<!-- Source http://l2i-god.gaikotsu.ru/ (Lindvior) -->
<race>HUMAN</race>
<stats>
@ -1722,7 +1722,7 @@
<height normal="23" />
</collision>
</npc>
<npc id="33172" level="85" type="L2Npc" name="Officer Barton" title="Aden Vanguard">
<npc id="33172" level="85" type="L2QuestGuard" name="Officer Barton" title="Aden Vanguard">
<!-- Source http://l2i-god.gaikotsu.ru/ (Lindvior) -->
<race>ORC</race>
<stats>
@ -1748,7 +1748,7 @@
<height normal="30" />
</collision>
</npc>
<npc id="33173" level="85" type="L2Npc" name="Sniper Hayuk" title="Aden Vanguard">
<npc id="33173" level="85" type="L2QuestGuard" name="Sniper Hayuk" title="Aden Vanguard">
<!-- Source http://l2i-god.gaikotsu.ru/ (Lindvior) -->
<race>ELF</race>
<stats>
@ -1774,7 +1774,7 @@
<height normal="23.5" />
</collision>
</npc>
<npc id="33174" level="85" type="L2Npc" name="Magus Eliyah" title="Aden Vanguard">
<npc id="33174" level="85" type="L2QuestGuard" name="Magus Eliyah" title="Aden Vanguard">
<!-- Source http://l2i-god.gaikotsu.ru/ (Lindvior) -->
<race>HUMAN</race>
<stats>

View File

@ -337,7 +337,7 @@
<height normal="25" />
</collision>
</npc>
<npc id="33414" level="76" type="L2Npc" name="Van Archer">
<npc id="33414" level="76" type="L2QuestGuard" name="Van Archer">
<race>HUMAN</race>
<stats>
<vitals hp="4771" hpRegen="7.5" mp="4771" mpRegen="2.7" />
@ -361,7 +361,7 @@
<height normal="23.5" />
</collision>
</npc>
<npc id="33415" level="76" type="L2Npc" name="Van Infantry">
<npc id="33415" level="76" type="L2QuestGuard" name="Van Infantry">
<race>HUMAN</race>
<stats>
<vitals hp="4771" hpRegen="7.5" mp="4771" mpRegen="2.7" />

View File

@ -14,7 +14,7 @@
* 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.KartiasLabyrinth.AI;
package com.l2jmobius.gameserver.ai.npc;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
@ -29,13 +29,13 @@ import com.l2jmobius.util.Rnd;
/**
* @author Mobius
*/
public final class Fighter implements Runnable
public final class FighterAI implements Runnable
{
private L2PcInstance _player;
private final L2QuestGuardInstance _guard;
private int _followRange = 150;
public Fighter(L2PcInstance player, L2QuestGuardInstance guard)
public FighterAI(L2PcInstance player, L2QuestGuardInstance guard)
{
_player = player;
_guard = guard;
@ -64,7 +64,7 @@ public final class Fighter implements Runnable
{
return;
}
ThreadPoolManager.getInstance().scheduleGeneral(new Fighter(_player, _guard), _guard.isInCombat() ? 1000 : 3000);
ThreadPoolManager.getInstance().scheduleGeneral(new FighterAI(_player, _guard), _guard.isInCombat() ? 1000 : 3000);
// Guard is occupied. Use skills logic.
if (_guard.isInCombat())

View File

@ -14,7 +14,7 @@
* 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.KartiasLabyrinth.AI;
package com.l2jmobius.gameserver.ai.npc;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
@ -29,13 +29,13 @@ import com.l2jmobius.util.Rnd;
/**
* @author Mobius
*/
final class Healer implements Runnable
public final class HealerAI implements Runnable
{
private L2PcInstance _player;
private final L2QuestGuardInstance _guard;
private int _followRange = 200;
public Healer(L2PcInstance player, L2QuestGuardInstance guard)
public HealerAI(L2PcInstance player, L2QuestGuardInstance guard)
{
_player = player;
_guard = guard;
@ -64,7 +64,7 @@ final class Healer implements Runnable
{
return;
}
ThreadPoolManager.getInstance().scheduleGeneral(new Healer(_player, _guard), _guard.isInCombat() ? 1000 : 3000);
ThreadPoolManager.getInstance().scheduleGeneral(new HealerAI(_player, _guard), _guard.isInCombat() ? 1000 : 3000);
// Guard is occupied. Use skills logic.
if (_guard.isInCombat())