Daimon the White-Eyed - Part 2
- ID
- 604
- Название
- Daimon the White-Eyed - Part 2
- start_npcs_json
- [31683]
- npc_ids_json
- [25290,31541,31683]
- constants_json
- {"DAIMONS_ALTAR":31541,"EYE_OF_ARGOS":31683,"DAIMON_THE_WHITE_EYED":25290,"UNFINISHED_SUMMON_CRYSTAL":7192,"SUMMON_CRYSTAL":7193,"ESSENCE_OF_DAIMON":7194,"DYE_I2M2_C":4595,"DYE_I2W2_C":4596,"DYE_M2I2_C":4597,"DYE_M2W2_C":4598,"DYE_W2I2_C":4599,"DYE_W2M2_C":4600,"MIN_LEVEL":73}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00604_DaimonTheWhiteEyedPart2/Q00604_DaimonTheWhiteEyedPart2.java
NPC квеста
| ID | Название | Старт квеста | Уровень |
|---|---|---|---|
| 25290 | Daimon the White-Eyed | Нет | 78 |
| 31541 | Daimon's Altar | Нет | 70 |
| 31683 | Eye of Argos | Да | 70 |
Условия уровней: выражения из Java
private static final int MIN_LEVEL = 73; if (player.getLevel() < MIN_LEVEL)
Выдача предметов, адены и опыта: выражения из Java
giveItems(player, SUMMON_CRYSTAL, 1); rewardItems(player, reward, 5); giveItems(player, ESSENCE_OF_DAIMON, 1);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[31541-01.html] Altar of Daimon the White-Eyed: A sinister energy encircles the altar. Place the Bead of Summoning on the altar.
[31541-02.html] Altar of Daimon the White-Eyed: Evil forces are gathering... Oh, the horror!
[31541-03.html] Altar of Daimon the White-Eyed: Daimon the White-Eyed has already been summoned!
[31541-04.html] Altar of Daimon the White-Eyed: A summoning orb is needed.
[31541-05.html] Altar of Daimon the White-Eyed: Daimon's moans can be faintly heard...
[31683-01.htm] Eye of Argos: Have you been neglecting your training? I'm reluctant to assign this critical mission to you! (This quest may only be undertaken by characters of level 73 or above.)
[31683-02.htm] Eye of Argos: Where have you done with the Unfinished Bead of Summoning that I gave you?
[31683-03.htm] Eye of Argos: The bead containing my voice is now completed. Are you ready to confront Daimon the White-Eyed, dear warrior? Will you risk your life for the cause? "I'm ready."
[31683-04.htm] Eye of Argos: Go to the stronghold of Daimon the White-Eyed, find the altar used to make sacrifices and place the summoning orb upon it. One more thing! Occasionally, Daimon hides the altar. If this happens, wait until the altar reappears before taking action. Apply all your courage and faith to destroying Daimon!
[31683-05.html] Eye of Argos: Place the summoning orb onto the altar in the stronghold of Daimon the White-Eyed. Daimon will be drawn out by its power. Destroy him and return to me.
[31683-06.html] Eye of Argos: Dear soldier, I felt a weakening in his force around here! Did you kill Daimon the White-Eyed? "I killed the beast."
[31683-07.html] Eye of Argos: You've vanquished the dreaded Daimon, but he's not gone forever. Someday, he shall rise and threaten the peace of the world again. I pray when he does that we have many heroes like you.
[31683-08.html] Eye of Argos: Where is the proof that you killed Daimon? Do you think I'll fall for your lie? You, fake heroes!
[31683-09.html] Eye of Argos: Does Daimon the White-Eyed live? I understand your hesitance, but by overcoming your fear, the path to true heroism will open up to you!
Исходник условий и наград (Java)
/*
* 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 quests.Q00604_DaimonTheWhiteEyedPart2;
import org.l2jmobius.gameserver.config.NpcConfig;
import org.l2jmobius.gameserver.config.PlayerConfig;
import org.l2jmobius.gameserver.entity.Location;
import org.l2jmobius.gameserver.entity.World;
import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.managers.GlobalVariablesManager;
import org.l2jmobius.gameserver.mechanics.script.Quest;
import org.l2jmobius.gameserver.mechanics.script.QuestSound;
import org.l2jmobius.gameserver.mechanics.script.QuestState;
import org.l2jmobius.gameserver.network.enums.ChatType;
import org.l2jmobius.gameserver.network.serverpackets.NpcSay;
import org.l2jmobius.gameserver.util.LocationUtil;
/**
* Daimon the White-Eyed - Part 2 (604)
* @author Adry_85
*/
public class Q00604_DaimonTheWhiteEyedPart2 extends Quest
{
// NPCs
private static final int DAIMONS_ALTAR = 31541;
private static final int EYE_OF_ARGOS = 31683;
// Raid Boss
private static final int DAIMON_THE_WHITE_EYED = 25290;
// Items
private static final int UNFINISHED_SUMMON_CRYSTAL = 7192;
private static final int SUMMON_CRYSTAL = 7193;
private static final int ESSENCE_OF_DAIMON = 7194;
// Rewards
private static final int DYE_I2M2_C = 4595; // Greater Dye of INT <Int+2 Men-2>
private static final int DYE_I2W2_C = 4596; // Greater Dye of INT <Int+2 Wit-2>
private static final int DYE_M2I2_C = 4597; // Greater Dye of MEN <Men+2 Int-2>
private static final int DYE_M2W2_C = 4598; // Greater Dye of MEN <Men+2 Wit-2>
private static final int DYE_W2I2_C = 4599; // Greater Dye of WIT <Wit+2 Int-2>
private static final int DYE_W2M2_C = 4600; // Greater Dye of WIT <Wit+2 Men-2>
// Location
private static final Location DAIMON_THE_WHITE_EYED_LOC = new Location(186320, -43904, -3175);
// Misc
private static final String DAIMON_THE_WHITE_EYED_RESPAWN_TIME = "DAIMON_THE_WHITE_EYED_RESPAWN_TIME";
private static final int MIN_LEVEL = 73;
public Q00604_DaimonTheWhiteEyedPart2()
{
super(604, "Daimon the White-Eyed - Part 2");
addStartNpc(EYE_OF_ARGOS);
addTalkId(EYE_OF_ARGOS, DAIMONS_ALTAR);
addSpawnId(DAIMON_THE_WHITE_EYED);
addKillId(DAIMON_THE_WHITE_EYED);
registerQuestItems(SUMMON_CRYSTAL, ESSENCE_OF_DAIMON);
}
@Override
public String onEvent(String event, Npc npc, Player player)
{
if ("DESPAWN".equals(event))
{
if (isDaimonSpawned())
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getTemplate().getDisplayId(), "Can light exist without darkness?"));
npc.deleteMe();
}
return super.onEvent(event, npc, player);
}
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return null;
}
String htmltext = null;
switch (event)
{
case "31683-04.htm":
{
takeItems(player, UNFINISHED_SUMMON_CRYSTAL, 1);
qs.startQuest();
qs.setMemoState(11);
giveItems(player, SUMMON_CRYSTAL, 1);
htmltext = event;
break;
}
case "31683-07.html":
{
if (hasQuestItems(player, ESSENCE_OF_DAIMON))
{
final int reward;
final int random = getRandom(1000);
takeItems(player, ESSENCE_OF_DAIMON, 1);
if (random < 167)
{
reward = DYE_I2M2_C;
}
else if (random < 334)
{
reward = DYE_I2W2_C;
}
else if (random < 501)
{
reward = DYE_M2I2_C;
}
else if (random < 668)
{
reward = DYE_M2W2_C;
}
else if (random < 835)
{
reward = DYE_W2I2_C;
}
else
{
reward = DYE_W2M2_C;
}
rewardItems(player, reward, 5);
qs.exitQuest(true, true);
htmltext = event;
}
else
{
htmltext = "31683-08.html";
}
break;
}
case "31541-02.html":
{
if (hasQuestItems(player, SUMMON_CRYSTAL))
{
if (!isDaimonSpawned())
{
takeItems(player, SUMMON_CRYSTAL, 1);
htmltext = event;
addSpawn(DAIMON_THE_WHITE_EYED, DAIMON_THE_WHITE_EYED_LOC);
qs.setMemoState(21);
qs.setCond(2, true);
}
else
{
htmltext = "31541-03.html";
}
}
else
{
htmltext = "31541-04.html";
}
break;
}
}
return htmltext;
}
@Override
public String onTalk(Npc npc, Player player)
{
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
if (qs.isCreated())
{
if (player.getLevel() < MIN_LEVEL)
{
htmltext = "31683-01.htm";
}
else if (!hasQuestItems(player, UNFINISHED_SUMMON_CRYSTAL))
{
htmltext = "31683-02.htm";
}
else
{
htmltext = "31683-03.htm";
}
}
else if (qs.isStarted())
{
if (npc.getId() == EYE_OF_ARGOS)
{
if (qs.isMemoState(11))
{
htmltext = "31683-05.html";
}
else if ((qs.getMemoState() >= 22) && hasQuestItems(player, ESSENCE_OF_DAIMON))
{
htmltext = "31683-06.html";
}
else
{
htmltext = "31683-09.html";
}
}
else // DAIMONS_ALTAR
{
if (qs.isMemoState(11))
{
if (isDaimonSpawned())
{
htmltext = "31541-05.html";
}
else if (hasQuestItems(player, SUMMON_CRYSTAL))
{
htmltext = "31541-01.html";
}
else
{
htmltext = "31541-04.html";
}
}
else if (qs.isMemoState(21))
{
if (!isDaimonSpawned())
{
if (hasQuestItems(player, SUMMON_CRYSTAL))
{
takeItems(player, SUMMON_CRYSTAL, 1);
addSpawn(DAIMON_THE_WHITE_EYED, DAIMON_THE_WHITE_EYED_LOC);
htmltext = "31541-02.html";
}
else
{
htmltext = "31541-04.html";
}
}
else
{
htmltext = "31541-03.html";
}
}
else if (qs.getMemoState() >= 22)
{
htmltext = "31541-05.html";
}
}
}
return htmltext;
}
@Override
public void onSpawn(Npc npc)
{
startQuestTimer("DESPAWN", 1200000, npc, null);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getTemplate().getDisplayId(), "Who is calling me?"));
}
@Override
public void onKill(Npc npc, Player killer, boolean isSummon)
{
executeForEachPlayer(killer, npc, isSummon, true, false);
final int respawnMinDelay = (int) (43200000 * NpcConfig.RAID_MIN_RESPAWN_MULTIPLIER);
final int respawnMaxDelay = (int) (129600000 * NpcConfig.RAID_MAX_RESPAWN_MULTIPLIER);
final int respawnDelay = getRandom(respawnMinDelay, respawnMaxDelay);
GlobalVariablesManager.getInstance().set(DAIMON_THE_WHITE_EYED_RESPAWN_TIME, System.currentTimeMillis() + respawnDelay);
}
@Override
public void actionForEachPlayer(Player player, Npc npc, boolean isSummon)
{
final QuestState qs = getQuestState(player, false);
if ((qs != null) && (qs.getMemoState() >= 11) && (qs.getMemoState() <= 21) && LocationUtil.checkIfInRange(PlayerConfig.ALT_PARTY_RANGE, npc, player, false))
{
// if (hasQuestItems(player, ESSENCE_OF_DAIMON))
// {
qs.setCond(3, true);
qs.setMemoState(22);
// }
giveItems(player, ESSENCE_OF_DAIMON, 1);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
private static boolean isDaimonSpawned()
{
if (System.currentTimeMillis() > GlobalVariablesManager.getInstance().getLong(DAIMON_THE_WHITE_EYED_RESPAWN_TIME, 0))
{
return World.getVisibleObjects().stream().anyMatch(object -> object.getId() == DAIMON_THE_WHITE_EYED);
}
return true;
}
}