This commit is contained in:
mobius
2015-01-01 20:02:50 +00:00
parent eeae660458
commit a6a3718849
17894 changed files with 2818932 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
<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

@@ -0,0 +1,4 @@
<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

@@ -0,0 +1,42 @@
<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

@@ -0,0 +1,42 @@
<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

@@ -0,0 +1,42 @@
<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

@@ -0,0 +1,43 @@
<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

@@ -0,0 +1,7 @@
<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

@@ -0,0 +1,9 @@
<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

@@ -0,0 +1,42 @@
<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

@@ -0,0 +1,43 @@
<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

@@ -0,0 +1,41 @@
<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

@@ -0,0 +1,42 @@
<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

@@ -0,0 +1,7 @@
<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

@@ -0,0 +1,8 @@
<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

@@ -0,0 +1,359 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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.
*
* L2J DataPack 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.npc.Alarm;
import quests.Q00184_ArtOfPersuasion.Q00184_ArtOfPersuasion;
import quests.Q00185_NikolasCooperation.Q00185_NikolasCooperation;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.QuestSound;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Alarm AI for quests Art of Persuasion (184) and Nikola's Cooperation (185).
* @author Zoey76
*/
public final 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()
{
super(Alarm.class.getSimpleName(), "ai/npc");
addStartNpc(ALARM);
addTalkId(ALARM);
addFirstTalkId(ALARM);
addSpawnId(ALARM);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
final L2PcInstance player0 = npc.getVariables().getObject("player0", L2PcInstance.class);
final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
switch (event)
{
case "SELF_DESTRUCT_IN_60":
{
startQuestTimer("SELF_DESTRUCT_IN_30", 30000, npc, null);
broadcastNpcSay(npc, Say2.NPC_ALL, 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);
broadcastNpcSay(npc, Say2.NPC_ALL, 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);
broadcastNpcSay(npc, Say2.NPC_ALL, 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)
{
broadcastNpcSay(npc, Say2.NPC_ALL, 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))
{
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))
{
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(L2Npc npc, L2PcInstance talker)
{
String htmltext = getNoQuestMsg(talker);
if (verifyMemoState(talker, ART_OF_PERSUASION_ID, 3) || verifyMemoState(talker, NIKOLAS_COOPERATION_ID, 3))
{
final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class);
if (player == talker)
{
htmltext = "32367-01.html";
}
else
{
htmltext = "32367-02.html";
}
}
return htmltext;
}
@Override
public String onSpawn(L2Npc npc)
{
startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null);
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES);
final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.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 final boolean verifyMemoState(L2PcInstance 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 static final void setMemoState(L2PcInstance 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 final int getMemoStateEx(L2PcInstance 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 static final void setMemoStateEx(L2PcInstance 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();
}
}