Removed nonexistent client quests.

This commit is contained in:
MobiusDevelopment
2019-09-27 15:00:42 +00:00
parent 2866dbe20a
commit bf322b07e1
4941 changed files with 144 additions and 92943 deletions

View File

@@ -20,14 +20,11 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.spawns.SpawnGroup;
import org.l2jmobius.gameserver.model.spawns.SpawnTemplate;
import org.l2jmobius.gameserver.model.zone.ZoneType;
@@ -38,8 +35,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
import ai.AbstractNpcAI;
import instances.TaintedDimension.TaintedDimension;
import quests.Q10301_ShadowOfTerrorBlackishRedFog.Q10301_ShadowOfTerrorBlackishRedFog;
/**
* Ancient Arcan City AI.
@@ -111,19 +106,19 @@ public class AncientArcanCity extends AbstractNpcAI
if (zone.getId() == TELEPORT_ZONE.getId())
{
final QuestState qs = creature.getActingPlayer().getQuestState(Q10301_ShadowOfTerrorBlackishRedFog.class.getSimpleName());
if ((qs != null) && qs.isCond(3))
{
final Quest instance = QuestManager.getInstance().getQuest(TaintedDimension.class.getSimpleName());
if (instance != null)
{
instance.notifyEvent("enterInstance", null, player);
}
}
else
{
player.teleToLocation(ANCIENT_ARCAN_CITY);
}
// final QuestState qs = creature.getActingPlayer().getQuestState(Q10301_ShadowOfTerrorBlackishRedFog.class.getSimpleName());
// if ((qs != null) && qs.isCond(3))
// {
// final Quest instance = QuestManager.getInstance().getQuest(TaintedDimension.class.getSimpleName());
// if (instance != null)
// {
// instance.notifyEvent("enterInstance", null, player);
// }
// }
// else
// {
player.teleToLocation(ANCIENT_ARCAN_CITY);
// }
}
else
{

View File

@@ -1,4 +0,0 @@
<html><body>Alarm System:<br>
As the alarm rings, a window for the passcode pops up. On the screen you see the number 120, which begins counting down. It looks like the alarm system will be activated in about 2 minutes unless the passcode is successfully entered.<br>
<a action="bypass -h Quest Alarm 2">Enter the passcode.</a>
</body></html>

View File

@@ -1,4 +0,0 @@
<html><body>Alarm System:<br>
The alarm is ringing loudly. You should leave here immediately.<br>
(Another person has already undertaken the quest.)
</body></html>

View File

@@ -1,42 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode :|<br>
########################<br>
The first number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 3">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">9</a>
</td>
</tr>
</table>
</body></html>

View File

@@ -1,42 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : *|<br>
########################<br>
The second number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 4">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">9</a>
</td>
</tr>
</table>
</body></html>

View File

@@ -1,42 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : **|<br>
########################<br>
The third number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 5">9</a>
</td>
</tr>
</table>
</body></html>

View File

@@ -1,43 +0,0 @@
<html><body>
Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : ***|<br>
########################<br>
The fourth number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">9</a>
</td>
</tr>
</table>
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : ****<br>
########################<br>
Validation completed. Alarm has been disabled.
</body></html>

View File

@@ -1,9 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : ****<br>
########################<br>
Validation has failed. <br>
<br>
<a action="bypass -h Quest Alarm 2">Re-enter passcode.</a>
</body></html>

View File

@@ -1,42 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode :|<br>
########################<br>
The first number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 3">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_04.html">9</a>
</td>
</tr>
</table>
</body></html>

View File

@@ -1,43 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : *|<br>
########################<br>
The second number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 4">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_06.html">9</a>
</td>
</tr>
</table>
</body></html>

View File

@@ -1,41 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : **|<br>
########################<br>
The third number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">2</a>
</td> <td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 32367-184_08.html">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 5">9</a>
</td>
</tr>
</table>
</body></html>

View File

@@ -1,42 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : ***| <br>
########################<br>
The fourth number is...
<table border="0" border color="white" width="65" height="65">
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">1</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">2</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">3</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">4</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">5</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">6</a>
</td>
</tr>
<tr>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">7</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">8</a>
</td>
<td width="20" height="20" align="center">
<a action="bypass -h Quest Alarm 6">9</a>
</td>
</tr>
</table>
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter the passcode for communication.<br>
Passcode : **** <br>
########################<br>
Validation completed. Alarm has been disabled.
</body></html>

View File

@@ -1,8 +0,0 @@
<html><body>Alarm System:<br>
########################<br>
Enter passcode for communication.<br>
Passcode : **** <br>########################<br>
Validation has failed.<br>
<br>
<a action="bypass -h Quest Alarm 2">Re-enter passcode.</a>
</body></html>

View File

@@ -1,357 +0,0 @@
/*
* 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.areas.CrumaTower.Alarm;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
import quests.Q00184_ArtOfPersuasion.Q00184_ArtOfPersuasion;
import quests.Q00185_NikolasCooperation.Q00185_NikolasCooperation;
/**
* Alarm AI for quests Art of Persuasion (184) and Nikola's Cooperation (185).
* @author Zoey76
*/
public class Alarm extends AbstractNpcAI
{
// NPC
private static final int ALARM = 32367;
// Misc
private static final int ART_OF_PERSUASION_ID = 184;
private static final int NIKOLAS_COOPERATION_ID = 185;
private Alarm()
{
addStartNpc(ALARM);
addTalkId(ALARM);
addFirstTalkId(ALARM);
addSpawnId(ALARM);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
final PlayerInstance player0 = npc.getVariables().getObject("player0", PlayerInstance.class);
final Npc npc0 = npc.getVariables().getObject("npc0", Npc.class);
switch (event)
{
case "SELF_DESTRUCT_IN_60":
{
startQuestTimer("SELF_DESTRUCT_IN_30", 30000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_60_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
break;
}
case "SELF_DESTRUCT_IN_30":
{
startQuestTimer("SELF_DESTRUCT_IN_10", 20000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_30_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
break;
}
case "SELF_DESTRUCT_IN_10":
{
startQuestTimer("RECORDER_CRUSHED", 10000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_10_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
break;
}
case "RECORDER_CRUSHED":
{
if (npc0 != null)
{
if (npc0.getVariables().getBoolean("SPAWNED"))
{
npc0.getVariables().set("SPAWNED", false);
if (player0 != null)
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.RECORDER_CRUSHED);
if (verifyMemoState(player0, ART_OF_PERSUASION_ID, -1))
{
setMemoState(player0, ART_OF_PERSUASION_ID, 5);
}
else if (verifyMemoState(player0, NIKOLAS_COOPERATION_ID, -1))
{
setMemoState(player0, NIKOLAS_COOPERATION_ID, 5);
}
}
}
}
npc.deleteMe();
break;
}
case "32367-184_04.html":
case "32367-184_06.html":
case "32367-184_08.html":
{
htmltext = event;
break;
}
case "2":
{
if (player0 == player)
{
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
{
htmltext = "32367-184_02.html";
}
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
{
htmltext = "32367-185_02.html";
}
}
break;
}
case "3":
{
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
{
setMemoStateEx(player, ART_OF_PERSUASION_ID, 1, 1);
htmltext = "32367-184_04.html";
}
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
{
setMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1, 1);
htmltext = "32367-185_04.html";
}
break;
}
case "4":
{
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
{
setMemoStateEx(player, ART_OF_PERSUASION_ID, 1, getMemoStateEx(player, ART_OF_PERSUASION_ID, 1) + 1);
htmltext = "32367-184_06.html";
}
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
{
setMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1, getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1) + 1);
htmltext = "32367-185_06.html";
}
break;
}
case "5":
{
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
{
setMemoStateEx(player, ART_OF_PERSUASION_ID, 1, getMemoStateEx(player, ART_OF_PERSUASION_ID, 1) + 1);
htmltext = "32367-184_08.html";
}
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
{
setMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1, getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1) + 1);
htmltext = "32367-185_08.html";
}
break;
}
case "6":
{
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
{
final int i0 = getMemoStateEx(player, ART_OF_PERSUASION_ID, 1);
if (i0 >= 3)
{
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
{
npc0.getVariables().set("SPAWNED", false);
}
npc.deleteMe();
setMemoState(player, ART_OF_PERSUASION_ID, 4);
htmltext = "32367-184_09.html";
}
else
{
setMemoStateEx(player, ART_OF_PERSUASION_ID, 1, 0);
htmltext = "32367-184_10.html";
}
}
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
{
final int i0 = getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1);
if (i0 >= 3)
{
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
{
npc0.getVariables().set("SPAWNED", false);
}
npc.deleteMe();
setMemoState(player, NIKOLAS_COOPERATION_ID, 4);
htmltext = "32367-185_09.html";
}
else
{
setMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1, 0);
htmltext = "32367-185_10.html";
}
}
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance talker)
{
String htmltext = getNoQuestMsg(talker);
if (verifyMemoState(talker, ART_OF_PERSUASION_ID, 3) || verifyMemoState(talker, NIKOLAS_COOPERATION_ID, 3))
{
final PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.class);
if (player == talker)
{
htmltext = "32367-01.html";
}
else
{
htmltext = "32367-02.html";
}
}
return htmltext;
}
@Override
public String onSpawn(Npc npc)
{
cancelQuestTimer("SELF_DESTRUCT_IN_60", npc, null);
startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES);
final PlayerInstance player = npc.getVariables().getObject("player0", PlayerInstance.class);
if (player != null)
{
playSound(player, QuestSound.ITEMSOUND_SIREN);
}
return super.onSpawn(npc);
}
/**
* Verifies if the given player has the require memo state.
* @param player the player
* @param questId the quest ID
* @param memoState the memo state, if memo state is less than zero, only quest state is checked
* @return {@code true} if the player has the memo state, {@code false} otherwise
*/
private static boolean verifyMemoState(PlayerInstance player, int questId, int memoState)
{
QuestState qs = null;
switch (questId)
{
case ART_OF_PERSUASION_ID:
{
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
break;
}
case NIKOLAS_COOPERATION_ID:
{
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
break;
}
}
return (qs != null) && ((memoState < 0) || qs.isMemoState(memoState));
}
/**
* Sets the memo state for the given player and quest.
* @param player the player
* @param questId the quest ID
* @param memoState the memo state
*/
private void setMemoState(PlayerInstance player, int questId, int memoState)
{
QuestState qs = null;
switch (questId)
{
case ART_OF_PERSUASION_ID:
{
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
break;
}
case NIKOLAS_COOPERATION_ID:
{
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
break;
}
}
if (qs != null)
{
qs.setMemoState(memoState);
}
}
/**
* Gets the memo state ex for the given player, quest and slot.
* @param player the player
* @param questId the quest ID
* @param slot the slot
* @return the memo state ex
*/
private static int getMemoStateEx(PlayerInstance player, int questId, int slot)
{
QuestState qs = null;
switch (questId)
{
case ART_OF_PERSUASION_ID:
{
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
break;
}
case NIKOLAS_COOPERATION_ID:
{
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
break;
}
}
return (qs != null) ? qs.getMemoStateEx(slot) : -1;
}
/**
* Sets the memo state ex for the given player and quest.
* @param player the player
* @param questId the quest ID
* @param slot the slot
* @param memoStateEx the memo state ex
*/
private void setMemoStateEx(PlayerInstance player, int questId, int slot, int memoStateEx)
{
QuestState qs = null;
switch (questId)
{
case ART_OF_PERSUASION_ID:
{
qs = player.getQuestState(Q00184_ArtOfPersuasion.class.getSimpleName());
break;
}
case NIKOLAS_COOPERATION_ID:
{
qs = player.getQuestState(Q00185_NikolasCooperation.class.getSimpleName());
break;
}
}
if (qs != null)
{
qs.setMemoStateEx(slot, memoStateEx);
}
}
public static void main(String[] args)
{
new Alarm();
}
}

View File

@@ -16,15 +16,12 @@
*/
package ai.areas.FairySettlement.LargeCocoon;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureAttacked;
import org.l2jmobius.gameserver.model.quest.Quest;
import ai.AbstractNpcAI;
import quests.Q10305_UnstoppableFutileEfforts.Q10305_UnstoppableFutileEfforts;
/**
* Large Cocoon AI.
@@ -72,11 +69,11 @@ public class LargeCocoon extends AbstractNpcAI
case "attackPowerful":
{
// TODO: Quest 466 stuffs
final Quest qs10305 = QuestManager.getInstance().getQuest(Q10305_UnstoppableFutileEfforts.class.getSimpleName());
if (qs10305 != null)
{
qs10305.notifyEvent("NOTIFY_Q10305", npc, player);
}
// final Quest qs10305 = QuestManager.getInstance().getQuest(Q10305_UnstoppableFutileEfforts.class.getSimpleName());
// if (qs10305 != null)
// {
// qs10305.notifyEvent("NOTIFY_Q10305", npc, player);
// }
if (getRandom(3) < 1)
{
@@ -274,11 +271,11 @@ public class LargeCocoon extends AbstractNpcAI
final Playable playable = (Playable) event.getAttacker();
// TODO: Quest 466 stuffs
final Quest qs10305 = QuestManager.getInstance().getQuest(Q10305_UnstoppableFutileEfforts.class.getSimpleName());
if (qs10305 != null)
{
qs10305.notifyEvent("NOTIFY_Q10305", npc, playable.getActingPlayer());
}
// final Quest qs10305 = QuestManager.getInstance().getQuest(Q10305_UnstoppableFutileEfforts.class.getSimpleName());
// if (qs10305 != null)
// {
// qs10305.notifyEvent("NOTIFY_Q10305", npc, playable.getActingPlayer());
// }
if (getRandom(3) < 1)
{

View File

@@ -36,7 +36,6 @@ import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerChangeToAwakenedClass;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.network.SystemMessageId;
@@ -46,7 +45,6 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
import org.l2jmobius.gameserver.network.serverpackets.UserInfo;
import ai.AbstractNpcAI;
import quests.Q10472_WindsOfFateEncroachingShadows.Q10472_WindsOfFateEncroachingShadows;
/**
* AwakeningMaster AI.
@@ -81,14 +79,14 @@ public class AwakeningMaster extends AbstractNpcAI
}
// Skills
private static final SkillHolder WYNN_POWER = new SkillHolder(16390, 1);
private static final SkillHolder FEOH_POWER = new SkillHolder(16391, 1);
private static final SkillHolder TYRR_POWER = new SkillHolder(16392, 1);
private static final SkillHolder OTHELL_POWER = new SkillHolder(16393, 1);
private static final SkillHolder ISS_POWER = new SkillHolder(16394, 1);
private static final SkillHolder YUL_POWER = new SkillHolder(16395, 1);
private static final SkillHolder SIGEL_POWER = new SkillHolder(16396, 1);
private static final SkillHolder AEORE_POWER = new SkillHolder(16397, 1);
// private static final SkillHolder WYNN_POWER = new SkillHolder(16390, 1);
// private static final SkillHolder FEOH_POWER = new SkillHolder(16391, 1);
// private static final SkillHolder TYRR_POWER = new SkillHolder(16392, 1);
// private static final SkillHolder OTHELL_POWER = new SkillHolder(16393, 1);
// private static final SkillHolder ISS_POWER = new SkillHolder(16394, 1);
// private static final SkillHolder YUL_POWER = new SkillHolder(16395, 1);
// private static final SkillHolder SIGEL_POWER = new SkillHolder(16396, 1);
// private static final SkillHolder AEORE_POWER = new SkillHolder(16397, 1);
private AwakeningMaster()
{
@@ -209,54 +207,21 @@ public class AwakeningMaster extends AbstractNpcAI
if (player.getRace() == Race.ERTHEIA)
{
// Ertheia dual class quest
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
if (qs != null)
{
if ((npc.getId() == WYNN_MASTER) && qs.isCond(8))
{
return setNextErtheiaQuestState(npc, qs, WYNN_MASTER, 9, WYNN_POWER);
}
else if ((npc.getId() == FEOH_MASTER) && qs.isCond(9))
{
return setNextErtheiaQuestState(npc, qs, FEOH_MASTER, 10, FEOH_POWER);
}
else if ((npc.getId() == TYRR_MASTER) && qs.isCond(10))
{
return setNextErtheiaQuestState(npc, qs, TYRR_MASTER, 11, TYRR_POWER);
}
else if ((npc.getId() == OTHELL_MASTER) && qs.isCond(11))
{
return setNextErtheiaQuestState(npc, qs, OTHELL_MASTER, 12, OTHELL_POWER);
}
else if ((npc.getId() == ISS_MASTER) && qs.isCond(12))
{
return setNextErtheiaQuestState(npc, qs, ISS_MASTER, 13, ISS_POWER);
}
else if ((npc.getId() == YUL_MASTER) && qs.isCond(13))
{
return setNextErtheiaQuestState(npc, qs, YUL_MASTER, 14, YUL_POWER);
}
else if ((npc.getId() == SIGEL_MASTER) && qs.isCond(14))
{
return setNextErtheiaQuestState(npc, qs, SIGEL_MASTER, 15, SIGEL_POWER);
}
else if ((npc.getId() == AEORE_MASTER) && qs.isCond(15))
{
return setNextErtheiaQuestState(npc, qs, AEORE_MASTER, 16, AEORE_POWER);
}
}
/*
* final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName()); if (qs != null) { if ((npc.getId() == WYNN_MASTER) && qs.isCond(8)) { return setNextErtheiaQuestState(npc, qs, WYNN_MASTER, 9, WYNN_POWER); } else if ((npc.getId() == FEOH_MASTER)
* && qs.isCond(9)) { return setNextErtheiaQuestState(npc, qs, FEOH_MASTER, 10, FEOH_POWER); } else if ((npc.getId() == TYRR_MASTER) && qs.isCond(10)) { return setNextErtheiaQuestState(npc, qs, TYRR_MASTER, 11, TYRR_POWER); } else if ((npc.getId() == OTHELL_MASTER) && qs.isCond(11)) {
* return setNextErtheiaQuestState(npc, qs, OTHELL_MASTER, 12, OTHELL_POWER); } else if ((npc.getId() == ISS_MASTER) && qs.isCond(12)) { return setNextErtheiaQuestState(npc, qs, ISS_MASTER, 13, ISS_POWER); } else if ((npc.getId() == YUL_MASTER) && qs.isCond(13)) { return
* setNextErtheiaQuestState(npc, qs, YUL_MASTER, 14, YUL_POWER); } else if ((npc.getId() == SIGEL_MASTER) && qs.isCond(14)) { return setNextErtheiaQuestState(npc, qs, SIGEL_MASTER, 15, SIGEL_POWER); } else if ((npc.getId() == AEORE_MASTER) && qs.isCond(15)) { return
* setNextErtheiaQuestState(npc, qs, AEORE_MASTER, 16, AEORE_POWER); } }
*/
return "ertheia.html";
}
return npc.getId() + ".html";
}
private String setNextErtheiaQuestState(Npc npc, QuestState qs, int npcId, int cond, SkillHolder skill)
{
npc.setTarget(qs.getPlayer());
npc.doCast(skill.getSkill());
qs.setCond(cond, true);
return npcId + "-01.html";
}
/*
* private String setNextErtheiaQuestState(Npc npc, QuestState qs, int npcId, int cond, SkillHolder skill) { npc.setTarget(qs.getPlayer()); npc.doCast(skill.getSkill()); qs.setCond(cond, true); return npcId + "-01.html"; }
*/
@RegisterEvent(EventType.ON_PLAYER_CHANGE_TO_AWAKENED_CLASS)
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)

View File

@@ -30,14 +30,12 @@ import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.base.ClassId;
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import ai.AbstractNpcAI;
import quests.Q10472_WindsOfFateEncroachingShadows.Q10472_WindsOfFateEncroachingShadows;
/**
* Hardin (Agent of Chaos) AI.
@@ -188,11 +186,11 @@ public class Hardin extends AbstractNpcAI
{
if (player.getRace() == Race.ERTHEIA)
{
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17))
{
return "33870-03.html";
}
// final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
// if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17))
// {
// return "33870-03.html";
// }
if (!Config.HARDIN_ENABLE_ERTHEIAS)
{
return "33870-02.html";

View File

@@ -20,12 +20,9 @@ import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import ai.AbstractNpcAI;
import quests.Q10320_LetsGoToTheCentralSquare.Q10320_LetsGoToTheCentralSquare;
/**
* Pantheon AI.
@@ -80,17 +77,6 @@ public class Pantheon extends AbstractNpcAI
return htmltext;
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
final QuestState qs = player.getQuestState(Q10320_LetsGoToTheCentralSquare.class.getSimpleName());
if (qs == null)
{
showOnScreenMsg(player, NpcStringId.BEGIN_TUTORIAL_QUESTS, ExShowScreenMessage.TOP_CENTER, 4500);
}
return super.onFirstTalk(npc, player);
}
@Override
public String onSpawn(Npc npc)
{

View File

@@ -46,7 +46,6 @@ import org.l2jmobius.gameserver.model.events.annotations.Id;
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcMenuSelect;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
@@ -55,8 +54,6 @@ import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import ai.AbstractNpcAI;
import quests.Q10385_RedThreadOfFate.Q10385_RedThreadOfFate;
import quests.Q10472_WindsOfFateEncroachingShadows.Q10472_WindsOfFateEncroachingShadows;
/**
* Raina AI.
@@ -631,8 +628,12 @@ public class Raina extends AbstractNpcAI
break;
}
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
if (((qs == null) || !qs.isCompleted()) && !Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS)
// final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
// if (((qs == null) || !qs.isCompleted()) && !Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS)
// {
// break;
// }
if (!Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS)
{
break;
}
@@ -733,8 +734,9 @@ public class Raina extends AbstractNpcAI
private boolean haveDoneQuest(PlayerInstance player, boolean isErtheia)
{
final QuestState qs = isErtheia ? player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName()) : player.getQuestState(Q10385_RedThreadOfFate.class.getSimpleName());
return (((qs != null) && qs.isCompleted()) || Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS);
// final QuestState qs = isErtheia ? player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName()) : player.getQuestState(Q10385_RedThreadOfFate.class.getSimpleName());
// return (((qs != null) && qs.isCompleted()) || Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS);
return (Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS);
}
/**

View File

@@ -1,4 +0,0 @@
<html><body>Toyron:<br>
Alright now, let's search for the intruder. It appears it's the Giant's Book he is after. Let us search around the bookshelf.<br>
Keep the tension up while searching, as the intruder may suddenly show himself.
</body></html>

View File

@@ -1,4 +0,0 @@
<html><body>Toyron:<br>
We cannot let the intruder be. Let us find him, and slay him.<br>
The intruder will not be easy to take down. Please use skills to bring him down.
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>Toyron:<br>
This museum displays the Giants' relics. Unfortunately, it's sometimes plagued by thieves.<br>
The Giants disappeared long ago, but we still uncover treasures in their ruins, even now.<br>
<button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Toyron museum_teleport">Return to the Museum Lobby</button>
<button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</button>
</body></html></body></html>

View File

@@ -1,103 +0,0 @@
/*
* 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.areas.TalkingIsland.Toyron;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.quest.QuestState;
import ai.AbstractNpcAI;
import quests.Q10542_SearchingForNewPower.Q10542_SearchingForNewPower;
/**
* Toyron AI.
* @author Gladicek
*/
public class Toyron extends AbstractNpcAI
{
// NPC
private static final int TOYRON = 33004;
// Misc
private static final int TEMPLATE_ID = 182;
// Location
private static final Location MUSEUM_OUT = new Location(-111464, 255828, -1440);
private Toyron()
{
addStartNpc(TOYRON);
addFirstTalkId(TOYRON);
addTalkId(TOYRON);
addSpawnId(TOYRON);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final Instance world = InstanceManager.getInstance().getPlayerInstance(player, true);
if (event.equals("museum_teleport"))
{
if ((world != null) && (world.getTemplateId() == TEMPLATE_ID))
{
world.finishInstance(0);
}
else
{
player.teleToLocation(MUSEUM_OUT);
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSpawn(Npc npc)
{
npc.setIsInvul(true);
return super.onSpawn(npc);
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
String htmltext = "33004.html";
final Instance world = npc.getInstanceWorld();
if ((world != null) && (world.getTemplateId() == TEMPLATE_ID))
{
final QuestState qs = player.getQuestState(Q10542_SearchingForNewPower.class.getSimpleName());
if (qs != null)
{
switch (qs.getCond())
{
case 3:
htmltext = "33004-01.html";
break;
case 4:
htmltext = "33004-02.html";
break;
}
}
}
return htmltext;
}
public static void main(String[] args)
{
new Toyron();
}
}

View File

@@ -21,7 +21,6 @@ import java.util.Map;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.enums.Race;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -30,11 +29,8 @@ import org.l2jmobius.gameserver.model.events.ListenerRegisterType;
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
import org.l2jmobius.gameserver.model.events.annotations.RegisterType;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState;
import ai.AbstractNpcAI;
import quests.Q10365_ForTheSearchdogKing.Q10365_ForTheSearchdogKing;
/**
* Ye Segira Teleport Device AI.
@@ -101,15 +97,15 @@ public class YeSegiraTeleportDevice extends AbstractNpcAI
}
else if (event.equals("5_exploration_zone"))
{
final QuestState qs = player.getQuestState(Q10365_ForTheSearchdogKing.class.getSimpleName());
if ((qs != null) && qs.isStarted() && qs.isCond(1))
{
final Quest quest_10365 = QuestManager.getInstance().getQuest(Q10365_ForTheSearchdogKing.class.getSimpleName());
if (quest_10365 != null)
{
quest_10365.notifyEvent("TELEPORT_TO_NEXT_STAGE", null, player);
}
}
// final QuestState qs = player.getQuestState(Q10365_ForTheSearchdogKing.class.getSimpleName());
// if ((qs != null) && qs.isStarted() && qs.isCond(1))
// {
// final Quest quest_10365 = QuestManager.getInstance().getQuest(Q10365_ForTheSearchdogKing.class.getSimpleName());
// if (quest_10365 != null)
// {
// quest_10365.notifyEvent("TELEPORT_TO_NEXT_STAGE", null, player);
// }
// }
}
}
return super.onAdvEvent(event, npc, player);

View File

@@ -1,3 +0,0 @@
<html><body>Priest Cerenas:<br>
You can receive it after completing one of these quests: Noblesse - 4, One with an Exalted Spirit; or Noblesse, Soul Testing.<br>
</body></html>

View File

@@ -1,3 +0,0 @@
<html><body>Priest Cerenas:<br>
You already have 1 or more Noblesse Tiaras.<br>
</body></html>

View File

@@ -1,74 +0,0 @@
/*
* 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.areas.TownOfGoddard.Cerenas;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.quest.QuestState;
import ai.AbstractNpcAI;
import quests.Q10369_NoblesseSoulTesting.Q10369_NoblesseSoulTesting;
/**
* Cerenas AI.
* @author Gladicek
*/
public class Cerenas extends AbstractNpcAI
{
// NPC
private static final int CERENAS = 31281;
// Item
private static final int NOBLESSE_TIARA = 7694;
private Cerenas()
{
addStartNpc(CERENAS);
addTalkId(CERENAS);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = player.getQuestState(Q10369_NoblesseSoulTesting.class.getSimpleName());
String htmltext = null;
if (event.equals("tiara"))
{
if ((qs != null) && qs.isCompleted())
{
if (!hasQuestItems(player, NOBLESSE_TIARA))
{
giveItems(player, NOBLESSE_TIARA, 1);
}
else
{
htmltext = "31281-02.html";
}
}
else
{
htmltext = "31281-01.html";
}
}
return htmltext;
}
public static void main(String[] args)
{
new Cerenas();
}
}

View File

@@ -1,6 +0,0 @@
<html><body>Mysterious Wizard:<br>
I was just worried about you.<br>
I guess I was worried that a small Ertheia was led by the souls of the dead to somewhere.<br>
But it seems I picked the wrong time.<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest FortressOfTheDead endCinematic">"What do you mean?"</button>
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Mysterious Wizard:<br>
The deaths of your companions must have been shocking for you. I thought it was strange that Skeletons were appearing near the town.<br>
Please let your guard down. I'm just a <font color="LEVEL">wizard passing by</font>.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10751_WindsOfFateEncounters 33980-03.html">Didn't you pass by last time too?</button>
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>Mysterious Wizard:<br>
Me? Perhaps it was some other wizard passing by? There are many wizards in the world.<br>
By the way, I took the liberty of burying the dead body of the Ertheia, so please do not be angry.<br>
I will give you this to earn your trust. An item <font color="LEVEL">belonging to the dead</font>. It's as if it is from another world.<br>
I like you very much. I hope to see you again.
</body></html>

View File

@@ -1,4 +0,0 @@
<html><body>Mysterious Wizard:<br>
I'm just a wizard passing by. I'd rather not give names and get into unnecessary relationships.<br>
Perhaps that's why people call me the <font color="LEVEL">Mysterious Wizard</font>.
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Mysterious Wizard:<br>
The deaths of your companions must have been shocking for you. I thought it was strange that Skeletons were appearing near the town.<br>
Please let your guard down. I'm just a <font color="LEVEL">wizard passing by</font>.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10751_WindsOfFateEncounters 33980-06.html">Didn't you pass by last time too?</button>
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>Mysterious Wizard:<br>
Me? Perhaps it was some other wizard passing by? There are many wizards in the world.<br>
By the way, I took the liberty of burying the dead body of the Ertheia, so please do not be angry.<br>
I will give you this to earn your trust. An item <font color="LEVEL">belonging to the dead</font>. It's as if it is from another world.<br>
I like you very much. I hope to see you again.
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Mysterious Wizard:<br>
It seems nothing happened.<br>
Did you find the person you were looking for?<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest MysteriousWizard 33980-01.html">Why did you come here?"</button>
</body></html>

View File

@@ -1,83 +0,0 @@
/*
* 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.MysteriousWizard;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.quest.QuestState;
import ai.AbstractNpcAI;
import quests.Q10751_WindsOfFateEncounters.Q10751_WindsOfFateEncounters;
/**
* Mysterious Wizard AI.
* @author Gladicek
*/
public class MysteriousWizard extends AbstractNpcAI
{
// Npc
private static final int MYSTERIOUS_WIZARD = 33980;
// Misc
private static final int FORTRESS_OF_THE_DEAD = 254;
private MysteriousWizard()
{
addFirstTalkId(MYSTERIOUS_WIZARD);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
return event.equals("33980-01.html") ? event : null;
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
String htmltext = null;
final QuestState qs = player.getQuestState(Q10751_WindsOfFateEncounters.class.getSimpleName());
final Instance world = npc.getInstanceWorld();
if (isFotDInstance(world))
{
htmltext = "33980.html";
}
else if (qs != null)
{
if (qs.isCond(6))
{
htmltext = "33980-05.html";
}
else if (qs.isCond(7))
{
htmltext = "33980-04.html";
}
}
return htmltext;
}
private boolean isFotDInstance(Instance instance)
{
return (instance != null) && (instance.getTemplateId() == FORTRESS_OF_THE_DEAD);
}
public static void main(String[] args)
{
new MysteriousWizard();
}
}

View File

@@ -1,4 +0,0 @@
<html><body>Kain Van Halter:<br>
Took you long enough. I thought you'd be as swift as the wind, but you're slow as molasses. I got here first with <font color="LEVEL">Ferin</font>. She's the daughter of... Venir, was it? We're finally going to find the Grail. Let's get going.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ChamberOfProphecies teleport">"Let's go."</button>
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Kain Van Halter:<br>
The Grail was literally just a simple grail. it was not what I was looking for.<br>
But, I have no regrets about taking this journey with you.<br>
If it's not the Grail, I'm not interested in it. Do whatever you wish with it.<br>
Let us part ways now.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ChamberOfProphecies exit">"Good bye."</button>
</body></html>

View File

@@ -1,4 +0,0 @@
<html><body>Kain Van Halter:<br>
I hope that the Grail it's talking about is the same one I'm looking for.<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest ChamberOfProphecies status">Quest</button>
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>
Mysterious Wizard:<br>
<font color="LEVEL">Nidrah</font>? I have no idea what you're talking about. Oh, you mean thr vampire shouted at me?<br>
She was cursed with dark magic and was not herself. You believe her?<br>
More importantly, I want to talk about the object you have.<br>
<Button ALIGN="LEFT" ICON="Normal" action="bypass -h Quest ChamberOfProphecies 33980-02.html">"Do you know what this is?"</button>
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>
Mysterious Wizard:<br>
This is a extremely rare gem called <font color="LEVEL">Atelia</font>. To my knowledge, it's only found in the Wind Spirit Realm.<br>
I heard that an Atelia can recognize its owner. You see how it turned back to its original form when you touched it? That means you are the rightful owner.<br>
<Button ALIGN="LEFT" ICON="Normal" action="bypass -h Quest ChamberOfProphecies 33980-03.html">"Why are You telling me this?"</button>
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Mysterious Wizard:<br>
Do You still suspect me? I'm just helping you so that you won't lose what is yours. The Atelia will only end up in Queen's hands back in town, wich means ir will be the Queen's power. Don't you want the power for yourself?<br>
<Button ALIGN="LEFT" ICON="Normal" action="bypass -h Quest ChamberOfProphecies 33980-04.html">"Don't lie to me. This is not mine."</button>
<Button ALIGN="LEFT" ICON="Normal" action="bypass -h Quest ChamberOfProphecies 33980-04.html">"This is the power I will have?"</button>
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Mysterious Wizard:<br>
Really? Having Atelia's power will make you powerful beyond your imagination. You want to give up your last chance to use this power for yourself?<br>
<Button ALIGN="LEFT" ICON="Normal" action="bypass -h Quest ChamberOfProphecies 33980-05.html">"Do not tempt me to covet what is not mine!"</button>
<Button ALIGN="LEFT" ICON="Normal" action="bypass -h Quest ChamberOfProphecies 33980-05.html">"Well, if you say it's mine, then...hehe"</button>
</body></html>

View File

@@ -1,3 +0,0 @@
<html><body>Mysterious Wizard:<br>
I'm sorry to hear that. I wanted to see you become more powerful. That's all time has permitted us. Perhaps I will see you later?
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>
Mysterious Wizard:<br>
Long time no see. How do you do?<br>
<Button ALIGN="LEFT" ICON="Normal" action="bypass -h Quest ChamberOfProphecies 33980-01.html">"You are... Nidhar, was it?"</button>
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Grail:<br>
This is the grail the Prophecy Machine was referring to.<br>
Do you think this is THE grail?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ChamberOfProphecies 33996-02.html">Can I touch it?</button>
</body></html>

View File

@@ -1,3 +0,0 @@
<html><body>Grail:<br>
The grail disappeared, leaving behind a gem.
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>Grail:<br>
<center>The Atelias's powers are sealed here.</center><br1>
It will regan its from, when the masters of its power comes.<br1>
<center>-Zepharon, King of Ertheia</center><br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest ChamberOfProphecies 33996-01.html">Quest</button>
</body></html>

View File

@@ -1,463 +0,0 @@
/*
* 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.ChamberOfProphecies;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.quest.QuestState;
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.ExShowUsm;
import org.l2jmobius.gameserver.network.serverpackets.NpcSay;
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import instances.AbstractInstance;
import quests.Q10753_WindsOfFateChoices.Q10753_WindsOfFateChoices;
/**
* Chamber of Prophecies instance.
* @author Gigi, Mobius
*/
public class ChamberOfProphecies extends AbstractInstance
{
// NPCs
private static final int KAIN_VAN_HALTER = 31639;
private static final int VAN_HALTER = 33999;
private static final int FERIN = 34001;
private static final int GRAIL = 33996;
private static final int MYSTERIOUS_WIZARD = 33980;
// Misc
private static final int DOOR_2 = 17230102;
private static final int DOOR_3 = 17230103;
private static final int DOOR_4 = 17230104;
private static final int TEMPLATE_ID = 255;
private static final int PROPHECY_MACHINE = 39540;
private static final int ATELIA = 39542;
private static final Location FIRST_ROOM_LOC = new Location(-88503, 184754, -10440, 48891);
public ChamberOfProphecies()
{
super(TEMPLATE_ID);
addStartNpc(KAIN_VAN_HALTER);
addFirstTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD);
addTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD);
addSeeCreatureId(FERIN);
addSeeCreatureId(VAN_HALTER);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
if (event.equals("enterInstance"))
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
enterInstance(player, npc, TEMPLATE_ID);
if (hasQuestItems(player, PROPHECY_MACHINE))
{
takeItems(player, PROPHECY_MACHINE, 1);
}
qs.setCond(16, true);
}
}
else
{
final Instance world = npc.getInstanceWorld();
if (!isInInstance(world))
{
return null;
}
switch (event)
{
case "31639-01.html":
case "33996-01.html":
case "33980-01.html":
case "33980-02.html":
{
htmltext = event;
break;
}
case "33996-02.html":
{
world.broadcastPacket(ExShowUsm.USM_Q015_E); // TODO not show usim movie
world.despawnGroup("q10753_16_instance_grail");
world.spawnGroup("q10753_16_instance_wizard");
giveItems(player, ATELIA, 1);
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-03.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-04.html":
{
showOnScreenMsg(player, NpcStringId.THIS_CHOICE_CANNOT_BE_REVERSED, ExShowScreenMessage.TOP_CENTER, 6000);
htmltext = event;
break;
}
case "33980-05.html":
{
world.spawnGroup("q10753_16_instance_halter_2");
world.setStatus(6);
startQuestTimer("DESPAWN_WIZARD", 2000, npc, player);
htmltext = event;
break;
}
case "status":
{
if (world.isStatus(0))
{
htmltext = "31639-01.html";
break;
}
htmltext = "31639-02.html";
break;
}
case "teleport":
{
world.getNpc(FERIN).deleteMe(); // probably needs another npc id for initial room
world.spawnGroup("q10753_16_instance_halter_1_1");
world.spawnGroup("wof_room1");
player.teleToLocation(FIRST_ROOM_LOC);
cancelQuestTimers("CHECK_STATUS");
startQuestTimer("CHECK_STATUS", 7000, world.getNpc(KAIN_VAN_HALTER), null);
break;
}
case "CHECK_STATUS":
{
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
final PlayerInstance pl = world.getFirstPlayer();
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), pl);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), pl);
startQuestTimer("OPEN_DOOR1", 5000, npc, pl);
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 1:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.spawnGroup("wof_room2_1");
world.setStatus(2);
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 2:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
final PlayerInstance pl = world.getFirstPlayer();
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), pl);
startQuestTimer("OPEN_DOOR2", 5000, npc, pl);
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 3:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), world.getFirstPlayer());
}
startQuestTimer("CHECK_STATUS", 7000, npc, null);
break;
}
case 4:
{
if (world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
world.setStatus(5);
world.spawnGroup("wof_room4");
final PlayerInstance pl = world.getFirstPlayer();
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), pl);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), pl);
}
else
{
startQuestTimer("CHECK_STATUS", 7000, npc, null);
}
break;
}
}
break;
}
case "ATTACK":
case "ATTACK1":
case "ATTACK2":
{
npc.setRunning();
((Attackable) npc).setCanReturnToSpawnPoint(false);
if (npc.isScriptValue(0) && world.getAliveNpcs(MonsterInstance.class).isEmpty())
{
npc.setTarget(player);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else if (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK)
{
World.getInstance().forEachVisibleObjectInRange(npc, MonsterInstance.class, 3000, monster ->
{
addAttackDesire(npc, monster);
return;
});
}
break;
}
case "OPEN_DOOR1":
{
cancelQuestTimers("ATTACK");
world.setStatus(1);
world.openCloseDoor(DOOR_2, true);
world.spawnGroup("wof_room2");
break;
}
case "OPEN_DOOR2":
{
cancelQuestTimers("ATTACK1");
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
break;
}
case "BROADCAST_TEXT":
{
npc.setTarget(player);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_GUY_KAIN_HAS_A_SMARMY_FACE));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_7", 0, 0, 0, 0, 0));
break;
}
case "SEY2":
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
}
break;
}
case "SEY_KAIN":
{
if (npc.getId() == VAN_HALTER)
{
startQuestTimer("ATTACK1", 200, npc, player, true);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
}
break;
}
case "SEY3":
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
}
break;
}
case "SEY_KAIN_1":
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
break;
}
case "SEY_KAIN_2":
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
startQuestTimer("SEY_KAIN_3", 7000, npc, player);
}
break;
}
case "SEY4":
{
if (npc.getId() == FERIN)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
startQuestTimer("REST", 5000, npc, player);
npc.setScriptValue(1);
}
break;
}
case "SEY_KAIN_3":
{
if (npc.getId() == VAN_HALTER)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
startQuestTimer("SEY_KAIN_4", 1000, npc, player);
npc.setScriptValue(1);
}
break;
}
case "REST":
{
if (npc.getId() == FERIN)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
cancelQuestTimers("BROADCAST_TEXT");
}
break;
}
case "SEY_KAIN_4":
{
world.setStatus(5);
world.spawnGroup("q10753_16_instance_grail");
showOnScreenMsg(player, NpcStringId.LEAVE_THIS_PLACE_TO_KAIN_NGO_TO_THE_NEXT_ROOM, ExShowScreenMessage.TOP_CENTER, 6000);
world.openCloseDoor(DOOR_4, true);
cancelQuestTimers("ATTACK2");
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, player);
startQuestTimer("CLOSE", 15000, world.getNpc(GRAIL), player);
break;
}
case "CLOSE":
{
if (player.calculateDistance2D(world.getNpc(GRAIL)) < 390)
{
world.openCloseDoor(DOOR_4, false);
world.despawnGroup("q10753_16_instance_halter_1_1");
world.despawnGroup("wof_room4");
}
else
{
startQuestTimer("CLOSE", 3000, npc, player);
}
break;
}
case "DESPAWN_WIZARD":
{
world.despawnGroup("q10753_16_instance_wizard");
break;
}
case "exit":
{
startQuestTimer("finish", 3000, npc, player);
player.sendPacket(new SystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES).addInt((int) 1.0D));
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
if (qs != null)
{
qs.setCond(17, true);
}
break;
}
case "finish":
{
world.finishInstance(0);
break;
}
}
}
return htmltext;
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
final QuestState qs = player.getQuestState(Q10753_WindsOfFateChoices.class.getSimpleName());
String htmltext = null;
switch (npc.getId())
{
case KAIN_VAN_HALTER:
{
if ((qs != null) && qs.isCond(16))
{
htmltext = "31639.html";
}
break;
}
case GRAIL:
{
htmltext = "33996.html";
break;
}
case MYSTERIOUS_WIZARD:
{
if ((qs != null) && qs.isCond(16))
{
htmltext = "33980.html";
}
break;
}
}
return htmltext;
}
@Override
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (world != null)
{
switch (npc.getId())
{
case FERIN:
{
if (creature.isPlayer() && !creature.isDead() && npc.isScriptValue(0))
{
startQuestTimer("BROADCAST_TEXT", 12000, npc, (PlayerInstance) creature);
}
break;
}
case VAN_HALTER:
{
if (creature.isPlayer() && !creature.isDead() && world.isStatus(0))
{
startQuestTimer("ATTACK", 2000, npc, (PlayerInstance) creature, true);
}
break;
}
}
}
return super.onSeeCreature(npc, creature, isSummon);
}
public static void main(String[] args)
{
new ChamberOfProphecies();
}
}

View File

@@ -1,4 +0,0 @@
<html><body>Priest Cerenas:<br>
You are learning, adventurer. I will pray for your illumination.<br>
(You have already completed this quest.)
</body></html>

View File

@@ -1,3 +0,0 @@
<html><body>Priest Cerenas:<br>
No, no, this will not do. You have not proven yourself worthy. (You must have started the "Soul Testing" quest to enter.)
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Eva's Avatar:<br>
The Goddess of Destruction has finally resurrected! The energy of water continues to be contaminated....<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest EvasHiddenSpace exitInstance">Back</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -1,93 +0,0 @@
/*
* 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.EvasHiddenSpace;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.quest.QuestState;
import instances.AbstractInstance;
import quests.Q10369_NoblesseSoulTesting.Q10369_NoblesseSoulTesting;
/**
* Eva's Hidden Space instance zone.
* @author Gladicek, St3eT
*/
public class EvasHiddenSpace extends AbstractInstance
{
// NPCs
private static final int CERENAS = 31281;
private static final int EVAS_AVATAR = 33686;
// Misc
private static final int TEMPLATE_ID = 217;
public EvasHiddenSpace()
{
super(TEMPLATE_ID);
addStartNpc(CERENAS);
addTalkId(CERENAS, EVAS_AVATAR);
addFirstTalkId(EVAS_AVATAR);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
final QuestState qs = player.getQuestState(Q10369_NoblesseSoulTesting.class.getSimpleName());
if (event.equals("enterInstance"))
{
if ((qs != null) && qs.isStarted())
{
enterInstance(player, npc, TEMPLATE_ID);
if (qs.isCond(14))
{
qs.setCond(15);
}
else if (qs.isCond(17))
{
qs.setCond(18);
}
}
else if ((qs != null) && qs.isCompleted())
{
htmltext = "31281-01.html";
}
else
{
htmltext = "31281.html";
}
}
else if (event.equals("exitInstance"))
{
final Instance world = getPlayerInstance(player);
if (world != null)
{
teleportPlayerOut(player, world);
}
}
return htmltext;
}
public static void main(String[] args)
{
new EvasHiddenSpace();
}
}

View File

@@ -21,7 +21,6 @@ import java.util.List;
import org.l2jmobius.commons.util.CommonUtil;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Race;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.StatsSet;
import org.l2jmobius.gameserver.model.World;
@@ -39,12 +38,6 @@ import org.l2jmobius.gameserver.network.serverpackets.Earthquake;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import instances.AbstractInstance;
import quests.Q10341_DayOfDestinyHumansFate.Q10341_DayOfDestinyHumansFate;
import quests.Q10342_DayOfDestinyElvenFate.Q10342_DayOfDestinyElvenFate;
import quests.Q10343_DayOfDestinyDarkElfsFate.Q10343_DayOfDestinyDarkElfsFate;
import quests.Q10344_DayOfDestinyOrcsFate.Q10344_DayOfDestinyOrcsFate;
import quests.Q10345_DayOfDestinyDwarfsFate.Q10345_DayOfDestinyDwarfsFate;
import quests.Q10346_DayOfDestinyKamaelsFate.Q10346_DayOfDestinyKamaelsFate;
/**
* Evil Incubator instance zone.
@@ -95,16 +88,16 @@ public class EvilIncubator extends AbstractInstance
// Misc
private static final int TEMPLATE_ID = 185;
//@formatter:off
private static final EnumMap<Race, String> RACE_QUESTS = new EnumMap<>(Race.class);
static
{
RACE_QUESTS.put(Race.HUMAN, Q10341_DayOfDestinyHumansFate.class.getSimpleName());
RACE_QUESTS.put(Race.ELF, Q10342_DayOfDestinyElvenFate.class.getSimpleName());
RACE_QUESTS.put(Race.DARK_ELF, Q10343_DayOfDestinyDarkElfsFate.class.getSimpleName());
RACE_QUESTS.put(Race.ORC, Q10344_DayOfDestinyOrcsFate.class.getSimpleName());
RACE_QUESTS.put(Race.DWARF, Q10345_DayOfDestinyDwarfsFate.class.getSimpleName());
RACE_QUESTS.put(Race.KAMAEL, Q10346_DayOfDestinyKamaelsFate.class.getSimpleName());
}
//private static final EnumMap<Race, String> RACE_QUESTS = new EnumMap<>(Race.class);
//static
//{
// RACE_QUESTS.put(Race.HUMAN, Q10341_DayOfDestinyHumansFate.class.getSimpleName());
// RACE_QUESTS.put(Race.ELF, Q10342_DayOfDestinyElvenFate.class.getSimpleName());
// RACE_QUESTS.put(Race.DARK_ELF, Q10343_DayOfDestinyDarkElfsFate.class.getSimpleName());
// RACE_QUESTS.put(Race.ORC, Q10344_DayOfDestinyOrcsFate.class.getSimpleName());
// RACE_QUESTS.put(Race.DWARF, Q10345_DayOfDestinyDwarfsFate.class.getSimpleName());
// RACE_QUESTS.put(Race.KAMAEL, Q10346_DayOfDestinyKamaelsFate.class.getSimpleName());
//}
private static final EnumMap<ClassId, Integer> CLASS_BOSS = new EnumMap<>(ClassId.class);
static
{
@@ -557,7 +550,8 @@ public class EvilIncubator extends AbstractInstance
{
return null;
}
return RACE_QUESTS.containsKey(player.getRace()) ? player.getQuestState(RACE_QUESTS.get(player.getRace())) : null;
// return RACE_QUESTS.containsKey(player.getRace()) ? player.getQuestState(RACE_QUESTS.get(player.getRace())) : null;
return null;
}
public static void main(String[] args)

View File

@@ -1,3 +0,0 @@
<html><body>Magister Ayanthe:<br>
The monsters are coming. Concentrate and attack!
</body></html>

View File

@@ -1,4 +0,0 @@
<html><body>Magister Ayanthe:<br>
Focus on the fight!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FaeronTrainingGrounds1 33944-03.html">"Create more monsters so I can train."</Button>
</body></html>

View File

@@ -1,4 +0,0 @@
<html><body>Magister Ayanthe:<br>
Good. It pleases me that you're taking your training so seriously.<br>
But bear in mind that this is training, and not the real world. We will limit the number of monsters you face in a single encounter.
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Magister Ayanthe:<br>
You're better than I expected. Feels different from training with a dummy, right?<br>
Here, take these <font color="LEVEL">Spiritshots</font>. Right now, your weapon has no grade, but as you become stronger, you'll be using D-grade, C-grade, and even R-grade weapons. They're proving to be very valuable in the Material Realm.<br>
Go ahead and <font color="LEVEL">activate the Spiritshots</font>.<br>
I'll go prepare more monsters for your next training session, so let me know when the Spiritshots have been activated.<br>
(You can conveniently automate your Spiritshots by creating a <font color="LEVEL">shortcut</font> and then <font color="LEVEL">right-clicking</font> on it.)
</body></html>

View File

@@ -1,3 +0,0 @@
<html><head><body>Magister Ayanthe:<br>
All right, now your training begins again!
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>Mastery Ayanthe:<br>
I see you're a quick study. I'm impressed. I can't wait to see how much you'll have improved in the future. You have recovered some of your power that has been sealed while passing through the Dimensional Rift. These are called <font color="LEVEL">Skills</font>.<br>
The more abilities you recover, the stronger you'll grow.<br>
Now that you've recovered some of your power, shall we face tougher enemies? Are you ready?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FaeronTrainingGrounds1 33944-07.html">"My body is ready."</Button>
</body></html>

View File

@@ -1,3 +0,0 @@
<html><body>Magister Ayanthe:<br>
If you don't use your <font color="LEVEL">skills</font>, this next battle will be difficult!
</body></html>

View File

@@ -1,4 +0,0 @@
<html><body>Magister Ayanthe:<br>
Great work. You've made me very proud. You must be exhausted. Shall we step outside?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FaeronTrainingGrounds1 exit_instance">"I'd like to go outside."</button>
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Magister Ayanthe:<br>
Don't underestimate the enemy you see before you.<br>
While in battle, you must never lose focus.<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest FaeronTrainingGrounds1">Quest</Button>
</body></html>

View File

@@ -1,315 +0,0 @@
/*
* 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.FaeronTrainingGrounds1;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.StatsSet;
import org.l2jmobius.gameserver.model.WorldObject;
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.model.quest.QuestState;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.ExTutorialShowId;
import instances.AbstractInstance;
import quests.Q10735_ASpecialPower.Q10735_ASpecialPower;
/**
* Fearon Training Grounds Instance Zone.
* @author Sdw, malyelfik
*/
public class FaeronTrainingGrounds1 extends AbstractInstance
{
// NPCs
private static final int AYANTHE = 33942;
private static final int AYANTHE_2 = 33944;
// Monsters
private static final int FLOATO = 27526;
private static final int FLOATO2 = 27531;
private static final int RATEL = 27527;
// Items
private static final ItemHolder SPIRITSHOTS_TRAINING = new ItemHolder(2509, 150);
// Locations
private static final Location[] MOB_SPAWNS =
{
new Location(-74721, 240513, -3584),
new Location(-74760, 240773, -3560)
};
// Misc
private static final int TEMPLATE_ID = 251;
private static final double DAMAGE_BY_SKILL = 0.5d; // Percent
public FaeronTrainingGrounds1()
{
super(TEMPLATE_ID);
addStartNpc(AYANTHE, AYANTHE_2);
addFirstTalkId(AYANTHE_2);
addTalkId(AYANTHE, AYANTHE_2);
addKillId(FLOATO, FLOATO2, RATEL);
addSkillSeeId(RATEL);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = player.getQuestState(Q10735_ASpecialPower.class.getSimpleName());
String htmltext = null;
if (qs == null)
{
return htmltext;
}
switch (event)
{
case "enter_instance":
{
enterInstance(player, npc, TEMPLATE_ID);
break;
}
case "exit_instance":
{
finishInstance(player, 0);
break;
}
case "33944-03.html":
{
if (qs.isCond(6))
{
spawnMonsters(RATEL, player);
showOnScreenMsg(player, NpcStringId.FIGHT_USING_SKILLS, ExShowScreenMessage.TOP_CENTER, 10000);
}
else
{
final int npcId = (qs.isCond(4)) ? FLOATO2 : FLOATO;
spawnMonsters(npcId, player);
showOnScreenMsg(player, NpcStringId.ATTACK_THE_MONSTER, ExShowScreenMessage.TOP_CENTER, 10000);
}
htmltext = event;
break;
}
case "33944-07.html":
{
if (qs.isCond(5))
{
qs.setCond(6, true);
showOnScreenMsg(player, NpcStringId.FIGHT_USING_SKILLS, ExShowScreenMessage.TOP_CENTER, 10000);
spawnMonsters(RATEL, player);
htmltext = event;
}
break;
}
}
return htmltext;
}
@Override
public String onTalk(Npc npc, PlayerInstance player)
{
final QuestState qs = player.getQuestState(Q10735_ASpecialPower.class.getSimpleName());
String htmltext = getNoQuestMsg(player);
if (qs == null)
{
return htmltext;
}
if ((npc.getId() == AYANTHE_2) && qs.isStarted())
{
switch (qs.getCond())
{
case 1:
{
qs.setCond(2, true);
spawnMonsters(FLOATO, player);
showOnScreenMsg(player, NpcStringId.ATTACK_THE_MONSTER, ExShowScreenMessage.TOP_CENTER, 10000);
htmltext = "33944-01.html";
break;
}
case 2:
case 4:
case 6:
{
htmltext = "33944-02.html";
break;
}
case 3:
{
if (qs.getInt("ss") == 1)
{
spawnMonsters(FLOATO2, player);
showOnScreenMsg(player, NpcStringId.ATTACK_THE_MONSTER, ExShowScreenMessage.TOP_CENTER, 10000);
qs.setCond(4, true);
htmltext = "33944-05.html";
}
else
{
qs.set("ss", 1);
giveItems(player, SPIRITSHOTS_TRAINING);
showOnScreenMsg(player, NpcStringId.AUTOMATE_SPIRITSHOT_AS_SHOWN_IN_THE_TUTORIAL, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new ExTutorialShowId(14));
htmltext = "33944-04.html";
}
break;
}
case 5:
{
player.sendPacket(new ExTutorialShowId(15));
htmltext = "33944-06.html";
break;
}
case 7:
{
htmltext = "33944-08.html";
break;
}
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
// Check if monster is inside instance
final Instance world = npc.getInstanceWorld();
if (world == null)
{
return super.onKill(npc, killer, isSummon);
}
// Remove monster from instance spawn holder
world.setParameter("Mob" + npc.getScriptValue(), null);
// Handle quest state
final QuestState qs = killer.getQuestState(Q10735_ASpecialPower.class.getSimpleName());
if (qs != null)
{
switch (npc.getId())
{
case FLOATO:
case FLOATO2:
{
if ((qs.isCond(2) || qs.isCond(4)) && onKillQuestChange(killer, qs))
{
despawnMonsters(killer);
if (qs.isCond(5) && (killer.getLevel() < 5))
{
addExpAndSp(killer, 1716, 0);
}
}
break;
}
case RATEL:
{
if (qs.isCond(6) && onKillQuestChange(killer, qs))
{
despawnMonsters(killer);
showOnScreenMsg(killer, NpcStringId.TALK_TO_AYANTHE_TO_LEAVE_THE_TRAINING_GROUNDS, ExShowScreenMessage.TOP_CENTER, 10000);
}
break;
}
}
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onSkillSee(Npc npc, PlayerInstance player, Skill skill, WorldObject[] targets, boolean isSummon)
{
if (!npc.isDead() && (player.getTarget() == npc))
{
final double dmg = npc.getMaxHp() * DAMAGE_BY_SKILL;
npc.reduceCurrentHp(dmg, player, null);
}
return super.onSkillSee(npc, player, skill, targets, isSummon);
}
/**
* Handle death of training monster. When all monsters are killed, quest cond is increased.
* @param killer player who killed monster
* @param qs quest state of killer
* @return {@code true} when all monsters are killed, otherwise {@code false}
*/
private boolean onKillQuestChange(PlayerInstance killer, QuestState qs)
{
final int value = qs.getMemoStateEx(Q10735_ASpecialPower.KILL_COUNT_VAR) + 1;
if (value >= 2)
{
qs.setCond(qs.getCond() + 1, true);
qs.setMemoStateEx(Q10735_ASpecialPower.KILL_COUNT_VAR, 0);
return true;
}
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
qs.setMemoStateEx(Q10735_ASpecialPower.KILL_COUNT_VAR, value);
qs.getQuest().sendNpcLogList(killer);
return false;
}
/**
* Spawn training monsters inside instance
* @param npcId template id of training monster
* @param player player that owns instance
*/
private void spawnMonsters(int npcId, PlayerInstance player)
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
final StatsSet params = world.getParameters();
for (int i = 0; i < MOB_SPAWNS.length; i++)
{
if (params.getObject("Mob" + i, Npc.class) == null)
{
final Npc npc = addSpawn(npcId, MOB_SPAWNS[i], false, 0, false, world.getId());
npc.setScriptValue(i);
params.set("Mob" + i, npc);
}
}
}
}
/**
* Despawn training monsters inside instance
* @param player player that owns instance
*/
private void despawnMonsters(PlayerInstance player)
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
final StatsSet params = world.getParameters();
for (int i = 0; i < MOB_SPAWNS.length; i++)
{
final Npc mob = params.getObject("Mob" + i, Npc.class);
if (mob != null)
{
mob.deleteMe();
params.remove("Mob" + i);
}
}
}
}
public static void main(String[] args)
{
new FaeronTrainingGrounds1();
}
}

View File

@@ -1,4 +0,0 @@
<html><body>Master Katalin:<br>
The monsters are here.<br>
Stay focused in battle and take care not to get hurt.
</body></html>

View File

@@ -1,4 +0,0 @@
<html><body>Master Katalin:<br>
Focus on your battle!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FaeronTrainingGrounds2 33945-03.html">"More monsters please."</button>
</body></html>

View File

@@ -1,4 +0,0 @@
<html><body>Master Katalin:<br>
It's good to see you train hard.<br>
But for your safety, there's a limit to the number of monsters at once.
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Master Katalin:<br>
Different from the Training Dummies?<br>
Take these <font color="LEVEL">Soulshots</font>. They have no grade, but as you get stronger and get better weapons, you can use Grade D, C, B, A, S, S-80, and eventually R. It's very important in the Material Realm.<br>
<font color="LEVEL">Activate Soulshots</font>.<br>
I will prepare the next set of monsters. Tell me when you have activated the Soulshots.<br>
(How to Enable Auto-Use Soulshot or Spiritshot: Open your <font color="LEVEL">Inventory</font>. <font color="LEVEL">Click and Drag</font> Soulshot/Spiritshot into your Shortcut Bar. Right Click the Soulshot/Spiritshot Shortcut Icon to use it automatically.)
</body></html>

View File

@@ -1,3 +0,0 @@
<html><body>Master Katalin:<br>
Okay, here we go again.
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Master Katalin:<br>
Do you know what just happened? You were able to use a lot of abilities when you were in the Wind Spirit Realm. But as you came through the Dimensional Rift, your abilities were locked.<br>
But you just unlocked one of those abilities. They call them <font color="LEVEL">Skills</font> here.<br>
As you train more, you will be able to get more skills back.<br>
Shall we fight a more powerful enemy with your new skill?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FaeronTrainingGrounds2 33945-07.html">"Okay."</button>
</body></html>

View File

@@ -1,3 +0,0 @@
<html><body>Master Katalin:<br>
This battle won't be easy without your <font color="LEVEL">Skills</font>!
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Master Katalin:<br>
Good work! I am proud of you.<br>
We're done. Let's get out.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FaeronTrainingGrounds2 exit_instance">"Okay."</button>
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Master Katalin:<br>
You can't let your guard down with your enemy in front of you.<br>
You must always focus during battle.<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest FaeronTrainingGrounds2">Quest</Button>
</body></html>

View File

@@ -1,312 +0,0 @@
/*
* 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.FaeronTrainingGrounds2;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.StatsSet;
import org.l2jmobius.gameserver.model.WorldObject;
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.model.quest.QuestState;
import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import org.l2jmobius.gameserver.network.serverpackets.ExTutorialShowId;
import instances.AbstractInstance;
import quests.Q10736_ASpecialPower.Q10736_ASpecialPower;
/**
* Fearon Training Grounds Instance Zone.
* @author Sdw, malyelfik
*/
public class FaeronTrainingGrounds2 extends AbstractInstance
{
// NPCs
private static final int KATALIN = 33943;
private static final int KATALIN_2 = 33945;
// Monsters
private static final int FLOATO = 27526;
private static final int FLOATO2 = 27531;
private static final int RATEL = 27527;
// Item
private static final ItemHolder SOULSHOTS_TRAINING = new ItemHolder(1835, 150);
// Locations
private static final Location[] MOB_SPAWNS =
{
new Location(-74760, 240773, -3560),
new Location(-74721, 240513, -3584)
};
// Misc
private static final int TEMPLATE_ID = 252;
private static final double DAMAGE_BY_SKILL = 0.5d; // Percent
public FaeronTrainingGrounds2()
{
super(TEMPLATE_ID);
addStartNpc(KATALIN, KATALIN_2);
addFirstTalkId(KATALIN_2);
addTalkId(KATALIN, KATALIN_2);
addKillId(FLOATO, FLOATO2, RATEL);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = player.getQuestState(Q10736_ASpecialPower.class.getSimpleName());
String htmltext = null;
if (qs == null)
{
return htmltext;
}
switch (event)
{
case "enter_instance":
{
enterInstance(player, npc, TEMPLATE_ID);
break;
}
case "exit_instance":
{
finishInstance(player, 0);
break;
}
case "33945-03.html":
{
if (qs.isCond(6))
{
spawnMonsters(RATEL, player);
showOnScreenMsg(player, NpcStringId.FIGHT_USING_SKILLS, ExShowScreenMessage.TOP_CENTER, 10000);
}
else
{
final int npcId = (qs.isCond(4)) ? FLOATO2 : FLOATO;
spawnMonsters(npcId, player);
showOnScreenMsg(player, NpcStringId.ATTACK_THE_MONSTER, ExShowScreenMessage.TOP_CENTER, 10000);
}
htmltext = event;
break;
}
case "33945-07.html":
{
if (qs.isCond(5))
{
qs.setCond(6, true);
showOnScreenMsg(player, NpcStringId.FIGHT_USING_SKILLS, ExShowScreenMessage.TOP_CENTER, 10000);
spawnMonsters(RATEL, player);
htmltext = event;
}
break;
}
}
return htmltext;
}
@Override
public String onTalk(Npc npc, PlayerInstance player)
{
final QuestState qs = player.getQuestState(Q10736_ASpecialPower.class.getSimpleName());
String htmltext = getNoQuestMsg(player);
if (qs == null)
{
return htmltext;
}
if ((npc.getId() == KATALIN_2) && qs.isStarted())
{
switch (qs.getCond())
{
case 1:
{
qs.setCond(2, true);
spawnMonsters(FLOATO, player);
htmltext = "33945-01.html";
break;
}
case 2:
case 4:
case 6:
{
htmltext = "33945-02.html";
break;
}
case 3:
{
if (qs.getInt("ss") == 1)
{
spawnMonsters(FLOATO2, player);
qs.setCond(4, true);
htmltext = "33945-05.html";
}
else
{
qs.set("ss", 1);
giveItems(player, SOULSHOTS_TRAINING);
showOnScreenMsg(player, NpcStringId.AUTOMATE_SOULSHOT_AS_SHOWN_IN_THE_TUTORIAL, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new ExTutorialShowId(14));
htmltext = "33945-04.html";
}
break;
}
case 5:
{
player.sendPacket(new ExTutorialShowId(15));
htmltext = "33945-06.html";
break;
}
case 7:
{
htmltext = "33945-08.html";
break;
}
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
// Check if monster is inside instance
final Instance world = npc.getInstanceWorld();
if (world == null)
{
return super.onKill(npc, killer, isSummon);
}
// Remove monster from instance spawn holder
world.setParameter("Mob" + npc.getScriptValue(), null);
// Handle quest state
final QuestState qs = killer.getQuestState(Q10736_ASpecialPower.class.getSimpleName());
if (qs != null)
{
switch (npc.getId())
{
case FLOATO:
case FLOATO2:
{
if ((qs.isCond(2) || qs.isCond(4)) && onKillQuestChange(killer, qs))
{
despawnMonsters(killer);
if (qs.isCond(5) && (killer.getLevel() < 5))
{
addExpAndSp(killer, 1716, 0);
}
}
break;
}
case RATEL:
{
if (qs.isCond(6) && onKillQuestChange(killer, qs))
{
despawnMonsters(killer);
showOnScreenMsg(killer, NpcStringId.TALK_TO_KATALIN_TO_LEAVE_THE_TRAINING_GROUNDS, ExShowScreenMessage.TOP_CENTER, 10000);
}
break;
}
}
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onSkillSee(Npc npc, PlayerInstance player, Skill skill, WorldObject[] targets, boolean isSummon)
{
if (!npc.isDead() && (player.getTarget() == npc))
{
final double dmg = npc.getMaxHp() * DAMAGE_BY_SKILL;
npc.reduceCurrentHp(dmg, player, null);
}
return super.onSkillSee(npc, player, skill, targets, isSummon);
}
/**
* Handle death of training monster. When all monsters are killed, quest cond is increased.
* @param killer player who killed monster
* @param qs quest state of killer
* @return {@code true} when all monsters are killed, otherwise {@code false}
*/
private boolean onKillQuestChange(PlayerInstance killer, QuestState qs)
{
final int value = qs.getMemoStateEx(Q10736_ASpecialPower.KILL_COUNT_VAR) + 1;
if (value >= 2)
{
qs.setCond(qs.getCond() + 1, true);
qs.setMemoStateEx(Q10736_ASpecialPower.KILL_COUNT_VAR, 0);
return true;
}
playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
qs.setMemoStateEx(Q10736_ASpecialPower.KILL_COUNT_VAR, value);
qs.getQuest().sendNpcLogList(killer);
return false;
}
/**
* Spawn training monsters inside instance
* @param npcId template id of training monster
* @param player player that owns instance
*/
private void spawnMonsters(int npcId, PlayerInstance player)
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
final StatsSet params = world.getParameters();
for (int i = 0; i < MOB_SPAWNS.length; i++)
{
if (params.getObject("Mob" + i, Npc.class) == null)
{
final Npc npc = addSpawn(npcId, MOB_SPAWNS[i], false, 0, false, world.getId());
npc.setScriptValue(i);
params.set("Mob" + i, npc);
}
}
}
}
/**
* Despawn training monsters inside instance
* @param player player that owns instance
*/
private void despawnMonsters(PlayerInstance player)
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
final StatsSet params = world.getParameters();
for (int i = 0; i < MOB_SPAWNS.length; i++)
{
final Npc mob = params.getObject("Mob" + i, Npc.class);
if (mob != null)
{
mob.deleteMe();
params.remove("Mob" + i);
}
}
}
}
public static void main(String[] args)
{
new FaeronTrainingGrounds2();
}
}

View File

@@ -1,4 +0,0 @@
<html><body>Kain Van Halter:<br>
You're Ertheia. Child of the wind. Why would you try to kill Giselle all the way out here?<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest FortressOfTheDead 33979-02.html">"I didn't know that it was Giselle. She attacked first!"</button>
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Kain Van Halter:<br>
That's not a good reason. The fact that you came all the way here alone is suspicious.<br>
You were after Giselle's life in the first place!<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest FortressOfTheDead 33979-03.html">"I have Queen Navari's Mark."</button>
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>Kain Van Halter:<br>
The Queen of Ertheia sent you?<br>
All right, then. Since Giselle became very aggressive after becoming a vampire, I will take your word on your dispute.<br>
But what brings you all the way here? Why were you looking for Giselle? I can't imagine Ertheia having business with her.<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest FortressOfTheDead 33979-04.html">"I was looking for you."</button>
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Kain Van Halter:<br>
Me?<br>
What do you want with a wanderer like me? And I don't see why I should even help you. You tried to harm my sister! Good thing I stopped by to check on her.<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest FortressOfTheDead 33979-05.html">"It's about the Prophecy Machine."</button>
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Kain Van Halter:<br>
Prophecy Machine?<br>
What about the Prophecy Machine?<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest FortressOfTheDead 33979-06.html">"Here, take a look."</button>
</body></html>

View File

@@ -1,9 +0,0 @@
<html><body>Kain Van Halter:<br>
<center><font color="LEVEL">A red river flows...hard frost upon the earth...<br1>
One of half-noble blood,<br1>
descending with the winds to deliver from...<br1>
When joined by one...<br1>
The path will open to the Grail.</font></center><br1>
So why are you showing me this?<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest FortressOfTheDead 33979-07.html">"I know that you're interested in the Grail."</button>
</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Kain Van Halter:<br>
I see. Did Karla tell you? So she still remembers me mentioning the Grail that day.<br>
Check this out first.<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest FortressOfTheDead 33979-08.html">"This?"</button>
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>Kain Van Halter:<br>
Surprised? I found it while passing Goddard Territory.<br>
This looks similar to the Prophecy Machine that you showed me. It's probably a part of the whole.<br>
And about what's written on your machine... I think I know what it's saying.<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest FortressOfTheDead 33979-09.html">"Do tell."</button>
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>Kain Van Halter:<br>
<font color="LEVEL">A red river flows...Hm. I think I can see where this is going.</font><br>
It's talking about this continent. A red river flows...hard frost upon the earth. You see, <font color="LEVEL">Elmore</font> rules over a cold part of the land, which it once shared with Aden as Elmoreden. Now the whole continent is swarming with Shilen's bloody works.<br>
But this part is surprising. When joined by one...the path will open to the Grail. Truly?<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest FortressOfTheDead 33979-10.html">"Who is this one?"</button>
</body></html>

View File

@@ -1,8 +0,0 @@
<html><body>Kain Van Halter:<br>
<font color="LEVEL">One of half-noble blood...</font><br>
Ha! Even the prophecy of Ertheia describes me so, huh? Well, it's right. My mother was a commoner. A tragic farce, to be loved by the king! So here I am, a prince only in name. And descending with the winds to deliver from...yes, that is me. I happened to save Faeron once. <font color="LEVEL">Kain</font> is your man!<br>
The <font color="LEVEL">Grail</font>...if it's the same <font color="LEVEL">Grail</font>, then...anyway, you can read the rest of the prophecy with the fragment that I found, right?<br>
Take it. Your village needs it more than I.<br>
Hmm? Wait...<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest FortressOfTheDead spawnWizard">"What?"</button>
</body></html>

View File

@@ -1,2 +0,0 @@
<html><body>Kain Van Halter:<br>
Who is that person standing there?</body></html>

View File

@@ -1,5 +0,0 @@
<html><body>Kain Van Halter:<br>
You trespass on the land of death. Who are you?<br1>
No matter. You threatened Giselle with harm, and you will answer to me!<br>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h Quest FortressOfTheDead 33979-01.html">Quest</button>
</body></html>

View File

@@ -1,176 +0,0 @@
/*
* 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.FortressOfTheDead;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import instances.AbstractInstance;
import quests.Q10752_WindsOfFateAPromise.Q10752_WindsOfFateAPromise;
/**
* Fortress of the Dead instance zone.
* @author Gladicek
*/
public class FortressOfTheDead extends AbstractInstance
{
// NPCs
private static final int BROKEN_BOOKSHELF = 31526;
private static final int VAMPIRIC_SOLDIER = 19567;
private static final int VON_HELLMAN = 19566;
private static final int MYSTERIOUS_WIZARD = 33980;
private static final int KAIN_VAN_HALTER = 33979;
// Items
private static final int KAIN_PROPHECY_MACHINE_FRAGMENT = 39538;
// Location
private static final Location VON_HELLMAN_LOC = new Location(57963, -28676, 568, 49980);
private static final Location MYSTERIOUS_WIZARD_LOC = new Location(57982, -28645, 568);
private static final Location KAIN_VAN_HALTER_LOC = new Location(57963, -28676, 568, 49980);
// Misc
private static final int TEMPLATE_ID = 254;
public FortressOfTheDead()
{
super(TEMPLATE_ID);
addStartNpc(BROKEN_BOOKSHELF);
addFirstTalkId(KAIN_VAN_HALTER);
addTalkId(BROKEN_BOOKSHELF, KAIN_VAN_HALTER, MYSTERIOUS_WIZARD);
addKillId(VAMPIRIC_SOLDIER, VON_HELLMAN);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = null;
if (event.equals("enterInstance"))
{
enterInstance(player, npc, TEMPLATE_ID);
}
else
{
final Instance world = npc.getInstanceWorld();
if (isInInstance(world))
{
switch (event)
{
case "33979-01.html":
case "33979-02.html":
case "33979-03.html":
case "33979-04.html":
case "33979-05.html":
case "33979-06.html":
case "33979-07.html":
case "33979-08.html":
case "33979-09.html":
case "33979-10.html":
{
htmltext = event;
break;
}
case "exitInstance":
{
world.finishInstance(0);
break;
}
case "vampire_dead":
{
addSpawn(VON_HELLMAN, VON_HELLMAN_LOC, false, 0, false, world.getId());
break;
}
case "hellman_dead":
{
addSpawn(KAIN_VAN_HALTER, KAIN_VAN_HALTER_LOC, false, 0, false, world.getId());
break;
}
case "spawnWizard":
{
showOnScreenMsg(player, NpcStringId.TALK_TO_THE_MYSTERIOUS_WIZARD, ExShowScreenMessage.TOP_CENTER, 5000);
final Npc wizzard = addSpawn(MYSTERIOUS_WIZARD, MYSTERIOUS_WIZARD_LOC, true, 0, false, world.getId());
wizzard.setSummoner(player);
wizzard.setTitle(player.getAppearance().getVisibleName());
wizzard.broadcastInfo();
htmltext = "33979-11.html";
break;
}
case "endCinematic":
{
final QuestState qs = player.getQuestState(Q10752_WindsOfFateAPromise.class.getSimpleName());
if ((qs != null) && qs.isCond(8))
{
qs.setCond(9, true);
giveItems(player, KAIN_PROPHECY_MACHINE_FRAGMENT, 1);
}
world.getNpc(KAIN_VAN_HALTER).deleteMe();
world.getNpc(MYSTERIOUS_WIZARD).deleteMe();
playMovie(player, Movie.ERT_QUEST_B);
startQuestTimer("exitInstance", 25000, npc, player);
break;
}
}
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance player, boolean isSummon)
{
final Instance world = npc.getInstanceWorld();
if (isInInstance(world))
{
if (npc.getId() == VAMPIRIC_SOLDIER)
{
if (world.getAliveNpcs(VAMPIRIC_SOLDIER).isEmpty())
{
startQuestTimer("vampire_dead", 3000, npc, player);
}
}
else if (npc.getId() == VON_HELLMAN)
{
npc.deleteMe();
playMovie(player, Movie.ERT_QUEST_A);
startQuestTimer("hellman_dead", 6000, npc, player);
}
}
return super.onKill(npc, player, isSummon);
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
final QuestState qs = player.getQuestState(Q10752_WindsOfFateAPromise.class.getSimpleName());
if ((qs != null) && qs.isCond(8))
{
return "33979.html";
}
return null;
}
public static void main(String[] args)
{
new FortressOfTheDead();
}
}

View File

@@ -1,4 +0,0 @@
<html><body>Seal Control Device:<br>
This device controls the seals imprisoning the soul of Hermuncus.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest HarnakUndergroundRuins activate_seal">Release the seal.</Button>
</body></html>

View File

@@ -1,738 +0,0 @@
/*
* 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.HarnakUndergroundRuins;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.Movie;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.StatsSet;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.variables.NpcVariables;
import org.l2jmobius.gameserver.model.zone.ZoneType;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent;
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
import instances.AbstractInstance;
import quests.Q10338_SeizeYourDestiny.Q10338_SeizeYourDestiny;
/**
* Harnak Underground Ruins Instance Zone.
* @author Sdw
*/
public class HarnakUndergroundRuins extends AbstractInstance
{
// NPCs
private static final int HADEL = 33344;
private static final int KRAKIA_BATHUS = 27437;
private static final int KRAKIA_CARCASS = 27438;
private static final int KRAKIA_LOTUS = 27439;
private static final int RAKZAN = 27440;
private static final int WEISS_KHAN = 27441;
private static final int BAMONTI = 27442;
private static final int SEKNUS = 27443;
private static final int WEISS_ELE = 27454;
private static final int HARNAKS_WRAITH = 27445;
private static final int SEAL_CONTROL_DEVICE = 33548;
private static final int POWER_SOURCE = 33501;
private static final int[] POWER_SOURCES =
{
33501,
33556,
33557
};
// Locations
private static final Location NPC_ROOM1_LOC = new Location(-107930, 206328, -10872);
// Skills
private static final SkillHolder RELEASE_OF_POWER = new SkillHolder(14625, 1);
private static final SkillHolder MAXIMUM_DEFENSE = new SkillHolder(14700, 1);
private static final SkillHolder LIGHT_HEAL = new SkillHolder(14736, 1);
private static final SkillHolder ULTIMATE_BUFF = new SkillHolder(4318, 1);
// Misc
private static final int TEMPLATE_ID = 195;
private static final int ZONE_ROOM_2 = 200032;
private static final int ZONE_ROOM_3 = 200033;
private static final int DOOR_ONE = 16240100;
private static final int DOOR_TWO = 16240102;
private static final Map<CategoryType, Integer> MOB_CATEGORY = new HashMap<>();
static
{
MOB_CATEGORY.put(CategoryType.TANKER_CATEGORY, RAKZAN);
MOB_CATEGORY.put(CategoryType.WARRIOR_CATEGORY, KRAKIA_BATHUS);
MOB_CATEGORY.put(CategoryType.ROGUE_CATEGORY, BAMONTI);
MOB_CATEGORY.put(CategoryType.ARCHER_CATEGORY, KRAKIA_CARCASS);
MOB_CATEGORY.put(CategoryType.WIZARD_CATEGORY, WEISS_KHAN);
MOB_CATEGORY.put(CategoryType.ENCHANTER_CATEGORY, SEKNUS);
MOB_CATEGORY.put(CategoryType.SUMMONER_CATEGORY, KRAKIA_LOTUS);
MOB_CATEGORY.put(CategoryType.HEALER_CATEGORY, WEISS_ELE);
}
public HarnakUndergroundRuins()
{
super(TEMPLATE_ID);
registerMobs(KRAKIA_BATHUS, KRAKIA_CARCASS, KRAKIA_LOTUS, RAKZAN, WEISS_KHAN, BAMONTI, SEKNUS, WEISS_ELE, HARNAKS_WRAITH);
addSeeCreatureId(POWER_SOURCES);
addEnterZoneId(ZONE_ROOM_2, ZONE_ROOM_3);
addFirstTalkId(SEAL_CONTROL_DEVICE);
addTalkId(HADEL);
addStartNpc(HADEL);
}
@Override
protected void onEnter(PlayerInstance player, Instance instance, boolean firstEnter)
{
super.onEnter(player, instance, firstEnter);
if (firstEnter)
{
startQuestTimer("fail_instance", 1260000, null, player);
startQuestTimer("message1", 2500, null, player);
startQuestTimer("message2", 5000, null, player);
startQuestTimer("message3", 8500, null, player);
startQuestTimer("spawn_npc1", 10000, null, player);
}
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
switch (event)
{
case "enter_instance":
{
enterInstance(player, npc, TEMPLATE_ID);
break;
}
case "message1":
{
showOnScreenMsg(player, NpcStringId.AN_INTRUDER_INTERESTING, ExShowScreenMessage.TOP_CENTER, 5000);
break;
}
case "message2":
{
showOnScreenMsg(player, NpcStringId.PROVE_YOUR_WORTH, ExShowScreenMessage.TOP_CENTER, 5000);
break;
}
case "message3":
{
showOnScreenMsg(player, NpcStringId.ONLY_THOSE_STRONG_ENOUGH_SHALL_PROCEED, ExShowScreenMessage.TOP_CENTER, 5000);
break;
}
case "message4":
{
showOnScreenMsg(player, NpcStringId.THOUGH_SMALL_THIS_POWER_WILL_HELP_YOU_GREATLY, ExShowScreenMessage.TOP_CENTER, 5000);
break;
}
case "message5":
{
showOnScreenMsg(player, NpcStringId.ARE_YOU_STRONG_OR_WEAK_OF_THE_LIGHT_OR_DARKNESS, ExShowScreenMessage.TOP_CENTER, 5000);
break;
}
case "message6":
{
showOnScreenMsg(player, NpcStringId.ONLY_THOSE_OF_LIGHT_MAY_PASS_OTHERS_MUST_PROVE_THEIR_STRENGTH, ExShowScreenMessage.TOP_CENTER, 5000);
break;
}
case "razkan_say":
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.COME_ATTACK_ME_IF_YOU_DARE);
break;
}
case "bathus_say":
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IT_S_THE_END_FOR_YOU_TRAITOR);
break;
}
case "bamonti_say":
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_WANT_TO_HEAR_YOU_CRY);
break;
}
case "carcass_say":
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_WANT_TO_HEAR_YOU_CRY);
break;
}
case "khan_say":
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_LL_HAVE_TO_KILL_US_FIRST);
break;
}
case "seknus_say":
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LETS_SEE_WHAT_YOU_ARE_MADE_OF);
break;
}
case "lotus_say":
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.REPENT_AND_YOUR_DEATH_WILL_BE_QUICK);
break;
}
case "ele_say":
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DIE_TRAITOR);
break;
}
case "spawn_npc1":
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
world.setStatus(1);
world.spawnGroup("first_room");
moveNpcRoom1(RAKZAN, NpcStringId.ARE_YOU_AGAINST_THE_WILL_OF_LIGHT, "razkan_say", world);
}
break;
}
case "spawn_npc2":
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
world.openCloseDoor(DOOR_ONE, true);
world.spawnGroup("power_sources");
}
break;
}
case "spawn_npc3":
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
world.incStatus();
final List<Npc> npcs = world.spawnGroup("third_room");
final Npc powerSource = npcs.stream().filter(n -> n.getId() == POWER_SOURCE).findFirst().orElse(null);
if (powerSource != null)
{
powerSource.setTarget(player);
startQuestTimer("cast_light_heal", 3000, powerSource, player);
}
}
break;
}
case "spawn_wave1":
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
for (Entry<CategoryType, Integer> entry : MOB_CATEGORY.entrySet())
{
if (player.isInCategory(entry.getKey()))
{
world.setStatus(2);
world.setParameter("wave", 1);
world.setParameter("waveNpcId", entry.getValue());
final List<Npc> npcs = world.spawnGroup("second_room_wave_1_" + entry.getValue());
for (Npc n : npcs)
{
addAttackPlayerDesire(n, player);
}
break;
}
}
}
break;
}
case "spawn_wave2":
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
final int waveNpcId = world.getParameters().getInt("waveNpcId");
final List<Npc> npcs = world.spawnGroup("second_room_wave_2_" + waveNpcId);
for (Npc n : npcs)
{
addAttackPlayerDesire(n, player);
}
world.setParameter("wave", 2);
}
break;
}
case "spawn_wave3":
{
showOnScreenMsg(player, NpcStringId.I_MUST_GO_HELP_SOME_MORE, ExShowScreenMessage.TOP_CENTER, 5000);
final Instance world = player.getInstanceWorld();
if (world != null)
{
final int waveNpcId = world.getParameters().getInt("waveNpcId");
List<Npc> npcs = world.spawnGroup("second_room_wave_3_" + waveNpcId);
for (Npc n : npcs)
{
addAttackPlayerDesire(n, player);
}
npcs = world.spawnGroup("power_source");
for (Npc n : npcs)
{
n.setTarget(player);
startQuestTimer("cast_defense_maximum", 1, n, player);
}
world.setParameter("wave", 3);
}
break;
}
case "cast_defense_maximum":
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
if (npc.calculateDistance3D(player) < MAXIMUM_DEFENSE.getSkill().getCastRange())
{
npc.doCast(MAXIMUM_DEFENSE.getSkill());
final int defenseCounter = world.getParameters().getInt("defenseCounter", 0) + 1;
world.setParameter("defenseCounter", defenseCounter);
if (defenseCounter < 3)
{
startQuestTimer("cast_defense_maximum", 60000, npc, player);
}
else
{
npc.deleteMe();
}
}
else
{
startQuestTimer("cast_defense_maximum", 1, npc, player);
}
}
break;
}
case "cast_light_heal":
{
if (npc != null)
{
final Instance world = player.getInstanceWorld();
if ((world != null) && (world.isStatus(3) || world.isStatus(4)))
{
if (npc.calculateDistance3D(player) < LIGHT_HEAL.getSkill().getCastRange())
{
npc.doCast(LIGHT_HEAL.getSkill());
}
startQuestTimer("cast_light_heal", 3000, npc, player);
}
}
break;
}
case "fail_instance":
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
world.removeNpcs();
playMovie(player, Movie.SC_AWAKENING_BOSS_ENDING_B);
startQuestTimer("exit", 13500, npc, player);
}
break;
}
case "exit":
{
finishInstance(player, 0);
break;
}
case "spawn_npc4":
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
final int waveNpcId = world.getParameters().getInt("waveNpcId");
List<Npc> npcs = world.spawnGroup("third_room_" + waveNpcId);
for (Npc n : npcs)
{
addAttackPlayerDesire(n, player);
}
npcs = world.spawnGroup("seal");
for (Npc n : npcs)
{
n.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DISABLE_DEVICE_WILL_GO_OUT_OF_CONTROL_IN_1_MINUTE);
startQuestTimer("seal_say", 10000, n, player);
}
}
break;
}
case "activate_seal":
{
final Instance world = player.getInstanceWorld();
if ((world != null) && npc.isScriptValue(0))
{
npc.setScriptValue(1);
final int enabledSeal = world.getParameters().getInt("enabledSeal", 0) + 1;
world.setParameter("enabledSeal", enabledSeal);
if (enabledSeal == 2)
{
final QuestState qs = player.getQuestState(Q10338_SeizeYourDestiny.class.getSimpleName());
if ((qs != null) && qs.isCond(2))
{
qs.setCond(3, true);
}
cancelQuestTimer("fail_instance", null, player);
world.removeNpcs();
playMovie(player, Movie.SC_AWAKENING_BOSS_ENDING_A);
startQuestTimer("spawn_hermuncus", 25050, npc, player);
}
}
break;
}
case "seal_say":
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
final int timerCount = world.getParameters().getInt("timerCount", 0);
switch (timerCount)
{
case 0:
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.FIFTY_SECONDS_ARE_REMAINING);
break;
}
case 1:
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.FOURTY_SECONDS_ARE_REMAINING_2);
break;
}
case 2:
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.THIRTY_SECONDS_ARE_REMAINING_2);
break;
}
case 3:
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.TWENTY_SECONDS_ARE_REMAINING_2);
break;
}
case 4:
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.TEN_SECONDS_ARE_REMAINING_2);
break;
}
case 5:
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.FIVE_SECONDS);
break;
}
case 6:
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.FOUR_SECONDS);
break;
}
case 7:
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.THREE_SECONDS);
break;
}
case 8:
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.TWO_SECONDS);
break;
}
case 9:
{
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.ONE_SECOND);
break;
}
}
if (timerCount <= 4)
{
startQuestTimer("seal_say", 10000, npc, player);
}
else if ((timerCount > 4) && (timerCount <= 9))
{
startQuestTimer("seal_say", 1000, npc, player);
}
world.setParameter("timerCount", timerCount);
}
break;
}
case "spawn_hermuncus":
{
final Instance inst = player.getInstanceWorld();
if (inst != null)
{
inst.spawnGroup("hermuncus");
}
break;
}
case "cast_release_power":
{
npc.setTarget(player);
npc.doCast(RELEASE_OF_POWER.getSkill());
break;
}
case "whisper_to_player":
{
showOnScreenMsg(player, NpcStringId.I_HERMUNCUS_GIVE_MY_POWER_TO_THOSE_WHO_FIGHT_FOR_ME, ExShowScreenMessage.TOP_CENTER, 5000);
npc.broadcastSay(ChatType.WHISPER, NpcStringId.RECEIVE_THIS_POWER_FORM_THE_ANCIENT_GIANT);
npc.broadcastSay(ChatType.WHISPER, NpcStringId.USE_THIS_NEW_POWER_WHEN_THE_TIME_IS_RIGHT);
startQuestTimer("message4", 3000, npc, player);
}
}
return null;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
final Instance world = killer.getInstanceWorld();
if (world != null)
{
switch (world.getStatus())
{
case 0:
{
if (world.getAliveNpcs().isEmpty())
{
startQuestTimer("spawn_npc2", 100, npc, killer);
world.setStatus(1);
}
break;
}
case 1:
{
switch (npc.getId())
{
case RAKZAN:
{
moveNpcRoom1(KRAKIA_BATHUS, NpcStringId.ARE_YOU_PLANNING_TO_BETRAY_THE_GODS_AND_FOLLOW_A_GIANT, "bathus_say", world);
break;
}
case KRAKIA_BATHUS:
{
moveNpcRoom1(BAMONTI, NpcStringId.HAHA, "bamonti_say", world);
break;
}
case BAMONTI:
{
moveNpcRoom1(KRAKIA_CARCASS, NpcStringId.HAHA, "carcass_say", world);
break;
}
case KRAKIA_CARCASS:
{
moveNpcRoom1(WEISS_KHAN, NpcStringId.YOU_WILL_NOT_FREE_HERMUNCUS, "khan_say", world);
break;
}
case WEISS_KHAN:
{
moveNpcRoom1(SEKNUS, NpcStringId.MORTAL, "seknus_say", world);
break;
}
case SEKNUS:
{
moveNpcRoom1(KRAKIA_LOTUS, NpcStringId.TRYING_TO_FREE_HERMUNCUS, "lotus_say", world);
break;
}
case KRAKIA_LOTUS:
{
moveNpcRoom1(WEISS_ELE, NpcStringId.YOU_WILL_NEVER_BREAK_THE_SEAL, "ele_say", world);
break;
}
case WEISS_ELE:
{
startQuestTimer("spawn_npc2", 100, npc, killer);
break;
}
}
break;
}
case 2:
{
final StatsSet params = world.getParameters();
final int waveNpc = params.getInt("waveNpcId");
if (world.getAliveNpcs(waveNpc).isEmpty())
{
switch (params.getInt("wave"))
{
case 1:
{
startQuestTimer("spawn_wave2", 100, npc, killer);
break;
}
case 2:
{
startQuestTimer("spawn_wave3", 100, npc, killer);
break;
}
case 3:
{
world.openCloseDoor(DOOR_TWO, true);
break;
}
}
}
break;
}
default:
{
if (npc.getId() == HARNAKS_WRAITH)
{
cancelQuestTimer("fail_instance", null, killer);
world.removeNpcs();
playMovie(killer, Movie.SC_AWAKENING_BOSS_ENDING_A);
startQuestTimer("spawn_hermuncus", 25050, npc, killer);
}
}
}
}
return super.onKill(npc, killer, isSummon);
}
private void moveNpcRoom1(int npcId, NpcStringId message, String timer, Instance world)
{
final Npc npc = world.getNpc(npcId);
if (npc != null)
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, NPC_ROOM1_LOC);
npc.broadcastSay(ChatType.NPC_GENERAL, message);
startQuestTimer("timer", 2600, npc, null);
world.setParameter("currentNpc", npcId);
}
}
@Override
public String onAttack(Npc npc, PlayerInstance player, int damage, boolean isSummon)
{
final Instance world = player.getInstanceWorld();
if (world != null)
{
if (world.isStatus(1))
{
final int currentNpc = world.getParameters().getInt("currentNpc");
if (npc.getId() != currentNpc)
{
world.setStatus(0);
for (Npc n : world.getAliveNpcs())
{
addAttackPlayerDesire(n, player);
}
}
}
else if (world.isStatus(2))
{
if (((npc.getCurrentHp() / npc.getMaxHp()) * 100) < 80)
{
npc.doCast(ULTIMATE_BUFF.getSkill());
}
}
else if (world.isStatus(3) && (npc.getId() == HARNAKS_WRAITH))
{
final NpcVariables vars = npc.getVariables();
if (!vars.getBoolean("message1", false) && (((npc.getCurrentHp() / npc.getMaxHp()) * 100) > 80))
{
showOnScreenMsg(player, NpcStringId.FREE_ME_FROM_THIS_BINDING_OF_LIGHT, ExShowScreenMessage.TOP_CENTER, 5000);
vars.set("message1", true);
}
else if (!vars.getBoolean("message2", false) && (((npc.getCurrentHp() / npc.getMaxHp()) * 100) <= 80))
{
showOnScreenMsg(player, NpcStringId.DESTROY_THE_GHOST_OF_HARNAK_THIS_CORRUPTED_CREATURE, ExShowScreenMessage.TOP_CENTER, 5000);
vars.set("message2", true);
}
else if (!vars.getBoolean("message3", false) && (((npc.getCurrentHp() / npc.getMaxHp()) * 100) <= 60))
{
showOnScreenMsg(player, NpcStringId.FREE_ME_AND_I_PROMISE_YOU_THE_POWER_OF_GIANTS, ExShowScreenMessage.TOP_CENTER, 5000);
vars.set("message3", true);
}
else if (((npc.getCurrentHp() / npc.getMaxHp()) * 100) <= 50)
{
world.incStatus();
player.sendPacket(new ExSendUIEvent(player, false, false, 60, 0, NpcStringId.REMAINING_TIME));
showOnScreenMsg(player, NpcStringId.NO_THE_SEAL_CONTROLS_HAVE_BEEN_EXPOSED_GUARDS_PROTECT_THE_SEAL_CONTROLS, ExShowScreenMessage.TOP_CENTER, 10000);
startQuestTimer("spawn_npc4", 1, npc, player);
cancelQuestTimer("fail_instance", null, player);
startQuestTimer("fail_instance", 60000, null, player);
}
}
}
return super.onAttack(npc, player, damage, isSummon);
}
@Override
public String onSeeCreature(Npc npc, Creature creature, boolean isSummon)
{
if (creature.isPlayer())
{
startQuestTimer("cast_release_power", 2000, npc, creature.getActingPlayer());
if (npc.getId() == POWER_SOURCE)
{
startQuestTimer("whisper_to_player", 2000, npc, creature.getActingPlayer());
}
}
return super.onSeeCreature(npc, creature, isSummon);
}
@Override
public String onEnterZone(Creature creature, ZoneType zone)
{
if (!creature.isPlayer())
{
return null;
}
final PlayerInstance player = creature.getActingPlayer();
final Instance world = player.getInstanceWorld();
if (world != null)
{
switch (zone.getId())
{
case ZONE_ROOM_2:
{
if (world.isStatus(1))
{
world.incStatus();
startQuestTimer("message2", 100, null, player);
startQuestTimer("message5", 2600, null, player);
startQuestTimer("message6", 5100, null, player);
startQuestTimer("spawn_wave1", 5100, null, player);
}
break;
}
case ZONE_ROOM_3:
{
if (!world.getParameters().getBoolean("openingPlayed", false))
{
world.setParameter("openingPlayed", true);
startQuestTimer("spawn_npc3", 29950, null, player);
playMovie(player, Movie.SC_AWAKENING_BOSS_OPENING);
}
break;
}
}
}
return super.onEnterZone(creature, zone);
}
public static void main(String[] args)
{
new HarnakUndergroundRuins();
}
}

View File

@@ -1,5 +0,0 @@
<html><body>Maestro Dolkin:<br>
You're better than I thought!<br>
Shall we step outside?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KaraphonHabitat exit_instance">"Let's go then."</Button>
</body></html>

View File

@@ -1,88 +0,0 @@
/*
* 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.KaraphonHabitat;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.quest.QuestState;
import instances.AbstractInstance;
import quests.Q10745_TheSecretIngredients.Q10745_TheSecretIngredients;
/**
* Karaphon Habitat instance.
* @author Sdw
*/
public class KaraphonHabitat extends AbstractInstance
{
// NPCs
private static final int DOLKIN = 33954;
private static final int DOLKIN_INSTANCE = 34002;
// Monsters
private static final int KARAPHON = 23459;
// Instance
private static final int TEMPLATE_ID = 253;
public KaraphonHabitat()
{
super(TEMPLATE_ID);
addStartNpc(DOLKIN);
addFirstTalkId(DOLKIN_INSTANCE);
addTalkId(DOLKIN);
addKillId(KARAPHON);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = player.getQuestState(Q10745_TheSecretIngredients.class.getSimpleName());
if (qs != null)
{
switch (event)
{
case "enter_instance":
{
enterInstance(player, npc, TEMPLATE_ID);
break;
}
case "exit_instance":
{
finishInstance(player, 0);
break;
}
}
}
return null;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
final Instance world = killer.getInstanceWorld();
if (world != null)
{
world.setReenterTime();
}
return super.onKill(npc, killer, isSummon);
}
public static void main(String[] args)
{
new KaraphonHabitat();
}
}

View File

@@ -1,7 +0,0 @@
<html><body>Terain:<br>
Lakcis spoke of you.<br>
I am Terain, and I have come to help you through the Labyrinth of Belis.<br>
Now, when we open this door, enemies will rush toward us. We must defeat them and go on to the next room.<br>
Ready?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LabyrinthOfBelis room1">"Yes, I'm ready."</Button>
</body></html>

View File

@@ -1,3 +0,0 @@
<html><body>Terain:<br>
Focus on the battle. We'll talk later.
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Terain:<br>
You're better than you look!<br>
Now, this is the second room. I've already checked the place out, and I think they did something to the device in the middle of the room.<br>
If we activate it, I'm sure the door will open.<br>
Ready?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LabyrinthOfBelis room2">"Yes, I'm ready."</Button>
</body></html>

View File

@@ -1,8 +0,0 @@
<html><body>Terain:<br>
We reached the final room! Excellent!<br>
This will be the most difficult challenge, and will test us both to our limits.<br>
There is a powerful current flowing through this room, which you cannot pass. I can, but only with special equipment, and even then, I can only last a little while.<br>
I want you to watch over me while I destroy the circuit breaker, ok? As soon as I start, enemies will come pouring in, so keep them off me!<br>
Ready?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LabyrinthOfBelis room3">"Ready!"</Button>
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>Terain:<br>
Alright!<br>
One door left, and I have no idea what's behind it. Good luck, friend.<br>
Are you ready?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LabyrinthOfBelis room4">"Let's do this."</Button>
</body></html>

View File

@@ -1,6 +0,0 @@
<html><body>Terain:<br>
What happened?<br>
Someone scary has been resurrected. Let's go back to town! I'll move you.<br>
Are you ready?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest LabyrinthOfBelis finish">"Ready!"</Button>
</body></html>

View File

@@ -1,3 +0,0 @@
<html><body>Belis Verification System:<br>
2 Belis' Marks required.
</body></html>

View File

@@ -1,3 +0,0 @@
<html><body>Belis Verification System:<br>
1 Belis' Mark reqired.
</body></html>

Some files were not shown because too many files have changed in this diff Show More