Magical Power of Water - Part 2
- ID
- 610
- Название
- Magical Power of Water - Part 2
- start_npcs_json
- [31372]
- npc_ids_json
- [25316,31372,31560]
- constants_json
- {"ASEFA":31372,"VARKA_TOTEM":31560,"ASHUTAR":25316,"GREEN_TOTEM":7238,"ASHUTAR_HEART":7239,"MIN_LEVEL":75}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00610_MagicalPowerOfWaterPart2/Q00610_MagicalPowerOfWaterPart2.java
NPC квеста
| ID | Название | Старт квеста | Уровень |
|---|---|---|---|
| 25316 | Soul of Water Ashutar | Нет | 87 |
| 31372 | Asefa | Да | 70 |
| 31560 | Varka's Holy Altar | Нет | 70 |
Условия уровней: выражения из Java
private static final int MIN_LEVEL = 75; htmltext = (player.getLevel() >= MIN_LEVEL) ? (hasQuestItems(player, GREEN_TOTEM)) ? "31372-01.htm" : "31372-00a.html" : "31372-00b.html";
Выдача предметов, адены и опыта: выражения из Java
giveItems(player, ASHUTAR_HEART, 1); addExpAndSp(player, 10000, 0);
Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.
Тексты квеста
[31372-00a.html] Soul Guide Asefa: Still looking for the totem? You disappoint me. (Quest may only be undertaken by characters with the Green Totem.)
[31372-00b.html] Soul Guide Asefa: Come back when you aren't such a weakling. (Quest may only be undertaken by characters of level 75 or above.)
[31372-01.htm] Soul Guide Asefa: After investigating, I found that the magical power comes from the water spirit conjured by using the totem. If you can kill it, it will weaken Udan Mardui's magical power. Will you take on this important mission? Quest
[31372-02.html] Soul Guide Asefa: Now you must use caution. Break into the Varka Silenos barracks again and use this Green Totem at the holy altar. Then you can summon Ashutar, the soul of water and the source of Udan Mardui's magical power. Kill it and bring me its heart of ice!
[31372-03.html] Soul Guide Asefa: Now you must use caution. Break into the Varka Silenos barracks again and use this Green Totem at the holy altar. Then you can summon Ashutar, the soul of water. Kill it and bring me its heart of ice!
[31372-04.html] Soul Guide Asefa: Did you defeat Ashutar? "Here's the heart of ice."
[31372-05.html] Soul Guide Asefa: Kill Ashutar and bring me the source of the power!
[31372-06.html] >Soul Guide Asefa: Excellent job, comrade! At last I can use the magical power of Udan Mardui! You've brought our tribe much closer to victory, and we are in your debt. May glory be with us all!
[31372-07.html] Soul Guide Asefa: You have to bring me the Ice Heart of Ashutar!
[31560-01.html] Varka's Holy Altar: This stone sculpture is the work of artisans. It resembles a ram's head. Destroy the Green Totem at the altar
[31560-02.html] Varka's Holy Altar: With a piercing noise that rends the air, the Green Totem shatters into a million brilliant shards of light. The tendrils of blue energy which seep from the altar suddenly coalesce, and Water Spirit Ashutar materializes.
[31560-03.html] Varka's Holy Altar: Someone is already performing a ritual at the altar.
[31560-04.html] Varka's Holy Spirit: Without the Green Totem, I can't conjure Soul of Water Ashutar.
[31560-05.html] Varka's Holy Altar: The energy I felt at the altar is getting weaker.
Исходник условий и наград (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.Q00610_MagicalPowerOfWaterPart2;
import org.l2jmobius.gameserver.config.NpcConfig;
import org.l2jmobius.gameserver.config.PlayerConfig;
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.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;
import org.l2jmobius.gameserver.network.enums.ChatType;
import org.l2jmobius.gameserver.network.serverpackets.NpcSay;
import org.l2jmobius.gameserver.util.LocationUtil;
/**
* Magical Power of Water - Part 2 (610)
* @author Joxit
*/
public class Q00610_MagicalPowerOfWaterPart2 extends Quest
{
// NPCs
private static final int ASEFA = 31372;
private static final int VARKA_TOTEM = 31560;
// Monster
private static final int ASHUTAR = 25316;
// Items
private static final int GREEN_TOTEM = 7238;
private static final int ASHUTAR_HEART = 7239;
// Misc
private static final int MIN_LEVEL = 75;
public Q00610_MagicalPowerOfWaterPart2()
{
super(610, "Magical Power of Water - Part 2");
addStartNpc(ASEFA);
addTalkId(ASEFA, VARKA_TOTEM);
addKillId(ASHUTAR);
registerQuestItems(GREEN_TOTEM, ASHUTAR_HEART);
final long test = GlobalVariablesManager.getInstance().getLong("Q00610_respawn", 0);
final long remain = test != 0 ? test - System.currentTimeMillis() : 0;
if (remain > 0)
{
startQuestTimer("spawn_npc", remain, null, null);
}
else
{
addSpawn(VARKA_TOTEM, 105452, -36775, -1050, 34000, false, 0, true);
}
}
@Override
public void actionForEachPlayer(Player player, Npc npc, boolean isSummon)
{
final QuestState qs = getQuestState(player, false);
if ((qs != null) && LocationUtil.checkIfInRange(PlayerConfig.ALT_PARTY_RANGE, npc, player, false))
{
if (npc.getId() == ASHUTAR)
{
switch (qs.getCond())
{
case 1: // take the item and give the heart
{
takeItems(player, GREEN_TOTEM, 1);
// break; fallthrough
}
case 2:
{
if (!hasQuestItems(player, ASHUTAR_HEART))
{
giveItems(player, ASHUTAR_HEART, 1);
}
qs.setCond(3, true);
break;
}
}
}
}
}
@Override
public String onEvent(String event, Npc npc, Player player)
{
String htmltext = null;
if (player != null)
{
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return null;
}
switch (event)
{
case "31372-02.html":
{
qs.startQuest();
htmltext = event;
break;
}
case "give_heart":
{
if (hasQuestItems(player, ASHUTAR_HEART))
{
addExpAndSp(player, 10000, 0);
qs.exitQuest(true, true);
htmltext = "31372-06.html";
}
else
{
htmltext = "31372-07.html";
}
break;
}
case "spawn_totem":
{
htmltext = (hasQuestItems(player, GREEN_TOTEM)) ? spawnAshutar(npc, qs) : "31560-04.html";
break;
}
}
}
else
{
if (event.equals("despawn_ashutar"))
{
npc.broadcastPacket(new NpcSay(npc, ChatType.NPC_GENERAL, "The power of constraint is getting weaker. Your ritual has failed!"));
npc.deleteMe();
addSpawn(VARKA_TOTEM, 105452, -36775, -1050, 34000, false, 0, true);
}
else if (event.equals("spawn_npc"))
{
addSpawn(VARKA_TOTEM, 105452, -36775, -1050, 34000, false, 0, true);
}
}
return htmltext;
}
@Override
public void onKill(Npc npc, Player killer, boolean isSummon)
{
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);
cancelQuestTimer("despawn_ashutar", npc, null);
GlobalVariablesManager.getInstance().set("Q00610_respawn", String.valueOf(System.currentTimeMillis() + respawnDelay));
startQuestTimer("spawn_npc", respawnDelay, null, null);
executeForEachPlayer(killer, npc, isSummon, true, false);
}
@Override
public String onTalk(Npc npc, Player player)
{
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
switch (npc.getId())
{
case ASEFA:
{
switch (qs.getState())
{
case State.CREATED:
{
htmltext = (player.getLevel() >= MIN_LEVEL) ? (hasQuestItems(player, GREEN_TOTEM)) ? "31372-01.htm" : "31372-00a.html" : "31372-00b.html";
break;
}
case State.STARTED:
{
htmltext = (qs.isCond(1)) ? "31372-03.html" : (hasQuestItems(player, ASHUTAR_HEART)) ? "31372-04.html" : "31372-05.html";
break;
}
}
break;
}
case VARKA_TOTEM:
{
if (qs.isStarted())
{
switch (qs.getCond())
{
case 1:
{
htmltext = "31560-01.html";
break;
}
case 2:
{
htmltext = spawnAshutar(npc, qs);
break;
}
case 3:
{
htmltext = "31560-05.html";
break;
}
}
}
break;
}
}
return htmltext;
}
private String spawnAshutar(Npc npc, QuestState qs)
{
if (getQuestTimer("spawn_npc", null, null) != null)
{
return "31560-03.html";
}
if (qs.isCond(1))
{
takeItems(qs.getPlayer(), GREEN_TOTEM, 1);
qs.setCond(2, true);
}
npc.deleteMe();
final Npc ashutar = addSpawn(ASHUTAR, 104825, -36926, -1136, 0, false, 0);
ashutar.broadcastPacket(new NpcSay(ashutar, ChatType.NPC_GENERAL, "The magical power of water comes from the power of storm and hail! If you dare to confront it, only death will await you!"));
startQuestTimer("despawn_ashutar", 1200000, ashutar, null);
return "31560-02.html";
}
}