Quest For Honor (10819).

This commit is contained in:
MobiusDev
2016-07-30 07:41:55 +00:00
parent 48a7ea7b92
commit 18f1ac68b4
13 changed files with 239 additions and 4 deletions

View File

@@ -163,7 +163,6 @@
10806 The Dimensional Warp, Part 6
10807 The Dimensional Warp, Part 7
10809 The Hero's Journey: Blazing Swamp
10819 For Honor
10820 Relationships Befitting of the Status
10821 Helping Others
10823 Exalted, One Who Shatters the Limit

View File

@@ -0,0 +1,7 @@
<html><body>Olympiad Manager:<br>
Welcome! Has Lionel sent you?<br>
I'm the Olympiad Manager.<br>
Lionel has told me that new heroes will rise to lead this world, and I'm here to see who those people will be.<br>
I've seen countless heroes rise, and you sure look like you've got what it takes. You are ready to take my test.<br>
<Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest Q10819_ForHonor 31688-04.htm">"What's the test?"</Button>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Olympiad Manager:<br>
You don't meet the conditions yet. Please come back once you are ready.<br>
(Only characters above Lv. 99.)
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Olympiad Manager:<br>
I don't know where you heard about this, but I've prepared this test for those who've spoken to Lionel.<br>
Please go find him first.<br>
(Only characters who are performing the Exalted, One Who Overcomes the Limit quest may take this quest.)
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Olympiad Manager:<br>
Lionel has told me that those who take this test must be at least <font color="LEVEL">Noblesse</font>. The condition for participating in the Olympiad is the same.<br>
That means that people I will meet will one day lead this world. An honor, of course!<br>
That's why I'm here.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10819_ForHonor 31688-05.htm">"Is it that important?"</Button>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Olympiad Manager:<br>
I've been constantly meeting Noblesse. So there's no one else who can recognize a Noblesse.<br>
Recently, I've discussed with the Mysterious Butler about ways to find true heroes. Up until then, I've tested people by asking them to participate in the Olympiad.<br>
However, I've concluded that in order to find a true hero, I should test them both by making them show me proof that they've participated in the <font color="LEVEL">Olympiad</font> and the <font color="LEVEL">Ceremony of Chaos</font>.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10819_ForHonor 31688-06.html">"How can I prove that?"</Button>
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Olympiad Manager:<br>
You'll get a <font color="LEVEL">Proof of Battle</font> when you participate in the <font color="LEVEL">Olympiad</font> or the <font color="LEVEL">Ceremony of Chaos</font>. Please bring <font color="LEVEL">100</font> of these.<br>
Bringing 100 Proof of Battle is my test.<br>
I'm sure as someone who Lionel has personally sent, you'll do great.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Olympiad Manager:<br>
I don't think you are done yet.<br>
Participate in the <font color="LEVEL">Olympiad</font> and the <font color="LEVEL">Ceremony of Chaos</font>, and collect <font color="LEVEL">100 Proof of Battle</font>.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Olympiad Manager:<br>
You did it! How was it? Not that bad, right?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10819_ForHonor 31688-09.html">"It was okay."</Button>
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Olympiad Manager:<br>
You've proven me right. I knew you could do it. Here's the certificate. I hope you become even stronger.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Olympiad Manager:<br>
You've proven me right. I knew you could do it. Here's the certificate.<br>
It looks like you passed the other tests, so go find Lionel. I hope you become even stronger.
</body></html>

View File

@@ -0,0 +1,186 @@
/*
* 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.Q10819_ForHonor;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventType;
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
import com.l2jmobius.gameserver.model.events.annotations.RegisterType;
import com.l2jmobius.gameserver.model.events.impl.ceremonyofchaos.OnCeremonyOfChaosMatchResult;
import com.l2jmobius.gameserver.model.events.impl.olympiad.OnOlympiadMatchResult;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
import quests.Q10817_ExaltedOneWhoOvercomesTheLimit.Q10817_ExaltedOneWhoOvercomesTheLimit;
/**
* For Honor (10819)
* @URL https://l2wiki.com/For_Honor
* @author Mobius
*/
public final class Q10819_ForHonor extends Quest
{
// NPC
private static final int OLYMPIAD_MANAGER = 31688;
// Items
private static final int PROOF_OF_BATTLE = 45872;
private static final int ISHUMA_CERTIFICATE = 45630;
private static final int SIR_KRISTOF_RODEMAI_CERTIFICATE = 45631;
private static final int DAICHIR_SERTIFICATE = 45628;
// Rewards
private static final int OLYMPIAD_MANAGER_CERTIFICATE = 45629;
private static final int BATTLE_QUICK_HEALING_POTION = 45945;
// Misc
private static final int MIN_LEVEL = 99;
public Q10819_ForHonor()
{
super(10819);
addStartNpc(OLYMPIAD_MANAGER);
addTalkId(OLYMPIAD_MANAGER);
addCondMinLevel(MIN_LEVEL, "31688-02.html");
addCondStartedQuest(Q10817_ExaltedOneWhoOvercomesTheLimit.class.getSimpleName(), "31688-03.html");
registerQuestItems(PROOF_OF_BATTLE);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return htmltext;
}
switch (event)
{
case "31688-04.htm":
case "31688-05.htm":
{
htmltext = event;
break;
}
case "31688-06.html":
{
qs.startQuest();
htmltext = event;
break;
}
case "31688-09.html":
{
if (qs.isCond(2))
{
if ((player.getLevel() >= MIN_LEVEL))
{
if (hasQuestItems(player, DAICHIR_SERTIFICATE, ISHUMA_CERTIFICATE, SIR_KRISTOF_RODEMAI_CERTIFICATE))
{
htmltext = "31688-10.html";
}
else
{
htmltext = event;
}
takeItems(player, PROOF_OF_BATTLE, -1);
giveItems(player, BATTLE_QUICK_HEALING_POTION, 180);
giveItems(player, OLYMPIAD_MANAGER_CERTIFICATE, 1);
qs.exitQuest(false, true);
htmltext = event;
}
else
{
htmltext = getNoQuestLevelRewardMsg(player);
}
}
break;
}
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
switch (qs.getState())
{
case State.CREATED:
{
htmltext = "31688-01.htm";
break;
}
case State.STARTED:
{
if (qs.isCond(1))
{
htmltext = "31688-07.html";
}
else if (qs.isCond(2))
{
htmltext = "31688-08.html";
}
break;
}
case State.COMPLETED:
{
htmltext = getAlreadyCompletedMsg(player);
break;
}
}
return htmltext;
}
private void manageQuestProgress(L2PcInstance player)
{
if (player != null)
{
final QuestState qs = getQuestState(player, false);
if ((qs != null) && qs.isCond(1))
{
giveItems(player, PROOF_OF_BATTLE, 1);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
if (getQuestItemsCount(player, PROOF_OF_BATTLE) >= 100)
{
qs.setCond(2, true);
}
}
}
}
@RegisterEvent(EventType.ON_CEREMONY_OF_CHAOS_MATCH_RESULT)
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
private void onCeremonyOfChaosMatchResult(OnCeremonyOfChaosMatchResult event)
{
event.getMembers().forEach(player -> manageQuestProgress(player.getPlayer()));
}
@RegisterEvent(EventType.ON_OLYMPIAD_MATCH_RESULT)
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
private void onOlympiadMatchResult(OnOlympiadMatchResult event)
{
manageQuestProgress(event.getWinner().getPlayer());
manageQuestProgress(event.getLoser().getPlayer());
}
}

View File

@@ -349,7 +349,7 @@ import quests.Q10793_SaveTheSouls.Q10793_SaveTheSouls;
import quests.Q10795_LettersFromTheQueenWallOfAgros.Q10795_LettersFromTheQueenWallOfAgros;
import quests.Q10798_LettersFromTheQueenDragonValley.Q10798_LettersFromTheQueenDragonValley;
import quests.Q10799_StrangeThingsAfootInTheValley.Q10799_StrangeThingsAfootInTheValley;
import quests.Q10800_ReconnaissanceADragonValley.Q10800_ReconnaissanceADragonValley;
import quests.Q10800_ReconnaissanceAtDragonValley.Q10800_ReconnaissanceAtDragonValley;
import quests.Q10811_ExaltedOneWhoFacesTheLimit.Q10811_ExaltedOneWhoFacesTheLimit;
import quests.Q10812_FacingSadness.Q10812_FacingSadness;
import quests.Q10813_ForGlory.Q10813_ForGlory;
@@ -357,6 +357,7 @@ import quests.Q10814_BefittingOfTheStatus.Q10814_BefittingOfTheStatus;
import quests.Q10815_StepUp.Q10815_StepUp;
import quests.Q10817_ExaltedOneWhoOvercomesTheLimit.Q10817_ExaltedOneWhoOvercomesTheLimit;
import quests.Q10818_ConfrontingAGiantMonster.Q10818_ConfrontingAGiantMonster;
import quests.Q10819_ForHonor.Q10819_ForHonor;
/**
* @author NosBit
@@ -697,14 +698,15 @@ public class QuestMasterHandler
Q10795_LettersFromTheQueenWallOfAgros.class,
Q10798_LettersFromTheQueenDragonValley.class,
Q10799_StrangeThingsAfootInTheValley.class,
Q10800_ReconnaissanceADragonValley.class,
Q10800_ReconnaissanceAtDragonValley.class,
Q10811_ExaltedOneWhoFacesTheLimit.class,
Q10812_FacingSadness.class,
Q10813_ForGlory.class,
Q10814_BefittingOfTheStatus.class,
Q10815_StepUp.class,
Q10817_ExaltedOneWhoOvercomesTheLimit.class,
Q10818_ConfrontingAGiantMonster.class
Q10818_ConfrontingAGiantMonster.class,
Q10819_ForHonor.class
};
public static void main(String[] args)