This commit is contained in:
7
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-01.htm
vendored
Normal file
7
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-01.htm
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Elder Casian:<br>
|
||||
Did you know that at one time this barren wasteland was one of the most fertile places in Aden? For centuries farmers sowed their seeds and harvested abundant crops here. Ah, yes, those were the days...<br>
|
||||
But then that devil Beleth and his minions arrived. We had to come up with a resolution quickly. We were compelled to at last open the forbidden spellbook...<br>
|
||||
For two days and nights fire rained down on us and dark magic swept the land like a whirlwind... It wasn't at all what we'd anticipated...<br>
|
||||
I couldn't bear to stay in this ruined place, so I wandered the world for many years. But now I find myself drawn back, hoping to somehow restore this land to its former beauty. I shan't be able to do this alone...<br>
|
||||
<a action="bypass -h Quest Q00370_AnElderSowsSeeds 30612-02.htm">"What can I do to help?"</a>
|
||||
</body></html>
|
||||
6
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-02.htm
vendored
Normal file
6
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-02.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Elder Casian:<br>
|
||||
The magic we unwittingly unleashed came from "Kranvel's Spellbook", one of the forbidden tomes of the Ivory Tower. Its fearsome power sucked the magic from all living organisms in the area, and then unleashed it all back upon us with a vengeance!<br>
|
||||
Poor Spellsinger Diena saw the whole thing and fell into a deep state of shock. As she shed blood and tears, she destroyed the book and scattered it to the wind... She was determined that no one should ever use such evil magic again... We couldn't stop her! We all felt as if we were in a terrible nightmare, and just stared blankly at her...<br>
|
||||
But now we know that that spellbook is the key to the restoration of this place. Please find the pieces of the book that were scattered to the wind.<br>
|
||||
<a action="bypass -h Quest Q00370_AnElderSowsSeeds 30612-03.htm">"Where should I look for the pieces of "Kranvel's Spellbook"?"</a>
|
||||
</body></html>
|
||||
5
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-03.htm
vendored
Normal file
5
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-03.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Elder Casian:<br>
|
||||
Ironically, the deformed beasts around us hold the clues to finding the legacy of Kranvel. Giant ants are known to pick up anything they find and take it to their nests. It is said that they have collected a great number of ancient relics and taken them to their nest in the maze-like caves beneath the wasteland.<br>
|
||||
You will most likely find the pieces of "Kranvel's Spellbook" in the <font color="LEVEL">Ant Nest</font>. You mustn't attempt this alone! Take some reliable colleagues along with you.<br>
|
||||
<a action="bypass -h Quest Q00370_AnElderSowsSeeds 30612-04.htm">"You can count on me."</a>
|
||||
</body></html>
|
||||
6
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-04.htm
vendored
Normal file
6
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-04.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Elder Casian:<br>
|
||||
In order to obtain the pieces of the spellbook, you must conquer the <font color="LEVEL">ant recruits, ant patrols, ant guards, the noble ant and the noble ant leader</font>.<br>
|
||||
<font color="LEVEL">Check carefully any scraps of paper you come across</font>. The pieces of "Kranvel's Spellbook" should be easy to identify.<br>
|
||||
The spellbook has four chapters: <font color="LEVEL">the Chapter of Fire, the Chapter of Water, the Chapter of Wind and the Chapter of Earth</font>. The contents will only be discernible if you recover all four chapters.<br>
|
||||
This is a challenging task, but I think you are ready for it. May the divine blessing be with you...
|
||||
</body></html>
|
||||
8
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-05.html
vendored
Normal file
8
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-05.html
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Elder Casian:<br>
|
||||
Did you know that at one time this barren wasteland was one of the most fertile places in Aden? For centuries, farmers sowed their seeds and harvested their abundant crops here. Ah, yes, those were the days...<br>
|
||||
But then that devil Beleth and his minions arrived. We had to act quickly. We were compelled to at last open the forbidden spellbook...<br>
|
||||
For two days and nights fire rained down on us and dark magic swept over the land like a whirlwind... It wasn't at all what we'd anticipated...<br>
|
||||
When it was over, this is all that was left... A dusty wasteland inhabited by weird-looking freaks...<br>
|
||||
Some day, hopefully, we shall find a way to change this place back into the verdant farmland it once was... I hope we can count on you when that time comes.<br>
|
||||
(This quest may only be undertaken by a character of level 28 or above.)
|
||||
</body></html>
|
||||
8
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-06.html
vendored
Normal file
8
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-06.html
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<html><body>Elder Casian:<br>
|
||||
The wind is unusually scorching today... Do you feel it? The angry cries of the souls of those who perished here seem carried on the blistering breeze across the Wasteland...<br>
|
||||
Forgive me. This place has that effect on me. By the way, how are things at the Ant Nest?<br>
|
||||
<a action="bypass -h Quest Q00370_AnElderSowsSeeds 30612-07.html">"Where can I find the spellbook?"</a><br>
|
||||
<a action="bypass -h Quest Q00370_AnElderSowsSeeds REWARD">"I have brought all four chapters of "Kranvel's Spellbook"."</a><br>
|
||||
<a action="bypass -h Quest Q00370_AnElderSowsSeeds 30612-09.html">"I need to find more chapters."</a><br>
|
||||
<a action="bypass -h Quest Q00370_AnElderSowsSeeds 30612-10.html">"I quit."</a>
|
||||
</body></html>
|
||||
6
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-07.html
vendored
Normal file
6
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-07.html
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Elder Casian:<br>
|
||||
How could you forget? You must slay <font color="LEVEL">ant recruits, ant patrols, ant guards, noble ants, and the noble ant leader</font> in order to obtain the pieces of the spellbook.<br>
|
||||
<font color="LEVEL">Examine any scraps of paper you come across carefully.</font> The pieces of "Kranvel's Spellbook" should be instantly recognizable.<br>
|
||||
You must find all four chapters: <font color="LEVEL">the Chapter of Fire, the Chapter of Water, the Chapter of Wind and the Chapter of Earth</font>.<br>
|
||||
<a action="bypass -h Quest Q00370_AnElderSowsSeeds 30612-06.html">Back</a>
|
||||
</body></html>
|
||||
7
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-08.html
vendored
Normal file
7
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-08.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Elder Casian:<br>
|
||||
Let's see, the Chapter of Fire, the Chapter of Water, the Chapter of Wind, and the Chapter of Earth... you have brought them all! Perhaps your discovery will lead to a way to restore this ruined place. At last I shall be redeemed... This is all thanks to you. Please accept this humble token of my appreciation.<br>
|
||||
But this sad chapter is not yet complete... The dark magic that caused this disaster had many sources, united in their power and holding copies of "Kranvel's Spellbook"!<br>
|
||||
Alas, it's true! There remain many pieces of that horrid tome scattered about the inside of the Ant Nest. If I am to continue my research, and above all to keep this dreadful power from falling into the wrong hands, the remaining fragments of "Kranvel's Spellbook" must be recovered! Please help!<br>
|
||||
<a action="bypass -h Quest Q00370_AnElderSowsSeeds 30612-09.html">"I will continue to help."</a><br>
|
||||
<a action="bypass -h Quest Q00370_AnElderSowsSeeds 30612-10.html">"I quit."</a>
|
||||
</body></html>
|
||||
3
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-09.html
vendored
Normal file
3
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-09.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Elder Casian:<br>
|
||||
Thank you for helping us. Hopefully someday our efforts will pay off, and restore this wasteland to its former beauty. Bless you, my child...
|
||||
</body></html>
|
||||
5
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-10.html
vendored
Normal file
5
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-10.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Elder Casian:<br>
|
||||
I understand. Your assistance has given me the opportunity to redeem myself. I don't know exactly where my research will lead, but hopefully to a better world...<br>
|
||||
We all must do what we think is best. Only time will tell whether our choices are good ones...<br>
|
||||
Thank you so very much for your help. May you be blessed by the gods...
|
||||
</body></html>
|
||||
4
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-11.html
vendored
Normal file
4
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/30612-11.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Elder Casian:<br>
|
||||
How could you have forgotten so quickly?<br>
|
||||
"Kranvel's Spellbook" consists of four chapters: <font color="LEVEL">the Chapter of Fire, the Chapter of Water, the Chapter of Wind and the Chapter of Earth</font>. The contents will not be discernible unless you find all four chapters. Please, you must help us! We're counting on you!
|
||||
</body></html>
|
||||
187
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/Q00370_AnElderSowsSeeds.java
vendored
Normal file
187
trunk/dist/game/data/scripts/quests/Q00370_AnElderSowsSeeds/Q00370_AnElderSowsSeeds.java
vendored
Normal file
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* 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 quests.Q00370_AnElderSowsSeeds;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.model.quest.QuestState;
|
||||
import com.l2jserver.gameserver.util.Util;
|
||||
|
||||
/**
|
||||
* An Elder Sows Seeds (370)
|
||||
* @author Adry_85
|
||||
*/
|
||||
public final class Q00370_AnElderSowsSeeds extends Quest
|
||||
{
|
||||
// NPC
|
||||
private static final int CASIAN = 30612;
|
||||
// Items
|
||||
private static final int SPELLBOOK_PAGE = 5916;
|
||||
private static final int CHAPTER_OF_FIRE = 5917;
|
||||
private static final int CHAPTER_OF_WATER = 5918;
|
||||
private static final int CHAPTER_OF_WIND = 5919;
|
||||
private static final int CHAPTER_OF_EARTH = 5920;
|
||||
// Misc
|
||||
private static final int MIN_LEVEL = 28;
|
||||
// Mobs
|
||||
private static final Map<Integer, Integer> MOBS1 = new HashMap<>();
|
||||
private static final Map<Integer, Double> MOBS2 = new HashMap<>();
|
||||
static
|
||||
{
|
||||
MOBS1.put(20082, 9); // ant_recruit
|
||||
MOBS1.put(20086, 9); // ant_guard
|
||||
MOBS1.put(20090, 22); // noble_ant_leader
|
||||
MOBS2.put(20084, 0.101); // ant_patrol
|
||||
MOBS2.put(20089, 0.100); // noble_ant
|
||||
}
|
||||
|
||||
public Q00370_AnElderSowsSeeds()
|
||||
{
|
||||
super(370, Q00370_AnElderSowsSeeds.class.getSimpleName(), "An Elder Sows Seeds");
|
||||
addStartNpc(CASIAN);
|
||||
addTalkId(CASIAN);
|
||||
addKillId(MOBS1.keySet());
|
||||
addKillId(MOBS2.keySet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPartyMember(L2PcInstance member, L2Npc npc)
|
||||
{
|
||||
final QuestState st = getQuestState(member, false);
|
||||
return ((st != null) && st.isStarted());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final QuestState st = getQuestState(player, false);
|
||||
if (st == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
{
|
||||
case "30612-02.htm":
|
||||
case "30612-03.htm":
|
||||
case "30612-06.html":
|
||||
case "30612-07.html":
|
||||
case "30612-09.html":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "30612-04.htm":
|
||||
{
|
||||
st.startQuest();
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "REWARD":
|
||||
{
|
||||
if (st.isStarted())
|
||||
{
|
||||
if (exchangeChapters(player, false))
|
||||
{
|
||||
htmltext = "30612-08.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "30612-11.html";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "30612-10.html":
|
||||
{
|
||||
if (st.isStarted())
|
||||
{
|
||||
exchangeChapters(player, true);
|
||||
st.exitQuest(true, true);
|
||||
htmltext = event;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
|
||||
{
|
||||
int npcId = npc.getId();
|
||||
if (MOBS1.containsKey(npcId))
|
||||
{
|
||||
if (getRandom(100) < MOBS1.get(npcId))
|
||||
{
|
||||
L2PcInstance luckyPlayer = getRandomPartyMember(player, npc);
|
||||
if (luckyPlayer != null)
|
||||
{
|
||||
giveItemRandomly(luckyPlayer, npc, SPELLBOOK_PAGE, 1, 0, 1.0, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
final QuestState st = getRandomPartyMemberState(player, -1, 3, npc);
|
||||
if (st != null)
|
||||
{
|
||||
giveItemRandomly(st.getPlayer(), npc, SPELLBOOK_PAGE, 1, 0, MOBS2.get(npcId), true);
|
||||
}
|
||||
}
|
||||
return super.onKill(npc, player, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final QuestState st = getQuestState(player, true);
|
||||
String htmltext = getNoQuestMsg(player);
|
||||
if (st.isCreated())
|
||||
{
|
||||
htmltext = (player.getLevel() >= MIN_LEVEL) ? "30612-01.htm" : "30612-05.html";
|
||||
}
|
||||
else if (st.isStarted())
|
||||
{
|
||||
htmltext = "30612-06.html";
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
private final boolean exchangeChapters(L2PcInstance player, boolean takeAllItems)
|
||||
{
|
||||
final long waterChapters = getQuestItemsCount(player, CHAPTER_OF_WATER);
|
||||
final long earthChapters = getQuestItemsCount(player, CHAPTER_OF_EARTH);
|
||||
final long windChapters = getQuestItemsCount(player, CHAPTER_OF_WIND);
|
||||
final long fireChapters = getQuestItemsCount(player, CHAPTER_OF_FIRE);
|
||||
final long minCount = Util.min(waterChapters, earthChapters, windChapters, fireChapters);
|
||||
if (minCount > 0)
|
||||
{
|
||||
giveAdena(player, minCount * 3600, true);
|
||||
}
|
||||
final long countToTake = (takeAllItems ? -1 : minCount);
|
||||
takeItems(player, (int) countToTake, CHAPTER_OF_WATER, CHAPTER_OF_EARTH, CHAPTER_OF_WIND, CHAPTER_OF_FIRE);
|
||||
return (minCount > 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user